The testbench for the SpaceWire CODEC is built up using the standard parallel testbench modules,
PGive,
PTake and
PSnoop, and also the serial testbench modules
SGive and
SSnoop.
An illustration of how the testbench modules are connected together to form the SpaceWire CODEC Testbench is given below:-
|
Interactive block diagram - click on area of interest to find out more. |
The SpaceWire CODEC has four handshake interfaces that are all controlled via stimulus files input to the
PGive and
PTake testbench modules. By adjusting the content of these files an almost infinite amount of operating scenarios can be created. In addition to the handshake interfaces the SpaceWire CODEC also has two serial interfaces, one of which is driven with the
SGive testbench module.
Unfortunately no self-checking mechanism is provided with this testbench, but there are report files for every interface on the CODEC that tell the entire story of what is happening throughout all the tests.
The testing is broken into two sections:-
- The CODEC is stimulated intensely with errors via its Serial Receive Interface and all the parallel interfaces are stimulated intensely too.
- The CODEC's Serial Transmit Interface is Connected to its Serial Receive Interface and all the parallel interfaces are stimulated intensely.
More information on both test sections is given below.
The 91 tests in this section focus on checking that the Receiver and State Machine operate correctly under a number of serial error conditions. For each test the serial Data & Strobe inputs are driven with the required tokens to put the CODEC into a known test state, then an error is inserted and the CODEC's reaction to it checked.
Besides checking that the CODEC moves from its current state into the Error Reset state upon error detection, these tests also check the following two points:-
- No NChar's get through the Receiver & Receive FIFO that are corrupt or not allowed.
- No Time-Codes get through the Receiver that are corrupt or not allowed.
- No NChar's get through the Transmitter & Transmit FIFO that are not allowed.
- No Time-Codes get through the Transmitter that not allowed.
A brief summary of each test is given below. PT stands for Primary Trip and represents what signal should trigger the State Machine to move states.
22x Error Wait State Tests:
- Disconnect Error [PT = err_dsc]
- Single Parity Error [PT = err_par] (ESC part of NULL)
- Single Parity Error [PT = err_par] (FCT part of NULL)
- Double Parity Error [PT = err_par] (ESC & FCT parts of NULL)
- Escape Error [PT = err_esc] (ESC + ESC)
- Escape Error [PT = err_esc] (ESC + EOP)
- Escape Error [PT = err_esc] (ESC + EEP)
- Character Error [PT = got_fct] (FCT)
- Character Error [PT = got_nchar] (DATA)
- Character Error [PT = got_nchar] (EOP)
- Character Error [PT = got_nchar] (EEP)
- Character Error [PT = got_time] (TIME)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + ESC)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EOP)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EEP)
- Parity Error + Character Error [PT = err_par OR got_fct] (FCT)
- Parity Error + Character Error [PT = err_par OR got_nchar] (DATA)
- Parity Error + Character Error [PT = err_par OR got_nchar] (EOP)
- Parity Error + Character Error [PT = err_par OR got_nchar] (EEP)
- Parity Error + Character Error [PT = err_par OR got_time] (ESC part of TIME)
- Parity Error + Character Error [PT = err_par OR got_time] (DATA part of TIME)
- Double Parity Error + Character Error [PT = err_par OR got_time] (ESC & DATA parts of TIME)
22x Ready State Tests:
- Disconnect Error [PT = err_dsc]
- Single Parity Error [PT = err_par] (ESC part of NULL)
- Single Parity Error [PT = err_par] (FCT part of NULL)
- Double Parity Error [PT = err_par] (ESC & FCT parts of NULL)
- Escape Error [PT = err_esc] (ESC + ESC)
- Escape Error [PT = err_esc] (ESC + EOP)
- Escape Error [PT = err_esc] (ESC + EEP)
- Character Error [PT = got_fct] (FCT)
- Character Error [PT = got_nchar] (DATA)
- Character Error [PT = got_nchar] (EOP)
- Character Error [PT = got_nchar] (EEP)
- Character Error [PT = got_time] (TIME)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + ESC)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EOP)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EEP)
- Parity Error + Character Error [PT = err_par OR got_fct] (FCT)
- Parity Error + Character Error [PT = err_par OR got_nchar] (DATA)
- Parity Error + Character Error [PT = err_par OR got_nchar] (EOP)
- Parity Error + Character Error [PT = err_par OR got_nchar] (EEP)
- Parity Error + Character Error [PT = err_par OR got_time] (ESC part of TIME)
- Parity Error + Character Error [PT = err_par OR got_time] (DATA part of TIME)
- Double Parity Error + Character Error [PT = err_par OR got_time] (ESC & DATA parts of TIME)
2x Started State Tests:
- Disconnect Error [PT = err_dsc]
- Timeout Error [PT = 12.8us elapsed]
22x Connecting State Tests:
- Disconnect Error [PT = err_dsc]
- Single Parity Error [PT = err_par] (ESC part of NULL)
- Single Parity Error [PT = err_par] (FCT part of NULL)
- Double Parity Error [PT = err_par] (ESC & FCT parts of NULL)
- Escape Error [PT = err_esc] (ESC + ESC)
- Escape Error [PT = err_esc] (ESC + EOP)
- Escape Error [PT = err_esc] (ESC + EEP)
- Character Error [PT = got_nchar] (DATA)
- Character Error [PT = got_nchar] (EOP)
- Character Error [PT = got_nchar] (EEP)
- Character Error [PT = got_time] (TIME)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + ESC)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EOP)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EEP)
- Parity Error [PT = err_par] (FCT)
- Parity Error + Character Error [PT = err_par OR got_nchar] (DATA)
- Parity Error + Character Error [PT = err_par OR got_nchar] (EOP)
- Parity Error + Character Error [PT = err_par OR got_nchar] (EEP)
- Parity Error + Character Error [PT = err_par OR got_time] (ESC part of TIME)
- Parity Error + Character Error [PT = err_par OR got_time] (DATA part of TIME)
- Double Parity Error + Character Error [PT = err_par OR got_time] (ESC & DATA parts of TIME)
- Timeout Error [PT = 12.8us elapsed]
23x Run State Tests:
- Disconnect Error [PT = err_dsc]
- Single Parity Error [PT = err_par] (ESC part of NULL)
- Single Parity Error [PT = err_par] (FCT part of NULL)
- Double Parity Error [PT = err_par] (ESC & FCT parts of NULL)
- Escape Error [PT = err_esc] (ESC + ESC)
- Escape Error [PT = err_esc] (ESC + EOP)
- Escape Error [PT = err_esc] (ESC + EEP)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + ESC)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EOP)
- Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EEP)
- Parity Error [PT = err_par] (FCT)
- Parity Error [PT = err_par] (DATA)
- Parity Error [PT = err_par] (EOP)
- Parity Error [PT = err_par] (EEP)
- Parity Error [PT = err_par] (ESC part of TIME)
- Parity Error [PT = err_par] (DATA part of TIME)
- Double Parity Error [PT = err_par] (ESC & DATA parts of TIME)
- Disable asserted during Run state [PT = disable].
- FCT Overflow [PT = err_fct] (Too many FCT's)
- a. NChar Overflow [PT = err_fct] (Too many NChar's)
b. With a Full FIFO no Initial FCT should be issued by the transmitter but a Time-Code should be received OK
c. Empty FIFO to see if EEP was added to end the overflowed data from Test 88a.
d. Accept Time-Codes to see if the value of 65 from Test 88b was received OK.
This test set (89) stimulates the SpaceWire CODEC under normal operating conditions with all four parallel interfaces operating as normal. With the Serial Transmit Interface connected directly to the Serial Receive Interface, this test checks that everything input via the Input NChar & Time-Code Interface travels through the entire CODEC and comes back out on the Output NChar & Time-Code Interface.
This is by far one of the simplest tests to run but is also one of the most important since it checks that the CODEC's Transmitter can actually talk to its Receiver.
With the SpaceWire CODEC Testbench, the
Receive FIFO Testbench and the
Transmit FIFO Testbench the SpaceWire CODEC appears to have been tested very well indeed. However there are many more tests that can be run to validate a SpaceWire CODEC design, especially by using the flexible Testbench Modules,
PGive,
PTake,
PSnoop,
SGive and
SSnoop.
This testbench documentation hopefully provides an insight into some of the testing we do, but by no means does it show the weeks of testing that we have done in order to hopefully ensure that the SpaceWire CODEC is an error free design. With a choice of spending the day documenting a few tests or running a few hundred tests we choose the latter everytime and without question.