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.irclog.whitequark.org/amaranth-lang · Matrix #amaranth-lang:matrix.org
feldim2425_ has quit [Ping timeout: 260 seconds]
feldim2425 has joined #amaranth-lang
phire has joined #amaranth-lang
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 248 seconds]
frgo has joined #amaranth-lang
Degi has quit [Ping timeout: 252 seconds]
Degi has joined #amaranth-lang
frgo has quit [Ping timeout: 252 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 276 seconds]
frgo has joined #amaranth-lang
frgo has quit [Ping timeout: 244 seconds]
frgo has joined #amaranth-lang
frgo has quit [Remote host closed the connection]
frgo has joined #amaranth-lang
frgo has quit [Read error: Connection reset by peer]
frgo_ has joined #amaranth-lang
frgo_ has quit [Read error: Connection reset by peer]
RobTaylor[m] has quit [Quit: Idle timeout reached: 172800s]
frgo has joined #amaranth-lang
frgo has quit [Remote host closed the connection]
<anuejn> oh cool re glasgow streams
<anuejn> vup and me started to migrate naps to amaranth streams the other day
<anuejn> and we will probably come up with some extensions (like packetized streams with last) up downstream and might write an RFC when we prototyped it
<anuejn> s/up downstream/downstream/
<zyp[m]> for packetized streams, I've been using this recently: https://paste.jvnv.net/view/L6IeQ
<zyp[m]> been meaning to make a library of that and other reusable stream blocks I'm writing
<zyp[m]> although, to be honest, I'm finding that first is not very useful; almost every packetized stream interface I make only has last
BentoMon has joined #amaranth-lang
<anuejn> zyp[m]: yeah we are also using first in exactly one place in the entire codebase
<anuejn> and that place does not seem super nescessary
<anuejn> but we use a lot of other signals (for example we have an ImageStream that has a frame_last and a line_last)
<anuejn> huh, no actually only that and some axi-foo
<anuejn> but in the past it was handy to be able to write cores so that they work with different kinds of streams (i.e. non-packetized, packetized, and image)
<anuejn> maybe we can team up and make a library of stream stuff :)
<zyp[m]> I've found first is useful as a resync thing, e.g. to throw away partial state and start over
<zyp[m]> but I think maybe that should be decoupled from Packet and be its own thing with more strictly defined semantics
<whitequark[cis]> <anuejn> "maybe we can team up and make..." <- we should, yeah!
<whitequark[cis]> i'll chip in from glasgow too
<anuejn> maybe lets collect cores (kind of streams) we have / find useful somewhere to gather requirements?
<whitequark[cis]> I'd say open a discussion on the Amaranth repo
<anuejn> sonuds good
<anuejn> Ill do that
<zyp[m]> haven't needed/written a matching deserializer yet, but those are fairly basic building blocks IMO :)
<anuejn> we have a gearbox
<anuejn> I think that is like the more generic version?
<whitequark[cis]> something that i want to have upstream is a universal FIFO
<whitequark[cis]> you give it the depth and acceptable latency and clock domains and gearing ratio, it instantiates the right kind of FIFO inside
<anuejn> that would be quite cool
<anuejn> we now always gear before the fifo
<whitequark[cis]> it's useful because the gearing could be done as a part of a memory with asymmetric ports
<anuejn> yeah seems quite handy
<anuejn> okay wrote some thoughts up
<anuejn> I think the main trickyness is in the last paragraph:
<anuejn> how do we enable cores to be written so that they can operate on different kinds of streams (like PacketizedStream vs ImageStream) 
<zyp[m]> <anuejn> "how do we enable cores to be..." <- write them so that they doesn't care about the stream payload's shape more than they have to
<zyp[m]> and make use of lib.data aggregates
<anuejn> did you read the motivating example of writing a MetadataWrapper that works with both PacketizedStream and ImageStream?
<anuejn> or a StreamGearbox?
<zyp[m]> yes, and I see your gearbox talks about bits, my serializer takes a data.ArrayLayout with an arbitrary shape, which I can further stick a Packet into
<anuejn> ah huh cool
<zyp[m]> lib.data shapes are introspectable, you can look at the layout and unwrap the inner payload if you need to separate it from the sideband signals
<whitequark[cis]> yep
<anuejn> so in your model sideband signals are always at the innermost level?
<zyp[m]> no, the primary payload would be innermost, and each layer above could e.g. add sideband signals
<zyp[m]> also, this only generalizes as far as you have something you can call a «primary payload» in the stream
<anuejn> I see
<anuejn> but how would a real gearbox fit into that model?
<anuejn> I often have to convert a 12bit stream into a 64bit one to write it into dram
<zyp[m]> here's an example of a pipeline I've made with `lib.data` types: https://github.com/orbcode/orbtrace/blob/main/orbtrace/trace/tpiu.py
<zyp[m]> stream shape through the pipeline goes `8` -> `TPIURawFrame` -> `TPIUUnmangledFrame` -> `TPIUUnmangledByte` -> `MuxedByte` -> `Packet`
<zyp[m]> anuejn: I figure a generic N:M gearbox would use arrays on both inputs and outputs with the same inner shape
<zyp[m]> and if you're doing something like 12 -> 64 where there's no even relationship, the inner shape can still be a single bit
lf_ has quit [Ping timeout: 248 seconds]
lf has joined #amaranth-lang
<anuejn> zyp[m]: that is some cool code
* anuejn has to think and probably sleep about it
<anuejn> I think this is the first time I really understood the power behind lib.data in combination with lib.wiring
<anuejn> I guess I have to experiment and get used to it a bit
<anuejn> ... feel like I am kinda bogged down in the way I used to do things