|
CIRCT 24.0.0git
|
Classes | |
| class | ESI_Manifest_ROM |
| class | ESI_Manifest_ROM_Wrapper |
| class | ChannelMMIO |
| class | TelemetryMMIO |
| class | MMIOIndirection |
Functions | |
| Module | HeaderMMIO (int manifest_loc) |
| type["ChannelDemuxNImpl"] | ChannelDemuxN_HalfStage_ReadyBlocking (Type data_type, int num_outs, int next_sel_width) |
| type["ChannelDemuxTree"] | ChannelDemuxTree_HalfStage_ReadyBlocking (Type data_type, int num_outs, int branching_factor_log2) |
| type["MMIOPrefixRouterImpl"] | MMIOPrefixRouter (Tuple[Tuple[int, Optional[int]],...] regions) |
| type["DesignResetControllerImpl"] | DesignResetController (int delay_cycles) |
| type["SliceReadGearboxImpl"] | SliceReadGearbox (int input_bitwidth, int output_bitwidth) |
| type["ConcatReadGearboxImpl"] | ConcatReadGearbox (int input_bitwidth, int output_bitwidth) |
| type["DepackReadGearboxImpl"] | DepackReadGearbox (int input_bitwidth, int output_bitwidth) |
| type["ShiftReadGearboxImpl"] | ShiftReadGearbox (int input_bitwidth, int output_bitwidth) |
| select_read_gearbox (bool is_list, int input_bitwidth, int output_bitwidth) | |
| HostMemReadReqSplitter (Channel req_channel_type, Channel resp_channel_type, int max_chunk_bytes, int max_outstanding=1, bool round_read_lengths=True) | |
| HostmemReadProcessor (int read_width, hostmem_module, List[esi._OutputBundleSetter] reqs, int max_read_request_bytes=DEFAULT_MAX_READ_REQUEST_BYTES, int max_outstanding_reads=1, bool round_read_lengths=True) | |
| type["TaggedWriteGearboxImpl"] | TaggedWriteGearbox (int input_bitwidth, int output_bitwidth, int max_burst_bytes) |
| type[ 'EmitEveryNImpl'] | EmitEveryN (Type message_type, int N) |
| type["HostMemWriteProcessorImpl"] | HostMemWriteProcessor (int write_width, hostmem_module, List[esi._OutputBundleSetter] reqs, int max_write_payload_bytes=DEFAULT_MAX_WRITE_PAYLOAD_BYTES) |
| typing.Type[ 'ChannelHostMemImpl'] | ChannelHostMem (int read_width, int write_width, int max_read_request_bytes=DEFAULT_MAX_READ_REQUEST_BYTES, int max_write_payload_bytes=DEFAULT_MAX_WRITE_PAYLOAD_BYTES, int max_outstanding_reads=1, bool round_read_lengths=True) |
| type[ 'DummyToHostEngineImpl'] | DummyToHostEngine (Type client_type) |
| type[ 'DummyFromHostEngineImpl'] | DummyFromHostEngine (Type client_type) |
| Tuple[Callable, Callable] | _resolve_engine_pair (str path) |
| type[ 'ChannelEngineService'] | ChannelEngineService (Callable to_host_engine_gen, Callable from_host_engine_gen) |
Variables | |
| int | MagicNumber = 0x207D98E5_E5100E51 |
| int | VersionNumber = 1 |
| int | IndirectionMagicNumber = 0x312bf0cc_E5100E51 |
| int | IndirectionVersionNumber = 0 |
| int | ResetMagicNumber = 0x00000E510000B007 |
| int | ResetCycles = 8192 |
| int | MMIOWordBytes = esi.MMIODataType.width // 8 |
| int | DEFAULT_MAX_READ_REQUEST_BYTES = 64 * 4 |
| int | DEFAULT_MAX_WRITE_PAYLOAD_BYTES = 256 |
|
protected |
Resolve a dotted Python import path to a
`(to_host_engine_gen, from_host_engine_gen)` tuple, used to override the
default engine pair for a specific service request.
The path may point at either:
- a module-level 2-tuple attribute, e.g.
`"mypkg.mymod.MyEnginePair"` where `MyEnginePair` is
`(MyToHost, MyFromHost)`; or
- a zero-arg factory callable returning such a tuple.
Definition at line 2409 of file common.py.
Referenced by ChannelEngineService().
| type["ChannelDemuxNImpl"] esiaccel.bsp.common.ChannelDemuxN_HalfStage_ReadyBlocking | ( | Type | data_type, |
| int | num_outs, | ||
| int | next_sel_width ) |
N-way channel demultiplexer for valid/ready signaling. Contains
valid/ready registers on the output channels. The selection signal is now
embedded in the input channel payload as a struct {sel, data}. Input
signals ready when the selected output register is empty.
Definition at line 174 of file common.py.
References Input, Output, and wrap().
Referenced by ChannelDemuxTree_HalfStage_ReadyBlocking(), and MMIOPrefixRouter().
| type["ChannelDemuxTree"] esiaccel.bsp.common.ChannelDemuxTree_HalfStage_ReadyBlocking | ( | Type | data_type, |
| int | num_outs, | ||
| int | branching_factor_log2 ) |
Pipelined N-way channel demultiplexer for valid/ready signaling. This implementation uses a tree structure of ChannelDemuxN_HalfStage_ReadyBlocking modules to reduce fanout pressure. Supports maximum half-throughput to save complexity and area.
Definition at line 267 of file common.py.
References ChannelDemuxN_HalfStage_ReadyBlocking(), Input, and Output.
| type['ChannelEngineService'] esiaccel.bsp.common.ChannelEngineService | ( | Callable | to_host_engine_gen, |
| Callable | from_host_engine_gen ) |
Returns a channel service implementation which calls
to_host_engine_gen(<client_type>) or from_host_engine_gen(<client_type>) to
generate the to_host and from_host engines for each channel. Does not support
engines which can service multiple clients at once.
Individual service requests may override the default engine pair by passing
`options={"engine": "pkg.mod.attr"}` at the service-request call site (e.g.
`HostComms.some_bundle(AppID(...), options={"engine": "..."})`). The path
is resolved by `_resolve_engine_pair` and must yield a
`(to_host_engine_gen, from_host_engine_gen)` tuple with the same call shape
as the defaults; the override applies to every channel of that request's
bundle.
Definition at line 2446 of file common.py.
References _resolve_engine_pair().
| typing.Type['ChannelHostMemImpl'] esiaccel.bsp.common.ChannelHostMem | ( | int | read_width, |
| int | write_width, | ||
| int | max_read_request_bytes = DEFAULT_MAX_READ_REQUEST_BYTES, | ||
| int | max_write_payload_bytes = DEFAULT_MAX_WRITE_PAYLOAD_BYTES, | ||
| int | max_outstanding_reads = 1, | ||
| bool | round_read_lengths = True ) |
HostMem service multiplexing every client onto one read and one write bundle. `max_outstanding_reads` is the per-client limit on logical read requests in flight (see `HostMemReadReqSplitter`); values above 1 require the upstream to return each client's read responses in request order. `round_read_lengths` selects word-granular upstream reads (the default); byte-granular transports can disable it to avoid reading padding bytes.
Definition at line 2278 of file common.py.
References HostmemReadProcessor(), HostMemWriteProcessor(), and Output.
| type["ConcatReadGearboxImpl"] esiaccel.bsp.common.ConcatReadGearbox | ( | int | input_bitwidth, |
| int | output_bitwidth ) |
Concatenate ``ceil(OUT/IN)`` consecutive engine words into one client element wider than the word (``OUT > IN``). Serves single-message reads (any ``OUT > IN``; the low ``OUT`` bits of the concatenation are the element) and contiguous list reads whose element is a whole number of output_bitwidth (``OUT % IN == 0``, so elements never straddle). ``valid_bytes`` is unused: such lists have no partial words and a single element is one flit. Straddling lists use `ShiftReadGearbox`.
Definition at line 1008 of file common.py.
Referenced by select_read_gearbox().
| type["DepackReadGearboxImpl"] esiaccel.bsp.common.DepackReadGearbox | ( | int | input_bitwidth, |
| int | output_bitwidth ) |
Unpack a byte-aligned element that divides the engine word (``OUT % 8 == 0`` and ``IN % OUT == 0``) from a contiguous list response. Each word holds ``IN/OUT`` gap-free elements that never straddle, so a counter drives a parts:1 element mux -- no shifter (e.g. 32b/64b, 64b/256b). ``valid_bytes`` locates the last element in the burst's (possibly partial) final word. Straddling relationships use `ShiftReadGearbox`.
Definition at line 1113 of file common.py.
Referenced by select_read_gearbox().
| type["DesignResetControllerImpl"] esiaccel.bsp.common.DesignResetController | ( | int | delay_cycles | ) |
Counts `delay_cycles` clock cycles after a reset request is observed, then asserts `design_reset` for one cycle. This module must be driven by the *external* reset only (not the reset it generates) so that the countdown is not disturbed by the reset it produces. `reset_pending` is asserted from the moment a reset is requested until it fires. It is intended to be used to quiesce the design (e.g. stop accepting new transactions) so that nothing is in flight when the reset is asserted.
| type['DummyFromHostEngineImpl'] esiaccel.bsp.common.DummyFromHostEngine | ( | Type | client_type | ) |
| type['DummyToHostEngineImpl'] esiaccel.bsp.common.DummyToHostEngine | ( | Type | client_type | ) |
| type['EmitEveryNImpl'] esiaccel.bsp.common.EmitEveryN | ( | Type | message_type, |
| int | N ) |
Emit (forward) one message for every N input messages. The emitted message is the last one of the N received. N must be >= 1.
Definition at line 2045 of file common.py.
Referenced by HostMemWriteProcessor().
| Module esiaccel.bsp.common.HeaderMMIO | ( | int | manifest_loc | ) |
| esiaccel.bsp.common.HostmemReadProcessor | ( | int | read_width, |
| hostmem_module, | |||
| List[esi._OutputBundleSetter] | reqs, | ||
| int | max_read_request_bytes = DEFAULT_MAX_READ_REQUEST_BYTES, | ||
| int | max_outstanding_reads = 1, | ||
| bool | round_read_lengths = True ) |
Construct a host memory read request module to orchestrate the the read connections. Responsible for both gearboxing the data, multiplexing the requests, reassembling out-of-order responses and routing the responses to the correct clients. `max_outstanding_reads` bounds the number of logical read requests each client may have in flight (see `HostMemReadReqSplitter`). Values above 1 require the upstream to return each client's responses in request order. Generate this module dynamically to allow for multiple read clients of multiple types to be directly accomodated.
Definition at line 1676 of file common.py.
References HostMemReadReqSplitter(), Output, select_read_gearbox(), and wrap().
Referenced by ChannelHostMem().
| esiaccel.bsp.common.HostMemReadReqSplitter | ( | Channel | req_channel_type, |
| Channel | resp_channel_type, | ||
| int | max_chunk_bytes, | ||
| int | max_outstanding = 1, | ||
| bool | round_read_lengths = True ) |
Split oversized host memory read requests into request-sized chunks before
arbitration and reassemble the per-chunk responses into a single logical
burst per request.
A burst read (`read_list`) can request many more bytes than a single upstream
read request can carry. This module breaks such a request into
`max_chunk_bytes`-sized (word-aligned) chunks addressed sequentially from the
base. Splitting here -- *before* the requests
are arbitrated onto the shared upstream read channel -- lets each client's
chunks interleave with other clients' requests, so one large burst does not
monopolize host memory bandwidth.
On the response path the per-chunk end-of-list markers are dropped and a
single burst-final `last` (plus the final word's `valid_bytes`) is re-derived
from each logical request's length, so the gearbox and client see one
contiguous response stream per request, identical to an unsplit read.
Up to `max_outstanding` logical requests may be in flight at once. On accept,
each request's {word count, final-word valid bytes} is queued in a metadata
FIFO (depth `max_outstanding`); the response path frames each burst from the
head of that FIFO. This **requires the upstream to return response words in
request order** (no interleaving of different requests' words) -- the
response `tag` is passed through from `resp_in` and is not used for matching.
A new request is accepted whenever the chunk emitter is free (or is issuing
its final chunk this cycle) and fewer than `max_outstanding` requests are in
flight; draining responses does not block accepting. Throughput: a
single-chunk request can be accepted every cycle, chunks are issued one per
cycle, and responses flow one word per cycle with no bubble between bursts.
No latency is added over the single-request version. There is no
combinational path from `resp_in` to `req_in`'s ready; with
`max_outstanding` > 1, `req_out`'s ready feeds `req_in`'s ready.
Zero-length requests are not supported.
req_channel_type: channel of the upstream read request {address, length
(bytes), tag}.
resp_channel_type: channel of the upstream response {tag, data, last}.
max_chunk_bytes: largest per-chunk byte count; must be > 0 and a multiple of
the response word size.
max_outstanding: maximum number of logical requests in flight (accepted
but whose final response word has not yet been delivered). The default of 1
serializes requests.
round_read_lengths: round chunk lengths up to a whole response word for
transports requiring word-granular reads. Disable for byte-granular
transports such as cosim, which zero-pad a partial final response word.
Definition at line 1391 of file common.py.
Referenced by HostmemReadProcessor().
| type["HostMemWriteProcessorImpl"] esiaccel.bsp.common.HostMemWriteProcessor | ( | int | write_width, |
| hostmem_module, | |||
| List[esi._OutputBundleSetter] | reqs, | ||
| int | max_write_payload_bytes = DEFAULT_MAX_WRITE_PAYLOAD_BYTES ) |
Construct a host memory write request module to orchestrate the the write connections. Responsible for both gearboxing the data, multiplexing the requests, reassembling out-of-order responses and routing the responses to the correct clients. Generate this module dynamically to allow for multiple write clients of multiple types to be directly accomodated.
Definition at line 2097 of file common.py.
References EmitEveryN(), Output, TaggedWriteGearbox(), and wrap().
Referenced by ChannelHostMem().
| type["MMIOPrefixRouterImpl"] esiaccel.bsp.common.MMIOPrefixRouter | ( | Tuple[Tuple[int, Optional[int]], ...] | regions | ) |
Build a pipelined address-prefix tree which routes MMIO commands.
Each ``(base, size)`` must describe a disjoint, power-of-two-aligned block.
The last region may pass ``size=None`` to claim every address at or above its
base; the manifest uses this since its size isn't known during generation.
Internal nodes test one address bit and register both outgoing paths. Leaves
replace the global address with the block-local low bits, so no subtractor is
needed (the open-ended region is the one exception).
For four 0x100-byte regions at 0x0/0x100/0x200/0x300 plus an open-ended
region at 0x400: the open-ended region is peeled off first, then each level
splits the remaining candidates in half, so depth is ``O(log N)`` rather than
one level per region::
cmd ──▶ addr[31:10]≠0 ──1──▶ @0x400 (open ended, offset -= 0x400)
│
0
▼
addr[9]
╱ ╲
0 1
▼ ▼
addr[8] addr[8]
╱ ╲ ╱ ╲
0 1 0 1
▼ ▼ ▼ ▼
@0x0 @0x100 @0x200 @0x300
The four leaves all take their client-local offset as ``addr[7:0]``.
Definition at line 377 of file common.py.
References ChannelDemuxN_HalfStage_ReadyBlocking(), Input, and Output.
Referenced by esiaccel.bsp.common.ChannelMMIO.build_read().
| esiaccel.bsp.common.select_read_gearbox | ( | bool | is_list, |
| int | input_bitwidth, | ||
| int | output_bitwidth ) |
Pick the read-gearbox module for a client of the given kind and width
relationship. Every gearbox shares the {tag, data, valid_bytes, last} input
(from `HostMemReadReqSplitter`) and the {tag, data, last} output, so callers
wire them identically. `ShiftReadGearbox` is the correct-for-everything
fallback; the others avoid its barrel shifter for regular relationships.
Definition at line 1354 of file common.py.
References ConcatReadGearbox(), DepackReadGearbox(), ShiftReadGearbox(), and SliceReadGearbox().
Referenced by HostmemReadProcessor().
| type["ShiftReadGearboxImpl"] esiaccel.bsp.common.ShiftReadGearbox | ( | int | input_bitwidth, |
| int | output_bitwidth ) |
Universal fallback: unpack a contiguous, byte-packed element stream (a `read_list` response) for ANY ``(input_bitwidth, output_bitwidth)`` pair. Elements are packed at their natural byte stride ``stride = ceil(OUT/8)`` bytes, so element k begins at wire bit ``k*stride*8`` and, in general, straddles engine-word boundaries at an arbitrary bit offset. A byte-addressed shift-register accumulator realigns each element across words. This is correct for every width relationship; `SliceReadGearbox`, `ConcatReadGearbox` and `DepackReadGearbox` are optimizations that avoid this barrel shifter for the regular (non-straddling) cases. Each input word carries ``valid_bytes`` (how many of its bytes are real) and ``last``. Both are framed to one whole `read_list` request rather than to the transport: `HostMemReadReqSplitter` drops the per-chunk framing of the reads it issues and re-derives these from the request's total length, so only the request's final word is ever partial. That length is ``num_elements * stride``, so tracking real bytes lets the gearbox emit exactly the right elements and place the list-terminating ``last`` on the final one -- no padding element is ever emitted.
Definition at line 1208 of file common.py.
Referenced by select_read_gearbox().
| type["SliceReadGearboxImpl"] esiaccel.bsp.common.SliceReadGearbox | ( | int | input_bitwidth, |
| int | output_bitwidth ) |
Narrow one engine word to a single-message client element no wider than the word (``OUT <= IN``). The element sits in the word's low bits, so the datapath is a slice; ``valid_bytes`` is unused (a single element is never a partial word). Wider single elements use `ConcatReadGearbox`; packed list reads use `DepackReadGearbox`/`ShiftReadGearbox`.
Definition at line 958 of file common.py.
Referenced by select_read_gearbox().
| type["TaggedWriteGearboxImpl"] esiaccel.bsp.common.TaggedWriteGearbox | ( | int | input_bitwidth, |
| int | output_bitwidth, | ||
| int | max_burst_bytes ) |
Build a gearbox to convert the client data to upstream write chunks.
Assumes a struct {address, tag, data} and only gearboxes the data. Tag is
stored separately and the struct is re-assembled later on.
'max_burst_bytes' caps a single contiguous upstream write transaction (a
max-payload-size analog): when an element spans more than 'max_burst_bytes',
its engine words are split into multiple <= 'max_burst_bytes' transactions by
emitting the framing 'last' at each boundary. 0 disables the cap.
Definition at line 1881 of file common.py.
Referenced by HostMemWriteProcessor().
| int esiaccel.bsp.common.DEFAULT_MAX_READ_REQUEST_BYTES = 64 * 4 |
| int esiaccel.bsp.common.DEFAULT_MAX_WRITE_PAYLOAD_BYTES = 256 |
| int esiaccel.bsp.common.IndirectionMagicNumber = 0x312bf0cc_E5100E51 |
| int esiaccel.bsp.common.MMIOWordBytes = esi.MMIODataType.width // 8 |
| int esiaccel.bsp.common.ResetMagicNumber = 0x00000E510000B007 |