Bar
SpaceWire UK
Specialist providers of VHDL Intellectual Property & Design Services
BarBarBarBar
SpaceWire Switch Core Testbench - PTake
The PTake VHDL testbench module is used to consume 9-bit SpaceWire data and is for use with the SpaceWire Switch Core (Router). The data consumption is controlled by an external file and uses the same handshake mechanism as the Autonomous Cascadable Dual Port FIFO.


PTake control files can be used to create exotic test patterns from the combination of the very simple elements described below.



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

Example: # Hello I'm a comment!



Take
A take character (T) is used to consume a single data, eop or eep token. If a token is not currently available then the take character will wait for one to appear and then consume it.

Example 1: T, T, T will swallow 3 tokens.
Example 2: 100*T will swallow 100 tokens.



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

Example: 2*T, 0*T, 1*T will swallow 3 tokens.



Commas
Commas separate tokens and do not generate anything themselves.

Example: T,T, 44*T , 5*T will swallow 51 tokens.



Stars
A Star generates multiple copies of whatever follows it.

Example: 2*(2*(2*T)) will swallow 8 tokens.



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

Example: T, 2*(T, 2*(T, T)) will swallow 11 tokens.



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.

Example: R*T could well swallow 100 tokens.



Gap
A gap character (G) generates a one-cycle wait state where no data will be transferred.

Example 1: T, G, T will consume a token, wait one cycle, consume a token.
Example 2: T, 5*G, 2*T will consume a token, wait five cycles, consume two tokens.



Set-up
A set-up character (S) adds wait states on the front of all subsequent data transfers. The default set-up value is 0.

Example 1: S, T, T will wait one cycle, consume a token, wait one cycle, consume a token.
Example 2: T, 4*S, T will consume a token, wait four cycles, consume a token.



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

Example: 254*L, R*T could well consume 254 tokens.



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

Example: 2*U, R*T could well consume 0 tokens.



Some Real World Examples
This control sequence will swallow 100 tokens, wait for 1000 cycles and then swallow another 100 tokens. This control sequence will swallow 1000 tokens at half the maximum rate and then swallow another 1000 tokens at the maximum rate.