| 3 |
3 |
module vita_rx_tb;
|
| 4 |
4 |
|
| 5 |
5 |
localparam DECIM = 8'd4;
|
| 6 |
|
localparam MAXCHAN=4;
|
| 7 |
|
localparam NUMCHAN=4;
|
|
6 |
localparam MAXCHAN=1;
|
|
7 |
localparam NUMCHAN=1;
|
| 8 |
8 |
|
| 9 |
9 |
reg clk = 0;
|
| 10 |
10 |
reg reset = 1;
|
| ... | ... | |
| 94 |
94 |
@(posedge clk);
|
| 95 |
95 |
write_setting(4,32'hDEADBEEF); // VITA header
|
| 96 |
96 |
write_setting(5,32'hF00D1234); // VITA streamid
|
| 97 |
|
write_setting(6,32'h98765432); // VITA trailer
|
|
97 |
write_setting(6,32'hF0000000); // VITA trailer
|
| 98 |
98 |
write_setting(7,8); // Samples per VITA packet
|
| 99 |
99 |
write_setting(8,NUMCHAN); // Samples per VITA packet
|
| 100 |
100 |
queue_rx_cmd(1,0,8,32'h0,32'h0); // send imm, single packet
|
| ... | ... | |
| 111 |
111 |
queue_rx_cmd(0,0,8,32'h0,32'h340); // send at, on time
|
| 112 |
112 |
queue_rx_cmd(0,0,8,32'h0,32'h100); // send at, but late
|
| 113 |
113 |
|
|
114 |
#100000;
|
|
115 |
$display("\nChained, break chain\n");
|
| 114 |
116 |
queue_rx_cmd(1,1,8,32'h0,32'h0); // chained, but break chain
|
| 115 |
117 |
#100000;
|
|
118 |
$display("\nSingle packet\n");
|
|
119 |
queue_rx_cmd(1,0,8,32'h0,32'h0); // send imm, single packet
|
|
120 |
#100000;
|
| 116 |
121 |
$display("\nEnd chain with zero samples, shouldn't error\n");
|
| 117 |
122 |
queue_rx_cmd(1,1,8,32'h0,32'h0); // chained
|
| 118 |
123 |
queue_rx_cmd(0,0,0,32'h0,32'h0); // end chain with zero samples, should keep us out of error
|