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
lf has quit [Ping timeout: 240 seconds]
lf has joined #amaranth-lang
FFY00_ has joined #amaranth-lang
FFY00 has quit [Ping timeout: 258 seconds]
<cr1901> Nothing concrete, just a minddump: I was running symbiyosys against Verilog generated by Amaranth. It failed, so sby made a vcd, verilog testbench, and a so-called "witness file". While looking at the output vcd, I found _another_ bug. Wouldn't it be cool to "somehow" go from the witness file to an amaranth module that automatically reproduces the exact input states to trigger the bugs?
<whitequark[cis]> that is very much possible
<cr1901> Very cool... I'll keep it on the backburner. If I didn't just learn what a "witness file" was today (and I wasn't trying to "just fix the bugs" right now), I may very well be taking a stab at generating an Amaranth TB module.
anubis has joined #amaranth-lang
lf has quit [Ping timeout: 240 seconds]
lf has joined #amaranth-lang
anubis has quit [Ping timeout: 258 seconds]
<whitequark[cis]> zyp: so my concern re: ready_i is: suppose I am making a memory controller. in the ideal scenario I am probably feeding bytes from the read stream of the IO buffer directly into the AXI rdata channel
<whitequark[cis]> if the RDATA stream becomes not ready, you do have to buffer these words somewhere
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 264 seconds]
Degi_ is now known as Degi
<zyp[m]> oh, absolutely, I'd say it's very application specific whether ready_i is useful or not, I'm just saying I want both options, and to be explicit about it
<zyp[m]> and to clarify, in my mind out and in are still two independent streams that both has a valid and optionally have a ready
<zyp[m]> there's also single stream endpoints where you can't have backpressure, e.g. the data you receive from an ethernet PHY, an audio ADC or any other source without flow control
<whitequark[cis]> yeah, okay, I see your point
<whitequark[cis]> I do think we need a way to indicate that there can be no backpressure, but without removing ready; rather ready for such streams should be a Const(1)
<whitequark[cis]> (connect already handles this case specially)
<cr1901> http://gopher.wdj-consulting.com:70/paste/72bfa4f7-ab9b-4040-86d9-09a2ba9a344f.txt This is a self-contained attempt at a tb generator via a witness. I got as far as mapping the witness back to Signals on the interface and extracting the values to set to each signal on each clock cycle
<cr1901> unfortunately, the tb doesn't actually ever generate VCDs for the signals I extract, despite the process running fine for 25 iters. I'm sure I'm doing something not right w/ the return values from find_signature, but this is about the amount of time I'm willing to spend
<cr1901> I'll manually copy and paste the parsed values for now
<whitequark[cis]> this is the wrong approach
<whitequark[cis]> take a look at the methods in back.rtlil which return a name_map
<cr1901> Ack, I'll try again when I'm ready to play w/ this some more. In the short term, I got what I wanted (an automated way to extract the values I need to paste into a testbench file)
nelgau has joined #amaranth-lang
nelgau has quit [Read error: Connection reset by peer]
nelgau has joined #amaranth-lang
muddassir_ali_71 has quit [Quit: Idle timeout reached: 172800s]
mcc111[m] has joined #amaranth-lang
<mcc111[m]> I have a low-skill question. I want a register/signal that has this pattern over time:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/IgKNVsSveqWppwPJmOkyGShT>)
<whitequark[cis]> or something like `out = Cat(cnt[:n] == (2<<(n+1))-1 for n in range(4))`
<mwk> ws2qxsXZ
jjsuperpower has joined #amaranth-lang
<whitequark[cis]> or even
<mcc111[m]> whitequark[cis]: mm, that's interesting too
<whitequark[cis]> out = Cat(cnt[:n] == ~0 for n in range(4))
<whitequark[cis]> no, wait, that won't work; ~0 is negative
<whitequark[cis]> out = Cat(~cnt[:n] == 0 for n in range(4))
<whitequark[cis]> anyway, that lets you avoid having a "previous value" register which can cause issues when the counter overflows
<mcc111[m]> Wouldn't the counter overflowing be good? Because it just wraps?
<mcc111[m]> What I REALLY want is, I want to have a trigger whose frequency I can speed up or speed down in increments of 2x
<mcc111[m]> So I was going to have the "counter change" register, and then I was going to have a "check me" mask that I &'d with it, and check if the result is equal to 0
<mcc111[m]> Maybe this is too complicated to begin with
<whitequark[cis]> oh
<mcc111[m]> whitequark[cis]: ok it took me a minute to understand what this is doing but it is neat
<whitequark[cis]> mcc111[m]: > <@mcc111:matrix.org> What I REALLY want is, I want to have a trigger whose frequency I can speed up or speed down in increments of 2x
<whitequark[cis]> > So I was going to have the "counter change" register, and then I was going to have a "check me" mask that I &'d with it, and check if the result is equal to 0
<whitequark[cis]> have a counter whose high bits are masked off on each increment; whenever it overflows you have your trigger
<whitequark[cis]> so like...
<whitequark[cis]> m.d.sync += count.eq((count + 1) & ((2 << n) - 1))
<whitequark[cis]> m.d.comb += trigger.eq(count == 0)
<mcc111[m]> ok, i think i see what you mean. i'll think about that
jjsuperpower has quit [Ping timeout: 240 seconds]
jjsuperpower has joined #amaranth-lang
sugarbeet has quit [Ping timeout: 240 seconds]
sugarbeet has joined #amaranth-lang
nelgau_ has joined #amaranth-lang
jfng[m] has quit [Quit: Idle timeout reached: 172800s]
Chips4MakersakaS has quit [Quit: Idle timeout reached: 172800s]
nelgau has quit [Read error: Connection reset by peer]
GenTooMan has quit [Quit: Leaving]
GenTooMan has joined #amaranth-lang
nelgau_ has quit [Read error: Connection reset by peer]
nelgau_ has joined #amaranth-lang
nelgau_ has quit [Read error: Connection reset by peer]
nelgau has joined #amaranth-lang
jjsuperpower has quit [Ping timeout: 255 seconds]
nelgau has quit [Read error: Connection reset by peer]
nelgau has joined #amaranth-lang
balrog has quit [Quit: Bye]
balrog has joined #amaranth-lang
nelgau has quit [Read error: Connection reset by peer]
nelgau_ has joined #amaranth-lang
nelgau_ has quit [Ping timeout: 255 seconds]
lambda has quit [Ping timeout: 240 seconds]
qookie has quit [Ping timeout: 240 seconds]
qookie has joined #amaranth-lang
<mcc111[m]> wow uhhh it really does not take a lot of simulating to get a gtkwave file above 1 GB
lambda has joined #amaranth-lang
RobTaylor[m] has quit [Quit: Idle timeout reached: 172800s]
<cr1901> >an automated way to extract the values I need to paste into a testbench file <-- Realized tonight; there's value to both "generate source code to a python function implementing the TB" and "generate a generator ready for use w/ Amaranth sim"; the former is useful if your design's interface/timing changes and the witness file can no longer be used directly (but is still useful for automating _most_ of the work)
<galibert[m]> witness file = generated trace including inputs that formal has found breaking the asserts?
<cr1901> it's a serialization format for the formal inputs that break the asserts, so external tools can ingest it and "create testbenches/whatever"
<galibert[m]> ok, I got it essentially right, thanks
jwise0[m] has joined #amaranth-lang
<jwise0[m]> recommend having your simulator write out LXT2 instead of VCD
<galibert[m]> I'm fascinated that gtkwave has 4 custom formats
<cr1901> in Yosys' case it's JSON. From reading "yosys-witness" help AIGER and Boolector's BTOR formats also can be used for witness traces
vegard_e[m] has quit [Quit: Idle timeout reached: 172800s]