Bar
SpaceWire UK
Specialist providers of VHDL Intellectual Property & Design Services
BarBarBarBar
SpaceWire Switch Core Testbench
The VHDL SpaceWire testbench provides a complete test harness around the SpaceWire Switch Core (Router) and allows data to be generated, examined and consumed.

The testbench philosophy is based on the above three requirements:- Separating these requirements into modules yields:- An illustration of how these modules are connected together to form a Switch Core testbench is given below:-


The testbench top-level can be used to test any configuration of the Switch Core having anywhere between 2 and 32 ports.

Listed below are some example stimuli that can be used to test a 4 port version of the Switch Core (1 user port plus 3 external ports).



Example 1 - Nice & Easy
This example shows a fixed packet flow from a single input port to a single output port using hardware addressing.

PGive Stimulus PTake Stimulus PSnoop Generated Reports
Inputs Outputs
give_01.txt take_01.txt input_01.txt output_01.txt
give_02.txt take_02.txt input_02.txt output_02.txt
give_03.txt take_03.txt input_03.txt output_03.txt

The two important reports to examine in this example are input_02.txt and output_03.txt. The following point should also be noted from this example:-


Example 2 - Bottleneck
This example shows a fixed packet flow from every input port to a single output port using hardware addressing.

PGive Stimulus PTake Stimulus PSnoop Generated Reports
Inputs Outputs
give_01.txt take_01.txt input_01.txt output_01.txt
give_02.txt take_02.txt input_02.txt output_02.txt
give_03.txt take_03.txt input_03.txt output_03.txt

The four important reports to examine in this example are input_01.txt, input_02.txt, input_03.txt and output_02.txt. The following point should also be noted from this example:-


Example 3 - Everything to Everywhere
This example shows random packet flow from every input port to every output port using hardware addressing.

PGive Stimulus PTake Stimulus PSnoop Generated Reports
Inputs Outputs
give_01.txt take_01.txt input_01.txt output_01.txt
give_02.txt take_02.txt input_02.txt output_02.txt
give_03.txt take_03.txt input_03.txt output_03.txt

All reports are worth examining in this example and for readability the first byte of each packet is set to the number of the input port where it originated.



Example 4 - User Port
This example shows how to communicate with the internal User Port.
PGive Stimulus PTake Stimulus PSnoop Generated Reports
Inputs Outputs
give_01.txt take_01.txt input_01.txt output_01.txt
give_02.txt take_02.txt input_02.txt output_02.txt
give_03.txt take_03.txt input_03.txt output_03.txt

The two important reports to examine in this example are input_01.txt and output_01.txt. The following point should also be noted from this example:-


Example 5 - Logical Addressing
This example shows how to set-up and use two Logical Addresses, one with header deletion and one without.
PGive Stimulus PTake Stimulus PSnoop Generated Reports
Inputs Outputs
give_01.txt take_01.txt input_01.txt output_01.txt
give_02.txt take_02.txt input_02.txt output_02.txt
give_03.txt take_03.txt input_03.txt output_03.txt

The three important reports to examine in this example are input_01.txt, output_02.txt and output_03.txt. The following points should also be noted from this example:-


Example 6 - Grouping
This example shows how to set-up and use two Grouped Logical Addresses, one with header deletion and one without.
PGive Stimulus PTake Stimulus PSnoop Generated Reports
Inputs Outputs
give_01.txt take_01.txt input_01.txt output_01.txt
give_02.txt take_02.txt input_02.txt output_02.txt
give_03.txt take_03.txt input_03.txt output_03.txt

All reports are worth examining in this example and for readability the first byte of each packet is set to the number of the input port where it originated. The following points should also be noted from this example:-


Example 7 - Disconnected Ports
This example shows how Grouped Logical Addressed packets are automatically routed to the available and connected ports. For this example to work the active signal assignment in the testbench module must be commented out and the process beneath it uncommented.
PGive Stimulus PTake Stimulus PSnoop Generated Reports
Inputs Outputs
give_01.txt take_01.txt input_01.txt output_01.txt
give_02.txt take_02.txt input_02.txt output_02.txt
give_03.txt take_03.txt input_03.txt output_03.txt

All reports are worth examining in this example and for readability the first byte of each packet is set to the number of the input port where it originated. The following points should also be noted from this example:-


Summary
The above stimuli only touch the surface of what is possible with PGive, PTake and PSnoop. By using the full capabilities of these modules comprehensive testbenches can be created within a very short space of time.