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
<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]