SED Wrapper
Overview
sed_wrapper is a VHDL wrapper around the Lattice ECP5 SED primitive SEDGA.
It is used to initialize the SED block and periodically trigger Single Event Upset
detection by issuing SEDSTART pulses.
The wrapper performs the following main functions:
Generates the required
SEDENABLEinitialization sequence.Instantiates the Lattice
SEDGAprimitive.Synchronizes the initialization-complete indication into the
SEDCLKOUTclock domain.Periodically generates a one-cycle
SEDSTARTpulse.Monitors
SEDINPROGto detect completion of a SED run.Latches
SEDERRas a sticky error output.Optionally stops further SED checks after an error is detected.
This module is intended for use in Lattice FPGA designs where the internal SED primitive is used for configuration-memory error detection.
Warning
According to Lattice errata PB1384, SED functionalities may be compromised in designs using Distributed RAM.
In the framework of HotRIO, this includes any firmware that instantiates hotrio_master_rx or hotrio_slave
with ctc_g => true, hotrio_dual_ring_wrapper, ethernet_ipv4_udp_formatter, octo_spi and fifo_dc_9b.
It is advised to avoid instantiation of sed_wrapper in designs impacted by the errata.
Detailed portlist
Generics
Name |
Description |
Type |
Default |
|---|---|---|---|
init_hold_cycles_g | number of clk_i cycles used to hold each step of the sed initialization sequence. |
|
|
gap_sedclk_cycles_g | number of sedclkout cycles to wait after a complete sed run before issuing the next sedstart pulse |
|
|
stop_on_error_g | when set to true, the wrapper stops issuing further sedstart pulses after a sed error has been detected and latched |
|
|
Input signals
IN ports
Name |
Description |
Type |
|---|---|---|
clk_i | system clock used for the sed initialization sequence |
|
rstn_i | active-low reset. resets both the initialization fsm and the sed run-control fsm |
|
sedfrcerr_i | force-error input connected to the sedfrcerr input of the sedga primitive. default value is '0' |
|
Output signals
OUT ports
Name |
Description |
Type |
|---|---|---|
sederr_o | sticky sed error output. once a sed error is detected, this output remains high until reset |
|
seddone_o | direct status output from the seddone output of the sedga primitive |
|
sedinprog_o | direct status output from the sedinprog output of the sedga primitive |
|
sedclkout_o | direct clock output from the sedclkout output of the sedga primitive |
|
Internal Primitive Instantiation
The wrapper instantiates the Lattice SEDGA primitive.
The primitive is configured with:
Primitive Generic |
Value |
Description |
|---|---|---|
|
|
SED clock frequency setting used by the Lattice primitive. |
|
|
Continuous checking is disabled. The wrapper manually starts SED checks using |
|
|
Device density setting for the target Lattice FPGA. |
Functional Description
The wrapper contains two main control sections:
Initialization FSM running in the
clk_iclock domain.Periodic SED run-control FSM running in the
SEDCLKOUTclock domain.
The initialization FSM controls SEDENABLE. After initialization is complete,
the run-control FSM periodically asserts SEDSTART to start SED checks.
The outputs seddone_o, sedinprog_o and sedclkout_o are passed directly
from the SEDGA primitive. The output sederr_o is generated from an
internally latched version of SEDERR.
Initialization Sequence
The initialization process runs from clk_i and generates the following
SEDENABLE sequence:
0 -> 1 -> 0 -> 1
Each step is held for init_hold_cycles_g clock cycles.
The initialization FSM uses the following states:
State |
Description |
|---|---|
|
Holds |
|
Holds |
|
Holds |
|
Drives |
After the final initialization state is reached, init_done_s is asserted and
remains high until reset.
SED Run-Control FSM
The SED run-control FSM operates on the rising edge of sedclkout_s.
It is responsible for generating periodic SEDSTART pulses after the
initialization sequence has completed.
The FSM uses the following states:
State |
Description |
|---|---|
|
Waits for |
|
Asserts |
|
Waits for |
|
Waits for the falling edge of |
|
Waits for |
|
Stops issuing further |
Error Handling
The primitive output sederr_s is latched internally.
if (sederr_s = '1') then
sederr_latched_s <= '1';
end if;
The output sederr_o is driven from this latched error signal:
sederr_o <= sederr_latched_s;
This makes sederr_o a sticky error indication. Once an error is detected, the
output remains high until rstn_i is asserted low.
If stop_on_error_g is set to true, the wrapper stops issuing new
SEDSTART pulses after an error has been latched.
Reset Behaviour
The reset input rstn_i is active low.
When rstn_i is asserted low:
The initialization FSM returns to
INIT_0A.SEDENABLEis driven low.init_done_sis cleared.The CDC synchronizer registers are cleared.
The SED run-control FSM returns to
RUN_IDLE.sedstart_sis cleared.The gap counter is cleared.
The latched SED error is cleared.
The delayed
SEDINPROGregister is cleared.