Bar
SpaceWire UK
Specialist providers of VHDL Intellectual Property & Design Services
BarBarBarBar
SpaceWire Serial Testbench Module - SGive
The SGive testbench module is used to generate serial SpaceWire Data & Strobe signals that can be used to stimulate any SpaceWire CODEC. The testbench module also has the ability to reset the CODEC that it is sending data to. A simple block diagram for the testbench module is shown below.


The testbench signal generation is controlled by an external file that is passed to the testbench via a VHDL Generic. This file is a basic ASCII file that uses the very simple token syntax given below.



Comments
Comment lines start with a hash (#) character at the very first position of the line.

Examples:-


Numbers
A number followed by a star will generate multiple copies of whatever follows the star. A zero will naturally generate nothing (zero copies).

Examples:-


Commas
Commas separate tokens and do not generate anything themselves.

Examples:-


Stars
A Star generates multiple copies of whatever follows it.

Examples:-


Brackets
Brackets are used to isolate sets of tokens and do not generate anything themselves.

Examples:-


Null
A Null generates a NULL token that is used to fill gaps when no other tokens are available.

Examples:- To generate a null with a double parity error start the keyword with a capital letter, i.e. Null. Single parity errors can be obtained with the token pair Esc, fct and esc, Fct.



Flow Control
A Flow Control generates a FCT token that can be used to control NChar (data, eop & eep) traffic allowance.

Examples:- To generate a fct with a parity error start the keyword with a capital letter, i.e. Fct.



Escape
An Escape generates an Escape token that can be used to manually generate NULL's or Time-Codes, or used to generate Escape errors.

Examples:- To generate an esc with a parity error start the keyword with a capital letter, i.e. Esc.



Time
Time generates time-code tokens that can be used to transfer the current system time.

There are four possible values that can follow the time keyword:- Examples:- To generate a time-code with a double parity error start the keyword with a capital letter, i.e. Time. Single parity errors can be obtained with the token pair Esc, data=3 and esc, Data=56.



Packet Data
Packet Data generates data tokens that can be used to make up the byte content of a packet.

There are four possible values that can follow the data keyword:- Examples:- To generate a data byte with a parity error start the keyword with a capital letter, i.e. Data.



Packet Terminators
Packet Terminators (EOP or EEP) generate end of packet or an error end of packet tokens. An EOP or EEP can also be generated by using data=256 or data=257.

Examples:- To generate an eop/eep with a parity error start the keyword with a capital letter, i.e. Eop/Eep.



Ascending
An ascending character (A) generates a data token that is one more than the last data token. If the last data token was 255 then the next data token will be 0.

Examples:-



Descending
A descending character (D) generates a data token that is one less than the last data token. If the last data token was 0 then the next data token will be 255.

Examples:-



Random
A random character (R) followed by a star will generate a random number of whatever follows the star. If the random number happens to be zero then nothing will be generated. This random number will also be in the range Lower Limit to Upper Limit.

Examples:- A random character (R) following a data keyword will generate a random data byte in the range Lower Limit to Upper Limit. This random number will also be in the range Lower Limit to Upper Limit.

Examples:-


Lower Limit
A lower-limit character (L) sets the lower limit of all subsequent random numbers. The default lower-limit value is 0.

Examples:-


Upper Limit
An upper-limit character (U) sets the upper limit of all subsequent random numbers. The default upper-limit value is 255.

Examples:-


Gap
A gap character (G) generates a 1ns quiet time where no signal transitions take place.

Examples:-


Set-up
A set-up character (S) sets the set-up time (bit-gap time) in ns multiples of all subsequent Data & Strobe signal transitions. The default set-up value is 100 (10MBit/s).

Examples:-


Halt
A Halt character (H) is used to output a 100ns reset pulse on the active high reset output.

Examples:-


Some Real World Examples
This control sequence will generate 25 NULL's followed by 7 FCT's. This control sequence will generate 50 NULL's where the middle one has a double parity error. This control sequence will generate 20 packets that have a header of 10, vary in length from 5 to 10 bytes, contain random bytes in the range 128-255 and are terminated with either an eop or eep. This control sequence will generate 25 packets that have a random header in the range 1 to 15 and a body of 10 random bytes in the range 0-255.