-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PacketStream protocol. #85
Conversation
0669c0c
to
ee9e485
Compare
e11179f
to
919bb9b
Compare
The motivation here is a bit unclear to me. The documentation says
However the "data" in question appears to be only bytes. Presumably there is a specific use-case in mind here but it is not clear to me what it is; network packets, perhaps? It seems to me like ideally protocols in |
This protocol was indeed specifically created for a hardware-based MAC/IP/UDP stack (which will soon be coming to |
@bgamari It was discussed with @lmbollen whether to make the payload polymorphic. In theory there isn't anything that currently really looks at the payload so it would not be super hard to do add a type variable for the payload. But in my experience working with packetized streams there usually is not a sane way to have an interior type. You are almost certainly only dealing with fragments, these will generally not have a clear structure at the scope of a single cycle. The structure comes from the fragments together. Do you have some concrete idea how you see a packet stream packet with a non-byte oriented payload? I'm not against the idea but just don't see the advantage. |
This is my experience too. In particular, any protocol that has byte enables (including the interface of block RAMs) are a pain to deal with if they're not having bits/bytes/bitvector as an interior type. Still, ADTs are the killer feature of Clash IMO, so perhaps we should also offer API compatible versions without byte enables. |
4d8758d
to
a38eadc
Compare
56ab0c0
to
dac1bc4
Compare
2e0e8df
to
bfe1baf
Compare
97b5f56
to
a90007a
Compare
* Support zero-byte transfers * Add utility that merges trailing zero-byte transfers * Make PacketStream test framework more flexible Now allows users to: - Set the distribution of abort generation themselves; - Choose whether to generate zero-byte packets; - Choose whether to generate trailing zero-byte transfers. * Converters: remove expensive operations `mod` and `*` are removed.
Reverted back to the old version where all M2S outputs are registered, but now also handles arbitrary metadata and output data widths bigger than 1 that divide the input data width. Zero-byte transfers are always preserved. This new version reduces the LUT resource usage by half compared to the old registered version, because of a mux with 1 selector bit (optimal) being inferred by synthesizers for the next state computation, instead of a mux with 2 selector bits.
Now correctly drops packets that are too big to fit in the content FIFO in 'Backpressure' mode.
Forcing bytes in PacketStream _data to be 0x00 turned out to be too restrictive. Allowing them to be undefined makes a lot of components more efficient: depacketizers, packetizers, dropTail, and upConverter. It also strengthens the test framework as we can now force un-enabled bytes to throw an error when evaluated.
Adds a generic component which enforces packets to be a certain length, which is extracted from the metadata. Packets that are too small are aborted. This is useful for higher-level network protocols such as IP and UDP.
- Removed dangerous leZeroIsZero (could cause type checker to break) - Added source argument to nullByte - Improved documentation of unsafeAbortOnBackpressureC - Remove use of bitCoerce if only pack or unpack is required - Removed M2SNoMeta in favour of PacketStreamM2S n ()
Now tests the behaviour of the metadata transformer functions.
fc4b463
to
c70f77d
Compare
packetArbiterC now reuses Df.CollectMode. A NoSkip mode is added.
A new PR will be opened for these.
Todos:
forceResetSanity
to async fifo