naps.stream package

Submodules

naps.stream.first_stream module

class naps.stream.first_stream.PacketizedFirstStream(payload_shape, name=None, src_loc_at=1)

Bases: naps.stream.stream.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: nmigen.hdl.ir.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

class naps.stream.formal_util_test.BrokenStreamSource(*args, src_loc_at=0, **kwargs)

Bases: nmigen.hdl.ir.Elaboratable

elaborate(platform)
class naps.stream.formal_util_test.FormalUtilTestCase(methodName='runTest')

Bases: unittest.case.TestCase

test_catch_changing_payload()
test_catch_dont_wait_for_ready()
test_catch_valid_depends_on_ready()

naps.stream.pipeline module

class naps.stream.pipeline.Pipeline(m, prefix='', start_domain='sync')

Bases: object

A helper (syntactic sugar) to easier write pipelines of stream cores

property last
property output

naps.stream.sim_util module

naps.stream.sim_util.read_from_stream(stream: naps.stream.stream.Stream, extract='payload', timeout=100)
naps.stream.sim_util.read_packet_from_stream(stream: naps.stream.stream.PacketizedStream, timeout=100, allow_pause=True, pause_after_word=0)
naps.stream.sim_util.write_packet_to_stream(stream: naps.stream.stream.PacketizedStream, payload_array, timeout=100)
naps.stream.sim_util.write_to_stream(stream: naps.stream.stream.Stream, timeout=100, **kwargs)

naps.stream.stream module

class naps.stream.stream.BasicStream(payload_shape, name=None, src_loc_at=1)

Bases: naps.stream.stream.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: naps.stream.stream.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: naps.data_structure.bundle.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: naps.stream.stream.BasicStream, output_stream: naps.stream.stream.BasicStream, m: nmigen.hdl.dsl.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: a nmigen Module @param latency: the latency of the transform data path in cycles

Module contents