naps.stream package
Submodules
naps.stream.first_stream module
- class naps.stream.first_stream.PacketizedFirstStream(payload_shape, name=None, src_loc_at=1)
Bases:
BasicStream
A stream that carries a payload and can separate Packets via a first signal that is asserted on the first word of a packet
naps.stream.formal_util module
- class naps.stream.formal_util.LegalStreamSource(*args, src_loc_at=0, **kwargs)
Bases:
Elaboratable
A stream source that can be used to constrain stream input of cores
- elaborate(platform)
- naps.stream.formal_util.verify_stream_output_contract(module, stream_output=None, support_modules=[])
naps.stream.formal_util_test module
naps.stream.pipeline module
naps.stream.sim_util module
- naps.stream.sim_util.read_packet_from_stream(stream: PacketizedStream, timeout=100, allow_pause=True, pause_after_word=0)
- naps.stream.sim_util.write_packet_to_stream(stream: PacketizedStream, payload_array, timeout=100)
naps.stream.stream module
- class naps.stream.stream.BasicStream(payload_shape, name=None, src_loc_at=1)
Bases:
Stream
A basic stream that carries a payload
- property out_of_band_signals
- class naps.stream.stream.PacketizedStream(payload_shape, name=None, src_loc_at=1)
Bases:
BasicStream
A stream that carries a payload and can separate Packets via a last signal that is asserted on the last word of a packet
- class naps.stream.stream.Stream(name=None, src_loc_at=1)
Bases:
Bundle
A stream is everything that inherits from Bundle and has a ready@UPWARDS, a valid@DOWNWARDS. Stream Sinks (downstream) pull ready high if they can accept data and stream Sources (upstream) pull valid high if they have data to offer. Both ready-before-valid and valid-before-ready are allowed. A successful data transfer on the stream happens if ready and valid are 1 during a cycle.
Optionally Streams may have any number of DOWNWARDS Signals, that carry actual payload and/or out-of-band signaling (e.g. last or first) as their payload.
Streams have to implement a clone() methods that returns a Stream that is shaped just like the original stream but not connected to it.
This is the base Stream class that is pretty much useless on its own. Other Classes are implementing Streams that are useful for real use-cases. Probably you are looking for BasicStream
- clone(name=None, src_loc_at=1)
- property payload_signals
naps.stream.stream_transformer module
- naps.stream.stream_transformer.stream_transformer(input_stream: BasicStream, output_stream: BasicStream, m: Module, *, latency: int, handle_out_of_band=True, allow_partial_out_of_band=False)
A utility to help you writing fixed latency stream ip that converts one input word to one output word.
- Warning:
You have to make sure that you only sample the input when ready and valid of it are high for transformers with latency otherwise you are not going to comply to the stream contract. In this case you MUST place a StreamBuffer after your core.
@param handle_out_of_band: determines if this core should connect the out of bands signals or if it is done manually @param allow_partial_out_of_band: allow the out of band signals of the streams to differ @param input_stream: the input stream @param output_stream: the output stream @param m: an amaranth HDL Module @param latency: the latency of the transform data path in cycles