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 · play https://amaranth-lang.org/play/ · code https://github.com/amaranth-lang · logs https://libera.catirclogs.org/amaranth-lang · Matrix #amaranth-lang:matrix.org
jn has quit [Ping timeout: 268 seconds]
jn has joined #amaranth-lang
jn has joined #amaranth-lang
Degi has quit [Ping timeout: 268 seconds]
Degi has joined #amaranth-lang
galibert[m] has quit [Quit: Idle timeout reached: 172800s]
<_whitenotifier-4> [amaranth] whitequark commented on issue #1603: Using `sim.add_clock(Period())` (`Period` without any arguments) leads to an empty VCD file - https://github.com/amaranth-lang/amaranth/issues/1603#issuecomment-3007324527
frgo has quit [Read error: Connection reset by peer]
frgo_ has joined #amaranth-lang
jorolf[m] has joined #amaranth-lang
<jorolf[m]> Is there a way to convert a signature/interface into a value-like inside a simulation? So that I can just call ctx.get(dut.stream) instead of ctx.get(dut.stream.valid), ctx.get(dut.stream.payload), ctx.get(dut.stream.ready)
<whitequark[cis]> not really no; what do you want to achieve in the end?
<jorolf[m]> Afaic it currently throws with "TypeError: Object <PureInterface: ...> cannot be converted to an Amaranth value"
<whitequark[cis]> (you could always make a function with the three ctx.get calls)
<jorolf[m]> I'm currently working with my axi interface and I have a line like this:
<jorolf[m]> `async for clk_edge, rst_value, valid, ready, addr, len, id in ctx.tick("sync").sample(ar.VALID, ar.READY, ar.ADDR, ar.LEN, ar.ID):`
<jorolf[m]> Which I found a bit too verbose, especially since I might need more signals in the future
<jorolf[m]> imho being able to just write async for clk_edge, rst_value, axi in ctx.tick("sync").sample(ar): would be more readable
zyp[m] has joined #amaranth-lang
<zyp[m]> you probably want something like this: https://github.com/zyp/katsuo-stream/blob/main/katsuo/stream/sim.py#L14
<whitequark[cis]> yeah, this calls for an abstraction
<whitequark[cis]> i'm not at all convinced that optimizing for writing this async for statement is desirable
<whitequark[cis]> i think you probably shouldn't normally be sampling every AXI signal
<jorolf[m]> Hmm, I only need the async for in a single place (inside a process) so I don't think I need to abstract it away (yet).
<jorolf[m]> <whitequark[cis]> "i think you probably shouldn't..." <- By "normally" do you mean "outside of abstractions" or "sampling every tick"?
<whitequark[cis]> really i think it's "ever, outside of debugging tools"?
<jorolf[m]> Ah sorry, I misunderstood. I was talking about every signal of a channel (e.g. read request aka. AR) which could be needed when a handshake occurs
<jorolf[m]> s/talking/thinking/, s//`/, s//`/
<zyp[m]> if you're building this on amaranth.lib.stream, you'd bundle all signals except valid/ready into the payload
<zyp[m]> IMO it'd probably be preferable to use five amaranth streams internally and provide a shim that adapts them to an interface with the standard AXI names when you need that for interopability
<zyp[m]> otherwise you need to redo every stream construct (e.g. CDC) that you want to use with your AXI streams
<jorolf[m]> Ah, I haven't thought about a shim yet
<jorolf[m]> That would add more complexity to my conversion step, but that might also help me in the long run
<whitequark[cis]> I do want to emphasize that I think it's very important to use a five-stream tuple for AXI
<whitequark[cis]> this is the design I'd like to have in amaranth-soc
anubis has joined #amaranth-lang
anubis has quit [Remote host closed the connection]
anubis has joined #amaranth-lang
anubis has quit [Remote host closed the connection]
catvstory has joined #amaranth-lang
catvstory has quit [Quit: Leaving]
anubis has joined #amaranth-lang
anubis_ has joined #amaranth-lang
anubis has quit [Ping timeout: 272 seconds]
Lord_Nightmare has quit [Quit: ZNC - http://znc.in]
Lord_Nightmare has joined #amaranth-lang
anubis_ has quit [Ping timeout: 272 seconds]
balrog has joined #amaranth-lang
balrog_ has quit [Ping timeout: 276 seconds]