whitequark[cis] changed the topic of #amaranth-lang to: Amaranth hardware definition language · weekly meetings: Amaranth each Mon 1700 UTC, Amaranth SoC each Fri 1700 UTC · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang · Matrix #amaranth-lang:matrix.org
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #amaranth-lang
Degi has quit [Ping timeout: 240 seconds]
Degi has joined #amaranth-lang
<_whitenotifier-f> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/yosys/compare/3c3f21badc4b...0338c1cd0ed5
<_whitenotifier-f> [YoWASP/yosys] whitequark 0338c1c - Update dependencies.
Bluefoxicy has quit [Read error: Connection reset by peer]
Bluefoxicy has joined #amaranth-lang
sugarbeet has quit [Ping timeout: 260 seconds]
sugarbeet has joined #amaranth-lang
peeps[zen] has quit [Read error: Connection reset by peer]
peeps[zen] has joined #amaranth-lang
GenTooMan has quit [Ping timeout: 240 seconds]
GenTooMan has joined #amaranth-lang
jjsuperpower has joined #amaranth-lang
jjsuperpower has quit [Ping timeout: 244 seconds]
notgull has quit [Ping timeout: 260 seconds]
notgull has joined #amaranth-lang
Raito_Bezarius has quit [Quit: free()]
Raito_Bezarius has joined #amaranth-lang
mcc111[m] has joined #amaranth-lang
<mcc111[m]> What is the amaranth equivalent of like always @(negedge audgen_sclk) begin ? in my other stuff i've been tracking "this was true on the last frame, now it's false" with a separate signal, is there something automated?
zyp[m] has joined #amaranth-lang
<zyp[m]> you can have a negative edge domain
<cr1901> m.d.domains.neg_clk = ClockDomain(clk_edge = "neg")
<cr1901> m.d.comb += ClockSignal("neg_clk").eq(ClockSignal("sync"))
<cr1901> ^did not test this, something like this
adamgreig[m] has joined #amaranth-lang
<adamgreig[m]> mcc111: do you just want to react to the falling edge of some io signal, or do you have a bunch of logic that specifically needs to run on the falling edge of a clock?
<mcc111[m]> adamgreig[m]: I'm porting some verilog code, in the original there's a audgen_sclk which creates a half-speed clock by banging a register up and down, and the verilog code I'm porting acts on the falling edge. I don't know why they picked the falling rather than rising edge
<adamgreig[m]> it might be better to just run your logic on every other one of your normal clock cycles, you can use EnableInserter for example around a whole submodule
<adamgreig[m]> sometimes there are specific reasons for doing otherwise but often it's best to just have the one clock and not try to make new clock signals out of logic and then clock other logic off of them
<mcc111[m]> <adamgreig[m]> "it might be better to just run..." <- How would you run logic on every other cycle without creating a clock out of logic?
<adamgreig[m]> when you wrap a submodule in EnableInserter, or equivalently just like with m.If(enable): bla, the logic inside is "gated", it only responds to changes when enable is high, which you toggle every clock (m.d.sync += enable.eq(~enable))
<adamgreig[m]> the enable is a clock in some sense, but it's not the clock that actually runs the digital logic
<adamgreig[m]> so all your flip-flops are still clocked by your main sync clock, just their "clock enable" input is connected to something that's only high half the time
<mcc111[m]> ok. it seems like that only works for exactly halving the clock tho
<adamgreig[m]> any rational division is more or less easy, like 1 in 4, or 3 in 4, whatever you drive that signal to
<adamgreig[m]> the motivation is that your logic remains all part of the same clock domain, so you don't need clock-domain-crossing logic to move signals around, and you aren't making a potentially glitchy clock out of logic and feeding it back into a global clock net, you can just keep your flops connected to the same global clock net as the ones they're talking to
<mithro> @whitequark[cis] Would it make sense for an amaranth module to be elaborated to RTLIL and then saved using `write_rtlil` to be later loaded and patched into a design (as opposed to writing out to verilog and then reading it in again)?
Bluefoxicy has quit [Read error: Connection reset by peer]
Bluefoxicy has joined #amaranth-lang
richardeoin has quit [Ping timeout: 246 seconds]