Expand description
Port to a shared SHA-512 pipeline.
The shared line (rhdl_sha512_pipelined) is either the full pipeline,
which takes a block every cycle with a fixed latency, or a folded core,
which takes a block when its ready is high (S / 80 blocks per clock)
and returns it 82 cycles after it enters its ring. Both return blocks in
the order they took them, and the arbiter relies on nothing else. Several
modules share it through a ShaArbiter; each module talks to the
arbiter through a ShaClient, which offers exactly the interface of a
ShaRing (ShaRingIn/ShaRingOut), so a
core can swap its rings for one client.
core ──ShaRingIn──> ShaClient ──PipeIn/grant──> ShaArbiter ──> pipeline
core <─ShaRingOut── ShaClient <──PipeOut────── ShaArbiter <── pipeline§Client
- Credits. The line cannot hold a result, so every block in flight must
have room waiting at its client. A client holds
CLIENT_CREDITScredits, one per entry of its result FIFO; issuing a block takes one, and the core taking a digest returns one. - Two-block jobs. A job with
second_pad(a 128-byte message, as in the challengeH(R || A || M)) comes back from its first block marked first; the client resubmits the constant padding block with that state as the chain, ahead of new jobs. The entry’s credit carries over. - Order. The pipeline returns blocks in order, so a small ring of first flags, written at issue and read at return, tells the two kinds apart; tags pass through untouched.
§Arbiter
Round-robin over the clients’ requests (each client’s request depends
only on its registers), granting only while the line’s ready input is
high. Results are routed by a FIFO of client numbers written at issue and
read when a result returns (the line keeps order), so the pipeline’s tag
stays the client’s own and the line’s latency may vary.
§Combinational paths
A client’s req and ring outputs come from its registers only. The
arbiter’s grants and result routing are combinational from those
requests and from the pipeline’s output. So the client -> arbiter ->
client path that the grant takes in one cycle contains no loop, and the
request to the pipeline also depends only on registers.
Structs§
- Arbiter
In - Inputs of
ShaArbiter. - Arbiter
Out - Outputs of
ShaArbiter. - PipeIn
- One block for the pipeline (field for field
rhdl_sha512_pipelined::ShaIn). - PipeOut
- One finished block (field for field
rhdl_sha512_pipelined::ShaOut). - ShaArbiter
- Round-robin arbiter of up to 16 clients onto one pipeline.
- ShaClient
- Client of the shared SHA-512 pipeline, with a ring’s interface.
- ShaClient
In - Inputs of
ShaClient. - ShaClient
Out - Outputs of
ShaClient. - Shared
ShaIn - Inputs of
SharedShaPort. - Shared
ShaOut - Outputs of
SharedShaPort. - Shared
ShaPort Nclients and their arbiter: everything betweenNmodules and one shared SHA-512 pipeline.
Constants§
- CLIENT_
CREDITS - Jobs a client may have issued and not yet drained, which is also the depth of its result FIFO.
- PIPE_
LATENCY - Cycles from a request entering the pipeline to its result
(
rhdl_sha512_pipelined::LATENCY).
Functions§
- idle_
pipe_ in - An idle request (no block, all fields zero).
- idle_
pipe_ out - No result (all fields zero).
- sha_
arbiter_ kernel - State transition for
ShaArbiter. - sha_
client_ kernel - State transition for
ShaClient. - shared_
sha_ port_ kernel - Wiring for
SharedShaPort.