Chargement…
Chargement…
The block computes ReLU(bias + sum(value_k * weight_k)) over a sequence of signed 8-bit pairs. The bias is signed 16-bit.
Required datapath
The output is 0 when the final sum is negative or zero, the sum when it is between 1 and 127, and 127 above that. This exercise performs inference only. Weights are supplied by the upstream block and are not trained in the FPGA.
Behaviour
i_start is accepted while o_ready='1'. That edge loads i_bias and starts a new sum.i_value and i_weight pairs are consumed only when i_valid='1'. They start no earlier than the cycle after i_start.i_last='1' marks the final pair and is considered only together with i_valid='1'.o_done pulses for one cycle with o_value.i_valid='0' do not change the accumulator.| Signal | Direction | Width | Description |
|---|---|---|---|
i_clk | Input | 1 bit | System clock |
i_reset | Input | 1 bit | Active-high asynchronous reset |
i_start | Input | 1 bit | Initializes a new neuron |
i_bias | Input | 16 bits | Signed bias |
i_valid | Input | 1 bit | Valid value/weight pair |
i_last | Input | 1 bit | Final pair in the sum |
i_value | Input | 8 bits | Signed activation |
i_weight | Input | 8 bits | Signed weight |
o_ready | Output | 1 bit | The block can accept i_start |
o_done | Output | 1 bit | Result valid for one cycle |
o_value | Output | 8 bits | Saturating ReLU from 0 to 127 |