<d1b2>
<vipqualitypost> i am new to digital design but I just finished my first working SPI peripheral!! thanks everyone on this project/irc, it's a really fun language to work with for solving problems
<whitequark>
happy you like it!
<d1b2>
<vipqualitypost> actually, a quick question: when working on it, i made a signal that I used as a peripheral clock since I didn't want to run everything at the full frequency. I implemented this with a m.If to loop until I passed so many clock cycles. Is that the best way to do that or should I have looked into creating a new clock domain? how can I drive a new clock domain? I had some issues with aligning signals using this if loop
<d1b2>
<vipqualitypost> I was working off the Robert Baruch github tutorials, but the section on clock domains is brief and the docs didn't seem to mention much either.
<charlottia>
This is working at the edges of my knowledge so take with a grain of salt/someone else chime in pls: using a counter to derive a slower clock signal like that is A-OK, and (AFAICT) aligning signals like that really is part of the work here/why one ends up spending long whiles staring at graphviz at this point.
<charlottia>
I'm haven't actually tried working with a second sync domain yet and am not 100% on how it's done: I imagine either you create the new ClockDomain and then drive its clk directly from yours, or perhaps from an Instance of a primitive.
Stevetronics has joined #amaranth-lang
<d1b2>
<vipqualitypost> ah, I didn't think to try and write to the clk directly! maybe I will give that a go.. but good to know I wasn't too far off!