Bar
SpaceWire UK
Specialist providers of VHDL Intellectual Property & Design Services
BarBarBarBar
SpaceWire CODEC Testbench
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:-

D/S Input Stimulus D/S Input Report (74kb ZIP) D/S Output Report (59kb ZIP) SpaceWire SGive Testbench Module SpaceWire SSnoop Testbench Module SpaceWire SSnoop Testbench Module SpaceWire CODEC SpaceWire PTake Testbench Module SpaceWire PSnoop Testbench Module SpaceWire PTake Testbench Module SpaceWire PSnoop Testbench Module SpaceWire PGive Testbench Module SpaceWire PSnoop Testbench Module SpaceWire PGive Testbench Module SpaceWire PSnoop Testbench Module Time Output Stimulus Time Output Report Data Output Stimulus Data Output Report Time Input Stimulus Time Input Report Data Input Stimulus Data Input Report (696kb ZIP)
SpaceWire CODEC Testbench
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:- More information on both test sections is given below.



Section 1 - Receiver & State Machine Tests
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:- 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:
  1. Disconnect Error [PT = err_dsc]
  2. Single Parity Error [PT = err_par] (ESC part of NULL)
  3. Single Parity Error [PT = err_par] (FCT part of NULL)
  4. Double Parity Error [PT = err_par] (ESC & FCT parts of NULL)
  5. Escape Error [PT = err_esc] (ESC + ESC)
  6. Escape Error [PT = err_esc] (ESC + EOP)
  7. Escape Error [PT = err_esc] (ESC + EEP)
  8. Character Error [PT = got_fct] (FCT)
  9. Character Error [PT = got_nchar] (DATA)
  10. Character Error [PT = got_nchar] (EOP)
  11. Character Error [PT = got_nchar] (EEP)
  12. Character Error [PT = got_time] (TIME)
  13. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + ESC)
  14. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EOP)
  15. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EEP)
  16. Parity Error + Character Error [PT = err_par OR got_fct] (FCT)
  17. Parity Error + Character Error [PT = err_par OR got_nchar] (DATA)
  18. Parity Error + Character Error [PT = err_par OR got_nchar] (EOP)
  19. Parity Error + Character Error [PT = err_par OR got_nchar] (EEP)
  20. Parity Error + Character Error [PT = err_par OR got_time] (ESC part of TIME)
  21. Parity Error + Character Error [PT = err_par OR got_time] (DATA part of TIME)
  22. Double Parity Error + Character Error [PT = err_par OR got_time] (ESC & DATA parts of TIME)
22x Ready State Tests:
  1. Disconnect Error [PT = err_dsc]
  2. Single Parity Error [PT = err_par] (ESC part of NULL)
  3. Single Parity Error [PT = err_par] (FCT part of NULL)
  4. Double Parity Error [PT = err_par] (ESC & FCT parts of NULL)
  5. Escape Error [PT = err_esc] (ESC + ESC)
  6. Escape Error [PT = err_esc] (ESC + EOP)
  7. Escape Error [PT = err_esc] (ESC + EEP)
  8. Character Error [PT = got_fct] (FCT)
  9. Character Error [PT = got_nchar] (DATA)
  10. Character Error [PT = got_nchar] (EOP)
  11. Character Error [PT = got_nchar] (EEP)
  12. Character Error [PT = got_time] (TIME)
  13. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + ESC)
  14. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EOP)
  15. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EEP)
  16. Parity Error + Character Error [PT = err_par OR got_fct] (FCT)
  17. Parity Error + Character Error [PT = err_par OR got_nchar] (DATA)
  18. Parity Error + Character Error [PT = err_par OR got_nchar] (EOP)
  19. Parity Error + Character Error [PT = err_par OR got_nchar] (EEP)
  20. Parity Error + Character Error [PT = err_par OR got_time] (ESC part of TIME)
  21. Parity Error + Character Error [PT = err_par OR got_time] (DATA part of TIME)
  22. Double Parity Error + Character Error [PT = err_par OR got_time] (ESC & DATA parts of TIME)
2x Started State Tests:
  1. Disconnect Error [PT = err_dsc]
  2. Timeout Error [PT = 12.8us elapsed]
22x Connecting State Tests:
  1. Disconnect Error [PT = err_dsc]
  2. Single Parity Error [PT = err_par] (ESC part of NULL)
  3. Single Parity Error [PT = err_par] (FCT part of NULL)
  4. Double Parity Error [PT = err_par] (ESC & FCT parts of NULL)
  5. Escape Error [PT = err_esc] (ESC + ESC)
  6. Escape Error [PT = err_esc] (ESC + EOP)
  7. Escape Error [PT = err_esc] (ESC + EEP)
  8. Character Error [PT = got_nchar] (DATA)
  9. Character Error [PT = got_nchar] (EOP)
  10. Character Error [PT = got_nchar] (EEP)
  11. Character Error [PT = got_time] (TIME)
  12. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + ESC)
  13. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EOP)
  14. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EEP)
  15. Parity Error [PT = err_par] (FCT)
  16. Parity Error + Character Error [PT = err_par OR got_nchar] (DATA)
  17. Parity Error + Character Error [PT = err_par OR got_nchar] (EOP)
  18. Parity Error + Character Error [PT = err_par OR got_nchar] (EEP)
  19. Parity Error + Character Error [PT = err_par OR got_time] (ESC part of TIME)
  20. Parity Error + Character Error [PT = err_par OR got_time] (DATA part of TIME)
  21. Double Parity Error + Character Error [PT = err_par OR got_time] (ESC & DATA parts of TIME)
  22. Timeout Error [PT = 12.8us elapsed]
23x Run State Tests:
  1. Disconnect Error [PT = err_dsc]
  2. Single Parity Error [PT = err_par] (ESC part of NULL)
  3. Single Parity Error [PT = err_par] (FCT part of NULL)
  4. Double Parity Error [PT = err_par] (ESC & FCT parts of NULL)
  5. Escape Error [PT = err_esc] (ESC + ESC)
  6. Escape Error [PT = err_esc] (ESC + EOP)
  7. Escape Error [PT = err_esc] (ESC + EEP)
  8. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + ESC)
  9. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EOP)
  10. Parity Error + Escape Error [PT = err_par OR err_esc] (ESC + EEP)
  11. Parity Error [PT = err_par] (FCT)
  12. Parity Error [PT = err_par] (DATA)
  13. Parity Error [PT = err_par] (EOP)
  14. Parity Error [PT = err_par] (EEP)
  15. Parity Error [PT = err_par] (ESC part of TIME)
  16. Parity Error [PT = err_par] (DATA part of TIME)
  17. Double Parity Error [PT = err_par] (ESC & DATA parts of TIME)
  18. Disable asserted during Run state [PT = disable].
  19. FCT Overflow [PT = err_fct] (Too many FCT's)
  20. 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.



Section 2 - Transmitter & Receiver Tests
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.



Summary
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.