1 |
2 |
zguig52 |
-------------------------------
|
2 |
|
|
---- Project: EurySPACE CCSDS RX/TX with wishbone interface
|
3 |
|
|
---- Design Name: ccsds_rxtx_bench
|
4 |
|
|
---- Version: 1.0.0
|
5 |
|
|
---- Description:
|
6 |
|
|
---- Unit level + sub-components testing vhdl ressource
|
7 |
|
|
---- 1: generate clock signals
|
8 |
|
|
---- 2: generate resets signals
|
9 |
|
|
---- 3: generate wb read/write cycles signals
|
10 |
|
|
---- 4: generate rx/tx external data and samples signals
|
11 |
|
|
---- 5: generate test sequences for sub-components
|
12 |
|
|
---- 6: store signals results as ASCII files
|
13 |
|
|
-------------------------------
|
14 |
|
|
---- Author(s):
|
15 |
|
|
---- Guillaume Rembert
|
16 |
|
|
-------------------------------
|
17 |
|
|
---- Licence:
|
18 |
|
|
---- MIT
|
19 |
|
|
-------------------------------
|
20 |
|
|
---- Changes list:
|
21 |
|
|
---- 2015/11/18: initial release
|
22 |
|
|
---- 2015/12/28: adding random stimuli generation
|
23 |
|
|
---- 2016/10/19: adding sub-components (CRC + buffer) test ressources
|
24 |
|
|
---- 2016/10/25: adding framer sub-component test ressources + CRC checks
|
25 |
|
|
---- 2016/10/27: adding serdes sub-component test ressources
|
26 |
|
|
---- 2016/10/30: framer tests improvements
|
27 |
|
|
---- 2016/11/04: adding lfsr sub-component test ressources
|
28 |
|
|
---- 2016/11/05: adding mapper sub-component test ressources
|
29 |
|
|
---- 2016/11/08: adding srrc + filter sub-components test ressources
|
30 |
|
|
---- 2016/11/18: adding differential coder + symbols to samples mapper sub-components test ressources
|
31 |
|
|
---- 2016/11/20: adding files output for samples to allow external software analysis
|
32 |
|
|
---- 2017/15/01: adding convolutional coder
|
33 |
|
|
-------------------------------
|
34 |
|
|
--TODO: functions for sub-components interactions and checks (wb_read, wb_write, buffer_read, ...)
|
35 |
|
|
|
36 |
|
|
-- To convert hexa ASCII encoded output files (hex) to binary files (raw wav) : xxd -r -p samples.hex > samples.wav
|
37 |
|
|
-- To change endianness: xxd -r -p samples.hex | dd conv=swab of=samples.wav
|
38 |
|
|
|
39 |
|
|
-- libraries used
|
40 |
|
|
library ieee;
|
41 |
|
|
use ieee.std_logic_1164.all;
|
42 |
|
|
use std.textio.all;
|
43 |
|
|
library work;
|
44 |
|
|
use work.ccsds_rxtx_functions.all;
|
45 |
|
|
use work.ccsds_rxtx_parameters.all;
|
46 |
|
|
use work.ccsds_rxtx_types.all;
|
47 |
|
|
|
48 |
|
|
--=============================================================================
|
49 |
|
|
-- Entity declaration for ccsds_rxtx_bench - rx/tx unit test tool
|
50 |
|
|
--=============================================================================
|
51 |
|
|
entity ccsds_rxtx_bench is
|
52 |
|
|
generic (
|
53 |
|
|
-- system parameters
|
54 |
|
|
CCSDS_RXTX_BENCH_RXTX0_RX_PHYS_SIG_QUANT_DEPTH: integer := RX_PHYS_SIG_QUANT_DEPTH;
|
55 |
|
|
CCSDS_RXTX_BENCH_RXTX0_TX_PHYS_SIG_QUANT_DEPTH: integer := TX_PHYS_SIG_QUANT_DEPTH;
|
56 |
|
|
CCSDS_RXTX_BENCH_RXTX0_WB_ADDR_BUS_SIZE: integer := RXTX_SYSTEM_WB_ADDR_BUS_SIZE;
|
57 |
|
|
CCSDS_RXTX_BENCH_RXTX0_WB_DATA_BUS_SIZE: integer := RXTX_SYSTEM_WB_DATA_BUS_SIZE;
|
58 |
|
|
CCSDS_RXTX_BENCH_RXTX0_WB_WRITE_CYCLES_MAX: integer := 8;
|
59 |
|
|
-- sub-systems parameters
|
60 |
|
|
-- BUFFER
|
61 |
|
|
CCSDS_RXTX_BENCH_BUFFER0_DATA_BUS_SIZE : integer := 32;
|
62 |
|
|
CCSDS_RXTX_BENCH_BUFFER0_SIZE : integer := 16;
|
63 |
|
|
-- CODER DIFFERENTIAL
|
64 |
|
|
CCSDS_RXTX_BENCH_CODER_DIFF0_BITS_PER_CODEWORD: integer := 4;
|
65 |
|
|
CCSDS_RXTX_BENCH_CODER_DIFF0_DATA_BUS_SIZE: integer := 32;
|
66 |
|
|
-- CODER CONVOLUTIONAL
|
67 |
|
|
--TODO: 2 TESTS / ONE STATIC WITH PREDIFINED INPUT/ OUTPUT + ONE DYNAMIC WITH RANDOM DATA
|
68 |
|
|
CCSDS_RXTX_BENCH_CODER_CONV0_CONNEXION_VECTORS: std_logic_vector_array := ("1111001", "1011011");
|
69 |
|
|
CCSDS_RXTX_BENCH_CODER_CONV0_CONSTRAINT_SIZE: integer := 7;
|
70 |
|
|
CCSDS_RXTX_BENCH_CODER_CONV0_DATA_BUS_SIZE: integer := 8; --255
|
71 |
|
|
CCSDS_RXTX_BENCH_CODER_CONV0_OPERATING_MODE: integer := 1;
|
72 |
|
|
CCSDS_RXTX_BENCH_CODER_CONV0_OUTPUT_INVERSION: boolean_array := (false, true);
|
73 |
|
|
CCSDS_RXTX_BENCH_CODER_CONV0_RATE_OUTPUT: integer := 2;
|
74 |
|
|
CCSDS_RXTX_BENCH_CODER_CONV0_SEED: std_logic_vector := "000000";
|
75 |
|
|
CCSDS_RXTX_BENCH_CODER_CONV0_INPUT: std_logic_vector := "10000000";
|
76 |
|
|
CCSDS_RXTX_BENCH_CODER_CONV0_OUTPUT: std_logic_vector := "1011101001001001";
|
77 |
|
|
-- CRC
|
78 |
|
|
CCSDS_RXTX_BENCH_CRC0_DATA: std_logic_vector := x"313233343536373839";
|
79 |
|
|
CCSDS_RXTX_BENCH_CRC0_INPUT_BYTES_REFLECTED: boolean := false;
|
80 |
|
|
CCSDS_RXTX_BENCH_CRC0_INPUT_REFLECTED: boolean := false;
|
81 |
|
|
CCSDS_RXTX_BENCH_CRC0_LENGTH: integer := 2;
|
82 |
|
|
CCSDS_RXTX_BENCH_CRC0_OUTPUT_REFLECTED: boolean := false;
|
83 |
|
|
CCSDS_RXTX_BENCH_CRC0_POLYNOMIAL: std_logic_vector := x"1021";
|
84 |
|
|
CCSDS_RXTX_BENCH_CRC0_POLYNOMIAL_REFLECTED: boolean := false;
|
85 |
|
|
CCSDS_RXTX_BENCH_CRC0_RESULT: std_logic_vector := x"e5cc";
|
86 |
|
|
CCSDS_RXTX_BENCH_CRC0_SEED: std_logic_vector := x"ffff";
|
87 |
|
|
CCSDS_RXTX_BENCH_CRC0_XOR: std_logic_vector := x"0000";
|
88 |
|
|
-- FILTER
|
89 |
|
|
CCSDS_RXTX_BENCH_FILTER0_MAPPER_DATA_BUS_SIZE: integer := 32;
|
90 |
|
|
CCSDS_RXTX_BENCH_FILTER0_OFFSET_IQ: boolean := true;
|
91 |
|
|
CCSDS_RXTX_BENCH_FILTER0_OVERSAMPLING_RATIO: integer := 4;
|
92 |
|
|
CCSDS_RXTX_BENCH_FILTER0_ROLL_OFF: real := 0.5;
|
93 |
|
|
CCSDS_RXTX_BENCH_FILTER0_SIG_QUANT_DEPTH: integer := 8;
|
94 |
|
|
CCSDS_RXTX_BENCH_FILTER0_TARGET_SNR: real := 40.0;
|
95 |
|
|
CCSDS_RXTX_BENCH_FILTER0_BITS_PER_SYMBOL: integer := 1;
|
96 |
|
|
CCSDS_RXTX_BENCH_FILTER0_MODULATION_TYPE: integer := 1;
|
97 |
|
|
-- FRAMER
|
98 |
|
|
CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE: integer := 32;
|
99 |
|
|
CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH: integer := 24;
|
100 |
|
|
CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH: integer := 2;
|
101 |
|
|
CCSDS_RXTX_BENCH_FRAMER0_HEADER_LENGTH: integer := 6;
|
102 |
|
|
CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO: integer := 8;
|
103 |
|
|
-- LFSR
|
104 |
|
|
CCSDS_RXTX_BENCH_LFSR0_RESULT: std_logic_vector := "1111111101001000000011101100000010011010";
|
105 |
|
|
CCSDS_RXTX_BENCH_LFSR0_MEMORY_SIZE: integer := 8;
|
106 |
|
|
CCSDS_RXTX_BENCH_LFSR0_MODE: std_logic := '0';
|
107 |
|
|
CCSDS_RXTX_BENCH_LFSR0_POLYNOMIAL: std_logic_vector := x"A9";
|
108 |
|
|
CCSDS_RXTX_BENCH_LFSR0_SEED: std_logic_vector := x"FF";
|
109 |
|
|
-- MAPPER BITS SYMBOLS
|
110 |
|
|
CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_BITS_PER_SYMBOL: integer := 2;
|
111 |
|
|
CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_BUS_SIZE: integer := 32;
|
112 |
|
|
CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_MODULATION_TYPE: integer := 1;
|
113 |
|
|
-- MAPPER SYMBOLS SAMPLES
|
114 |
|
|
CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_BITS_PER_SYMBOL: integer := 3;
|
115 |
|
|
CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_QUANTIZATION_DEPTH: integer := 8;
|
116 |
|
|
CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_TARGET_SNR: real := 40.0;
|
117 |
|
|
-- SERDES
|
118 |
|
|
CCSDS_RXTX_BENCH_SERDES0_DEPTH: integer := 32;
|
119 |
|
|
-- SRRC
|
120 |
|
|
CCSDS_RXTX_BENCH_SRRC0_APODIZATION_WINDOW_TYPE: integer := 1;
|
121 |
|
|
CCSDS_RXTX_BENCH_SRRC0_OVERSAMPLING_RATIO: integer := 8;
|
122 |
|
|
CCSDS_RXTX_BENCH_SRRC0_ROLL_OFF: real := 0.5;
|
123 |
|
|
CCSDS_RXTX_BENCH_SRRC0_SIG_QUANT_DEPTH: integer := 16;
|
124 |
|
|
-- simulation/test parameters
|
125 |
|
|
CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD: time := 10 ns;
|
126 |
|
|
CCSDS_RXTX_BENCH_CODER_CONV0_CLK_PERIOD: time := 10 ns;
|
127 |
|
|
CCSDS_RXTX_BENCH_CODER_CONV0_WORDS_NUMBER: integer := 1000;
|
128 |
|
|
CCSDS_RXTX_BENCH_CODER_DIFF0_CLK_PERIOD: time := 10 ns;
|
129 |
|
|
CCSDS_RXTX_BENCH_CODER_DIFF0_WORDS_NUMBER: integer := 1000;
|
130 |
|
|
CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD: time := 10 ns;
|
131 |
|
|
CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE: integer:= 8;
|
132 |
|
|
CCSDS_RXTX_BENCH_CRC0_RANDOM_CHECK_NUMBER: integer:= 25;
|
133 |
|
|
CCSDS_RXTX_BENCH_FILTER0_CLK_PERIOD: time := 10 ns;
|
134 |
|
|
CCSDS_RXTX_BENCH_FILTER0_SYMBOL_WORDS_NUMBER: integer := 1000;
|
135 |
|
|
CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD: time := 10 ns;
|
136 |
|
|
CCSDS_RXTX_BENCH_FRAMER0_FRAME_NUMBER: integer := 25;
|
137 |
|
|
CCSDS_RXTX_BENCH_LFSR0_CLK_PERIOD: time := 10 ns;
|
138 |
|
|
CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_CLK_PERIOD: time := 10 ns;
|
139 |
|
|
CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_WORDS_NUMBER: integer := 1000;
|
140 |
|
|
CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_CLK_PERIOD: time := 10 ns;
|
141 |
|
|
CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_WORDS_NUMBER: integer := 1000;
|
142 |
|
|
CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD: time := 20 ns;
|
143 |
|
|
CCSDS_RXTX_BENCH_RXTX0_WB_TX_WRITE_CYCLE_NUMBER: integer := 5000;
|
144 |
|
|
CCSDS_RXTX_BENCH_RXTX0_WB_TX_OVERFLOW: boolean := true;
|
145 |
|
|
CCSDS_RXTX_BENCH_SEED: integer := 123456789;
|
146 |
|
|
CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD: time := 10 ns;
|
147 |
|
|
CCSDS_RXTX_BENCH_SERDES0_CYCLES_NUMBER: integer := 25;
|
148 |
|
|
CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD: time := 10 ns;
|
149 |
|
|
CCSDS_RXTX_BENCH_START_BUFFER_WAIT_DURATION: time := 2000 ns;
|
150 |
|
|
CCSDS_RXTX_BENCH_START_CODER_CONV_WAIT_DURATION: time := 2000 ns;
|
151 |
|
|
CCSDS_RXTX_BENCH_START_CODER_DIFF_WAIT_DURATION: time := 2000 ns;
|
152 |
|
|
CCSDS_RXTX_BENCH_START_CRC_WAIT_DURATION: time := 2000 ns;
|
153 |
|
|
CCSDS_RXTX_BENCH_START_FILTER_WAIT_DURATION: time := 2000 ns;
|
154 |
|
|
CCSDS_RXTX_BENCH_START_FRAMER_WAIT_DURATION: time := 2000 ns;
|
155 |
|
|
CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION: time := 2000 ns;
|
156 |
|
|
CCSDS_RXTX_BENCH_START_LFSR_WAIT_DURATION: time := 2000 ns;
|
157 |
|
|
CCSDS_RXTX_BENCH_START_MAPPER_BITS_SYMBOLS_WAIT_DURATION: time := 2000 ns;
|
158 |
|
|
CCSDS_RXTX_BENCH_START_MAPPER_SYMBOLS_SAMPLES_WAIT_DURATION: time := 2000 ns;
|
159 |
|
|
CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION: time := 400 ns;
|
160 |
|
|
CCSDS_RXTX_BENCH_START_SERDES_WAIT_DURATION: time := 2000 ns;
|
161 |
|
|
CCSDS_RXTX_BENCH_START_SRRC_WAIT_DURATION: time := 2000 ns;
|
162 |
|
|
CCSDS_RXTX_BENCH_START_WB_WAIT_DURATION: time := 1600 ns;
|
163 |
|
|
CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_ENABLE: boolean := true;
|
164 |
|
|
CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_FILES_NAME: string := "samples"
|
165 |
|
|
);
|
166 |
|
|
end ccsds_rxtx_bench;
|
167 |
|
|
|
168 |
|
|
--=============================================================================
|
169 |
|
|
-- architecture declaration / internal processing
|
170 |
|
|
--=============================================================================
|
171 |
|
|
architecture behaviour of ccsds_rxtx_bench is
|
172 |
|
|
component ccsds_rxtx_top is
|
173 |
|
|
port(
|
174 |
|
|
wb_ack_o: out std_logic;
|
175 |
|
|
wb_adr_i: in std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_WB_ADDR_BUS_SIZE-1 downto 0);
|
176 |
|
|
wb_clk_i: in std_logic;
|
177 |
|
|
wb_cyc_i: in std_logic;
|
178 |
|
|
wb_dat_i: in std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_WB_DATA_BUS_SIZE-1 downto 0);
|
179 |
|
|
wb_dat_o: out std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_WB_DATA_BUS_SIZE-1 downto 0);
|
180 |
|
|
wb_err_o: out std_logic;
|
181 |
|
|
wb_rst_i: in std_logic;
|
182 |
|
|
wb_rty_o: out std_logic;
|
183 |
|
|
wb_stb_i: in std_logic;
|
184 |
|
|
wb_we_i: in std_logic;
|
185 |
|
|
rx_clk_i: in std_logic;
|
186 |
|
|
rx_sam_i_i: in std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_RX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
|
187 |
|
|
rx_sam_q_i: in std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_RX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
|
188 |
|
|
rx_ena_o: out std_logic;
|
189 |
|
|
rx_irq_o: out std_logic;
|
190 |
|
|
tx_clk_i: in std_logic;
|
191 |
|
|
tx_dat_ser_i: in std_logic;
|
192 |
|
|
tx_buf_ful_o: out std_logic;
|
193 |
|
|
tx_idl_o: out std_logic;
|
194 |
|
|
tx_sam_i_o: out std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_TX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
|
195 |
|
|
tx_sam_q_o: out std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_TX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
|
196 |
|
|
tx_clk_o: out std_logic;
|
197 |
|
|
tx_ena_o: out std_logic
|
198 |
|
|
);
|
199 |
|
|
end component;
|
200 |
|
|
component ccsds_rxtx_buffer is
|
201 |
|
|
generic(
|
202 |
|
|
CCSDS_RXTX_BUFFER_DATA_BUS_SIZE : integer;
|
203 |
|
|
CCSDS_RXTX_BUFFER_SIZE : integer
|
204 |
|
|
);
|
205 |
|
|
port(
|
206 |
|
|
clk_i: in std_logic;
|
207 |
|
|
dat_i: in std_logic_vector(CCSDS_RXTX_BUFFER_DATA_BUS_SIZE-1 downto 0);
|
208 |
|
|
dat_val_i: in std_logic;
|
209 |
|
|
dat_nxt_i: in std_logic;
|
210 |
|
|
rst_i: in std_logic;
|
211 |
|
|
buf_emp_o: out std_logic;
|
212 |
|
|
buf_ful_o: out std_logic;
|
213 |
|
|
dat_o: out std_logic_vector(CCSDS_RXTX_BUFFER_DATA_BUS_SIZE-1 downto 0);
|
214 |
|
|
dat_val_o: out std_logic
|
215 |
|
|
);
|
216 |
|
|
end component;
|
217 |
|
|
component ccsds_tx_coder_convolutional is
|
218 |
|
|
generic(
|
219 |
|
|
CCSDS_TX_CODER_CONV_CONNEXION_VECTORS: std_logic_vector_array;
|
220 |
|
|
CCSDS_TX_CODER_CONV_CONSTRAINT_SIZE: integer;
|
221 |
|
|
CCSDS_TX_CODER_CONV_DATA_BUS_SIZE: integer;
|
222 |
|
|
CCSDS_TX_CODER_CONV_OPERATING_MODE: integer;
|
223 |
|
|
CCSDS_TX_CODER_CONV_OUTPUT_INVERSION: boolean_array;
|
224 |
|
|
CCSDS_TX_CODER_CONV_RATE_OUTPUT: integer;
|
225 |
|
|
CCSDS_TX_CODER_CONV_SEED: std_logic_vector
|
226 |
|
|
);
|
227 |
|
|
port(
|
228 |
|
|
clk_i: in std_logic;
|
229 |
|
|
dat_i: in std_logic_vector(CCSDS_TX_CODER_CONV_DATA_BUS_SIZE-1 downto 0);
|
230 |
|
|
dat_val_i: in std_logic;
|
231 |
|
|
rst_i: in std_logic;
|
232 |
|
|
bus_o: out std_logic;
|
233 |
|
|
dat_o: out std_logic_vector(CCSDS_TX_CODER_CONV_DATA_BUS_SIZE*CCSDS_TX_CODER_CONV_RATE_OUTPUT-1 downto 0);
|
234 |
|
|
dat_val_o: out std_logic
|
235 |
|
|
);
|
236 |
|
|
end component;
|
237 |
|
|
component ccsds_tx_coder_differential is
|
238 |
|
|
generic(
|
239 |
|
|
CCSDS_TX_CODER_DIFF_BITS_PER_CODEWORD: integer;
|
240 |
|
|
CCSDS_TX_CODER_DIFF_DATA_BUS_SIZE: integer
|
241 |
|
|
);
|
242 |
|
|
port(
|
243 |
|
|
clk_i: in std_logic;
|
244 |
|
|
dat_i: in std_logic_vector(CCSDS_TX_CODER_DIFF_DATA_BUS_SIZE-1 downto 0);
|
245 |
|
|
dat_val_i: in std_logic;
|
246 |
|
|
rst_i: in std_logic;
|
247 |
|
|
dat_o: out std_logic_vector(CCSDS_TX_CODER_DIFF_DATA_BUS_SIZE-1 downto 0);
|
248 |
|
|
dat_val_o: out std_logic
|
249 |
|
|
);
|
250 |
|
|
end component;
|
251 |
|
|
component ccsds_rxtx_crc is
|
252 |
|
|
generic(
|
253 |
|
|
CCSDS_RXTX_CRC_DATA_LENGTH: integer;
|
254 |
|
|
CCSDS_RXTX_CRC_FINAL_XOR: std_logic_vector;
|
255 |
|
|
CCSDS_RXTX_CRC_INPUT_BYTES_REFLECTED: boolean;
|
256 |
|
|
CCSDS_RXTX_CRC_INPUT_REFLECTED: boolean;
|
257 |
|
|
CCSDS_RXTX_CRC_LENGTH: integer;
|
258 |
|
|
CCSDS_RXTX_CRC_OUTPUT_REFLECTED: boolean;
|
259 |
|
|
CCSDS_RXTX_CRC_POLYNOMIAL: std_logic_vector;
|
260 |
|
|
CCSDS_RXTX_CRC_POLYNOMIAL_REFLECTED: boolean;
|
261 |
|
|
CCSDS_RXTX_CRC_SEED: std_logic_vector
|
262 |
|
|
);
|
263 |
|
|
port(
|
264 |
|
|
clk_i: in std_logic;
|
265 |
|
|
dat_i: in std_logic_vector(CCSDS_RXTX_CRC_DATA_LENGTH*8-1 downto 0);
|
266 |
|
|
nxt_i: in std_logic;
|
267 |
|
|
pad_dat_i: in std_logic_vector(CCSDS_RXTX_CRC_LENGTH*8-1 downto 0);
|
268 |
|
|
pad_dat_val_i: in std_logic;
|
269 |
|
|
rst_i: in std_logic;
|
270 |
|
|
crc_o: out std_logic_vector(CCSDS_RXTX_CRC_LENGTH*8-1 downto 0);
|
271 |
|
|
dat_o: out std_logic_vector(CCSDS_RXTX_CRC_DATA_LENGTH*8-1 downto 0);
|
272 |
|
|
bus_o: out std_logic;
|
273 |
|
|
dat_val_o: out std_logic
|
274 |
|
|
);
|
275 |
|
|
end component;
|
276 |
|
|
component ccsds_tx_filter is
|
277 |
|
|
generic(
|
278 |
|
|
CCSDS_TX_FILTER_OFFSET_IQ: boolean;
|
279 |
|
|
CCSDS_TX_FILTER_OVERSAMPLING_RATIO: integer;
|
280 |
|
|
CCSDS_TX_FILTER_SIG_QUANT_DEPTH: integer;
|
281 |
|
|
CCSDS_TX_FILTER_MODULATION_TYPE: integer;
|
282 |
|
|
CCSDS_TX_FILTER_TARGET_SNR: real;
|
283 |
|
|
CCSDS_TX_FILTER_BITS_PER_SYMBOL: integer
|
284 |
|
|
);
|
285 |
|
|
port(
|
286 |
|
|
clk_i: in std_logic;
|
287 |
|
|
rst_i: in std_logic;
|
288 |
|
|
sym_i_i: in std_logic_vector(CCSDS_TX_FILTER_BITS_PER_SYMBOL-1 downto 0);
|
289 |
|
|
sym_q_i: in std_logic_vector(CCSDS_TX_FILTER_BITS_PER_SYMBOL-1 downto 0);
|
290 |
|
|
sym_val_i: in std_logic;
|
291 |
|
|
sam_i_o: out std_logic_vector(CCSDS_TX_FILTER_SIG_QUANT_DEPTH-1 downto 0);
|
292 |
|
|
sam_q_o: out std_logic_vector(CCSDS_TX_FILTER_SIG_QUANT_DEPTH-1 downto 0);
|
293 |
|
|
sam_val_o: out std_logic
|
294 |
|
|
);
|
295 |
|
|
end component;
|
296 |
|
|
component ccsds_tx_framer is
|
297 |
|
|
generic (
|
298 |
|
|
CCSDS_TX_FRAMER_HEADER_LENGTH: integer;
|
299 |
|
|
CCSDS_TX_FRAMER_FOOTER_LENGTH: integer;
|
300 |
|
|
CCSDS_TX_FRAMER_DATA_LENGTH: integer;
|
301 |
|
|
CCSDS_TX_FRAMER_DATA_BUS_SIZE: integer;
|
302 |
|
|
CCSDS_TX_FRAMER_PARALLELISM_MAX_RATIO: integer
|
303 |
|
|
);
|
304 |
|
|
port(
|
305 |
|
|
clk_i: in std_logic;
|
306 |
|
|
rst_i: in std_logic;
|
307 |
|
|
dat_i: in std_logic_vector(CCSDS_TX_FRAMER_DATA_BUS_SIZE-1 downto 0);
|
308 |
|
|
dat_val_i: in std_logic;
|
309 |
|
|
dat_o: out std_logic_vector((CCSDS_TX_FRAMER_HEADER_LENGTH+CCSDS_TX_FRAMER_FOOTER_LENGTH+CCSDS_TX_FRAMER_DATA_LENGTH)*8-1 downto 0);
|
310 |
|
|
dat_val_o: out std_logic;
|
311 |
|
|
dat_nxt_o: out std_logic;
|
312 |
|
|
idl_o: out std_logic
|
313 |
|
|
);
|
314 |
|
|
end component;
|
315 |
|
|
component ccsds_rxtx_lfsr is
|
316 |
|
|
generic(
|
317 |
|
|
CCSDS_RXTX_LFSR_DATA_BUS_SIZE: integer;
|
318 |
|
|
CCSDS_RXTX_LFSR_MEMORY_SIZE: integer;
|
319 |
|
|
CCSDS_RXTX_LFSR_MODE: std_logic;
|
320 |
|
|
CCSDS_RXTX_LFSR_POLYNOMIAL: std_logic_vector;
|
321 |
|
|
CCSDS_RXTX_LFSR_SEED: std_logic_vector
|
322 |
|
|
);
|
323 |
|
|
port(
|
324 |
|
|
clk_i: in std_logic;
|
325 |
|
|
rst_i: in std_logic;
|
326 |
|
|
dat_o: out std_logic_vector(CCSDS_RXTX_LFSR_DATA_BUS_SIZE-1 downto 0);
|
327 |
|
|
dat_val_o: out std_logic
|
328 |
|
|
);
|
329 |
|
|
end component;
|
330 |
|
|
component ccsds_tx_mapper_bits_symbols is
|
331 |
|
|
generic(
|
332 |
|
|
CCSDS_TX_MAPPER_DATA_BUS_SIZE: integer;
|
333 |
|
|
CCSDS_TX_MAPPER_MODULATION_TYPE: integer;
|
334 |
|
|
CCSDS_TX_MAPPER_BITS_PER_SYMBOL: integer
|
335 |
|
|
);
|
336 |
|
|
port(
|
337 |
|
|
clk_i: in std_logic;
|
338 |
|
|
dat_i: in std_logic_vector(CCSDS_TX_MAPPER_DATA_BUS_SIZE-1 downto 0);
|
339 |
|
|
dat_val_i: in std_logic;
|
340 |
|
|
rst_i: in std_logic;
|
341 |
|
|
sym_i_o: out std_logic_vector(CCSDS_TX_MAPPER_BITS_PER_SYMBOL-1 downto 0);
|
342 |
|
|
sym_q_o: out std_logic_vector(CCSDS_TX_MAPPER_BITS_PER_SYMBOL-1 downto 0);
|
343 |
|
|
sym_val_o: out std_logic
|
344 |
|
|
);
|
345 |
|
|
end component;
|
346 |
|
|
component ccsds_tx_mapper_symbols_samples is
|
347 |
|
|
generic(
|
348 |
|
|
CCSDS_TX_MAPPER_TARGET_SNR: real;
|
349 |
|
|
CCSDS_TX_MAPPER_BITS_PER_SYMBOL: integer;
|
350 |
|
|
CCSDS_TX_MAPPER_QUANTIZATION_DEPTH: integer
|
351 |
|
|
);
|
352 |
|
|
port(
|
353 |
|
|
clk_i: in std_logic;
|
354 |
|
|
rst_i: in std_logic;
|
355 |
|
|
sym_i: in std_logic_vector(CCSDS_TX_MAPPER_BITS_PER_SYMBOL-1 downto 0);
|
356 |
|
|
sym_val_i: in std_logic;
|
357 |
|
|
sam_val_o: out std_logic;
|
358 |
|
|
sam_o: out std_logic_vector(CCSDS_TX_MAPPER_QUANTIZATION_DEPTH-1 downto 0)
|
359 |
|
|
);
|
360 |
|
|
end component;
|
361 |
|
|
component ccsds_rxtx_serdes is
|
362 |
|
|
generic (
|
363 |
|
|
CCSDS_RXTX_SERDES_DEPTH : integer
|
364 |
|
|
);
|
365 |
|
|
port(
|
366 |
|
|
clk_i: in std_logic;
|
367 |
|
|
dat_par_i: in std_logic_vector(CCSDS_RXTX_SERDES_DEPTH-1 downto 0);
|
368 |
|
|
dat_par_val_i: in std_logic;
|
369 |
|
|
dat_ser_i: in std_logic;
|
370 |
|
|
dat_ser_val_i: in std_logic;
|
371 |
|
|
rst_i: in std_logic;
|
372 |
|
|
bus_o: out std_logic;
|
373 |
|
|
dat_par_o: out std_logic_vector(CCSDS_RXTX_SERDES_DEPTH-1 downto 0);
|
374 |
|
|
dat_par_val_o: out std_logic;
|
375 |
|
|
dat_ser_o: out std_logic;
|
376 |
|
|
dat_ser_val_o: out std_logic
|
377 |
|
|
);
|
378 |
|
|
end component;
|
379 |
|
|
component ccsds_rxtx_srrc is
|
380 |
|
|
generic(
|
381 |
|
|
CCSDS_RXTX_SRRC_APODIZATION_WINDOW_TYPE: integer;
|
382 |
|
|
CCSDS_RXTX_SRRC_OVERSAMPLING_RATIO: integer;
|
383 |
|
|
CCSDS_RXTX_SRRC_ROLL_OFF: real;
|
384 |
|
|
CCSDS_RXTX_SRRC_SIG_QUANT_DEPTH: integer
|
385 |
|
|
);
|
386 |
|
|
port(
|
387 |
|
|
clk_i: in std_logic;
|
388 |
|
|
rst_i: in std_logic;
|
389 |
|
|
sam_i: in std_logic_vector(CCSDS_RXTX_SRRC_SIG_QUANT_DEPTH-1 downto 0);
|
390 |
|
|
sam_val_i: in std_logic;
|
391 |
|
|
sam_o: out std_logic_vector(CCSDS_RXTX_SRRC_SIG_QUANT_DEPTH-1 downto 0);
|
392 |
|
|
sam_val_o: out std_logic
|
393 |
|
|
);
|
394 |
|
|
end component;
|
395 |
|
|
|
396 |
|
|
-- internal constants
|
397 |
|
|
constant CCSDS_RXTX_BENCH_FILTER0_MAPPER_CLK_PERIOD: time := CCSDS_RXTX_BENCH_FILTER0_CLK_PERIOD*CCSDS_RXTX_BENCH_FILTER0_OVERSAMPLING_RATIO;
|
398 |
|
|
constant CCSDS_RXTX_BENCH_FILTER0_MAPPER_DATA_CLK_PERIOD: time := CCSDS_RXTX_BENCH_FILTER0_MAPPER_CLK_PERIOD * CCSDS_RXTX_BENCH_FILTER0_MAPPER_DATA_BUS_SIZE * CCSDS_RXTX_BENCH_FILTER0_MODULATION_TYPE / (CCSDS_RXTX_BENCH_FILTER0_BITS_PER_SYMBOL * 2);
|
399 |
|
|
constant CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_CLK_PERIOD: time := CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_CLK_PERIOD * CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_BUS_SIZE * CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_MODULATION_TYPE / (CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_BITS_PER_SYMBOL * 2);
|
400 |
|
|
constant CCSDS_RXTX_BENCH_RXTX0_TX_CLK_PERIOD: time := CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD/8;
|
401 |
|
|
constant CCSDS_RXTX_BENCH_RXTX0_RX_CLK_PERIOD: time := CCSDS_RXTX_BENCH_RXTX0_TX_CLK_PERIOD;
|
402 |
|
|
-- internal variables
|
403 |
|
|
signal bench_ena_buffer0_random_data: std_logic := '0';
|
404 |
|
|
signal bench_ena_coder_conv0_random_data: std_logic := '0';
|
405 |
|
|
signal bench_ena_coder_diff0_random_data: std_logic := '0';
|
406 |
|
|
signal bench_ena_crc0_random_data: std_logic := '0';
|
407 |
|
|
signal bench_ena_filter0_random_data: std_logic := '0';
|
408 |
|
|
signal bench_ena_framer0_random_data: std_logic := '0';
|
409 |
|
|
signal bench_ena_mapper_bits_symbols0_random_data: std_logic := '0';
|
410 |
|
|
signal bench_ena_mapper_symbols_samples0_random_data: std_logic := '0';
|
411 |
|
|
signal bench_ena_rxtx0_random_data: std_logic := '0';
|
412 |
|
|
signal bench_ena_serdes0_random_data: std_logic := '0';
|
413 |
|
|
|
414 |
|
|
file CCSDS_RXTX_BENCH_FILTER0_OUTPUT_CSV_IQ_FILE: text open write_mode is out CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_FILES_NAME & "_filter0_iq.csv";
|
415 |
|
|
file CCSDS_RXTX_BENCH_FILTER0_OUTPUT_HEX_IQ_FILE: text open write_mode is out CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_FILES_NAME & "_filter0_iq.hex";
|
416 |
|
|
file CCSDS_RXTX_BENCH_FILTER0_OUTPUT_HEX_I_FILE: text open write_mode is out CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_FILES_NAME & "_filter0_i.hex";
|
417 |
|
|
file CCSDS_RXTX_BENCH_FILTER0_OUTPUT_HEX_Q_FILE: text open write_mode is out CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_FILES_NAME & "_filter0_q.hex";
|
418 |
|
|
file CCSDS_RXTX_BENCH_SRRC0_OUTPUT_HEX_FILE: text open write_mode is out CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_FILES_NAME & "_srrc0.hex";
|
419 |
|
|
|
420 |
|
|
-- synthetic generated stimuli
|
421 |
|
|
--NB: un-initialized on purposes - to allow observation of components default behaviour
|
422 |
|
|
-- wishbone bus
|
423 |
|
|
signal bench_sti_rxtx0_wb_clk: std_logic;
|
424 |
|
|
signal bench_sti_rxtx0_wb_rst: std_logic;
|
425 |
|
|
signal bench_sti_rxtx0_wb_adr: std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_WB_ADDR_BUS_SIZE-1 downto 0);
|
426 |
|
|
signal bench_sti_rxtx0_wb_cyc: std_logic;
|
427 |
|
|
signal bench_sti_rxtx0_wb_dat: std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_WB_DATA_BUS_SIZE-1 downto 0);
|
428 |
|
|
signal bench_sti_rxtx0_wb_random_dat: std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_WB_DATA_BUS_SIZE-1 downto 0);
|
429 |
|
|
signal bench_sti_rxtx0_wb_stb: std_logic;
|
430 |
|
|
signal bench_sti_rxtx0_wb_we: std_logic;
|
431 |
|
|
-- rx
|
432 |
|
|
signal bench_sti_rxtx0_rx_clk: std_logic;
|
433 |
|
|
signal bench_sti_rxtx0_rx_data_next: std_logic;
|
434 |
|
|
signal bench_sti_rxtx0_rx_samples_i: std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_RX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
|
435 |
|
|
signal bench_sti_rxtx0_rx_samples_q: std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_RX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
|
436 |
|
|
-- tx
|
437 |
|
|
signal bench_sti_rxtx0_tx_clk: std_logic;
|
438 |
|
|
signal bench_sti_rxtx0_tx_data_ser: std_logic;
|
439 |
|
|
-- buffer
|
440 |
|
|
signal bench_sti_buffer0_clk: std_logic;
|
441 |
|
|
signal bench_sti_buffer0_rst: std_logic;
|
442 |
|
|
signal bench_sti_buffer0_next_data: std_logic;
|
443 |
|
|
signal bench_sti_buffer0_data: std_logic_vector(CCSDS_RXTX_BENCH_BUFFER0_DATA_BUS_SIZE-1 downto 0);
|
444 |
|
|
signal bench_sti_buffer0_data_valid: std_logic;
|
445 |
|
|
-- coder convolutional
|
446 |
|
|
signal bench_sti_coder_conv0_clk: std_logic;
|
447 |
|
|
signal bench_sti_coder_conv0_rst: std_logic;
|
448 |
|
|
signal bench_sti_coder_conv0_dat: std_logic_vector(CCSDS_RXTX_BENCH_CODER_CONV0_DATA_BUS_SIZE-1 downto 0);
|
449 |
|
|
signal bench_sti_coder_conv0_dat_val: std_logic;
|
450 |
|
|
-- coder differential
|
451 |
|
|
signal bench_sti_coder_diff0_clk: std_logic;
|
452 |
|
|
signal bench_sti_coder_diff0_rst: std_logic;
|
453 |
|
|
signal bench_sti_coder_diff0_dat: std_logic_vector(CCSDS_RXTX_BENCH_CODER_DIFF0_DATA_BUS_SIZE-1 downto 0);
|
454 |
|
|
signal bench_sti_coder_diff0_dat_val: std_logic;
|
455 |
|
|
-- crc
|
456 |
|
|
signal bench_sti_crc0_clk: std_logic;
|
457 |
|
|
signal bench_sti_crc0_rst: std_logic;
|
458 |
|
|
signal bench_sti_crc0_nxt: std_logic;
|
459 |
|
|
signal bench_sti_crc0_data: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_DATA'length-1 downto 0);
|
460 |
|
|
signal bench_sti_crc0_padding_data_valid: std_logic;
|
461 |
|
|
signal bench_sti_crc0_check_nxt: std_logic;
|
462 |
|
|
signal bench_sti_crc0_check_data: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE*8-1 downto 0);
|
463 |
|
|
signal bench_sti_crc0_check_padding_data: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_LENGTH*8-1 downto 0);
|
464 |
|
|
signal bench_sti_crc0_check_padding_data_valid: std_logic;
|
465 |
|
|
signal bench_sti_crc0_random_nxt: std_logic;
|
466 |
|
|
signal bench_sti_crc0_random_data: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE*8-1 downto 0);
|
467 |
|
|
signal bench_sti_crc0_random_padding_data_valid: std_logic;
|
468 |
|
|
-- filter
|
469 |
|
|
signal bench_sti_filter0_clk: std_logic;
|
470 |
|
|
signal bench_sti_filter0_rst: std_logic;
|
471 |
|
|
signal bench_sti_filter0_sym_i: std_logic_vector(CCSDS_RXTX_BENCH_FILTER0_BITS_PER_SYMBOL-1 downto 0);
|
472 |
|
|
signal bench_sti_filter0_sym_q: std_logic_vector(CCSDS_RXTX_BENCH_FILTER0_BITS_PER_SYMBOL-1 downto 0);
|
473 |
|
|
signal bench_sti_filter0_sym_val: std_logic;
|
474 |
|
|
signal bench_sti_filter0_mapper_data: std_logic_vector(CCSDS_RXTX_BENCH_FILTER0_MAPPER_DATA_BUS_SIZE-1 downto 0);
|
475 |
|
|
signal bench_sti_filter0_mapper_clk: std_logic;
|
476 |
|
|
signal bench_sti_filter0_mapper_dat_val: std_logic;
|
477 |
|
|
-- framer
|
478 |
|
|
signal bench_sti_framer0_clk: std_logic;
|
479 |
|
|
signal bench_sti_framer0_rst: std_logic;
|
480 |
|
|
signal bench_sti_framer0_data_valid: std_logic;
|
481 |
|
|
signal bench_sti_framer0_data: std_logic_vector(CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE-1 downto 0);
|
482 |
|
|
-- lfsr
|
483 |
|
|
signal bench_sti_lfsr0_clk: std_logic;
|
484 |
|
|
signal bench_sti_lfsr0_rst: std_logic;
|
485 |
|
|
-- mapper bits symbols
|
486 |
|
|
signal bench_sti_mapper_bits_symbols0_clk: std_logic;
|
487 |
|
|
signal bench_sti_mapper_bits_symbols0_rst: std_logic;
|
488 |
|
|
signal bench_sti_mapper_bits_symbols0_data: std_logic_vector(CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_BUS_SIZE-1 downto 0);
|
489 |
|
|
signal bench_sti_mapper_bits_symbols0_dat_val: std_logic;
|
490 |
|
|
-- mapper symbols samples
|
491 |
|
|
signal bench_sti_mapper_symbols_samples0_clk: std_logic;
|
492 |
|
|
signal bench_sti_mapper_symbols_samples0_rst: std_logic;
|
493 |
|
|
signal bench_sti_mapper_symbols_samples0_sym: std_logic_vector(CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_BITS_PER_SYMBOL-1 downto 0);
|
494 |
|
|
signal bench_sti_mapper_symbols_samples0_sym_val: std_logic;
|
495 |
|
|
-- serdes
|
496 |
|
|
signal bench_sti_serdes0_clk: std_logic;
|
497 |
|
|
signal bench_sti_serdes0_rst: std_logic;
|
498 |
|
|
signal bench_sti_serdes0_data_par_valid: std_logic;
|
499 |
|
|
signal bench_sti_serdes0_data_par: std_logic_vector(CCSDS_RXTX_BENCH_SERDES0_DEPTH-1 downto 0);
|
500 |
|
|
signal bench_sti_serdes0_data_ser_valid: std_logic;
|
501 |
|
|
signal bench_sti_serdes0_data_ser: std_logic;
|
502 |
|
|
-- srrc
|
503 |
|
|
signal bench_sti_srrc0_clk: std_logic;
|
504 |
|
|
signal bench_sti_srrc0_rst: std_logic;
|
505 |
|
|
signal bench_sti_srrc0_sam: std_logic_vector(CCSDS_RXTX_BENCH_SRRC0_SIG_QUANT_DEPTH-1 downto 0);
|
506 |
|
|
signal bench_sti_srrc0_sam_val: std_logic;
|
507 |
|
|
-- core generated response
|
508 |
|
|
-- wishbone bus
|
509 |
|
|
signal bench_res_rxtx0_wb_ack: std_logic;
|
510 |
|
|
signal bench_res_rxtx0_wb_dat: std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_WB_DATA_BUS_SIZE-1 downto 0);
|
511 |
|
|
signal bench_res_rxtx0_wb_err: std_logic;
|
512 |
|
|
signal bench_res_rxtx0_wb_rty: std_logic;
|
513 |
|
|
-- rx
|
514 |
|
|
signal bench_res_rxtx0_rx_ena: std_logic;
|
515 |
|
|
signal bench_res_rxtx0_rx_irq: std_logic;
|
516 |
|
|
-- tx
|
517 |
|
|
signal bench_res_rxtx0_tx_clk: std_logic;
|
518 |
|
|
signal bench_res_rxtx0_tx_buf_ful: std_logic;
|
519 |
|
|
signal bench_res_rxtx0_tx_idl: std_logic;
|
520 |
|
|
signal bench_res_rxtx0_tx_samples_i: std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_TX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
|
521 |
|
|
signal bench_res_rxtx0_tx_samples_q: std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_TX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
|
522 |
|
|
signal bench_res_rxtx0_tx_ena: std_logic;
|
523 |
|
|
-- buffer
|
524 |
|
|
signal bench_res_buffer0_buffer_empty: std_logic;
|
525 |
|
|
signal bench_res_buffer0_buffer_full: std_logic;
|
526 |
|
|
signal bench_res_buffer0_data: std_logic_vector(CCSDS_RXTX_BENCH_BUFFER0_DATA_BUS_SIZE-1 downto 0);
|
527 |
|
|
signal bench_res_buffer0_data_valid: std_logic;
|
528 |
|
|
-- coder convolutional
|
529 |
|
|
signal bench_res_coder_conv0_dat: std_logic_vector(CCSDS_RXTX_BENCH_CODER_CONV0_DATA_BUS_SIZE*CCSDS_RXTX_BENCH_CODER_CONV0_RATE_OUTPUT-1 downto 0);
|
530 |
|
|
signal bench_res_coder_conv0_dat_val: std_logic;
|
531 |
|
|
signal bench_res_coder_conv0_bus: std_logic;
|
532 |
|
|
-- coder differential
|
533 |
|
|
signal bench_res_coder_diff0_dat: std_logic_vector(CCSDS_RXTX_BENCH_CODER_DIFF0_DATA_BUS_SIZE-1 downto 0);
|
534 |
|
|
signal bench_res_coder_diff0_dat_val: std_logic;
|
535 |
|
|
-- crc
|
536 |
|
|
signal bench_res_crc0_busy: std_logic;
|
537 |
|
|
signal bench_res_crc0_crc: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_LENGTH*8-1 downto 0);
|
538 |
|
|
signal bench_res_crc0_data: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_DATA'length-1 downto 0);
|
539 |
|
|
signal bench_res_crc0_data_valid: std_logic;
|
540 |
|
|
signal bench_res_crc0_check_busy: std_logic;
|
541 |
|
|
signal bench_res_crc0_check_crc: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_LENGTH*8-1 downto 0);
|
542 |
|
|
signal bench_res_crc0_check_data: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE*8-1 downto 0);
|
543 |
|
|
signal bench_res_crc0_check_data_valid: std_logic;
|
544 |
|
|
signal bench_res_crc0_random_busy: std_logic;
|
545 |
|
|
signal bench_res_crc0_random_crc: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_LENGTH*8-1 downto 0);
|
546 |
|
|
signal bench_res_crc0_random_data: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE*8-1 downto 0);
|
547 |
|
|
signal bench_res_crc0_random_data_valid: std_logic;
|
548 |
|
|
-- filter
|
549 |
|
|
signal bench_res_filter0_sam_i: std_logic_vector(CCSDS_RXTX_BENCH_FILTER0_SIG_QUANT_DEPTH-1 downto 0);
|
550 |
|
|
signal bench_res_filter0_sam_q: std_logic_vector(CCSDS_RXTX_BENCH_FILTER0_SIG_QUANT_DEPTH-1 downto 0);
|
551 |
|
|
signal bench_res_filter0_sam_val: std_logic;
|
552 |
|
|
signal bench_res_filter0_srrc_sam_i: std_logic_vector(CCSDS_RXTX_BENCH_FILTER0_SIG_QUANT_DEPTH-1 downto 0);
|
553 |
|
|
signal bench_res_filter0_srrc_sam_q: std_logic_vector(CCSDS_RXTX_BENCH_FILTER0_SIG_QUANT_DEPTH-1 downto 0);
|
554 |
|
|
signal bench_res_filter0_srrc_sam_i_val: std_logic;
|
555 |
|
|
signal bench_res_filter0_srrc_sam_q_val: std_logic;
|
556 |
|
|
-- framer
|
557 |
|
|
signal bench_res_framer0_data_valid: std_logic;
|
558 |
|
|
signal bench_res_framer0_dat_nxt: std_logic;
|
559 |
|
|
signal bench_res_framer0_idl: std_logic;
|
560 |
|
|
signal bench_res_framer0_data: std_logic_vector((CCSDS_RXTX_BENCH_FRAMER0_HEADER_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH)*8-1 downto 0);
|
561 |
|
|
-- lfsr
|
562 |
|
|
signal bench_res_lfsr0_data_valid: std_logic;
|
563 |
|
|
signal bench_res_lfsr0_data: std_logic_vector(CCSDS_RXTX_BENCH_LFSR0_RESULT'length-1 downto 0);
|
564 |
|
|
-- mapper bits symbols
|
565 |
|
|
signal bench_res_mapper_bits_symbols0_sym_i: std_logic_vector(CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_BITS_PER_SYMBOL-1 downto 0);
|
566 |
|
|
signal bench_res_mapper_bits_symbols0_sym_q: std_logic_vector(CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_BITS_PER_SYMBOL-1 downto 0);
|
567 |
|
|
signal bench_res_mapper_bits_symbols0_sym_val: std_logic;
|
568 |
|
|
-- mapper symbols samples
|
569 |
|
|
signal bench_res_mapper_symbols_samples0_sam: std_logic_vector(CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_QUANTIZATION_DEPTH-1 downto 0);
|
570 |
|
|
signal bench_res_mapper_symbols_samples0_sam_val: std_logic;
|
571 |
|
|
-- serdes
|
572 |
|
|
signal bench_res_serdes0_busy: std_logic;
|
573 |
|
|
signal bench_res_serdes0_data_par: std_logic_vector(CCSDS_RXTX_BENCH_SERDES0_DEPTH-1 downto 0);
|
574 |
|
|
signal bench_res_serdes0_data_par_valid: std_logic;
|
575 |
|
|
signal bench_res_serdes0_data_ser: std_logic;
|
576 |
|
|
signal bench_res_serdes0_data_ser_valid: std_logic;
|
577 |
|
|
-- srrc
|
578 |
|
|
signal bench_res_srrc0_sam: std_logic_vector(CCSDS_RXTX_BENCH_SRRC0_SIG_QUANT_DEPTH-1 downto 0);
|
579 |
|
|
signal bench_res_srrc0_sam_val: std_logic;
|
580 |
|
|
signal bench_res_srrc1_sam: std_logic_vector(CCSDS_RXTX_BENCH_SRRC0_SIG_QUANT_DEPTH-1 downto 0);
|
581 |
|
|
signal bench_res_srrc1_sam_val: std_logic;
|
582 |
|
|
|
583 |
|
|
--=============================================================================
|
584 |
|
|
-- architecture begin
|
585 |
|
|
--=============================================================================
|
586 |
|
|
begin
|
587 |
|
|
-- Instance(s) of unit under test
|
588 |
|
|
rxtx_000: ccsds_rxtx_top
|
589 |
|
|
port map(
|
590 |
|
|
wb_ack_o => bench_res_rxtx0_wb_ack,
|
591 |
|
|
wb_adr_i => bench_sti_rxtx0_wb_adr,
|
592 |
|
|
wb_clk_i => bench_sti_rxtx0_wb_clk,
|
593 |
|
|
wb_cyc_i => bench_sti_rxtx0_wb_cyc,
|
594 |
|
|
wb_dat_i => bench_sti_rxtx0_wb_dat,
|
595 |
|
|
wb_dat_o => bench_res_rxtx0_wb_dat,
|
596 |
|
|
wb_err_o => bench_res_rxtx0_wb_err,
|
597 |
|
|
wb_rst_i => bench_sti_rxtx0_wb_rst,
|
598 |
|
|
wb_rty_o => bench_res_rxtx0_wb_rty,
|
599 |
|
|
wb_stb_i => bench_sti_rxtx0_wb_stb,
|
600 |
|
|
wb_we_i => bench_sti_rxtx0_wb_we,
|
601 |
|
|
rx_clk_i => bench_sti_rxtx0_rx_clk,
|
602 |
|
|
rx_sam_i_i => bench_sti_rxtx0_rx_samples_i,
|
603 |
|
|
rx_sam_q_i => bench_sti_rxtx0_rx_samples_q,
|
604 |
|
|
rx_irq_o => bench_res_rxtx0_rx_irq,
|
605 |
|
|
rx_ena_o => bench_res_rxtx0_rx_ena,
|
606 |
|
|
tx_clk_i => bench_sti_rxtx0_tx_clk,
|
607 |
|
|
tx_dat_ser_i => bench_sti_rxtx0_tx_data_ser,
|
608 |
|
|
tx_sam_i_o => bench_res_rxtx0_tx_samples_i,
|
609 |
|
|
tx_sam_q_o => bench_res_rxtx0_tx_samples_q,
|
610 |
|
|
tx_clk_o => bench_res_rxtx0_tx_clk,
|
611 |
|
|
tx_buf_ful_o => bench_res_rxtx0_tx_buf_ful,
|
612 |
|
|
tx_idl_o => bench_res_rxtx0_tx_idl,
|
613 |
|
|
tx_ena_o => bench_res_rxtx0_tx_ena
|
614 |
|
|
);
|
615 |
|
|
-- Instance(s) of sub-components under test
|
616 |
|
|
buffer_000: ccsds_rxtx_buffer
|
617 |
|
|
generic map(
|
618 |
|
|
CCSDS_RXTX_BUFFER_DATA_BUS_SIZE => CCSDS_RXTX_BENCH_BUFFER0_DATA_BUS_SIZE,
|
619 |
|
|
CCSDS_RXTX_BUFFER_SIZE => CCSDS_RXTX_BENCH_BUFFER0_SIZE
|
620 |
|
|
)
|
621 |
|
|
port map(
|
622 |
|
|
clk_i => bench_sti_buffer0_clk,
|
623 |
|
|
rst_i => bench_sti_buffer0_rst,
|
624 |
|
|
dat_val_i => bench_sti_buffer0_data_valid,
|
625 |
|
|
dat_i => bench_sti_buffer0_data,
|
626 |
|
|
dat_val_o => bench_res_buffer0_data_valid,
|
627 |
|
|
buf_emp_o => bench_res_buffer0_buffer_empty,
|
628 |
|
|
buf_ful_o => bench_res_buffer0_buffer_full,
|
629 |
|
|
dat_nxt_i => bench_sti_buffer0_next_data,
|
630 |
|
|
dat_o => bench_res_buffer0_data
|
631 |
|
|
);
|
632 |
|
|
coder_convolutionial_000: ccsds_tx_coder_convolutional
|
633 |
|
|
generic map(
|
634 |
|
|
CCSDS_TX_CODER_CONV_CONNEXION_VECTORS => CCSDS_RXTX_BENCH_CODER_CONV0_CONNEXION_VECTORS,
|
635 |
|
|
CCSDS_TX_CODER_CONV_CONSTRAINT_SIZE => CCSDS_RXTX_BENCH_CODER_CONV0_CONSTRAINT_SIZE,
|
636 |
|
|
CCSDS_TX_CODER_CONV_DATA_BUS_SIZE => CCSDS_RXTX_BENCH_CODER_CONV0_DATA_BUS_SIZE,
|
637 |
|
|
CCSDS_TX_CODER_CONV_OPERATING_MODE => CCSDS_RXTX_BENCH_CODER_CONV0_OPERATING_MODE,
|
638 |
|
|
CCSDS_TX_CODER_CONV_OUTPUT_INVERSION => CCSDS_RXTX_BENCH_CODER_CONV0_OUTPUT_INVERSION,
|
639 |
|
|
CCSDS_TX_CODER_CONV_RATE_OUTPUT => CCSDS_RXTX_BENCH_CODER_CONV0_RATE_OUTPUT,
|
640 |
|
|
CCSDS_TX_CODER_CONV_SEED => CCSDS_RXTX_BENCH_CODER_CONV0_SEED
|
641 |
|
|
)
|
642 |
|
|
port map(
|
643 |
|
|
clk_i => bench_sti_coder_conv0_clk,
|
644 |
|
|
rst_i => bench_sti_coder_conv0_rst,
|
645 |
|
|
dat_val_i => bench_sti_coder_conv0_dat_val,
|
646 |
|
|
dat_i => bench_sti_coder_conv0_dat,
|
647 |
|
|
bus_o => bench_res_coder_conv0_bus,
|
648 |
|
|
dat_val_o => bench_res_coder_conv0_dat_val,
|
649 |
|
|
dat_o => bench_res_coder_conv0_dat
|
650 |
|
|
);
|
651 |
|
|
coder_differential_000: ccsds_tx_coder_differential
|
652 |
|
|
generic map(
|
653 |
|
|
CCSDS_TX_CODER_DIFF_BITS_PER_CODEWORD => CCSDS_RXTX_BENCH_CODER_DIFF0_BITS_PER_CODEWORD,
|
654 |
|
|
CCSDS_TX_CODER_DIFF_DATA_BUS_SIZE => CCSDS_RXTX_BENCH_CODER_DIFF0_DATA_BUS_SIZE
|
655 |
|
|
)
|
656 |
|
|
port map(
|
657 |
|
|
clk_i => bench_sti_coder_diff0_clk,
|
658 |
|
|
rst_i => bench_sti_coder_diff0_rst,
|
659 |
|
|
dat_val_i => bench_sti_coder_diff0_dat_val,
|
660 |
|
|
dat_i => bench_sti_coder_diff0_dat,
|
661 |
|
|
dat_val_o => bench_res_coder_diff0_dat_val,
|
662 |
|
|
dat_o => bench_res_coder_diff0_dat
|
663 |
|
|
);
|
664 |
|
|
crc_000: ccsds_rxtx_crc
|
665 |
|
|
generic map(
|
666 |
|
|
CCSDS_RXTX_CRC_DATA_LENGTH => CCSDS_RXTX_BENCH_CRC0_DATA'length/8,
|
667 |
|
|
CCSDS_RXTX_CRC_LENGTH => CCSDS_RXTX_BENCH_CRC0_LENGTH,
|
668 |
|
|
CCSDS_RXTX_CRC_POLYNOMIAL => CCSDS_RXTX_BENCH_CRC0_POLYNOMIAL,
|
669 |
|
|
CCSDS_RXTX_CRC_SEED => CCSDS_RXTX_BENCH_CRC0_SEED,
|
670 |
|
|
CCSDS_RXTX_CRC_INPUT_REFLECTED => CCSDS_RXTX_BENCH_CRC0_INPUT_REFLECTED,
|
671 |
|
|
CCSDS_RXTX_CRC_INPUT_BYTES_REFLECTED => CCSDS_RXTX_BENCH_CRC0_INPUT_BYTES_REFLECTED,
|
672 |
|
|
CCSDS_RXTX_CRC_OUTPUT_REFLECTED => CCSDS_RXTX_BENCH_CRC0_OUTPUT_REFLECTED,
|
673 |
|
|
CCSDS_RXTX_CRC_POLYNOMIAL_REFLECTED => CCSDS_RXTX_BENCH_CRC0_POLYNOMIAL_REFLECTED,
|
674 |
|
|
CCSDS_RXTX_CRC_FINAL_XOR => CCSDS_RXTX_BENCH_CRC0_XOR
|
675 |
|
|
)
|
676 |
|
|
port map(
|
677 |
|
|
clk_i => bench_sti_crc0_clk,
|
678 |
|
|
rst_i => bench_sti_crc0_rst,
|
679 |
|
|
nxt_i => bench_sti_crc0_nxt,
|
680 |
|
|
bus_o => bench_res_crc0_busy,
|
681 |
|
|
dat_i => bench_sti_crc0_data,
|
682 |
|
|
pad_dat_i => (others => '0'),
|
683 |
|
|
pad_dat_val_i => bench_sti_crc0_padding_data_valid,
|
684 |
|
|
crc_o => bench_res_crc0_crc,
|
685 |
|
|
dat_o => bench_res_crc0_data,
|
686 |
|
|
dat_val_o => bench_res_crc0_data_valid
|
687 |
|
|
);
|
688 |
|
|
crc_001: ccsds_rxtx_crc
|
689 |
|
|
generic map(
|
690 |
|
|
CCSDS_RXTX_CRC_DATA_LENGTH => CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE,
|
691 |
|
|
CCSDS_RXTX_CRC_LENGTH => CCSDS_RXTX_BENCH_CRC0_LENGTH,
|
692 |
|
|
CCSDS_RXTX_CRC_POLYNOMIAL => CCSDS_RXTX_BENCH_CRC0_POLYNOMIAL,
|
693 |
|
|
CCSDS_RXTX_CRC_SEED => CCSDS_RXTX_BENCH_CRC0_SEED,
|
694 |
|
|
CCSDS_RXTX_CRC_INPUT_REFLECTED => CCSDS_RXTX_BENCH_CRC0_INPUT_REFLECTED,
|
695 |
|
|
CCSDS_RXTX_CRC_INPUT_BYTES_REFLECTED => CCSDS_RXTX_BENCH_CRC0_INPUT_BYTES_REFLECTED,
|
696 |
|
|
CCSDS_RXTX_CRC_OUTPUT_REFLECTED => CCSDS_RXTX_BENCH_CRC0_OUTPUT_REFLECTED,
|
697 |
|
|
CCSDS_RXTX_CRC_POLYNOMIAL_REFLECTED => CCSDS_RXTX_BENCH_CRC0_POLYNOMIAL_REFLECTED,
|
698 |
|
|
CCSDS_RXTX_CRC_FINAL_XOR => CCSDS_RXTX_BENCH_CRC0_XOR
|
699 |
|
|
)
|
700 |
|
|
port map(
|
701 |
|
|
clk_i => bench_sti_crc0_clk,
|
702 |
|
|
rst_i => bench_sti_crc0_rst,
|
703 |
|
|
nxt_i => bench_sti_crc0_random_nxt,
|
704 |
|
|
bus_o => bench_res_crc0_random_busy,
|
705 |
|
|
dat_i => bench_sti_crc0_random_data,
|
706 |
|
|
pad_dat_i => (others => '0'),
|
707 |
|
|
pad_dat_val_i => bench_sti_crc0_random_padding_data_valid,
|
708 |
|
|
crc_o => bench_res_crc0_random_crc,
|
709 |
|
|
dat_o => bench_res_crc0_random_data,
|
710 |
|
|
dat_val_o => bench_res_crc0_random_data_valid
|
711 |
|
|
);
|
712 |
|
|
crc_002: ccsds_rxtx_crc
|
713 |
|
|
generic map(
|
714 |
|
|
CCSDS_RXTX_CRC_DATA_LENGTH => CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE,
|
715 |
|
|
CCSDS_RXTX_CRC_LENGTH => CCSDS_RXTX_BENCH_CRC0_LENGTH,
|
716 |
|
|
CCSDS_RXTX_CRC_POLYNOMIAL => CCSDS_RXTX_BENCH_CRC0_POLYNOMIAL,
|
717 |
|
|
CCSDS_RXTX_CRC_SEED => CCSDS_RXTX_BENCH_CRC0_SEED,
|
718 |
|
|
CCSDS_RXTX_CRC_INPUT_REFLECTED => CCSDS_RXTX_BENCH_CRC0_INPUT_REFLECTED,
|
719 |
|
|
CCSDS_RXTX_CRC_INPUT_BYTES_REFLECTED => CCSDS_RXTX_BENCH_CRC0_INPUT_BYTES_REFLECTED,
|
720 |
|
|
CCSDS_RXTX_CRC_OUTPUT_REFLECTED => CCSDS_RXTX_BENCH_CRC0_OUTPUT_REFLECTED,
|
721 |
|
|
CCSDS_RXTX_CRC_POLYNOMIAL_REFLECTED => CCSDS_RXTX_BENCH_CRC0_POLYNOMIAL_REFLECTED,
|
722 |
|
|
CCSDS_RXTX_CRC_FINAL_XOR => CCSDS_RXTX_BENCH_CRC0_XOR
|
723 |
|
|
)
|
724 |
|
|
port map(
|
725 |
|
|
clk_i => bench_sti_crc0_clk,
|
726 |
|
|
rst_i => bench_sti_crc0_rst,
|
727 |
|
|
nxt_i => bench_sti_crc0_check_nxt,
|
728 |
|
|
bus_o => bench_res_crc0_check_busy,
|
729 |
|
|
dat_i => bench_sti_crc0_check_data,
|
730 |
|
|
pad_dat_val_i => bench_sti_crc0_check_padding_data_valid,
|
731 |
|
|
pad_dat_i => bench_sti_crc0_check_padding_data,
|
732 |
|
|
crc_o => bench_res_crc0_check_crc,
|
733 |
|
|
dat_o => bench_res_crc0_check_data,
|
734 |
|
|
dat_val_o => bench_res_crc0_check_data_valid
|
735 |
|
|
);
|
736 |
|
|
filter000: ccsds_tx_filter
|
737 |
|
|
generic map(
|
738 |
|
|
CCSDS_TX_FILTER_OVERSAMPLING_RATIO => CCSDS_RXTX_BENCH_FILTER0_OVERSAMPLING_RATIO,
|
739 |
|
|
CCSDS_TX_FILTER_OFFSET_IQ => CCSDS_RXTX_BENCH_FILTER0_OFFSET_IQ,
|
740 |
|
|
CCSDS_TX_FILTER_SIG_QUANT_DEPTH => CCSDS_RXTX_BENCH_FILTER0_SIG_QUANT_DEPTH,
|
741 |
|
|
CCSDS_TX_FILTER_MODULATION_TYPE => CCSDS_RXTX_BENCH_FILTER0_MODULATION_TYPE,
|
742 |
|
|
CCSDS_TX_FILTER_TARGET_SNR => CCSDS_RXTX_BENCH_FILTER0_TARGET_SNR,
|
743 |
|
|
CCSDS_TX_FILTER_BITS_PER_SYMBOL => CCSDS_RXTX_BENCH_FILTER0_BITS_PER_SYMBOL
|
744 |
|
|
)
|
745 |
|
|
port map(
|
746 |
|
|
clk_i => bench_sti_filter0_clk,
|
747 |
|
|
sym_i_i => bench_sti_filter0_sym_i,
|
748 |
|
|
sym_q_i => bench_sti_filter0_sym_q,
|
749 |
|
|
sym_val_i => bench_sti_filter0_sym_val,
|
750 |
|
|
rst_i => bench_sti_filter0_rst,
|
751 |
|
|
sam_val_o => bench_res_filter0_sam_val,
|
752 |
|
|
sam_i_o => bench_res_filter0_sam_i,
|
753 |
|
|
sam_q_o => bench_res_filter0_sam_q
|
754 |
|
|
);
|
755 |
|
|
framer_000: ccsds_tx_framer
|
756 |
|
|
generic map (
|
757 |
|
|
CCSDS_TX_FRAMER_HEADER_LENGTH => CCSDS_RXTX_BENCH_FRAMER0_HEADER_LENGTH,
|
758 |
|
|
CCSDS_TX_FRAMER_FOOTER_LENGTH => CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH,
|
759 |
|
|
CCSDS_TX_FRAMER_DATA_LENGTH => CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH,
|
760 |
|
|
CCSDS_TX_FRAMER_DATA_BUS_SIZE => CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE,
|
761 |
|
|
CCSDS_TX_FRAMER_PARALLELISM_MAX_RATIO => CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO
|
762 |
|
|
)
|
763 |
|
|
port map(
|
764 |
|
|
clk_i => bench_sti_framer0_clk,
|
765 |
|
|
rst_i => bench_sti_framer0_rst,
|
766 |
|
|
dat_val_i => bench_sti_framer0_data_valid,
|
767 |
|
|
dat_i => bench_sti_framer0_data,
|
768 |
|
|
dat_val_o => bench_res_framer0_data_valid,
|
769 |
|
|
dat_o => bench_res_framer0_data,
|
770 |
|
|
dat_nxt_o => bench_res_framer0_dat_nxt,
|
771 |
|
|
idl_o => bench_res_framer0_idl
|
772 |
|
|
);
|
773 |
|
|
lfsr_000: ccsds_rxtx_lfsr
|
774 |
|
|
generic map(
|
775 |
|
|
CCSDS_RXTX_LFSR_DATA_BUS_SIZE => CCSDS_RXTX_BENCH_LFSR0_RESULT'length,
|
776 |
|
|
CCSDS_RXTX_LFSR_MEMORY_SIZE => CCSDS_RXTX_BENCH_LFSR0_MEMORY_SIZE,
|
777 |
|
|
CCSDS_RXTX_LFSR_MODE => CCSDS_RXTX_BENCH_LFSR0_MODE,
|
778 |
|
|
CCSDS_RXTX_LFSR_POLYNOMIAL => CCSDS_RXTX_BENCH_LFSR0_POLYNOMIAL,
|
779 |
|
|
CCSDS_RXTX_LFSR_SEED => CCSDS_RXTX_BENCH_LFSR0_SEED
|
780 |
|
|
)
|
781 |
|
|
port map(
|
782 |
|
|
clk_i => bench_sti_lfsr0_clk,
|
783 |
|
|
rst_i => bench_sti_lfsr0_rst,
|
784 |
|
|
dat_val_o => bench_res_lfsr0_data_valid,
|
785 |
|
|
dat_o => bench_res_lfsr0_data
|
786 |
|
|
);
|
787 |
|
|
mapper_bits_symbols_000: ccsds_tx_mapper_bits_symbols
|
788 |
|
|
generic map(
|
789 |
|
|
CCSDS_TX_MAPPER_DATA_BUS_SIZE => CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_BUS_SIZE,
|
790 |
|
|
CCSDS_TX_MAPPER_MODULATION_TYPE => CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_MODULATION_TYPE,
|
791 |
|
|
CCSDS_TX_MAPPER_BITS_PER_SYMBOL => CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_BITS_PER_SYMBOL
|
792 |
|
|
)
|
793 |
|
|
port map(
|
794 |
|
|
clk_i => bench_sti_mapper_bits_symbols0_clk,
|
795 |
|
|
dat_i => bench_sti_mapper_bits_symbols0_data,
|
796 |
|
|
dat_val_i => bench_sti_mapper_bits_symbols0_dat_val,
|
797 |
|
|
rst_i => bench_sti_mapper_bits_symbols0_rst,
|
798 |
|
|
sym_i_o => bench_res_mapper_bits_symbols0_sym_i,
|
799 |
|
|
sym_q_o => bench_res_mapper_bits_symbols0_sym_q,
|
800 |
|
|
sym_val_o => bench_res_mapper_bits_symbols0_sym_val
|
801 |
|
|
);
|
802 |
|
|
mapper_bits_symbols_001: ccsds_tx_mapper_bits_symbols
|
803 |
|
|
generic map(
|
804 |
|
|
CCSDS_TX_MAPPER_DATA_BUS_SIZE => CCSDS_RXTX_BENCH_FILTER0_MAPPER_DATA_BUS_SIZE,
|
805 |
|
|
CCSDS_TX_MAPPER_MODULATION_TYPE => CCSDS_RXTX_BENCH_FILTER0_MODULATION_TYPE,
|
806 |
|
|
CCSDS_TX_MAPPER_BITS_PER_SYMBOL => CCSDS_RXTX_BENCH_FILTER0_BITS_PER_SYMBOL
|
807 |
|
|
)
|
808 |
|
|
port map(
|
809 |
|
|
clk_i => bench_sti_filter0_mapper_clk,
|
810 |
|
|
dat_i => bench_sti_filter0_mapper_data,
|
811 |
|
|
dat_val_i => bench_sti_filter0_mapper_dat_val,
|
812 |
|
|
rst_i => bench_sti_filter0_rst,
|
813 |
|
|
sym_i_o => bench_sti_filter0_sym_i,
|
814 |
|
|
sym_q_o => bench_sti_filter0_sym_q,
|
815 |
|
|
sym_val_o => bench_sti_filter0_sym_val
|
816 |
|
|
);
|
817 |
|
|
mapper_symbols_samples_000: ccsds_tx_mapper_symbols_samples
|
818 |
|
|
generic map(
|
819 |
|
|
CCSDS_TX_MAPPER_QUANTIZATION_DEPTH => CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_QUANTIZATION_DEPTH,
|
820 |
|
|
CCSDS_TX_MAPPER_TARGET_SNR => CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_TARGET_SNR,
|
821 |
|
|
CCSDS_TX_MAPPER_BITS_PER_SYMBOL => CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_BITS_PER_SYMBOL
|
822 |
|
|
)
|
823 |
|
|
port map(
|
824 |
|
|
clk_i => bench_sti_mapper_symbols_samples0_clk,
|
825 |
|
|
sym_i => bench_sti_mapper_symbols_samples0_sym,
|
826 |
|
|
sym_val_i => bench_sti_mapper_symbols_samples0_sym_val,
|
827 |
|
|
rst_i => bench_sti_mapper_symbols_samples0_rst,
|
828 |
|
|
sam_o => bench_res_mapper_symbols_samples0_sam,
|
829 |
|
|
sam_val_o => bench_res_mapper_symbols_samples0_sam_val
|
830 |
|
|
);
|
831 |
|
|
serdes_000: ccsds_rxtx_serdes
|
832 |
|
|
generic map(
|
833 |
|
|
CCSDS_RXTX_SERDES_DEPTH => CCSDS_RXTX_BENCH_SERDES0_DEPTH
|
834 |
|
|
)
|
835 |
|
|
port map(
|
836 |
|
|
clk_i => bench_sti_serdes0_clk,
|
837 |
|
|
dat_par_i => bench_sti_serdes0_data_par,
|
838 |
|
|
dat_par_val_i => bench_sti_serdes0_data_par_valid,
|
839 |
|
|
dat_ser_i => bench_sti_serdes0_data_ser,
|
840 |
|
|
dat_ser_val_i => bench_sti_serdes0_data_ser_valid,
|
841 |
|
|
rst_i => bench_sti_serdes0_rst,
|
842 |
|
|
bus_o => bench_res_serdes0_busy,
|
843 |
|
|
dat_par_o => bench_res_serdes0_data_par,
|
844 |
|
|
dat_par_val_o => bench_res_serdes0_data_par_valid,
|
845 |
|
|
dat_ser_o => bench_res_serdes0_data_ser,
|
846 |
|
|
dat_ser_val_o => bench_res_serdes0_data_ser_valid
|
847 |
|
|
);
|
848 |
|
|
srrc_000: ccsds_rxtx_srrc
|
849 |
|
|
generic map(
|
850 |
|
|
CCSDS_RXTX_SRRC_APODIZATION_WINDOW_TYPE => CCSDS_RXTX_BENCH_SRRC0_APODIZATION_WINDOW_TYPE,
|
851 |
|
|
CCSDS_RXTX_SRRC_OVERSAMPLING_RATIO => CCSDS_RXTX_BENCH_SRRC0_OVERSAMPLING_RATIO,
|
852 |
|
|
CCSDS_RXTX_SRRC_ROLL_OFF => CCSDS_RXTX_BENCH_SRRC0_ROLL_OFF,
|
853 |
|
|
CCSDS_RXTX_SRRC_SIG_QUANT_DEPTH => CCSDS_RXTX_BENCH_SRRC0_SIG_QUANT_DEPTH
|
854 |
|
|
)
|
855 |
|
|
port map(
|
856 |
|
|
clk_i => bench_sti_srrc0_clk,
|
857 |
|
|
sam_i => bench_sti_srrc0_sam,
|
858 |
|
|
sam_val_i => bench_sti_srrc0_sam_val,
|
859 |
|
|
rst_i => bench_sti_srrc0_rst,
|
860 |
|
|
sam_o => bench_res_srrc0_sam,
|
861 |
|
|
sam_val_o => bench_res_srrc0_sam_val
|
862 |
|
|
);
|
863 |
|
|
srrc_001: ccsds_rxtx_srrc
|
864 |
|
|
generic map(
|
865 |
|
|
CCSDS_RXTX_SRRC_APODIZATION_WINDOW_TYPE => CCSDS_RXTX_BENCH_SRRC0_APODIZATION_WINDOW_TYPE,
|
866 |
|
|
CCSDS_RXTX_SRRC_OVERSAMPLING_RATIO => CCSDS_RXTX_BENCH_SRRC0_OVERSAMPLING_RATIO,
|
867 |
|
|
CCSDS_RXTX_SRRC_ROLL_OFF => CCSDS_RXTX_BENCH_SRRC0_ROLL_OFF,
|
868 |
|
|
CCSDS_RXTX_SRRC_SIG_QUANT_DEPTH => CCSDS_RXTX_BENCH_SRRC0_SIG_QUANT_DEPTH
|
869 |
|
|
)
|
870 |
|
|
port map(
|
871 |
|
|
clk_i => bench_sti_srrc0_clk,
|
872 |
|
|
sam_i => bench_res_srrc0_sam,
|
873 |
|
|
sam_val_i => bench_res_srrc0_sam_val,
|
874 |
|
|
rst_i => bench_sti_srrc0_rst,
|
875 |
|
|
sam_o => bench_res_srrc1_sam,
|
876 |
|
|
sam_val_o => bench_res_srrc1_sam_val
|
877 |
|
|
);
|
878 |
|
|
srrc_002: ccsds_rxtx_srrc
|
879 |
|
|
generic map(
|
880 |
|
|
CCSDS_RXTX_SRRC_APODIZATION_WINDOW_TYPE => 1,
|
881 |
|
|
CCSDS_RXTX_SRRC_OVERSAMPLING_RATIO => CCSDS_RXTX_BENCH_FILTER0_OVERSAMPLING_RATIO,
|
882 |
|
|
CCSDS_RXTX_SRRC_ROLL_OFF => CCSDS_RXTX_BENCH_FILTER0_ROLL_OFF,
|
883 |
|
|
CCSDS_RXTX_SRRC_SIG_QUANT_DEPTH => CCSDS_RXTX_BENCH_FILTER0_SIG_QUANT_DEPTH
|
884 |
|
|
)
|
885 |
|
|
port map(
|
886 |
|
|
clk_i => bench_sti_filter0_clk,
|
887 |
|
|
sam_i => bench_res_filter0_sam_i,
|
888 |
|
|
sam_val_i => bench_res_filter0_sam_val,
|
889 |
|
|
rst_i => bench_sti_filter0_rst,
|
890 |
|
|
sam_o => bench_res_filter0_srrc_sam_i,
|
891 |
|
|
sam_val_o => bench_res_filter0_srrc_sam_i_val
|
892 |
|
|
);
|
893 |
|
|
srrc_003: ccsds_rxtx_srrc
|
894 |
|
|
generic map(
|
895 |
|
|
CCSDS_RXTX_SRRC_APODIZATION_WINDOW_TYPE => 1,
|
896 |
|
|
CCSDS_RXTX_SRRC_OVERSAMPLING_RATIO => CCSDS_RXTX_BENCH_FILTER0_OVERSAMPLING_RATIO,
|
897 |
|
|
CCSDS_RXTX_SRRC_ROLL_OFF => CCSDS_RXTX_BENCH_FILTER0_ROLL_OFF,
|
898 |
|
|
CCSDS_RXTX_SRRC_SIG_QUANT_DEPTH => CCSDS_RXTX_BENCH_FILTER0_SIG_QUANT_DEPTH
|
899 |
|
|
)
|
900 |
|
|
port map(
|
901 |
|
|
clk_i => bench_sti_filter0_clk,
|
902 |
|
|
sam_i => bench_res_filter0_sam_q,
|
903 |
|
|
sam_val_i => bench_res_filter0_sam_val,
|
904 |
|
|
rst_i => bench_sti_filter0_rst,
|
905 |
|
|
sam_o => bench_res_filter0_srrc_sam_q,
|
906 |
|
|
sam_val_o => bench_res_filter0_srrc_sam_q_val
|
907 |
|
|
);
|
908 |
|
|
--=============================================================================
|
909 |
|
|
-- Begin of bench_sti_rxtx0_wb_clkp
|
910 |
|
|
-- bench_sti_rxtx0_wb_clk generation
|
911 |
|
|
--=============================================================================
|
912 |
|
|
-- read:
|
913 |
|
|
-- write: bench_sti_rxtx0_wb_clk
|
914 |
|
|
-- r/w:
|
915 |
|
|
BENCH_STI_RXTX0_WB_CLKP : process
|
916 |
|
|
begin
|
917 |
|
|
bench_sti_rxtx0_wb_clk <= '1';
|
918 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD/2;
|
919 |
|
|
bench_sti_rxtx0_wb_clk <= '0';
|
920 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD/2;
|
921 |
|
|
end process;
|
922 |
|
|
--=============================================================================
|
923 |
|
|
-- Begin of bench_sti_rxtx0_rx_clkp
|
924 |
|
|
-- bench_sti_rxtx0_rx_clk generation
|
925 |
|
|
--=============================================================================
|
926 |
|
|
-- read:
|
927 |
|
|
-- write: bench_sti_rxtx0_rx_clk
|
928 |
|
|
-- r/w:
|
929 |
|
|
BENCH_STI_RXTX0_RX_CLKP : process
|
930 |
|
|
begin
|
931 |
|
|
bench_sti_rxtx0_rx_clk <= '1';
|
932 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_RX_CLK_PERIOD/2;
|
933 |
|
|
bench_sti_rxtx0_rx_clk <= '0';
|
934 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_RX_CLK_PERIOD/2;
|
935 |
|
|
end process;
|
936 |
|
|
--=============================================================================
|
937 |
|
|
-- Begin of bench_sti_rxtx0_tx_clkp
|
938 |
|
|
-- bench_sti_rxtx0_tx_clk generation
|
939 |
|
|
--=============================================================================
|
940 |
|
|
-- read:
|
941 |
|
|
-- write: bench_sti_rxtx0_tx_clk
|
942 |
|
|
-- r/w:
|
943 |
|
|
BENCH_STI_RXTX0_TX_CLKP : process
|
944 |
|
|
begin
|
945 |
|
|
bench_sti_rxtx0_tx_clk <= '1';
|
946 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_TX_CLK_PERIOD/2;
|
947 |
|
|
bench_sti_rxtx0_tx_clk <= '0';
|
948 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_TX_CLK_PERIOD/2;
|
949 |
|
|
end process;
|
950 |
|
|
--=============================================================================
|
951 |
|
|
-- Begin of bench_sti_buffer0_clkp
|
952 |
|
|
-- bench_sti_buffer0_clk generation
|
953 |
|
|
--=============================================================================
|
954 |
|
|
-- read:
|
955 |
|
|
-- write: bench_sti_buffer0_clk
|
956 |
|
|
-- r/w:
|
957 |
|
|
BENCH_STI_BUFFER0_CLKP : process
|
958 |
|
|
begin
|
959 |
|
|
bench_sti_buffer0_clk <= '1';
|
960 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD/2;
|
961 |
|
|
bench_sti_buffer0_clk <= '0';
|
962 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD/2;
|
963 |
|
|
end process;
|
964 |
|
|
--=============================================================================
|
965 |
|
|
-- Begin of bench_sti_coder_conv0_clk
|
966 |
|
|
-- bench_sti_coder_conv0_clk generation
|
967 |
|
|
--=============================================================================
|
968 |
|
|
-- read:
|
969 |
|
|
-- write: bench_sti_coder_conv0_clk
|
970 |
|
|
-- r/w:
|
971 |
|
|
BENCH_STI_CODER_CONV0_CLKP : process
|
972 |
|
|
begin
|
973 |
|
|
bench_sti_coder_conv0_clk <= '1';
|
974 |
|
|
wait for CCSDS_RXTX_BENCH_CODER_CONV0_CLK_PERIOD/2;
|
975 |
|
|
bench_sti_coder_conv0_clk <= '0';
|
976 |
|
|
wait for CCSDS_RXTX_BENCH_CODER_CONV0_CLK_PERIOD/2;
|
977 |
|
|
end process;
|
978 |
|
|
--=============================================================================
|
979 |
|
|
-- Begin of bench_sti_coder_diff0_clk
|
980 |
|
|
-- bench_sti_coder_diff0_clk generation
|
981 |
|
|
--=============================================================================
|
982 |
|
|
-- read:
|
983 |
|
|
-- write: bench_sti_coder_diff0_clk
|
984 |
|
|
-- r/w:
|
985 |
|
|
BENCH_STI_CODER_DIFF0_CLKP : process
|
986 |
|
|
begin
|
987 |
|
|
bench_sti_coder_diff0_clk <= '1';
|
988 |
|
|
wait for CCSDS_RXTX_BENCH_CODER_DIFF0_CLK_PERIOD/2;
|
989 |
|
|
bench_sti_coder_diff0_clk <= '0';
|
990 |
|
|
wait for CCSDS_RXTX_BENCH_CODER_DIFF0_CLK_PERIOD/2;
|
991 |
|
|
end process;
|
992 |
|
|
--=============================================================================
|
993 |
|
|
-- Begin of bench_sti_crc0_clkp
|
994 |
|
|
-- bench_sti_crc0_clk generation
|
995 |
|
|
--=============================================================================
|
996 |
|
|
-- read:
|
997 |
|
|
-- write: bench_sti_crc0_clk
|
998 |
|
|
-- r/w:
|
999 |
|
|
BENCH_STI_CRC0_CLKP : process
|
1000 |
|
|
begin
|
1001 |
|
|
bench_sti_crc0_clk <= '1';
|
1002 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD/2;
|
1003 |
|
|
bench_sti_crc0_clk <= '0';
|
1004 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD/2;
|
1005 |
|
|
end process;
|
1006 |
|
|
--=============================================================================
|
1007 |
|
|
-- Begin of bench_sti_filter0_clkp
|
1008 |
|
|
-- bench_sti_filter0_clk generation
|
1009 |
|
|
--=============================================================================
|
1010 |
|
|
-- read:
|
1011 |
|
|
-- write: bench_sti_filter0_clk
|
1012 |
|
|
-- r/w:
|
1013 |
|
|
BENCH_STI_FILTER0_CLKP : process
|
1014 |
|
|
begin
|
1015 |
|
|
bench_sti_filter0_clk <= '1';
|
1016 |
|
|
wait for CCSDS_RXTX_BENCH_FILTER0_CLK_PERIOD/2;
|
1017 |
|
|
bench_sti_filter0_clk <= '0';
|
1018 |
|
|
wait for CCSDS_RXTX_BENCH_FILTER0_CLK_PERIOD/2;
|
1019 |
|
|
end process;
|
1020 |
|
|
--=============================================================================
|
1021 |
|
|
-- Begin of bench_sti_filter0_mapper_clkp
|
1022 |
|
|
-- bench_sti_filter0_mapper_clk generation
|
1023 |
|
|
--=============================================================================
|
1024 |
|
|
-- read:
|
1025 |
|
|
-- write: bench_sti_filter0_mapper_clk
|
1026 |
|
|
-- r/w:
|
1027 |
|
|
BENCH_STI_FILTER0_MAPPER_CLKP : process
|
1028 |
|
|
begin
|
1029 |
|
|
bench_sti_filter0_mapper_clk <= '1';
|
1030 |
|
|
wait for CCSDS_RXTX_BENCH_FILTER0_MAPPER_CLK_PERIOD/2;
|
1031 |
|
|
bench_sti_filter0_mapper_clk <= '0';
|
1032 |
|
|
wait for CCSDS_RXTX_BENCH_FILTER0_MAPPER_CLK_PERIOD/2;
|
1033 |
|
|
end process;
|
1034 |
|
|
--=============================================================================
|
1035 |
|
|
-- Begin of bench_sti_framer0_clkp
|
1036 |
|
|
-- bench_sti_framer0_clk generation
|
1037 |
|
|
--=============================================================================
|
1038 |
|
|
-- read:
|
1039 |
|
|
-- write: bench_sti_framer0_clk
|
1040 |
|
|
-- r/w:
|
1041 |
|
|
BENCH_STI_FRAMER0_CLKP : process
|
1042 |
|
|
begin
|
1043 |
|
|
bench_sti_framer0_clk <= '1';
|
1044 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD/2;
|
1045 |
|
|
bench_sti_framer0_clk <= '0';
|
1046 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD/2;
|
1047 |
|
|
end process;
|
1048 |
|
|
--=============================================================================
|
1049 |
|
|
-- Begin of bench_sti_lfsr0_clkp
|
1050 |
|
|
-- bench_sti_lfsr0_clk generation
|
1051 |
|
|
--=============================================================================
|
1052 |
|
|
-- read:
|
1053 |
|
|
-- write: bench_sti_lfsr0_clk
|
1054 |
|
|
-- r/w:
|
1055 |
|
|
BENCH_STI_LFSR0_CLKP : process
|
1056 |
|
|
begin
|
1057 |
|
|
bench_sti_lfsr0_clk <= '1';
|
1058 |
|
|
wait for CCSDS_RXTX_BENCH_LFSR0_CLK_PERIOD/2;
|
1059 |
|
|
bench_sti_lfsr0_clk <= '0';
|
1060 |
|
|
wait for CCSDS_RXTX_BENCH_LFSR0_CLK_PERIOD/2;
|
1061 |
|
|
end process;
|
1062 |
|
|
--=============================================================================
|
1063 |
|
|
-- Begin of bench_sti_mapper_bits_symbols0_clkp
|
1064 |
|
|
-- bench_sti_mapper_bits_symbols0_clk generation
|
1065 |
|
|
--=============================================================================
|
1066 |
|
|
-- read:
|
1067 |
|
|
-- write: bench_sti_mapper_bits_symbols0_clk
|
1068 |
|
|
-- r/w:
|
1069 |
|
|
BENCH_STI_MAPPER_BITS_SYMBOLS0_CLKP : process
|
1070 |
|
|
begin
|
1071 |
|
|
bench_sti_mapper_bits_symbols0_clk <= '1';
|
1072 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_CLK_PERIOD/2;
|
1073 |
|
|
bench_sti_mapper_bits_symbols0_clk <= '0';
|
1074 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_CLK_PERIOD/2;
|
1075 |
|
|
end process;
|
1076 |
|
|
--=============================================================================
|
1077 |
|
|
-- Begin of bench_sti_mapper_symbols_samples0_clkp
|
1078 |
|
|
-- bench_sti_mapper_symbols_samples0_clk generation
|
1079 |
|
|
--=============================================================================
|
1080 |
|
|
-- read:
|
1081 |
|
|
-- write: bench_sti_mapper_symbols_samples0_clk
|
1082 |
|
|
-- r/w:
|
1083 |
|
|
BENCH_STI_MAPPER_SYMBOLS_SAMPLES0_CLKP : process
|
1084 |
|
|
begin
|
1085 |
|
|
bench_sti_mapper_symbols_samples0_clk <= '1';
|
1086 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_CLK_PERIOD/2;
|
1087 |
|
|
bench_sti_mapper_symbols_samples0_clk <= '0';
|
1088 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_CLK_PERIOD/2;
|
1089 |
|
|
end process;
|
1090 |
|
|
--=============================================================================
|
1091 |
|
|
-- Begin of bench_sti_serdes0_clkp
|
1092 |
|
|
-- bench_sti_serdes0_clk generation
|
1093 |
|
|
--=============================================================================
|
1094 |
|
|
-- read:
|
1095 |
|
|
-- write: bench_sti_serdes0_clk
|
1096 |
|
|
-- r/w:
|
1097 |
|
|
BENCH_STI_SERDES0_CLKP : process
|
1098 |
|
|
begin
|
1099 |
|
|
bench_sti_serdes0_clk <= '1';
|
1100 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD/2;
|
1101 |
|
|
bench_sti_serdes0_clk <= '0';
|
1102 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD/2;
|
1103 |
|
|
end process;
|
1104 |
|
|
--=============================================================================
|
1105 |
|
|
-- Begin of bench_sti_srrc0_clkp
|
1106 |
|
|
-- bench_sti_srrc0_clk generation
|
1107 |
|
|
--=============================================================================
|
1108 |
|
|
-- read:
|
1109 |
|
|
-- write: bench_sti_srrc0_clk
|
1110 |
|
|
-- r/w:
|
1111 |
|
|
BENCH_STI_SRRC0_CLKP : process
|
1112 |
|
|
begin
|
1113 |
|
|
bench_sti_srrc0_clk <= '1';
|
1114 |
|
|
wait for CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD/2;
|
1115 |
|
|
bench_sti_srrc0_clk <= '0';
|
1116 |
|
|
wait for CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD/2;
|
1117 |
|
|
end process;
|
1118 |
|
|
--=============================================================================
|
1119 |
|
|
-- Begin of bench_sti_rxtx0_tx_datap
|
1120 |
|
|
-- bench_sti_rxtx0_tx_data generation / dephased from 1/2 clk with bench_sti_rxtx0_tx_clk
|
1121 |
|
|
--=============================================================================
|
1122 |
|
|
-- read:
|
1123 |
|
|
-- write: bench_sti_rxtx0_tx_data_ser0
|
1124 |
|
|
-- r/w:
|
1125 |
|
|
BENCH_STI_RXTX0_TX_DATAP : process
|
1126 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1127 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1128 |
|
|
variable random : std_logic_vector(1 downto 0);
|
1129 |
|
|
begin
|
1130 |
|
|
if (bench_ena_rxtx0_random_data = '1') then
|
1131 |
|
|
sim_generate_random_std_logic_vector(2,seed1,seed2,random);
|
1132 |
|
|
bench_sti_rxtx0_tx_data_ser <= random(0);
|
1133 |
|
|
end if;
|
1134 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_TX_CLK_PERIOD;
|
1135 |
|
|
end process;
|
1136 |
|
|
--=============================================================================
|
1137 |
|
|
-- Begin of bench_sti_buffer0_datap
|
1138 |
|
|
-- bench_sti_buffer0_data generation
|
1139 |
|
|
--=============================================================================
|
1140 |
|
|
-- read: bench_ena_buffer0_random_data
|
1141 |
|
|
-- write: bench_sti_buffer0_data
|
1142 |
|
|
-- r/w:
|
1143 |
|
|
BENCH_STI_BUFFER0_DATAP : process
|
1144 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1145 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1146 |
|
|
variable random : std_logic_vector(CCSDS_RXTX_BENCH_BUFFER0_DATA_BUS_SIZE-1 downto 0);
|
1147 |
|
|
begin
|
1148 |
|
|
if (bench_ena_buffer0_random_data = '1') then
|
1149 |
|
|
sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_BUFFER0_DATA_BUS_SIZE,seed1,seed2,random);
|
1150 |
|
|
bench_sti_buffer0_data <= random;
|
1151 |
|
|
end if;
|
1152 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD;
|
1153 |
|
|
end process;
|
1154 |
|
|
--=============================================================================
|
1155 |
|
|
-- Begin of bench_sti_coder_conv0_datap
|
1156 |
|
|
-- bench_sti_coder_conv0_random_data generation
|
1157 |
|
|
--=============================================================================
|
1158 |
|
|
-- read: bench_ena_coder_conv0_random_data
|
1159 |
|
|
-- write: bench_sti_coder_conv0_dat
|
1160 |
|
|
-- r/w:
|
1161 |
|
|
BENCH_STI_CODER_CONV0_DATAP : process
|
1162 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1163 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1164 |
|
|
variable random : std_logic_vector(CCSDS_RXTX_BENCH_CODER_CONV0_DATA_BUS_SIZE-1 downto 0);
|
1165 |
|
|
begin
|
1166 |
|
|
-- if (bench_ena_coder_conv0_random_data = '1') then
|
1167 |
|
|
-- sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_CODER_CONV0_DATA_BUS_SIZE,seed1,seed2,random);
|
1168 |
|
|
-- bench_sti_coder_conv0_dat <= random;
|
1169 |
|
|
-- end if;
|
1170 |
|
|
-- wait for CCSDS_RXTX_BENCH_CODER_CONV0_CLK_PERIOD;
|
1171 |
|
|
bench_sti_coder_conv0_dat <= CCSDS_RXTX_BENCH_CODER_CONV0_INPUT;
|
1172 |
|
|
wait;
|
1173 |
|
|
end process;
|
1174 |
|
|
--=============================================================================
|
1175 |
|
|
-- Begin of bench_sti_coder_diff0_datap
|
1176 |
|
|
-- bench_sti_coder_diff0_random_data generation
|
1177 |
|
|
--=============================================================================
|
1178 |
|
|
-- read: bench_ena_coder_diff0_random_data
|
1179 |
|
|
-- write: bench_sti_coder_diff0_dat
|
1180 |
|
|
-- r/w:
|
1181 |
|
|
BENCH_STI_CODER_DIFF0_DATAP : process
|
1182 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1183 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1184 |
|
|
variable random : std_logic_vector(CCSDS_RXTX_BENCH_CODER_DIFF0_DATA_BUS_SIZE-1 downto 0);
|
1185 |
|
|
begin
|
1186 |
|
|
if (bench_ena_coder_diff0_random_data = '1') then
|
1187 |
|
|
sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_CODER_DIFF0_DATA_BUS_SIZE,seed1,seed2,random);
|
1188 |
|
|
bench_sti_coder_diff0_dat <= random;
|
1189 |
|
|
end if;
|
1190 |
|
|
wait for CCSDS_RXTX_BENCH_CODER_DIFF0_CLK_PERIOD;
|
1191 |
|
|
end process;
|
1192 |
|
|
--=============================================================================
|
1193 |
|
|
-- Begin of bench_sti_crc0_datap
|
1194 |
|
|
-- bench_sti_crc0_random_data generation
|
1195 |
|
|
--=============================================================================
|
1196 |
|
|
-- read: bench_ena_crc0_random_data
|
1197 |
|
|
-- write: bench_sti_crc0_random_data
|
1198 |
|
|
-- r/w:
|
1199 |
|
|
BENCH_STI_CRC0_DATAP : process
|
1200 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1201 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1202 |
|
|
variable random : std_logic_vector(CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE*8-1 downto 0);
|
1203 |
|
|
begin
|
1204 |
|
|
if (bench_ena_crc0_random_data = '1') then
|
1205 |
|
|
sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE*8,seed1,seed2,random);
|
1206 |
|
|
bench_sti_crc0_random_data <= random;
|
1207 |
|
|
end if;
|
1208 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD;
|
1209 |
|
|
end process;
|
1210 |
|
|
--=============================================================================
|
1211 |
|
|
-- Begin of bench_sti_filter0_datap
|
1212 |
|
|
-- bench_sti_filter0_mapper_data generation
|
1213 |
|
|
--=============================================================================
|
1214 |
|
|
-- read: bench_ena_filter0_random_data
|
1215 |
|
|
-- write: bench_sti_filter0_mapper_data
|
1216 |
|
|
-- r/w:
|
1217 |
|
|
BENCH_STI_FILTER0_DATAP : process
|
1218 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1219 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1220 |
|
|
variable random : std_logic_vector(CCSDS_RXTX_BENCH_FILTER0_MAPPER_DATA_BUS_SIZE-1 downto 0);
|
1221 |
|
|
begin
|
1222 |
|
|
if (bench_ena_filter0_random_data = '1') then
|
1223 |
|
|
sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_FILTER0_MAPPER_DATA_BUS_SIZE,seed1,seed2,random);
|
1224 |
|
|
bench_sti_filter0_mapper_data <= random;
|
1225 |
|
|
end if;
|
1226 |
|
|
wait for CCSDS_RXTX_BENCH_FILTER0_MAPPER_DATA_CLK_PERIOD;
|
1227 |
|
|
end process;
|
1228 |
|
|
--=============================================================================
|
1229 |
|
|
-- Begin of bench_sti_framer0_datap
|
1230 |
|
|
-- bench_sti_framer0_data generation
|
1231 |
|
|
--=============================================================================
|
1232 |
|
|
-- read: bench_ena_framer0_random_data
|
1233 |
|
|
-- write: bench_sti_framer0_data
|
1234 |
|
|
-- r/w:
|
1235 |
|
|
BENCH_STI_FRAMER0_DATAP : process
|
1236 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1237 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1238 |
|
|
variable random : std_logic_vector(CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE-1 downto 0);
|
1239 |
|
|
begin
|
1240 |
|
|
if (bench_ena_framer0_random_data = '1') then
|
1241 |
|
|
sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE,seed1,seed2,random);
|
1242 |
|
|
bench_sti_framer0_data <= random;
|
1243 |
|
|
end if;
|
1244 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD;
|
1245 |
|
|
end process;
|
1246 |
|
|
--=============================================================================
|
1247 |
|
|
-- Begin of bench_sti_mapper_bits_symbols0_datap
|
1248 |
|
|
-- bench_sti_mapper_bits_symbols0_data generation
|
1249 |
|
|
--=============================================================================
|
1250 |
|
|
-- read: bench_ena_mapper_bits_symbols0_random_data
|
1251 |
|
|
-- write: bench_sti_mapper_bits_symbols0_data
|
1252 |
|
|
-- r/w:
|
1253 |
|
|
BENCH_STI_MAPPER_BITS_SYMBOLS0_DATAP : process
|
1254 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1255 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1256 |
|
|
variable random : std_logic_vector(CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_BUS_SIZE-1 downto 0);
|
1257 |
|
|
begin
|
1258 |
|
|
if (bench_ena_mapper_bits_symbols0_random_data = '1') then
|
1259 |
|
|
sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_BUS_SIZE,seed1,seed2,random);
|
1260 |
|
|
bench_sti_mapper_bits_symbols0_data <= random;
|
1261 |
|
|
end if;
|
1262 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_CLK_PERIOD;
|
1263 |
|
|
end process;
|
1264 |
|
|
--=============================================================================
|
1265 |
|
|
-- Begin of bench_sti_mapper_symbols_samples0_datap
|
1266 |
|
|
-- bench_sti_mapper_symbols_samples0_data generation
|
1267 |
|
|
--=============================================================================
|
1268 |
|
|
-- read: bench_ena_mapper_symbols_samples0_random_data
|
1269 |
|
|
-- write: bench_sti_mapper_symbols_samples0_data
|
1270 |
|
|
-- r/w:
|
1271 |
|
|
BENCH_STI_MAPPER_SYMBOLS_SAMPLES0_DATAP : process
|
1272 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1273 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1274 |
|
|
variable random : std_logic_vector(CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_BITS_PER_SYMBOL-1 downto 0);
|
1275 |
|
|
begin
|
1276 |
|
|
if (bench_ena_mapper_symbols_samples0_random_data = '1') then
|
1277 |
|
|
sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_BITS_PER_SYMBOL,seed1,seed2,random);
|
1278 |
|
|
bench_sti_mapper_symbols_samples0_sym <= random;
|
1279 |
|
|
end if;
|
1280 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_CLK_PERIOD;
|
1281 |
|
|
end process;
|
1282 |
|
|
--=============================================================================
|
1283 |
|
|
-- Begin of bench_sti_serdes0_datap
|
1284 |
|
|
-- bench_sti_serdes0_data generation
|
1285 |
|
|
--=============================================================================
|
1286 |
|
|
-- read: bench_ena_serdes0_random_data
|
1287 |
|
|
-- write: bench_sti_serdes0_data_par, bench_sti_serdes0_data_ser
|
1288 |
|
|
-- r/w:
|
1289 |
|
|
BENCH_STI_SERDES0_DATAP : process
|
1290 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1291 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1292 |
|
|
variable random : std_logic_vector(CCSDS_RXTX_BENCH_SERDES0_DEPTH-1 downto 0);
|
1293 |
|
|
begin
|
1294 |
|
|
if (bench_ena_serdes0_random_data = '1') then
|
1295 |
|
|
sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_SERDES0_DEPTH,seed1,seed2,random);
|
1296 |
|
|
bench_sti_serdes0_data_par <= random;
|
1297 |
|
|
bench_sti_serdes0_data_ser <= random(0);
|
1298 |
|
|
end if;
|
1299 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD;
|
1300 |
|
|
end process;
|
1301 |
|
|
--=============================================================================
|
1302 |
|
|
-- Begin of bench_sti_rxtx0_rx_samplesp
|
1303 |
|
|
-- bench_sti_rxtx0_rx_samples generation
|
1304 |
|
|
--=============================================================================
|
1305 |
|
|
-- read: bench_ena_rxtx0_random_data
|
1306 |
|
|
-- write: bench_sti_rxtx0_rx_samples_i, bench_sti_rxtx0_rx_samples_q
|
1307 |
|
|
-- r/w:
|
1308 |
|
|
BENCH_STI_RXTX0_RX_SAMPLESP : process
|
1309 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1310 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1311 |
|
|
variable random1 : std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_RX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
|
1312 |
|
|
variable random2 : std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_RX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
|
1313 |
|
|
begin
|
1314 |
|
|
if (bench_ena_rxtx0_random_data = '1') then
|
1315 |
|
|
sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_RX_PHYS_SIG_QUANT_DEPTH,seed1,seed2,random1);
|
1316 |
|
|
sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_RX_PHYS_SIG_QUANT_DEPTH,seed2,seed1,random2);
|
1317 |
|
|
bench_sti_rxtx0_rx_samples_i <= random1;
|
1318 |
|
|
bench_sti_rxtx0_rx_samples_q <= random2;
|
1319 |
|
|
end if;
|
1320 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_RX_CLK_PERIOD;
|
1321 |
|
|
end process;
|
1322 |
|
|
--=============================================================================
|
1323 |
|
|
-- Begin of bench_sti_rxtx0_wb_datap
|
1324 |
|
|
-- bench_sti_rxtx0_wb_random_dat generation
|
1325 |
|
|
--=============================================================================
|
1326 |
|
|
-- read: bench_ena_rxtx0_random_data
|
1327 |
|
|
-- write: bench_sti_rxtx0_wb_random_dat0
|
1328 |
|
|
-- r/w:
|
1329 |
|
|
BENCH_STI_RXTX0_WB_DATP : process
|
1330 |
|
|
variable seed1 : positive := CCSDS_RXTX_BENCH_SEED;
|
1331 |
|
|
variable seed2 : positive := CCSDS_RXTX_BENCH_SEED*2;
|
1332 |
|
|
variable random1 : std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_WB_DATA_BUS_SIZE-1 downto 0);
|
1333 |
|
|
begin
|
1334 |
|
|
if (bench_ena_rxtx0_random_data = '1') then
|
1335 |
|
|
sim_generate_random_std_logic_vector(CCSDS_RXTX_BENCH_RXTX0_WB_DATA_BUS_SIZE,seed1,seed2,random1);
|
1336 |
|
|
bench_sti_rxtx0_wb_random_dat <= random1;
|
1337 |
|
|
end if;
|
1338 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
1339 |
|
|
end process;
|
1340 |
|
|
--=============================================================================
|
1341 |
|
|
-- Begin of bufferrwp
|
1342 |
|
|
-- generation of buffer subsystem read-write unit-tests
|
1343 |
|
|
--=============================================================================
|
1344 |
|
|
-- read: bench_res_buffer0_buffer_empty, bench_res_buffer0_buffer_full, bench_res_buffer0_data, bench_res_buffer0_data_valid
|
1345 |
|
|
-- write: bench_sti_buffer0_data_valid, bench_sti_buffer0_next_data, bench_ena_buffer0_random_data
|
1346 |
|
|
-- r/w:
|
1347 |
|
|
BUFFERRWP : process
|
1348 |
|
|
type buffer_array is array (CCSDS_RXTX_BENCH_BUFFER0_SIZE downto 0) of std_logic_vector(CCSDS_RXTX_BENCH_BUFFER0_DATA_BUS_SIZE-1 downto 0);
|
1349 |
|
|
variable buffer_expected_stored_data: buffer_array := (others => (others => '0'));
|
1350 |
|
|
variable buffer_content_ok: std_logic := '1';
|
1351 |
|
|
begin
|
1352 |
|
|
-- let the system free run
|
1353 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
1354 |
|
|
-- default state tests:
|
1355 |
|
|
-- check buffer is empty
|
1356 |
|
|
if (bench_res_buffer0_buffer_empty = '1') then
|
1357 |
|
|
report "BUFFERRWP: OK - Default state - Buffer is empty" severity note;
|
1358 |
|
|
else
|
1359 |
|
|
report "BUFFERRWP: KO - Default state - Buffer is not empty" severity warning;
|
1360 |
|
|
end if;
|
1361 |
|
|
-- check buffer is not full
|
1362 |
|
|
if (bench_res_buffer0_buffer_full = '0')then
|
1363 |
|
|
report "BUFFERRWP: OK - Default state - Buffer is not full" severity note;
|
1364 |
|
|
else
|
1365 |
|
|
report "BUFFERRWP: KO - Default state - Buffer is full" severity warning;
|
1366 |
|
|
end if;
|
1367 |
|
|
-- let the system reset
|
1368 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_BUFFER_WAIT_DURATION);
|
1369 |
|
|
-- initial state tests:
|
1370 |
|
|
-- check buffer is empty
|
1371 |
|
|
if (bench_res_buffer0_buffer_empty = '1') then
|
1372 |
|
|
report "BUFFERRWP: OK - Initial state - Buffer is empty" severity note;
|
1373 |
|
|
else
|
1374 |
|
|
report "BUFFERRWP: KO - Initial state - Buffer is not empty" severity warning;
|
1375 |
|
|
end if;
|
1376 |
|
|
-- check buffer is not full
|
1377 |
|
|
if (bench_res_buffer0_buffer_full = '0')then
|
1378 |
|
|
report "BUFFERRWP: OK - Initial state - Buffer is not full" severity note;
|
1379 |
|
|
else
|
1380 |
|
|
report "BUFFERRWP: KO - Initial state - Buffer is full" severity warning;
|
1381 |
|
|
end if;
|
1382 |
|
|
-- behaviour tests:
|
1383 |
|
|
report "BUFFERRWP: START BUFFER READ-WRITE TESTS" severity note;
|
1384 |
|
|
-- ask for data
|
1385 |
|
|
bench_sti_buffer0_next_data <= '1';
|
1386 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD;
|
1387 |
|
|
if (bench_res_buffer0_data_valid = '0') then
|
1388 |
|
|
report "BUFFERRWP: OK - No data came out with an empty buffer" severity note;
|
1389 |
|
|
else
|
1390 |
|
|
report "BUFFERRWP: KO - Data came out - buffer is empty / incoherent" severity warning;
|
1391 |
|
|
end if;
|
1392 |
|
|
bench_sti_buffer0_next_data <= '0';
|
1393 |
|
|
bench_ena_buffer0_random_data <= '1';
|
1394 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD;
|
1395 |
|
|
-- store data
|
1396 |
|
|
bench_sti_buffer0_data_valid <= '1';
|
1397 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD/2;
|
1398 |
|
|
buffer_expected_stored_data(0) := bench_sti_buffer0_data;
|
1399 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD/2;
|
1400 |
|
|
bench_sti_buffer0_data_valid <= '0';
|
1401 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD;
|
1402 |
|
|
if (bench_res_buffer0_buffer_empty = '0') then
|
1403 |
|
|
report "BUFFERRWP: OK - Buffer is not empty" severity note;
|
1404 |
|
|
else
|
1405 |
|
|
report "BUFFERRWP: KO - Buffer should not be empty" severity warning;
|
1406 |
|
|
end if;
|
1407 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD;
|
1408 |
|
|
-- get data
|
1409 |
|
|
bench_sti_buffer0_next_data <= '1';
|
1410 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD;
|
1411 |
|
|
bench_sti_buffer0_next_data <= '0';
|
1412 |
|
|
if (bench_res_buffer0_data_valid = '1') then
|
1413 |
|
|
report "BUFFERRWP: OK - Data valid signal received" severity note;
|
1414 |
|
|
else
|
1415 |
|
|
report "BUFFERRWP: KO - Data valid signal not received" severity warning;
|
1416 |
|
|
end if;
|
1417 |
|
|
if (bench_res_buffer0_data = buffer_expected_stored_data(0)) then
|
1418 |
|
|
report "BUFFERRWP: OK - Received value is equal to previously stored value" severity note;
|
1419 |
|
|
else
|
1420 |
|
|
report "BUFFERRWP: KO - Received value is different from previously stored value" severity warning;
|
1421 |
|
|
report "Received value:" severity note;
|
1422 |
|
|
for i in 0 to bench_res_buffer0_data'length-1 loop
|
1423 |
|
|
report std_logic'image(bench_res_buffer0_data(i));
|
1424 |
|
|
end loop;
|
1425 |
|
|
report "Expected value:" severity note;
|
1426 |
|
|
for i in 0 to buffer_expected_stored_data(0)'length-1 loop
|
1427 |
|
|
report std_logic'image(buffer_expected_stored_data(0)(i));
|
1428 |
|
|
end loop;
|
1429 |
|
|
end if;
|
1430 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD;
|
1431 |
|
|
if (bench_res_buffer0_buffer_empty = '1') then
|
1432 |
|
|
report "BUFFERRWP: OK - Buffer is empty after reading value" severity note;
|
1433 |
|
|
else
|
1434 |
|
|
report "BUFFERRWP: KO - Buffer is not empty" severity warning;
|
1435 |
|
|
end if;
|
1436 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD;
|
1437 |
|
|
-- store lot of data / make the buffer full
|
1438 |
|
|
bench_sti_buffer0_data_valid <= '1';
|
1439 |
|
|
for i in 0 to CCSDS_RXTX_BENCH_BUFFER0_SIZE loop
|
1440 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD/2;
|
1441 |
|
|
buffer_expected_stored_data(i) := bench_sti_buffer0_data;
|
1442 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD/2;
|
1443 |
|
|
if (bench_res_buffer0_buffer_full = '1') then
|
1444 |
|
|
if (i < CCSDS_RXTX_BENCH_BUFFER0_SIZE) then
|
1445 |
|
|
report "BUFFERRWP: KO - Buffer is full too early - loop: " & integer'image(i) & " value of the buffer array" severity warning;
|
1446 |
|
|
else
|
1447 |
|
|
report "BUFFERRWP: OK - Buffer is full after all write operations" severity note;
|
1448 |
|
|
end if;
|
1449 |
|
|
else
|
1450 |
|
|
if (i = CCSDS_RXTX_BENCH_BUFFER0_SIZE) then
|
1451 |
|
|
report "BUFFERRWP: KO - Buffer is not full after all write operations" severity note;
|
1452 |
|
|
end if;
|
1453 |
|
|
end if;
|
1454 |
|
|
end loop;
|
1455 |
|
|
bench_sti_buffer0_data_valid <= '0';
|
1456 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD;
|
1457 |
|
|
bench_ena_buffer0_random_data <= '0';
|
1458 |
|
|
-- read all data / make the buffer empty
|
1459 |
|
|
bench_sti_buffer0_next_data <= '1';
|
1460 |
|
|
for i in 0 to CCSDS_RXTX_BENCH_BUFFER0_SIZE loop
|
1461 |
|
|
wait for CCSDS_RXTX_BENCH_BUFFER0_CLK_PERIOD;
|
1462 |
|
|
if (buffer_expected_stored_data(i) /= bench_res_buffer0_data) then
|
1463 |
|
|
if (i < CCSDS_RXTX_BENCH_BUFFER0_SIZE) then
|
1464 |
|
|
report "BUFFERRWP: KO - Received value is different from previously stored value - loop: " & integer'image(i) severity warning;
|
1465 |
|
|
buffer_content_ok := '0';
|
1466 |
|
|
end if;
|
1467 |
|
|
end if;
|
1468 |
|
|
if (i = CCSDS_RXTX_BENCH_BUFFER0_SIZE) and (buffer_content_ok = '1') then
|
1469 |
|
|
report "BUFFERRWP: OK - Received values are all equal to previously stored values" severity note;
|
1470 |
|
|
end if;
|
1471 |
|
|
if (bench_res_buffer0_data_valid = '0') then
|
1472 |
|
|
if (i < CCSDS_RXTX_BENCH_BUFFER0_SIZE) then
|
1473 |
|
|
report "BUFFERRWP: KO - Data valid signal not received - loop: " & integer'image(i) severity warning;
|
1474 |
|
|
end if;
|
1475 |
|
|
end if;
|
1476 |
|
|
if (bench_res_buffer0_buffer_empty = '1') then
|
1477 |
|
|
if (i < CCSDS_RXTX_BENCH_BUFFER0_SIZE) then
|
1478 |
|
|
report "BUFFERRWP: KO - Data empty signal received too early - loop: " & integer'image(i) severity warning;
|
1479 |
|
|
else
|
1480 |
|
|
report "BUFFERRWP: OK - Buffer is empty after all read operations" severity note;
|
1481 |
|
|
end if;
|
1482 |
|
|
else
|
1483 |
|
|
if (i = CCSDS_RXTX_BENCH_BUFFER0_SIZE) then
|
1484 |
|
|
report "BUFFERRWP: KO - Buffer is not empty after all read operations" severity warning;
|
1485 |
|
|
end if;
|
1486 |
|
|
end if;
|
1487 |
|
|
end loop;
|
1488 |
|
|
bench_sti_buffer0_next_data <= '0';
|
1489 |
|
|
-- final state tests:
|
1490 |
|
|
-- check buffer is empty
|
1491 |
|
|
if (bench_res_buffer0_buffer_empty = '1') then
|
1492 |
|
|
report "BUFFERRWP: OK - Final state - Buffer is empty" severity note;
|
1493 |
|
|
else
|
1494 |
|
|
report "BUFFERRWP: KO - Final state - Buffer is not empty" severity warning;
|
1495 |
|
|
end if;
|
1496 |
|
|
-- check buffer is not full
|
1497 |
|
|
if (bench_res_buffer0_buffer_full = '0')then
|
1498 |
|
|
report "BUFFERRWP: OK - Final state - Buffer is not full" severity note;
|
1499 |
|
|
else
|
1500 |
|
|
report "BUFFERRWP: KO - Final state - Buffer is full" severity warning;
|
1501 |
|
|
end if;
|
1502 |
|
|
report "BUFFERRWP: END BUFFER READ-WRITE TESTS" severity note;
|
1503 |
|
|
-- do nothing
|
1504 |
|
|
wait;
|
1505 |
|
|
end process;
|
1506 |
|
|
--=============================================================================
|
1507 |
|
|
-- Begin of coderconvp
|
1508 |
|
|
-- generation of coder convolutional subsystem unit-tests
|
1509 |
|
|
--=============================================================================
|
1510 |
|
|
-- read: bench_res_coder_conv0_dat, bench_res_coder_conv0_dat_val, bench_res_coder_conv0_bus
|
1511 |
|
|
-- write: bench_ena_coder_conv0_random_data, bench_sti_coder_conv0_dat_val
|
1512 |
|
|
-- r/w:
|
1513 |
|
|
CODERCONVP : process
|
1514 |
|
|
begin
|
1515 |
|
|
-- let the system free run
|
1516 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
1517 |
|
|
-- default state tests:
|
1518 |
|
|
if (bench_res_coder_conv0_dat_val = '1') then
|
1519 |
|
|
report "CODERCONVP: KO - Default state - Convolutional coder output data is valid" severity warning;
|
1520 |
|
|
else
|
1521 |
|
|
report "CODERCONVP: OK - Default state - Convolutional coder output data is not valid" severity note;
|
1522 |
|
|
end if;
|
1523 |
|
|
-- let the system reset
|
1524 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_CODER_CONV_WAIT_DURATION);
|
1525 |
|
|
-- initial state tests:
|
1526 |
|
|
if (bench_res_coder_conv0_dat_val = '1') then
|
1527 |
|
|
report "CODERCONVP: KO - Initial state - Convolutional coder output data is valid" severity warning;
|
1528 |
|
|
else
|
1529 |
|
|
report "CODERCONVP: OK - Initial state - Convolutional coder output data is not valid" severity note;
|
1530 |
|
|
end if;
|
1531 |
|
|
-- behaviour tests:
|
1532 |
|
|
report "CODERCONVP: START CONVOLUTIONAL CODER TESTS" severity note;
|
1533 |
|
|
bench_ena_coder_conv0_random_data <= '1';
|
1534 |
|
|
wait for CCSDS_RXTX_BENCH_CODER_CONV0_CLK_PERIOD;
|
1535 |
|
|
for coder_current_check in 0 to CCSDS_RXTX_BENCH_CODER_CONV0_WORDS_NUMBER-1 loop
|
1536 |
|
|
for coder_current_bit in 0 to CCSDS_RXTX_BENCH_CODER_CONV0_DATA_BUS_SIZE loop
|
1537 |
|
|
if (coder_current_bit = 0) then
|
1538 |
|
|
bench_sti_coder_conv0_dat_val <= '1';
|
1539 |
|
|
else
|
1540 |
|
|
bench_sti_coder_conv0_dat_val <= '0';
|
1541 |
|
|
end if;
|
1542 |
|
|
wait for CCSDS_RXTX_BENCH_CODER_CONV0_CLK_PERIOD;
|
1543 |
|
|
end loop;
|
1544 |
|
|
if (bench_res_coder_conv0_dat_val = '0') then
|
1545 |
|
|
report "CODERCONVP: KO - Convolutional coder output data is not valid" severity warning;
|
1546 |
|
|
else
|
1547 |
|
|
if (bench_res_coder_conv0_dat = CCSDS_RXTX_BENCH_CODER_CONV0_OUTPUT) then
|
1548 |
|
|
report "CODERCONVP: OK - Convolutional coder output data match" severity note;
|
1549 |
|
|
else
|
1550 |
|
|
report "CODERCONVP: KO - Convolutional coder output data doesn't match" severity warning;
|
1551 |
|
|
end if;
|
1552 |
|
|
end if;
|
1553 |
|
|
end loop;
|
1554 |
|
|
bench_ena_coder_conv0_random_data <= '0';
|
1555 |
|
|
wait for CCSDS_RXTX_BENCH_CODER_CONV0_CLK_PERIOD;
|
1556 |
|
|
-- final state tests:
|
1557 |
|
|
if (bench_res_coder_conv0_dat_val = '1') then
|
1558 |
|
|
report "CODERCONVP: KO - Final state - Convolutional coder output data is valid" severity warning;
|
1559 |
|
|
else
|
1560 |
|
|
report "CODERCONVP: OK - Final state - Convolutional coder output data is not valid" severity note;
|
1561 |
|
|
end if;
|
1562 |
|
|
report "CODERCONVP: END CONVOLUTIONAL CODER TESTS" severity note;
|
1563 |
|
|
-- do nothing
|
1564 |
|
|
wait;
|
1565 |
|
|
end process;
|
1566 |
|
|
--=============================================================================
|
1567 |
|
|
-- Begin of coderdiffp
|
1568 |
|
|
-- generation of coder differential subsystem unit-tests
|
1569 |
|
|
--=============================================================================
|
1570 |
|
|
-- read: bench_res_coder_diff0_dat, bench_res_coder_diff0_dat_val
|
1571 |
|
|
-- write: bench_ena_coder_diff0_random_data, bench_sti_coder_diff0_dat_val
|
1572 |
|
|
-- r/w:
|
1573 |
|
|
CODERDIFFP : process
|
1574 |
|
|
begin
|
1575 |
|
|
-- let the system free run
|
1576 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
1577 |
|
|
-- default state tests:
|
1578 |
|
|
if (bench_res_coder_diff0_dat_val = '1') then
|
1579 |
|
|
report "CODERDIFFP: KO - Default state - Differential coder output data is valid" severity warning;
|
1580 |
|
|
else
|
1581 |
|
|
report "CODERDIFFP: OK - Default state - Differential coder output data is not valid" severity note;
|
1582 |
|
|
end if;
|
1583 |
|
|
-- let the system reset
|
1584 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_CODER_DIFF_WAIT_DURATION);
|
1585 |
|
|
-- initial state tests:
|
1586 |
|
|
if (bench_res_coder_diff0_dat_val = '1') then
|
1587 |
|
|
report "CODERDIFFP: KO - Initial state - Differential coder output data is valid" severity warning;
|
1588 |
|
|
else
|
1589 |
|
|
report "CODERDIFFP: OK - Initial state - Differential coder output data is not valid" severity note;
|
1590 |
|
|
end if;
|
1591 |
|
|
-- behaviour tests:
|
1592 |
|
|
report "CODERDIFFP: START DIFFERENTIAL CODER TESTS" severity note;
|
1593 |
|
|
bench_ena_coder_diff0_random_data <= '1';
|
1594 |
|
|
wait for CCSDS_RXTX_BENCH_CODER_DIFF0_CLK_PERIOD;
|
1595 |
|
|
bench_sti_coder_diff0_dat_val <= '1';
|
1596 |
|
|
wait for CCSDS_RXTX_BENCH_CODER_DIFF0_CLK_PERIOD*CCSDS_RXTX_BENCH_CODER_DIFF0_WORDS_NUMBER;
|
1597 |
|
|
bench_sti_coder_diff0_dat_val <= '0';
|
1598 |
|
|
bench_ena_coder_diff0_random_data <= '0';
|
1599 |
|
|
wait for CCSDS_RXTX_BENCH_CODER_DIFF0_CLK_PERIOD;
|
1600 |
|
|
-- final state tests:
|
1601 |
|
|
if (bench_res_coder_diff0_dat_val = '1') then
|
1602 |
|
|
report "CODERDIFFP: KO - Final state - Differential coder output data is valid" severity warning;
|
1603 |
|
|
else
|
1604 |
|
|
report "CODERDIFFP: OK - Final state - Differential coder output data is not valid" severity note;
|
1605 |
|
|
end if;
|
1606 |
|
|
report "CODERDIFFP: END DIFFERENTIAL CODER TESTS" severity note;
|
1607 |
|
|
-- do nothing
|
1608 |
|
|
wait;
|
1609 |
|
|
end process;
|
1610 |
|
|
--=============================================================================
|
1611 |
|
|
-- Begin of crcp
|
1612 |
|
|
-- generation of crc subsystem unit-tests
|
1613 |
|
|
--=============================================================================
|
1614 |
|
|
-- read: bench_res_crc0_data, bench_res_crc0_data_valid
|
1615 |
|
|
-- write: bench_sti_crc0_nxt, bench_sti_crc0_data, bench_ena_crc0_random_data
|
1616 |
|
|
-- r/w:
|
1617 |
|
|
CRCP : process
|
1618 |
|
|
variable crc_random_data_sent: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE*8-1 downto 0) := (others => '0');
|
1619 |
|
|
variable crc_random_data_crc: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_LENGTH*8-1 downto 0) := (others => '1');
|
1620 |
|
|
variable crc_random_data_crc_check: std_logic_vector(CCSDS_RXTX_BENCH_CRC0_LENGTH*8-1 downto 0) := (others => '0');
|
1621 |
|
|
variable crc_check_ok: std_logic := '1';
|
1622 |
|
|
begin
|
1623 |
|
|
-- let the system free run
|
1624 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
1625 |
|
|
-- default state tests:
|
1626 |
|
|
if (bench_res_crc0_data_valid = '1') then
|
1627 |
|
|
report "CRCP: KO - Default state - CRC output data is valid" severity warning;
|
1628 |
|
|
else
|
1629 |
|
|
report "CRCP: OK - Default state - CRC output data is not valid" severity note;
|
1630 |
|
|
end if;
|
1631 |
|
|
-- let the system reset
|
1632 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_CRC_WAIT_DURATION);
|
1633 |
|
|
-- initial state tests:
|
1634 |
|
|
if (bench_res_crc0_data_valid = '1') then
|
1635 |
|
|
report "CRCP: KO - Initial state - CRC output data is valid" severity warning;
|
1636 |
|
|
else
|
1637 |
|
|
report "CRCP: OK - Initial state - CRC output data is not valid" severity note;
|
1638 |
|
|
end if;
|
1639 |
|
|
-- behaviour tests:
|
1640 |
|
|
report "CRCP: START CRC COMPUTATION TESTS" severity note;
|
1641 |
|
|
-- present crc test data
|
1642 |
|
|
bench_sti_crc0_data <= CCSDS_RXTX_BENCH_CRC0_DATA;
|
1643 |
|
|
-- no specific padding done
|
1644 |
|
|
bench_sti_crc0_padding_data_valid <= '0';
|
1645 |
|
|
-- send next crc signal
|
1646 |
|
|
bench_sti_crc0_nxt <= '1';
|
1647 |
|
|
-- wait for one clk
|
1648 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD;
|
1649 |
|
|
-- stop next signal
|
1650 |
|
|
bench_sti_crc0_nxt <= '0';
|
1651 |
|
|
-- remove crc test data
|
1652 |
|
|
bench_sti_crc0_data <= (others => '0');
|
1653 |
|
|
if (bench_res_crc0_busy = '0') then
|
1654 |
|
|
report "CRCP: KO - CRC is not busy" severity warning;
|
1655 |
|
|
end if;
|
1656 |
|
|
-- wait for result
|
1657 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD*(CCSDS_RXTX_BENCH_CRC0_DATA'length+CCSDS_RXTX_BENCH_CRC0_LENGTH*8+1);
|
1658 |
|
|
if (bench_res_crc0_crc = CCSDS_RXTX_BENCH_CRC0_RESULT) and (bench_res_crc0_data_valid = '1') and (bench_res_crc0_data = CCSDS_RXTX_BENCH_CRC0_DATA) then
|
1659 |
|
|
report "CRCP: OK - Output CRC is conform to expectations" severity note;
|
1660 |
|
|
else
|
1661 |
|
|
report "CRCP: KO - Output CRC is different from expectations" severity warning;
|
1662 |
|
|
report "Received value:" severity note;
|
1663 |
|
|
for i in 0 to bench_res_crc0_data'length-1 loop
|
1664 |
|
|
report std_logic'image(bench_res_crc0_data(i));
|
1665 |
|
|
end loop;
|
1666 |
|
|
report "Expected value:" severity note;
|
1667 |
|
|
for i in 0 to CCSDS_RXTX_BENCH_CRC0_RESULT'length-1 loop
|
1668 |
|
|
report std_logic'image(CCSDS_RXTX_BENCH_CRC0_RESULT(i));
|
1669 |
|
|
end loop;
|
1670 |
|
|
end if;
|
1671 |
|
|
bench_ena_crc0_random_data <= '1';
|
1672 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD;
|
1673 |
|
|
for crc_current_check in 0 to CCSDS_RXTX_BENCH_CRC0_RANDOM_CHECK_NUMBER-1 loop
|
1674 |
|
|
-- present crc random data + store associated crc
|
1675 |
|
|
-- send next crc signal
|
1676 |
|
|
bench_sti_crc0_random_nxt <= '1';
|
1677 |
|
|
-- no specific padding done
|
1678 |
|
|
bench_sti_crc0_random_padding_data_valid <= '0';
|
1679 |
|
|
-- wait for one clk and store random data sent
|
1680 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD/2;
|
1681 |
|
|
crc_random_data_sent := bench_sti_crc0_random_data;
|
1682 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD/2;
|
1683 |
|
|
-- stop next signal
|
1684 |
|
|
bench_ena_crc0_random_data <= '0';
|
1685 |
|
|
bench_sti_crc0_random_nxt <= '0';
|
1686 |
|
|
if (bench_res_crc0_random_busy = '0') then
|
1687 |
|
|
report "CRCP: KO - random data CRC is not busy" severity warning;
|
1688 |
|
|
end if;
|
1689 |
|
|
-- wait for result
|
1690 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD*(CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE*8+CCSDS_RXTX_BENCH_CRC0_LENGTH*8+1);
|
1691 |
|
|
if (bench_res_crc0_random_data_valid = '1') then
|
1692 |
|
|
-- store crc
|
1693 |
|
|
crc_random_data_crc := bench_res_crc0_random_crc;
|
1694 |
|
|
else
|
1695 |
|
|
report "CRCP: KO - random data output CRC is not valid" severity warning;
|
1696 |
|
|
end if;
|
1697 |
|
|
-- present crc random data
|
1698 |
|
|
bench_sti_crc0_check_data <= crc_random_data_sent;
|
1699 |
|
|
-- present crc as padding value
|
1700 |
|
|
bench_sti_crc0_check_padding_data <= crc_random_data_crc;
|
1701 |
|
|
bench_sti_crc0_check_padding_data_valid <= '1';
|
1702 |
|
|
-- send next crc signal
|
1703 |
|
|
bench_sti_crc0_check_nxt <= '1';
|
1704 |
|
|
-- wait for one clk
|
1705 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD;
|
1706 |
|
|
-- stop next signal
|
1707 |
|
|
bench_sti_crc0_check_nxt <= '0';
|
1708 |
|
|
-- stop padding signal
|
1709 |
|
|
bench_sti_crc0_check_padding_data_valid <= '0';
|
1710 |
|
|
if (bench_res_crc0_check_busy = '0') then
|
1711 |
|
|
report "CRCP: KO - Random data checker CRC is not busy" severity warning;
|
1712 |
|
|
end if;
|
1713 |
|
|
-- wait for result
|
1714 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD*(CCSDS_RXTX_BENCH_CRC0_RANDOM_DATA_BUS_SIZE*8+CCSDS_RXTX_BENCH_CRC0_LENGTH*8+1);
|
1715 |
|
|
if (bench_res_crc0_check_data_valid = '1') then
|
1716 |
|
|
-- check output crc resulting is null
|
1717 |
|
|
if (bench_res_crc0_check_crc = crc_random_data_crc_check) and (bench_res_crc0_check_data = crc_random_data_sent) then
|
1718 |
|
|
if (crc_current_check = CCSDS_RXTX_BENCH_CRC0_RANDOM_CHECK_NUMBER-1) and (crc_check_ok = '1') then
|
1719 |
|
|
report "CRCP: OK - Random data checker output CRCs are all null" severity note;
|
1720 |
|
|
end if;
|
1721 |
|
|
else
|
1722 |
|
|
crc_check_ok := '0';
|
1723 |
|
|
report "CRCP: KO - Random data checker output CRC is not null - loop " & integer'image(crc_current_check) severity warning;
|
1724 |
|
|
report "Received value:" severity warning;
|
1725 |
|
|
for i in 0 to bench_res_crc0_check_data'length-1 loop
|
1726 |
|
|
report std_logic'image(bench_res_crc0_check_data(i)) severity warning;
|
1727 |
|
|
end loop;
|
1728 |
|
|
end if;
|
1729 |
|
|
else
|
1730 |
|
|
report "CRCP: KO - Output CRC checker is not valid" severity warning;
|
1731 |
|
|
end if;
|
1732 |
|
|
bench_ena_crc0_random_data <= '1';
|
1733 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD;
|
1734 |
|
|
end loop;
|
1735 |
|
|
bench_ena_crc0_random_data <= '0';
|
1736 |
|
|
wait for CCSDS_RXTX_BENCH_CRC0_CLK_PERIOD;
|
1737 |
|
|
-- final state tests:
|
1738 |
|
|
if (bench_res_crc0_data_valid = '1') then
|
1739 |
|
|
report "CRCP: KO - Final state - CRC output data is valid" severity warning;
|
1740 |
|
|
else
|
1741 |
|
|
report "CRCP: OK - Final state - CRC output data is not valid" severity note;
|
1742 |
|
|
end if;
|
1743 |
|
|
report "CRCP: END CRC COMPUTATION TESTS" severity note;
|
1744 |
|
|
-- do nothing
|
1745 |
|
|
wait;
|
1746 |
|
|
end process;
|
1747 |
|
|
--=============================================================================
|
1748 |
|
|
-- Begin of filterp
|
1749 |
|
|
-- generation of filter subsystem unit-tests
|
1750 |
|
|
--=============================================================================
|
1751 |
|
|
-- read:
|
1752 |
|
|
-- write:
|
1753 |
|
|
-- r/w:
|
1754 |
|
|
FILTERP : process
|
1755 |
|
|
variable samples_csv_output: line;
|
1756 |
|
|
variable samples_hex_output: line;
|
1757 |
|
|
variable samples_hex_i_output: line;
|
1758 |
|
|
variable samples_hex_q_output: line;
|
1759 |
|
|
begin
|
1760 |
|
|
-- let the system free run
|
1761 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
1762 |
|
|
-- default state tests:
|
1763 |
|
|
if (bench_res_filter0_sam_val = '0') then
|
1764 |
|
|
report "FILTERP: OK - Default state - Output samples are not valid" severity note;
|
1765 |
|
|
else
|
1766 |
|
|
report "FILTERP: KO - Default state - Output samples are valid" severity warning;
|
1767 |
|
|
end if;
|
1768 |
|
|
-- let the system reset
|
1769 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_FILTER_WAIT_DURATION);
|
1770 |
|
|
-- initial state tests:
|
1771 |
|
|
-- default state tests:
|
1772 |
|
|
if (bench_res_filter0_sam_val = '0') then
|
1773 |
|
|
report "FILTERP: OK - Initial state - Output samples are not valid" severity note;
|
1774 |
|
|
else
|
1775 |
|
|
report "FILTERP: KO - Initial state - Output samples are valid" severity warning;
|
1776 |
|
|
end if;
|
1777 |
|
|
-- behaviour tests:
|
1778 |
|
|
report "FILTERP: START FILTER TESTS" severity note;
|
1779 |
|
|
if (CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_ENABLE = true) then
|
1780 |
|
|
write(samples_csv_output, string'("I samples;Q samples - quantized on " & integer'image(CCSDS_RXTX_BENCH_FILTER0_SIG_QUANT_DEPTH) & " bits / Big-Endian (MSB first) ASCII hexa coded"));
|
1781 |
|
|
writeline(CCSDS_RXTX_BENCH_FILTER0_OUTPUT_CSV_IQ_FILE, samples_csv_output);
|
1782 |
|
|
end if;
|
1783 |
|
|
bench_ena_filter0_random_data <= '1';
|
1784 |
|
|
wait for CCSDS_RXTX_BENCH_FILTER0_MAPPER_DATA_CLK_PERIOD;
|
1785 |
|
|
bench_sti_filter0_mapper_dat_val <= '1';
|
1786 |
|
|
wait for CCSDS_RXTX_BENCH_FILTER0_BITS_PER_SYMBOL*CCSDS_RXTX_BENCH_FILTER0_MAPPER_DATA_CLK_PERIOD*CCSDS_RXTX_BENCH_FILTER0_BITS_PER_SYMBOL/CCSDS_RXTX_BENCH_FILTER0_MODULATION_TYPE;
|
1787 |
|
|
if (CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_ENABLE = true) then
|
1788 |
|
|
for i in 0 to 200 loop
|
1789 |
|
|
wait for CCSDS_RXTX_BENCH_FILTER0_CLK_PERIOD;
|
1790 |
|
|
if (bench_res_filter0_sam_val = '1') then
|
1791 |
|
|
write(samples_csv_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_i) & ";");
|
1792 |
|
|
write(samples_csv_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_q));
|
1793 |
|
|
write(samples_hex_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_i));
|
1794 |
|
|
write(samples_hex_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_q));
|
1795 |
|
|
writeline(CCSDS_RXTX_BENCH_FILTER0_OUTPUT_CSV_IQ_FILE, samples_csv_output);
|
1796 |
|
|
writeline(CCSDS_RXTX_BENCH_FILTER0_OUTPUT_HEX_IQ_FILE, samples_hex_output);
|
1797 |
|
|
write(samples_hex_i_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_i));
|
1798 |
|
|
write(samples_hex_q_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_q));
|
1799 |
|
|
writeline(CCSDS_RXTX_BENCH_FILTER0_OUTPUT_HEX_I_FILE, samples_hex_i_output);
|
1800 |
|
|
writeline(CCSDS_RXTX_BENCH_FILTER0_OUTPUT_HEX_Q_FILE, samples_hex_q_output);
|
1801 |
|
|
else
|
1802 |
|
|
report "FILTERP: KO - Output samples are not valid" severity warning;
|
1803 |
|
|
end if;
|
1804 |
|
|
end loop;
|
1805 |
|
|
else
|
1806 |
|
|
wait for 200*CCSDS_RXTX_BENCH_FILTER0_CLK_PERIOD;
|
1807 |
|
|
end if;
|
1808 |
|
|
if (bench_res_filter0_sam_val = '1') then
|
1809 |
|
|
report "FILTERP: OK - Output samples are valid" severity note;
|
1810 |
|
|
else
|
1811 |
|
|
report "FILTERP: KO - Output samples are not valid" severity warning;
|
1812 |
|
|
end if;
|
1813 |
|
|
if (CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_ENABLE = true) then
|
1814 |
|
|
for i in 0 to CCSDS_RXTX_BENCH_FILTER0_SYMBOL_WORDS_NUMBER-1 loop
|
1815 |
|
|
for j in 0 to CCSDS_RXTX_BENCH_FILTER0_MAPPER_CLK_PERIOD/CCSDS_RXTX_BENCH_FILTER0_CLK_PERIOD-1 loop
|
1816 |
|
|
wait for CCSDS_RXTX_BENCH_FILTER0_CLK_PERIOD;
|
1817 |
|
|
if (bench_res_filter0_sam_val = '1') then
|
1818 |
|
|
write(samples_csv_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_i) & ";");
|
1819 |
|
|
write(samples_csv_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_q));
|
1820 |
|
|
write(samples_hex_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_i));
|
1821 |
|
|
write(samples_hex_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_q));
|
1822 |
|
|
writeline(CCSDS_RXTX_BENCH_FILTER0_OUTPUT_CSV_IQ_FILE, samples_csv_output);
|
1823 |
|
|
writeline(CCSDS_RXTX_BENCH_FILTER0_OUTPUT_HEX_IQ_FILE, samples_hex_output);
|
1824 |
|
|
write(samples_hex_i_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_i));
|
1825 |
|
|
write(samples_hex_q_output, convert_std_logic_vector_to_hexa_ascii(bench_res_filter0_sam_q));
|
1826 |
|
|
writeline(CCSDS_RXTX_BENCH_FILTER0_OUTPUT_HEX_I_FILE, samples_hex_i_output);
|
1827 |
|
|
writeline(CCSDS_RXTX_BENCH_FILTER0_OUTPUT_HEX_Q_FILE, samples_hex_q_output);
|
1828 |
|
|
else
|
1829 |
|
|
report "FILTERP: KO - Output samples are not valid" severity warning;
|
1830 |
|
|
end if;
|
1831 |
|
|
end loop;
|
1832 |
|
|
end loop;
|
1833 |
|
|
else
|
1834 |
|
|
wait for CCSDS_RXTX_BENCH_FILTER0_MAPPER_CLK_PERIOD*CCSDS_RXTX_BENCH_FILTER0_SYMBOL_WORDS_NUMBER;
|
1835 |
|
|
end if;
|
1836 |
|
|
bench_sti_filter0_mapper_dat_val <= '0';
|
1837 |
|
|
bench_ena_filter0_random_data <= '0';
|
1838 |
|
|
wait for CCSDS_RXTX_BENCH_FILTER0_MAPPER_CLK_PERIOD*12;
|
1839 |
|
|
-- final state tests:
|
1840 |
|
|
if (bench_res_filter0_sam_val = '0') then
|
1841 |
|
|
report "FILTERP: OK - Final state - Output samples are not valid" severity note;
|
1842 |
|
|
else
|
1843 |
|
|
report "FILTERP: KO - Final state - Output samples are valid" severity warning;
|
1844 |
|
|
end if;
|
1845 |
|
|
report "FILTERP: END FILTER TESTS" severity note;
|
1846 |
|
|
-- do nothing
|
1847 |
|
|
wait;
|
1848 |
|
|
end process;
|
1849 |
|
|
--=============================================================================
|
1850 |
|
|
-- Begin of framerp
|
1851 |
|
|
-- generation of framer subsystem unit-tests
|
1852 |
|
|
--=============================================================================
|
1853 |
|
|
-- read: bench_res_framer0_data0, bench_res_framer0_data_valid0
|
1854 |
|
|
-- write: bench_ena_framer0_random_data
|
1855 |
|
|
-- r/w:
|
1856 |
|
|
FRAMERP : process
|
1857 |
|
|
type data_array is array (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8/CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE-1 downto 0) of std_logic_vector(CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE-1 downto 0);
|
1858 |
|
|
type frame_array is array (CCSDS_RXTX_BENCH_FRAMER0_FRAME_NUMBER-1 downto 0) of data_array;
|
1859 |
|
|
variable framer_expected_data: frame_array := (others => (others => (others => '0')));
|
1860 |
|
|
variable frame_content_ok: std_logic := '1';
|
1861 |
|
|
variable nb_data: integer;
|
1862 |
|
|
variable FRAME_OUTPUT_CYCLES_REQUIRED: integer;
|
1863 |
|
|
variable FRAME_PROCESSING_CYCLES_REQUIRED: integer := (CCSDS_RXTX_BENCH_FRAMER0_HEADER_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8+1;
|
1864 |
|
|
constant FRAME_ACQUISITION_CYCLES: integer := (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8-CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE)*CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO/CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE + 1;
|
1865 |
|
|
constant FRAME_REPETITION_CYCLES: integer := CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8*CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO/CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE;
|
1866 |
|
|
constant FRAME_ACQUISITION_CYCLES_IDLE: integer := FRAME_REPETITION_CYCLES - FRAME_ACQUISITION_CYCLES;
|
1867 |
|
|
begin
|
1868 |
|
|
if (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8 = CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE) and (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO = 1) then
|
1869 |
|
|
FRAME_OUTPUT_CYCLES_REQUIRED := (CCSDS_RXTX_BENCH_FRAMER0_HEADER_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8+6;
|
1870 |
|
|
else
|
1871 |
|
|
FRAME_OUTPUT_CYCLES_REQUIRED := (CCSDS_RXTX_BENCH_FRAMER0_HEADER_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8+5;
|
1872 |
|
|
end if;
|
1873 |
|
|
-- let the system free run
|
1874 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
1875 |
|
|
-- default state tests:
|
1876 |
|
|
-- let the system reset
|
1877 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_FRAMER_WAIT_DURATION);
|
1878 |
|
|
report "FRAMERP: START FRAMER TESTS" severity note;
|
1879 |
|
|
-- initial state tests:
|
1880 |
|
|
bench_ena_framer0_random_data <= '1';
|
1881 |
|
|
-- check output data is valid and idle only data found
|
1882 |
|
|
if ((CCSDS_RXTX_BENCH_START_FRAMER_WAIT_DURATION/CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD) < FRAME_OUTPUT_CYCLES_REQUIRED) then
|
1883 |
|
|
wait for (FRAME_OUTPUT_CYCLES_REQUIRED+1 - ((CCSDS_RXTX_BENCH_START_FRAMER_WAIT_DURATION/CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD) mod FRAME_OUTPUT_CYCLES_REQUIRED))*CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD;
|
1884 |
|
|
else
|
1885 |
|
|
wait for (FRAME_REPETITION_CYCLES+1 - (((CCSDS_RXTX_BENCH_START_FRAMER_WAIT_DURATION/CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD) - FRAME_OUTPUT_CYCLES_REQUIRED) mod (FRAME_REPETITION_CYCLES)))*CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD;
|
1886 |
|
|
end if;
|
1887 |
|
|
if bench_res_framer0_data_valid = '1' then
|
1888 |
|
|
if (bench_res_framer0_data((CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8+10 downto (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8) = "11111111110") then
|
1889 |
|
|
report "FRAMERP: OK - Initial state - Output frame is valid and Only Idle Data flag found" severity note;
|
1890 |
|
|
else
|
1891 |
|
|
report "FRAMERP: KO - Initial state - Output frame is valid without sent data - Only Idle Flag not found" severity warning;
|
1892 |
|
|
end if;
|
1893 |
|
|
else
|
1894 |
|
|
report "FRAMERP: KO - Initial state - Output frame is not valid without sent data" severity warning;
|
1895 |
|
|
end if;
|
1896 |
|
|
if (bench_res_framer0_dat_nxt = '0') then
|
1897 |
|
|
report "FRAMERP: KO - Initial state - Next data not requested" severity warning;
|
1898 |
|
|
else
|
1899 |
|
|
report "FRAMERP: OK - Initial state - Next data requested" severity note;
|
1900 |
|
|
end if;
|
1901 |
|
|
-- behaviour tests:
|
1902 |
|
|
-- align the end of data to the beginning of a new frame processing cycle
|
1903 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD*(FRAME_REPETITION_CYCLES - (FRAME_OUTPUT_CYCLES_REQUIRED mod FRAME_REPETITION_CYCLES) + FRAME_ACQUISITION_CYCLES_IDLE);
|
1904 |
|
|
-- send data for 1 frame
|
1905 |
|
|
for i in 0 to (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8/CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE)-1 loop
|
1906 |
|
|
bench_sti_framer0_data_valid <= '1';
|
1907 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD/2;
|
1908 |
|
|
framer_expected_data(0)(i) := bench_sti_framer0_data;
|
1909 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD/2;
|
1910 |
|
|
if (i /= (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8/CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE)-1) then
|
1911 |
|
|
if (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO /= 1) then
|
1912 |
|
|
bench_sti_framer0_data_valid <= '0';
|
1913 |
|
|
wait for (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO-1)*CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD;
|
1914 |
|
|
end if;
|
1915 |
|
|
end if;
|
1916 |
|
|
end loop;
|
1917 |
|
|
bench_sti_framer0_data_valid <= '0';
|
1918 |
|
|
bench_ena_framer0_random_data <= '0';
|
1919 |
|
|
-- wait for footer to be processed
|
1920 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD*(FRAME_PROCESSING_CYCLES_REQUIRED+4);
|
1921 |
|
|
if bench_res_framer0_data_valid = '0' then
|
1922 |
|
|
report "FRAMERP: KO - Output frame is not ready in time" severity warning;
|
1923 |
|
|
else
|
1924 |
|
|
report "FRAMERP: OK - Output frame is ready in time" severity note;
|
1925 |
|
|
-- check frame content is coherent with sent data
|
1926 |
|
|
for i in 0 to (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8/CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE)-1 loop
|
1927 |
|
|
if (bench_res_framer0_data((CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8-CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE*i-1 downto (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8-CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE*(i+1)) /= framer_expected_data(0)(i)) then
|
1928 |
|
|
report "FRAMERP: KO - Output frame content is not equal to sent data - loop: " & integer'image(i) severity warning;
|
1929 |
|
|
frame_content_ok := '0';
|
1930 |
|
|
else
|
1931 |
|
|
if (i = (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8/CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE)-1) and (frame_content_ok = '1') then
|
1932 |
|
|
report "FRAMERP: OK - Output frame is equal to sent data" severity note;
|
1933 |
|
|
end if;
|
1934 |
|
|
end if;
|
1935 |
|
|
end loop;
|
1936 |
|
|
end if;
|
1937 |
|
|
-- send data every CCSDS_TX_FRAMER_PARALLELISM_MAX_RATIO clk during CCSDS_RXTX_BENCH_FRAMER0_FRAME_NUMBER*frame_processing time, store sent data for first frame and check output frame content
|
1938 |
|
|
bench_ena_framer0_random_data <= '1';
|
1939 |
|
|
-- align the end of data to the beginning of a new frame processing cycle
|
1940 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD*(FRAME_REPETITION_CYCLES - (FRAME_OUTPUT_CYCLES_REQUIRED mod FRAME_REPETITION_CYCLES) + FRAME_ACQUISITION_CYCLES_IDLE);
|
1941 |
|
|
frame_content_ok := '1';
|
1942 |
|
|
for f in 0 to (CCSDS_RXTX_BENCH_FRAMER0_FRAME_NUMBER-1) loop
|
1943 |
|
|
for i in 0 to (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8/CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE)-1 loop
|
1944 |
|
|
bench_sti_framer0_data_valid <= '1';
|
1945 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD/2;
|
1946 |
|
|
framer_expected_data(f)(i) := bench_sti_framer0_data;
|
1947 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD/2;
|
1948 |
|
|
if (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO /= 1) then
|
1949 |
|
|
bench_sti_framer0_data_valid <= '0';
|
1950 |
|
|
wait for (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO-1)*CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD;
|
1951 |
|
|
end if;
|
1952 |
|
|
end loop;
|
1953 |
|
|
-- waiting for footer to be processed
|
1954 |
|
|
for data_packet in 0 to ((FRAME_PROCESSING_CYCLES_REQUIRED-1)/CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO)-1 loop
|
1955 |
|
|
bench_sti_framer0_data_valid <= '1';
|
1956 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD;
|
1957 |
|
|
if (data_packet /= ((FRAME_PROCESSING_CYCLES_REQUIRED-1)/CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO-1)) then
|
1958 |
|
|
if (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO /= 1) then
|
1959 |
|
|
bench_sti_framer0_data_valid <= '0';
|
1960 |
|
|
wait for (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO-1)*CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD;
|
1961 |
|
|
end if;
|
1962 |
|
|
end if;
|
1963 |
|
|
end loop;
|
1964 |
|
|
if (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO /= 1) then
|
1965 |
|
|
bench_sti_framer0_data_valid <= '0';
|
1966 |
|
|
end if;
|
1967 |
|
|
wait for 5*CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD;
|
1968 |
|
|
if bench_res_framer0_data_valid = '0' then
|
1969 |
|
|
report "FRAMERP: KO - Output frame is not ready in time - frame loop: " & integer'image(f) severity warning;
|
1970 |
|
|
else
|
1971 |
|
|
-- check frame content is coherent with sent data
|
1972 |
|
|
for i in 0 to (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8/CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE)-1 loop
|
1973 |
|
|
if (bench_res_framer0_data((CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8-CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE*i-1 downto (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8-CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE*(i+1)) /= framer_expected_data(f)(i)) then
|
1974 |
|
|
report "FRAMERP: KO - Output frame content is not equal to sent data - frame loop: " & integer'image(f) & " - data loop: " & integer'image(i) severity warning;
|
1975 |
|
|
frame_content_ok := '0';
|
1976 |
|
|
else
|
1977 |
|
|
if (i = (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8/CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE)-1) and (f = (CCSDS_RXTX_BENCH_FRAMER0_FRAME_NUMBER-1)) and (frame_content_ok = '1') then
|
1978 |
|
|
report "FRAMERP: OK - Received output frames are all equal to sent data" severity note;
|
1979 |
|
|
end if;
|
1980 |
|
|
end if;
|
1981 |
|
|
end loop;
|
1982 |
|
|
end if;
|
1983 |
|
|
if (f /= (CCSDS_RXTX_BENCH_FRAMER0_FRAME_NUMBER-1)) then
|
1984 |
|
|
-- fill current frame to start with new one
|
1985 |
|
|
if ((((CCSDS_RXTX_BENCH_FRAMER0_HEADER_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8) mod FRAME_REPETITION_CYCLES) /= 0) then
|
1986 |
|
|
nb_data := (FRAME_REPETITION_CYCLES - (((CCSDS_RXTX_BENCH_FRAMER0_HEADER_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8) mod FRAME_REPETITION_CYCLES))/CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO;
|
1987 |
|
|
for i in 0 to nb_data-1 loop
|
1988 |
|
|
bench_sti_framer0_data_valid <= '1';
|
1989 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD;
|
1990 |
|
|
if (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO /= 1) then
|
1991 |
|
|
bench_sti_framer0_data_valid <= '0';
|
1992 |
|
|
wait for (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO-1)*CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD;
|
1993 |
|
|
end if;
|
1994 |
|
|
end loop;
|
1995 |
|
|
-- align the end of data to the beginning of a new frame processing cycle
|
1996 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD*(2*FRAME_REPETITION_CYCLES - (FRAME_OUTPUT_CYCLES_REQUIRED mod FRAME_REPETITION_CYCLES) + FRAME_ACQUISITION_CYCLES_IDLE - nb_data*CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO);
|
1997 |
|
|
else
|
1998 |
|
|
-- align the end of data to the beginning of a new frame processing cycle
|
1999 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD*(FRAME_REPETITION_CYCLES - (FRAME_OUTPUT_CYCLES_REQUIRED mod FRAME_REPETITION_CYCLES) + FRAME_ACQUISITION_CYCLES_IDLE);
|
2000 |
|
|
end if;
|
2001 |
|
|
end if;
|
2002 |
|
|
end loop;
|
2003 |
|
|
bench_sti_framer0_data_valid <= '0';
|
2004 |
|
|
-- wait for last frame to be processed and presented
|
2005 |
|
|
wait for CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD*(FRAME_REPETITION_CYCLES*(((FRAME_PROCESSING_CYCLES_REQUIRED+1)/FRAME_REPETITION_CYCLES)+4));
|
2006 |
|
|
-- send data continuously to test full-speed / overflow behaviour
|
2007 |
|
|
bench_sti_framer0_data_valid <= '1';
|
2008 |
|
|
wait for (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO*CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO*CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH*8/CCSDS_RXTX_BENCH_FRAMER0_DATA_BUS_SIZE)*CCSDS_RXTX_BENCH_FRAMER0_CLK_PERIOD;
|
2009 |
|
|
if (CCSDS_RXTX_BENCH_FRAMER0_PARALLELISM_MAX_RATIO /= 1) then
|
2010 |
|
|
if (bench_res_framer0_dat_nxt = '0') then
|
2011 |
|
|
report "FRAMERP: OK - Overflow stop next data request" severity note;
|
2012 |
|
|
else
|
2013 |
|
|
report "FRAMERP: KO - Overflow doesn't stop next data request" severity warning;
|
2014 |
|
|
end if;
|
2015 |
|
|
else
|
2016 |
|
|
if (bench_res_framer0_dat_nxt = '1') then
|
2017 |
|
|
report "FRAMERP: OK - Full speed doesn't stop next data request" severity note;
|
2018 |
|
|
else
|
2019 |
|
|
report "FRAMERP: KO - Full speed stop next data request" severity warning;
|
2020 |
|
|
end if;
|
2021 |
|
|
end if;
|
2022 |
|
|
bench_sti_framer0_data_valid <= '0';
|
2023 |
|
|
bench_ena_framer0_random_data <= '0';
|
2024 |
|
|
-- final state tests:
|
2025 |
|
|
if bench_res_framer0_data_valid = '1' then
|
2026 |
|
|
if (bench_res_framer0_data((CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8+10 downto (CCSDS_RXTX_BENCH_FRAMER0_DATA_LENGTH+CCSDS_RXTX_BENCH_FRAMER0_FOOTER_LENGTH)*8) = "11111111110") then
|
2027 |
|
|
report "FRAMERP: OK - Final state - Output frame is valid and Only Idle Data flag found" severity note;
|
2028 |
|
|
else
|
2029 |
|
|
report "FRAMERP: KO - Final state - Output frame is valid without sent data - Only Idle Flag not found" severity warning;
|
2030 |
|
|
end if;
|
2031 |
|
|
else
|
2032 |
|
|
report "FRAMERP: KO - Final state - Output frame is not valid without sent data" severity warning;
|
2033 |
|
|
end if;
|
2034 |
|
|
if (bench_res_framer0_dat_nxt = '0') then
|
2035 |
|
|
report "FRAMERP: KO - Final state - Next data not requested" severity warning;
|
2036 |
|
|
else
|
2037 |
|
|
report "FRAMERP: OK - Final state - Next data requested" severity note;
|
2038 |
|
|
end if;
|
2039 |
|
|
report "FRAMERP: END FRAMER TESTS" severity note;
|
2040 |
|
|
-- do nothing
|
2041 |
|
|
wait;
|
2042 |
|
|
end process;
|
2043 |
|
|
--=============================================================================
|
2044 |
|
|
-- Begin of lfsrp
|
2045 |
|
|
-- generation of lfsr subsystem unit-tests
|
2046 |
|
|
--=============================================================================
|
2047 |
|
|
-- read: bench_res_lfsr0_data, bench_res_lfsr0_data_valid
|
2048 |
|
|
-- write:
|
2049 |
|
|
-- r/w:
|
2050 |
|
|
LFSRP : process
|
2051 |
|
|
begin
|
2052 |
|
|
-- let the system free run
|
2053 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
2054 |
|
|
-- default state tests:
|
2055 |
|
|
-- let the system reset
|
2056 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_LFSR_WAIT_DURATION);
|
2057 |
|
|
-- initial state tests:
|
2058 |
|
|
-- behaviour tests:
|
2059 |
|
|
report "LFSRP: START LFSR TESTS" severity note;
|
2060 |
|
|
wait for (CCSDS_RXTX_BENCH_LFSR0_RESULT'length)*CCSDS_RXTX_BENCH_LFSR0_CLK_PERIOD;
|
2061 |
|
|
if (bench_res_lfsr0_data_valid = '1') then
|
2062 |
|
|
report "LFSRP: OK - LFSR output is valid" severity note;
|
2063 |
|
|
if (bench_res_lfsr0_data = CCSDS_RXTX_BENCH_LFSR0_RESULT) then
|
2064 |
|
|
report "LFSRP: OK - LFSR output is equal to expected output" severity note;
|
2065 |
|
|
else
|
2066 |
|
|
report "LFSRP: KO - LFSR output is different from expected output" severity warning;
|
2067 |
|
|
end if;
|
2068 |
|
|
else
|
2069 |
|
|
report "LFSRP: KO - LFSR output is not valid" severity warning;
|
2070 |
|
|
end if;
|
2071 |
|
|
-- final state tests:
|
2072 |
|
|
report "LFSRP: END LFSR TESTS" severity note;
|
2073 |
|
|
-- do nothing
|
2074 |
|
|
wait;
|
2075 |
|
|
end process;
|
2076 |
|
|
--=============================================================================
|
2077 |
|
|
-- Begin of mapperbitssymbolsp
|
2078 |
|
|
-- generation of mapper subsystem unit-tests
|
2079 |
|
|
--=============================================================================
|
2080 |
|
|
-- read:
|
2081 |
|
|
-- write: bench_sti_mapper_bits_symbols0_dat_val, bench_sti_mapper_bits_symbols0_dat_val
|
2082 |
|
|
-- r/w:
|
2083 |
|
|
MAPPERBITSSYMBOLSP : process
|
2084 |
|
|
begin
|
2085 |
|
|
-- let the system free run
|
2086 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
2087 |
|
|
-- default state tests:
|
2088 |
|
|
if (bench_res_mapper_bits_symbols0_sym_val = '1') then
|
2089 |
|
|
report "MAPPERBITSSYMBOLSP: KO - Default state - Mapper output data is valid" severity warning;
|
2090 |
|
|
else
|
2091 |
|
|
report "MAPPERBITSSYMBOLSP: OK - Default state - Mapper output data is not valid" severity note;
|
2092 |
|
|
end if;
|
2093 |
|
|
-- let the system reset
|
2094 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_MAPPER_BITS_SYMBOLS_WAIT_DURATION);
|
2095 |
|
|
-- initial state tests:
|
2096 |
|
|
if (bench_res_mapper_bits_symbols0_sym_val = '1') then
|
2097 |
|
|
report "MAPPERBITSSYMBOLSP: KO - Initial state - Mapper output data is valid" severity warning;
|
2098 |
|
|
else
|
2099 |
|
|
report "MAPPERBITSSYMBOLSP: OK - Initial state - Mapper output data is not valid" severity note;
|
2100 |
|
|
end if;
|
2101 |
|
|
-- behaviour tests:
|
2102 |
|
|
report "MAPPERBITSSYMBOLSP: START BITS TO SYMBOLS MAPPER TESTS" severity note;
|
2103 |
|
|
bench_ena_mapper_bits_symbols0_random_data <= '1';
|
2104 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_CLK_PERIOD;
|
2105 |
|
|
bench_sti_mapper_bits_symbols0_dat_val <= '1';
|
2106 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_CLK_PERIOD*CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_BUS_SIZE/CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_BITS_PER_SYMBOL*CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_WORDS_NUMBER;
|
2107 |
|
|
bench_sti_mapper_bits_symbols0_dat_val <= '0';
|
2108 |
|
|
bench_ena_mapper_bits_symbols0_random_data <= '0';
|
2109 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_BITS_SYMBOLS0_DATA_CLK_PERIOD;
|
2110 |
|
|
-- final state tests:
|
2111 |
|
|
if (bench_res_mapper_bits_symbols0_sym_val = '1') then
|
2112 |
|
|
report "MAPPERBITSSYMBOLSP: KO - Final state - Mapper output data is valid" severity warning;
|
2113 |
|
|
else
|
2114 |
|
|
report "MAPPERBITSSYMBOLSP: OK - Final state - Mapper output data is not valid" severity note;
|
2115 |
|
|
end if;
|
2116 |
|
|
report "MAPPERBITSSYMBOLSP: END BITS TO SYMBOLS MAPPER TESTS" severity note;
|
2117 |
|
|
-- do nothing
|
2118 |
|
|
wait;
|
2119 |
|
|
end process;
|
2120 |
|
|
--=============================================================================
|
2121 |
|
|
-- Begin of mappersymbolssamplesp
|
2122 |
|
|
-- generation of mapper subsystem unit-tests
|
2123 |
|
|
--=============================================================================
|
2124 |
|
|
-- read:
|
2125 |
|
|
-- write: bench_sti_mapper_bits_symbols0_dat_val, bench_sti_mapper_bits_symbols0_dat_val
|
2126 |
|
|
-- r/w:
|
2127 |
|
|
MAPPERSYMBOLSSAMPLESP : process
|
2128 |
|
|
begin
|
2129 |
|
|
-- let the system free run
|
2130 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
2131 |
|
|
-- default state tests:
|
2132 |
|
|
if (bench_res_mapper_symbols_samples0_sam_val = '1') then
|
2133 |
|
|
report "MAPPERSYMBOLSSAMPLESP: KO - Default state - Mapper output data is valid" severity warning;
|
2134 |
|
|
else
|
2135 |
|
|
report "MAPPERSYMBOLSSAMPLESP: OK - Default state - Mapper output data is not valid" severity note;
|
2136 |
|
|
end if;
|
2137 |
|
|
-- let the system reset
|
2138 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_MAPPER_SYMBOLS_SAMPLES_WAIT_DURATION);
|
2139 |
|
|
-- initial state tests:
|
2140 |
|
|
if (bench_res_mapper_symbols_samples0_sam_val = '1') then
|
2141 |
|
|
report "MAPPERSYMBOLSSAMPLESP: KO - Initial state - Mapper output data is valid" severity warning;
|
2142 |
|
|
else
|
2143 |
|
|
report "MAPPERSYMBOLSSAMPLESP: OK - Initial state - Mapper output data is not valid" severity note;
|
2144 |
|
|
end if;
|
2145 |
|
|
-- behaviour tests:
|
2146 |
|
|
report "MAPPERSYMBOLSSAMPLESP: START SYMBOLS TO SAMPLES MAPPER TESTS" severity note;
|
2147 |
|
|
bench_ena_mapper_symbols_samples0_random_data <= '1';
|
2148 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_CLK_PERIOD;
|
2149 |
|
|
bench_sti_mapper_symbols_samples0_sym_val <= '1';
|
2150 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_CLK_PERIOD*CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_WORDS_NUMBER;
|
2151 |
|
|
bench_sti_mapper_symbols_samples0_sym_val <= '0';
|
2152 |
|
|
bench_ena_mapper_symbols_samples0_random_data <= '0';
|
2153 |
|
|
wait for CCSDS_RXTX_BENCH_MAPPER_SYMBOLS_SAMPLES0_CLK_PERIOD;
|
2154 |
|
|
-- final state tests:
|
2155 |
|
|
if (bench_res_mapper_symbols_samples0_sam_val = '1') then
|
2156 |
|
|
report "MAPPERSYMBOLSSAMPLESP: KO - Final state - Mapper output data is valid" severity warning;
|
2157 |
|
|
else
|
2158 |
|
|
report "MAPPERSYMBOLSSAMPLESP: OK - Final state - Mapper output data is not valid" severity note;
|
2159 |
|
|
end if;
|
2160 |
|
|
report "MAPPERSYMBOLSSAMPLESP: END SYMBOLS TO SAMPLES MAPPER TESTS" severity note;
|
2161 |
|
|
-- do nothing
|
2162 |
|
|
wait;
|
2163 |
|
|
end process;
|
2164 |
|
|
--=============================================================================
|
2165 |
|
|
-- Begin of serdesp
|
2166 |
|
|
-- generation of serdes subsystem unit-tests
|
2167 |
|
|
--=============================================================================
|
2168 |
|
|
-- read: bench_res_serdes0_data_par_valid, bench_res_serdes0_data_par, bench_res_serdes0_data_ser, bench_res_serdes0_data_ser_valid, bench_res_serdes0_busy
|
2169 |
|
|
-- write: bench_sti_serdes0_data_par_valid, bench_sti_serdes0_data_ser_valid, bench_ena_serdes0_random_data
|
2170 |
|
|
-- r/w:
|
2171 |
|
|
SERDESP : process
|
2172 |
|
|
variable serdes_expected_output: std_logic_vector(CCSDS_RXTX_BENCH_SERDES0_DEPTH-1 downto 0) := (others => '0');
|
2173 |
|
|
variable serdes_ok: std_logic := '1';
|
2174 |
|
|
begin
|
2175 |
|
|
-- let the system free run
|
2176 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
2177 |
|
|
-- default state tests:
|
2178 |
|
|
-- check serdes is not valid
|
2179 |
|
|
if (bench_res_serdes0_data_par_valid = '0') then
|
2180 |
|
|
report "SERDESP: OK - Default state - Serdes parallel output is not valid" severity note;
|
2181 |
|
|
else
|
2182 |
|
|
report "SERDESP: KO - Default state - Serdes parallel output is valid" severity warning;
|
2183 |
|
|
end if;
|
2184 |
|
|
if (bench_res_serdes0_data_ser_valid = '0') then
|
2185 |
|
|
report "SERDESP: OK - Default state - Serdes serial output is not valid" severity note;
|
2186 |
|
|
else
|
2187 |
|
|
report "SERDESP: KO - Default state - Serdes serial output is valid" severity warning;
|
2188 |
|
|
end if;
|
2189 |
|
|
if (bench_res_serdes0_busy = '0') then
|
2190 |
|
|
report "SERDESP: OK - Default state - Serdes is not busy" severity note;
|
2191 |
|
|
else
|
2192 |
|
|
report "SERDESP: KO - Default state - Serdes is busy" severity warning;
|
2193 |
|
|
end if;
|
2194 |
|
|
-- let the system reset
|
2195 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_SERDES_WAIT_DURATION);
|
2196 |
|
|
-- initial state tests:
|
2197 |
|
|
-- check serdes is not valid
|
2198 |
|
|
if (bench_res_serdes0_data_par_valid = '0') then
|
2199 |
|
|
report "SERDESP: OK - Initial state - Serdes parallel output is not valid" severity note;
|
2200 |
|
|
else
|
2201 |
|
|
report "SERDESP: KO - Initial state - Serdes parallel output is valid" severity warning;
|
2202 |
|
|
end if;
|
2203 |
|
|
if (bench_res_serdes0_data_ser_valid = '0') then
|
2204 |
|
|
report "SERDESP: OK - Initial state - Serdes serial output is not valid" severity note;
|
2205 |
|
|
else
|
2206 |
|
|
report "SERDESP: KO - Initial state - Serdes serial output is valid" severity warning;
|
2207 |
|
|
end if;
|
2208 |
|
|
if (bench_res_serdes0_busy = '0') then
|
2209 |
|
|
report "SERDESP: OK - Initial state - Serdes is not busy" severity note;
|
2210 |
|
|
else
|
2211 |
|
|
report "SERDESP: KO - Initial state - Serdes is busy" severity warning;
|
2212 |
|
|
end if;
|
2213 |
|
|
-- behaviour tests:
|
2214 |
|
|
report "SERDESP: START SERDES TESTS" severity note;
|
2215 |
|
|
bench_ena_serdes0_random_data <= '1';
|
2216 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD;
|
2217 |
|
|
-- test par2ser
|
2218 |
|
|
-- signal valid parallel data input
|
2219 |
|
|
bench_sti_serdes0_data_par_valid <= '1';
|
2220 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD/2;
|
2221 |
|
|
serdes_expected_output := bench_sti_serdes0_data_par;
|
2222 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD/2;
|
2223 |
|
|
bench_sti_serdes0_data_par_valid <= '0';
|
2224 |
|
|
for bit_pointer in (CCSDS_RXTX_BENCH_SERDES0_DEPTH-1) downto 0 loop
|
2225 |
|
|
if (bench_res_serdes0_busy = '0') then
|
2226 |
|
|
report "SERDESP: KO - Serdes is not busy" severity warning;
|
2227 |
|
|
else
|
2228 |
|
|
if (bench_res_serdes0_data_ser_valid = '1') then
|
2229 |
|
|
if (bench_res_serdes0_data_ser /= serdes_expected_output(bit_pointer)) then
|
2230 |
|
|
serdes_ok := '0';
|
2231 |
|
|
report "SERDESP: KO - Serdes serialized output data doesn't match expected output - cycle " & integer'image(bit_pointer) severity warning;
|
2232 |
|
|
report "Expected value: " & std_logic'image(serdes_expected_output(bit_pointer)) severity warning;
|
2233 |
|
|
report "Received value: " & std_logic'image(bench_res_serdes0_data_ser) severity warning;
|
2234 |
|
|
else
|
2235 |
|
|
if (serdes_ok = '1') and (bit_pointer = 0) then
|
2236 |
|
|
report "SERDESP: OK - Serdes serialized output data match expected output" severity note;
|
2237 |
|
|
end if;
|
2238 |
|
|
end if;
|
2239 |
|
|
else
|
2240 |
|
|
report "SERDESP: KO - Serdes serialized output data is not valid" severity warning;
|
2241 |
|
|
end if;
|
2242 |
|
|
end if;
|
2243 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD;
|
2244 |
|
|
end loop;
|
2245 |
|
|
-- test ser2par
|
2246 |
|
|
-- signal valid serial data input
|
2247 |
|
|
serdes_expected_output := (others => '0');
|
2248 |
|
|
bench_sti_serdes0_data_ser_valid <= '1';
|
2249 |
|
|
for bit_pointer in (CCSDS_RXTX_BENCH_SERDES0_DEPTH-1) downto 0 loop
|
2250 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD/2;
|
2251 |
|
|
serdes_expected_output(bit_pointer) := bench_sti_serdes0_data_ser;
|
2252 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD/2;
|
2253 |
|
|
end loop;
|
2254 |
|
|
bench_sti_serdes0_data_ser_valid <= '0';
|
2255 |
|
|
bench_ena_serdes0_random_data <= '0';
|
2256 |
|
|
if (bench_res_serdes0_data_par_valid = '1') then
|
2257 |
|
|
report "SERDESP: OK - Serdes parallelized output data is valid" severity note;
|
2258 |
|
|
if (bench_res_serdes0_data_par = serdes_expected_output) then
|
2259 |
|
|
report "SERDESP: OK - Serdes parallelized output data match expected output" severity note;
|
2260 |
|
|
else
|
2261 |
|
|
report "SERDESP: KO - Serdes parallelized output data doesn't match expected output" severity warning;
|
2262 |
|
|
report "Expected value:" severity warning;
|
2263 |
|
|
for bit_pointer in 0 to CCSDS_RXTX_BENCH_SERDES0_DEPTH-1 loop
|
2264 |
|
|
report std_logic'image(serdes_expected_output(bit_pointer)) severity warning;
|
2265 |
|
|
end loop;
|
2266 |
|
|
report "Received value:" severity warning;
|
2267 |
|
|
for bit_pointer in 0 to CCSDS_RXTX_BENCH_SERDES0_DEPTH-1 loop
|
2268 |
|
|
report std_logic'image(bench_res_serdes0_data_par(bit_pointer)) severity warning;
|
2269 |
|
|
end loop;
|
2270 |
|
|
end if;
|
2271 |
|
|
else
|
2272 |
|
|
report "SERDESP: KO - Serdes parallelized output data is not valid" severity warning;
|
2273 |
|
|
end if;
|
2274 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD;
|
2275 |
|
|
--TODO: TEST SER2PAR + PAR2SER SIMULTANEOUSLY
|
2276 |
|
|
-- many par2ser cycles
|
2277 |
|
|
bench_ena_serdes0_random_data <= '1';
|
2278 |
|
|
serdes_expected_output := (others => '0');
|
2279 |
|
|
serdes_ok := '1';
|
2280 |
|
|
for cycle_number in 0 to CCSDS_RXTX_BENCH_SERDES0_CYCLES_NUMBER-1 loop
|
2281 |
|
|
for bit_pointer in (CCSDS_RXTX_BENCH_SERDES0_DEPTH-1) downto 0 loop
|
2282 |
|
|
if (bit_pointer = (CCSDS_RXTX_BENCH_SERDES0_DEPTH-1)) then
|
2283 |
|
|
-- signal valid parallel data input
|
2284 |
|
|
bench_sti_serdes0_data_par_valid <= '1';
|
2285 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD/2;
|
2286 |
|
|
serdes_expected_output := bench_sti_serdes0_data_par;
|
2287 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD/2;
|
2288 |
|
|
bench_sti_serdes0_data_par_valid <= '0';
|
2289 |
|
|
else
|
2290 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD;
|
2291 |
|
|
end if;
|
2292 |
|
|
if (bench_res_serdes0_busy = '0') then
|
2293 |
|
|
report "SERDESP: KO - Serdes is not busy" severity warning;
|
2294 |
|
|
else
|
2295 |
|
|
if (bench_res_serdes0_data_ser_valid = '1') then
|
2296 |
|
|
if (bench_res_serdes0_data_ser /= serdes_expected_output(bit_pointer)) then
|
2297 |
|
|
serdes_ok := '0';
|
2298 |
|
|
report "SERDESP: KO - Serdes serialized output data doesn't match expected output - cycle " & integer'image(bit_pointer) severity warning;
|
2299 |
|
|
report "Expected value: " & std_logic'image(serdes_expected_output(bit_pointer)) severity warning;
|
2300 |
|
|
report "Received value: " & std_logic'image(bench_res_serdes0_data_ser) severity warning;
|
2301 |
|
|
else
|
2302 |
|
|
if (serdes_ok = '1') and (bit_pointer = 0) and (cycle_number = (CCSDS_RXTX_BENCH_SERDES0_CYCLES_NUMBER-1)) then
|
2303 |
|
|
report "SERDESP: OK - All serdes serialized output data match expected outputs" severity note;
|
2304 |
|
|
end if;
|
2305 |
|
|
end if;
|
2306 |
|
|
else
|
2307 |
|
|
report "SERDESP: KO - Serdes serialized output data is not valid" severity warning;
|
2308 |
|
|
end if;
|
2309 |
|
|
end if;
|
2310 |
|
|
end loop;
|
2311 |
|
|
end loop;
|
2312 |
|
|
-- many par2ser cycles
|
2313 |
|
|
serdes_expected_output := (others => '0');
|
2314 |
|
|
serdes_ok := '1';
|
2315 |
|
|
for cycle_number in 0 to CCSDS_RXTX_BENCH_SERDES0_CYCLES_NUMBER-1 loop
|
2316 |
|
|
-- signal valid serial data input
|
2317 |
|
|
bench_sti_serdes0_data_ser_valid <= '1';
|
2318 |
|
|
for bit_pointer in (CCSDS_RXTX_BENCH_SERDES0_DEPTH-1) downto 0 loop
|
2319 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD/2;
|
2320 |
|
|
serdes_expected_output(bit_pointer) := bench_sti_serdes0_data_ser;
|
2321 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD/2;
|
2322 |
|
|
end loop;
|
2323 |
|
|
if (bench_res_serdes0_data_par_valid = '1') then
|
2324 |
|
|
if (bench_res_serdes0_data_par = serdes_expected_output) then
|
2325 |
|
|
if (cycle_number = (CCSDS_RXTX_BENCH_SERDES0_CYCLES_NUMBER-1)) and (serdes_ok = '1') then
|
2326 |
|
|
report "SERDESP: OK - All serdes parallelized output data match expected outputs" severity note;
|
2327 |
|
|
end if;
|
2328 |
|
|
else
|
2329 |
|
|
serdes_ok := '0';
|
2330 |
|
|
report "SERDESP: KO - Serdes parallelized output data doesn't match expected output" severity warning;
|
2331 |
|
|
report "Expected value:" severity warning;
|
2332 |
|
|
for bit_pointer in 0 to CCSDS_RXTX_BENCH_SERDES0_DEPTH-1 loop
|
2333 |
|
|
report std_logic'image(serdes_expected_output(bit_pointer)) severity warning;
|
2334 |
|
|
end loop;
|
2335 |
|
|
report "Received value:" severity warning;
|
2336 |
|
|
for bit_pointer in 0 to CCSDS_RXTX_BENCH_SERDES0_DEPTH-1 loop
|
2337 |
|
|
report std_logic'image(bench_res_serdes0_data_par(bit_pointer)) severity warning;
|
2338 |
|
|
end loop;
|
2339 |
|
|
end if;
|
2340 |
|
|
else
|
2341 |
|
|
report "SERDESP: KO - Serdes parallelized output data is not valid" severity warning;
|
2342 |
|
|
end if;
|
2343 |
|
|
end loop;
|
2344 |
|
|
bench_sti_serdes0_data_ser_valid <= '0';
|
2345 |
|
|
bench_ena_serdes0_random_data <= '0';
|
2346 |
|
|
wait for CCSDS_RXTX_BENCH_SERDES0_CLK_PERIOD;
|
2347 |
|
|
-- final state tests:
|
2348 |
|
|
-- check serdes is not valid
|
2349 |
|
|
if (bench_res_serdes0_data_par_valid = '0') then
|
2350 |
|
|
report "SERDESP: OK - Final state - Serdes parallel output is not valid" severity note;
|
2351 |
|
|
else
|
2352 |
|
|
report "SERDESP: KO - Final state - Serdes parallel output is valid" severity warning;
|
2353 |
|
|
end if;
|
2354 |
|
|
if (bench_res_serdes0_data_ser_valid = '0') then
|
2355 |
|
|
report "SERDESP: OK - Final state - Serdes serial output is not valid" severity note;
|
2356 |
|
|
else
|
2357 |
|
|
report "SERDESP: KO - Final state - Serdes serial output is valid" severity warning;
|
2358 |
|
|
end if;
|
2359 |
|
|
if (bench_res_serdes0_busy = '0') then
|
2360 |
|
|
report "SERDESP: OK - Final state - Serdes is not busy" severity note;
|
2361 |
|
|
else
|
2362 |
|
|
report "SERDESP: KO - Final state - Serdes is busy" severity warning;
|
2363 |
|
|
end if;
|
2364 |
|
|
report "SERDESP: END SERDES TESTS" severity note;
|
2365 |
|
|
-- do nothing
|
2366 |
|
|
wait;
|
2367 |
|
|
end process;
|
2368 |
|
|
--=============================================================================
|
2369 |
|
|
-- Begin of srrcp
|
2370 |
|
|
-- generation of SRRC subsystem unit-tests
|
2371 |
|
|
--=============================================================================
|
2372 |
|
|
-- read:
|
2373 |
|
|
-- write:
|
2374 |
|
|
-- r/w:
|
2375 |
|
|
SRRCP : process
|
2376 |
|
|
constant srrc_zero: std_logic_vector(CCSDS_RXTX_BENCH_SRRC0_SIG_QUANT_DEPTH-1 downto 0) := (others => '0');
|
2377 |
|
|
variable samples_hex_output: line;
|
2378 |
|
|
begin
|
2379 |
|
|
-- let the system free run
|
2380 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
2381 |
|
|
-- default state tests:
|
2382 |
|
|
if (bench_res_srrc0_sam_val = '0') then
|
2383 |
|
|
report "SRRCP: OK - Default state - SRRC samples are not valid" severity note;
|
2384 |
|
|
else
|
2385 |
|
|
report "SRRCP: KO - Default state - SRRC samples are valid" severity warning;
|
2386 |
|
|
end if;
|
2387 |
|
|
-- let the system reset
|
2388 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_SRRC_WAIT_DURATION);
|
2389 |
|
|
-- initial state tests:
|
2390 |
|
|
if (bench_res_srrc0_sam_val = '0') then
|
2391 |
|
|
report "SRRCP: OK - Initial state - SRRC samples are not valid" severity note;
|
2392 |
|
|
else
|
2393 |
|
|
report "SRRCP: KO - Initial state - SRRC samples are valid" severity warning;
|
2394 |
|
|
end if;
|
2395 |
|
|
if (bench_res_srrc0_sam = srrc_zero) then
|
2396 |
|
|
report "SRRCP: OK - Initial state - SRRC samples are null" severity note;
|
2397 |
|
|
else
|
2398 |
|
|
report "SRRCP: KO - Initial state - SRRC samples are not null" severity warning;
|
2399 |
|
|
end if;
|
2400 |
|
|
-- behaviour tests:
|
2401 |
|
|
report "SRRCP: START SRRC TESTS" severity note;
|
2402 |
|
|
bench_sti_srrc0_sam(CCSDS_RXTX_BENCH_SRRC0_SIG_QUANT_DEPTH-1) <= '0';
|
2403 |
|
|
bench_sti_srrc0_sam(CCSDS_RXTX_BENCH_SRRC0_SIG_QUANT_DEPTH-2 downto 0) <= (others => '1');
|
2404 |
|
|
bench_sti_srrc0_sam_val <= '1';
|
2405 |
|
|
wait for CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD;
|
2406 |
|
|
bench_sti_srrc0_sam <= (others => '0');
|
2407 |
|
|
if (CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_ENABLE = true) then
|
2408 |
|
|
for i in 0 to 400 loop
|
2409 |
|
|
wait for CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD;
|
2410 |
|
|
if (bench_res_srrc0_sam_val = '1') then
|
2411 |
|
|
write(samples_hex_output, convert_std_logic_vector_to_hexa_ascii(bench_res_srrc0_sam));
|
2412 |
|
|
writeline(CCSDS_RXTX_BENCH_SRRC0_OUTPUT_HEX_FILE, samples_hex_output);
|
2413 |
|
|
else
|
2414 |
|
|
report "SRRCP: KO - SRRC samples are not valid" severity warning;
|
2415 |
|
|
end if;
|
2416 |
|
|
end loop;
|
2417 |
|
|
else
|
2418 |
|
|
wait for 400*CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD;
|
2419 |
|
|
end if;
|
2420 |
|
|
bench_sti_srrc0_sam(0) <= '1';
|
2421 |
|
|
wait for CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD;
|
2422 |
|
|
bench_sti_srrc0_sam <= (others => '0');
|
2423 |
|
|
if (CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_ENABLE = true) then
|
2424 |
|
|
for i in 0 to 400 loop
|
2425 |
|
|
wait for CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD;
|
2426 |
|
|
if (bench_res_srrc0_sam_val = '1') then
|
2427 |
|
|
write(samples_hex_output, convert_std_logic_vector_to_hexa_ascii(bench_res_srrc0_sam));
|
2428 |
|
|
writeline(CCSDS_RXTX_BENCH_SRRC0_OUTPUT_HEX_FILE, samples_hex_output);
|
2429 |
|
|
else
|
2430 |
|
|
report "SRRCP: KO - SRRC samples are not valid" severity warning;
|
2431 |
|
|
end if;
|
2432 |
|
|
end loop;
|
2433 |
|
|
else
|
2434 |
|
|
wait for 400*CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD;
|
2435 |
|
|
end if;
|
2436 |
|
|
bench_sti_srrc0_sam(CCSDS_RXTX_BENCH_SRRC0_SIG_QUANT_DEPTH-1) <= '1';
|
2437 |
|
|
bench_sti_srrc0_sam(CCSDS_RXTX_BENCH_SRRC0_SIG_QUANT_DEPTH-2 downto 0) <= (others => '0');
|
2438 |
|
|
wait for CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD;
|
2439 |
|
|
bench_sti_srrc0_sam <= (others => '0');
|
2440 |
|
|
if (CCSDS_RXTX_BENCH_OUTPUT_SIGNALS_ENABLE = true) then
|
2441 |
|
|
for i in 0 to 400 loop
|
2442 |
|
|
wait for CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD;
|
2443 |
|
|
if (bench_res_srrc0_sam_val = '1') then
|
2444 |
|
|
write(samples_hex_output, convert_std_logic_vector_to_hexa_ascii(bench_res_srrc0_sam));
|
2445 |
|
|
writeline(CCSDS_RXTX_BENCH_SRRC0_OUTPUT_HEX_FILE, samples_hex_output);
|
2446 |
|
|
else
|
2447 |
|
|
report "SRRCP: KO - SRRC samples are not valid" severity warning;
|
2448 |
|
|
end if;
|
2449 |
|
|
end loop;
|
2450 |
|
|
else
|
2451 |
|
|
wait for 400*CCSDS_RXTX_BENCH_SRRC0_CLK_PERIOD;
|
2452 |
|
|
end if;
|
2453 |
|
|
bench_sti_srrc0_sam_val <= '0';
|
2454 |
|
|
-- final state tests:
|
2455 |
|
|
if (bench_res_srrc0_sam_val = '0') then
|
2456 |
|
|
report "SRRCP: OK - Final state - SRRC samples are not valid" severity note;
|
2457 |
|
|
else
|
2458 |
|
|
report "SRRCP: KO - Final state - SRRC samples are valid" severity warning;
|
2459 |
|
|
end if;
|
2460 |
|
|
if (bench_res_srrc0_sam = srrc_zero) then
|
2461 |
|
|
report "SRRCP: OK - Final state - SRRC samples are null" severity note;
|
2462 |
|
|
else
|
2463 |
|
|
report "SRRCP: KO - Final state - SRRC samples are not null" severity warning;
|
2464 |
|
|
end if;
|
2465 |
|
|
report "SRRCP: END SRRC TESTS" severity note;
|
2466 |
|
|
-- do nothing
|
2467 |
|
|
wait;
|
2468 |
|
|
end process;
|
2469 |
|
|
--=============================================================================
|
2470 |
|
|
-- Begin of resetp
|
2471 |
|
|
-- generation of reset pulses
|
2472 |
|
|
--=============================================================================
|
2473 |
|
|
-- read:
|
2474 |
|
|
-- write: bench_sti_rxtx0_wb_rst, bench_sti_crc0_rst, bench_sti_buffer0_rst, bench_sti_framer0_rst
|
2475 |
|
|
-- r/w:
|
2476 |
|
|
RESETP : process
|
2477 |
|
|
begin
|
2478 |
|
|
-- let the system free run
|
2479 |
|
|
wait for CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION;
|
2480 |
|
|
report "RESETP: START RESET SIGNAL TEST" severity note;
|
2481 |
|
|
-- send reset signals
|
2482 |
|
|
bench_sti_rxtx0_wb_rst <= '1';
|
2483 |
|
|
bench_sti_coder_conv0_rst <= '1';
|
2484 |
|
|
bench_sti_coder_diff0_rst <= '1';
|
2485 |
|
|
bench_sti_crc0_rst <= '1';
|
2486 |
|
|
bench_sti_buffer0_rst <= '1';
|
2487 |
|
|
bench_sti_filter0_rst <= '1';
|
2488 |
|
|
bench_sti_framer0_rst <= '1';
|
2489 |
|
|
bench_sti_lfsr0_rst <= '1';
|
2490 |
|
|
bench_sti_mapper_bits_symbols0_rst <= '1';
|
2491 |
|
|
bench_sti_srrc0_rst <= '1';
|
2492 |
|
|
-- wait for some time
|
2493 |
|
|
wait for CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION;
|
2494 |
|
|
report "RESETP: END RESET SIGNAL TEST" severity note;
|
2495 |
|
|
-- stop reset signals
|
2496 |
|
|
bench_sti_rxtx0_wb_rst <= '0';
|
2497 |
|
|
bench_sti_coder_conv0_rst <= '0';
|
2498 |
|
|
bench_sti_coder_diff0_rst <= '0';
|
2499 |
|
|
bench_sti_crc0_rst <= '0';
|
2500 |
|
|
bench_sti_buffer0_rst <= '0';
|
2501 |
|
|
bench_sti_filter0_rst <= '0';
|
2502 |
|
|
bench_sti_framer0_rst <= '0';
|
2503 |
|
|
bench_sti_lfsr0_rst <= '0';
|
2504 |
|
|
bench_sti_mapper_bits_symbols0_rst <= '0';
|
2505 |
|
|
bench_sti_srrc0_rst <= '0';
|
2506 |
|
|
-- do nothing
|
2507 |
|
|
wait;
|
2508 |
|
|
end process;
|
2509 |
|
|
--=============================================================================
|
2510 |
|
|
-- Begin of wbrwp
|
2511 |
|
|
-- generation of master wb read / write cycles / aligned with clk0
|
2512 |
|
|
--=============================================================================
|
2513 |
|
|
-- read: bench_res_rxtx0_wb_ack0, bench_res_rxtx0_wb_err0, bench_res_rxtx0_wb_rty0, bench_sti_rxtx0_wb_random_dat0
|
2514 |
|
|
-- write: bench_sti_rxtx0_wb_adr0, bench_sti_rxtx0_wb_cyc0, bench_sti_rxtx0_wb_stb0, bench_sti_rxtx0_wb_we0, bench_sti_rxtx0_wb_dat0, bench_ena_rxtx0_random_data
|
2515 |
|
|
-- r/w:
|
2516 |
|
|
WBRWP : process
|
2517 |
|
|
variable output_done: boolean := false;
|
2518 |
|
|
begin
|
2519 |
|
|
-- let the system free run
|
2520 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2);
|
2521 |
|
|
-- default state tests:
|
2522 |
|
|
if (bench_res_rxtx0_wb_ack = '0') then
|
2523 |
|
|
report "WBRWP: OK - Default state - ACK not enabled" severity note;
|
2524 |
|
|
else
|
2525 |
|
|
report "WBRWP: OK - Default state - ACK enabled" severity warning;
|
2526 |
|
|
end if;
|
2527 |
|
|
if (bench_res_rxtx0_wb_err = '0') then
|
2528 |
|
|
report "WBRWP: OK - Default state - ERR not enabled" severity note;
|
2529 |
|
|
else
|
2530 |
|
|
report "WBRWP: OK - Default state - ERR enabled" severity warning;
|
2531 |
|
|
end if;
|
2532 |
|
|
if (bench_res_rxtx0_wb_rty = '0') then
|
2533 |
|
|
report "WBRWP: OK - Default state - RTY not enabled" severity note;
|
2534 |
|
|
else
|
2535 |
|
|
report "WBRWP: OK - Default state - RTY enabled" severity warning;
|
2536 |
|
|
end if;
|
2537 |
|
|
-- let the system reset
|
2538 |
|
|
wait for (CCSDS_RXTX_BENCH_START_FREE_RUN_DURATION/2 + CCSDS_RXTX_BENCH_START_RESET_SIG_DURATION + CCSDS_RXTX_BENCH_START_WB_WAIT_DURATION);
|
2539 |
|
|
-- initial state tests:
|
2540 |
|
|
if (bench_res_rxtx0_wb_ack = '0') then
|
2541 |
|
|
report "WBRWP: OK - Initial state - ACK not enabled" severity note;
|
2542 |
|
|
else
|
2543 |
|
|
report "WBRWP: OK - Initial state - ACK enabled" severity warning;
|
2544 |
|
|
end if;
|
2545 |
|
|
if (bench_res_rxtx0_wb_err = '0') then
|
2546 |
|
|
report "WBRWP: OK - Initial state - ERR not enabled" severity note;
|
2547 |
|
|
else
|
2548 |
|
|
report "WBRWP: OK - Initial state - ERR enabled" severity warning;
|
2549 |
|
|
end if;
|
2550 |
|
|
if (bench_res_rxtx0_wb_rty = '0') then
|
2551 |
|
|
report "WBRWP: OK - Initial state - RTY not enabled" severity note;
|
2552 |
|
|
else
|
2553 |
|
|
report "WBRWP: OK - Initial state - RTY enabled" severity warning;
|
2554 |
|
|
end if;
|
2555 |
|
|
-- behaviour tests:
|
2556 |
|
|
report "WBRWP: START WISHBONE BUS READ-WRITE TESTS" severity note;
|
2557 |
|
|
bench_ena_rxtx0_random_data <= '1';
|
2558 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2559 |
|
|
-- start a basic rx read cycle
|
2560 |
|
|
bench_sti_rxtx0_wb_we <= '0';
|
2561 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2562 |
|
|
bench_sti_rxtx0_wb_cyc <= '1';
|
2563 |
|
|
bench_sti_rxtx0_wb_stb <= '1';
|
2564 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2565 |
|
|
if (bench_res_rxtx0_wb_ack = '1') and (bench_res_rxtx0_wb_err = '0') and (bench_res_rxtx0_wb_rty = '0') then
|
2566 |
|
|
report "WBRWP: OK - RX read cycle success" severity note;
|
2567 |
|
|
else
|
2568 |
|
|
report "WBRWP: KO - RX read cycle fail" severity warning;
|
2569 |
|
|
end if;
|
2570 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2571 |
|
|
bench_sti_rxtx0_wb_cyc <= '0';
|
2572 |
|
|
bench_sti_rxtx0_wb_stb <= '0';
|
2573 |
|
|
bench_sti_rxtx0_wb_we <= '0';
|
2574 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2575 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2576 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD*10;
|
2577 |
|
|
-- start an error read cycle
|
2578 |
|
|
bench_sti_rxtx0_wb_adr <= "0001";
|
2579 |
|
|
bench_sti_rxtx0_wb_cyc <= '1';
|
2580 |
|
|
bench_sti_rxtx0_wb_stb <= '1';
|
2581 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2582 |
|
|
if (bench_res_rxtx0_wb_ack = '0') and (bench_res_rxtx0_wb_err = '1') and (bench_res_rxtx0_wb_rty = '1') then
|
2583 |
|
|
report "WBRWP: OK - Error read cycle success" severity note;
|
2584 |
|
|
else
|
2585 |
|
|
report "WBRWP: KO - Error read cycle fail" severity warning;
|
2586 |
|
|
end if;
|
2587 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2588 |
|
|
bench_sti_rxtx0_wb_cyc <= '0';
|
2589 |
|
|
bench_sti_rxtx0_wb_stb <= '0';
|
2590 |
|
|
bench_sti_rxtx0_wb_we <= '0';
|
2591 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2592 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2593 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD*10;
|
2594 |
|
|
-- start a basic configuration write cycle -> disable rx
|
2595 |
|
|
bench_sti_rxtx0_wb_we <= '1';
|
2596 |
|
|
bench_sti_rxtx0_wb_adr <= "0001";
|
2597 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2598 |
|
|
bench_sti_rxtx0_wb_cyc <= '1';
|
2599 |
|
|
bench_sti_rxtx0_wb_stb <= '1';
|
2600 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2601 |
|
|
if (bench_res_rxtx0_wb_ack = '1') and (bench_res_rxtx0_wb_err = '0') and (bench_res_rxtx0_wb_rty = '0') then
|
2602 |
|
|
report "WBRWP: OK - RXTX configuration write cycle success (RX disabled)" severity note;
|
2603 |
|
|
else
|
2604 |
|
|
report "WBRWP: KO - RXTX configuration write cycle fail" severity warning;
|
2605 |
|
|
end if;
|
2606 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2607 |
|
|
bench_sti_rxtx0_wb_cyc <= '0';
|
2608 |
|
|
bench_sti_rxtx0_wb_stb <= '0';
|
2609 |
|
|
bench_sti_rxtx0_wb_we <= '0';
|
2610 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2611 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2612 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD*10;
|
2613 |
|
|
-- start a basic configuration write cycle -> disable tx
|
2614 |
|
|
bench_sti_rxtx0_wb_we <= '1';
|
2615 |
|
|
bench_sti_rxtx0_wb_adr <= "0010";
|
2616 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2617 |
|
|
bench_sti_rxtx0_wb_cyc <= '1';
|
2618 |
|
|
bench_sti_rxtx0_wb_stb <= '1';
|
2619 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2620 |
|
|
if (bench_res_rxtx0_wb_ack = '1') and (bench_res_rxtx0_wb_err = '0') and (bench_res_rxtx0_wb_rty = '0') then
|
2621 |
|
|
report "WBRWP: OK - RXTX configuration write cycle success (TX disabled)" severity note;
|
2622 |
|
|
else
|
2623 |
|
|
report "WBRWP: KO - RXTX configuration write cycle fail" severity warning;
|
2624 |
|
|
end if;
|
2625 |
|
|
bench_sti_rxtx0_wb_cyc <= '0';
|
2626 |
|
|
bench_sti_rxtx0_wb_stb <= '0';
|
2627 |
|
|
bench_sti_rxtx0_wb_we <= '0';
|
2628 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2629 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2630 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD*10;
|
2631 |
|
|
-- start a basic configuration write cycle -> enable tx + enable internal wb data use for tx
|
2632 |
|
|
bench_sti_rxtx0_wb_we <= '1';
|
2633 |
|
|
bench_sti_rxtx0_wb_adr <= "0010";
|
2634 |
|
|
bench_sti_rxtx0_wb_dat <= "00000000000000000000000000000001";
|
2635 |
|
|
bench_sti_rxtx0_wb_cyc <= '1';
|
2636 |
|
|
bench_sti_rxtx0_wb_stb <= '1';
|
2637 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2638 |
|
|
if (bench_res_rxtx0_wb_ack = '1') and (bench_res_rxtx0_wb_err = '0') and (bench_res_rxtx0_wb_rty = '0') then
|
2639 |
|
|
report "WBRWP: OK - RXTX configuration write cycle success (TX enabled + internal WB data use)" severity note;
|
2640 |
|
|
else
|
2641 |
|
|
report "WBRWP: KO - RXTX configuration write cycle fail" severity warning;
|
2642 |
|
|
end if;
|
2643 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2644 |
|
|
bench_sti_rxtx0_wb_cyc <= '0';
|
2645 |
|
|
bench_sti_rxtx0_wb_stb <= '0';
|
2646 |
|
|
bench_sti_rxtx0_wb_we <= '0';
|
2647 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2648 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2649 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD*10;
|
2650 |
|
|
-- start a basic tx write cycle
|
2651 |
|
|
bench_sti_rxtx0_wb_we <= '1';
|
2652 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2653 |
|
|
bench_sti_rxtx0_wb_dat <= bench_sti_rxtx0_wb_random_dat;
|
2654 |
|
|
bench_sti_rxtx0_wb_cyc <= '1';
|
2655 |
|
|
bench_sti_rxtx0_wb_stb <= '1';
|
2656 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2657 |
|
|
if (bench_res_rxtx0_wb_ack = '1') and (bench_res_rxtx0_wb_err = '0') and (bench_res_rxtx0_wb_rty = '0') then
|
2658 |
|
|
report "WBRWP: OK - TX write cycle success" severity note;
|
2659 |
|
|
else
|
2660 |
|
|
report "WBRWP: KO - TX write cycle fail" severity warning;
|
2661 |
|
|
end if;
|
2662 |
|
|
bench_sti_rxtx0_wb_cyc <= '0';
|
2663 |
|
|
bench_sti_rxtx0_wb_stb <= '0';
|
2664 |
|
|
bench_sti_rxtx0_wb_we <= '0';
|
2665 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2666 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2667 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD*10;
|
2668 |
|
|
-- start an error basic tx write cycle (unknown address)
|
2669 |
|
|
bench_sti_rxtx0_wb_we <= '1';
|
2670 |
|
|
bench_sti_rxtx0_wb_adr <= "0011";
|
2671 |
|
|
bench_sti_rxtx0_wb_dat <= bench_sti_rxtx0_wb_random_dat;
|
2672 |
|
|
bench_sti_rxtx0_wb_cyc <= '1';
|
2673 |
|
|
bench_sti_rxtx0_wb_stb <= '1';
|
2674 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2675 |
|
|
if (bench_res_rxtx0_wb_ack = '0') and (bench_res_rxtx0_wb_err = '1') and (bench_res_rxtx0_wb_rty = '1') then
|
2676 |
|
|
report "WBRWP: OK - Error write cycle success" severity note;
|
2677 |
|
|
else
|
2678 |
|
|
report "WBRWP: KO - Error write cycle fail" severity warning;
|
2679 |
|
|
end if;
|
2680 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2681 |
|
|
bench_sti_rxtx0_wb_cyc <= '0';
|
2682 |
|
|
bench_sti_rxtx0_wb_stb <= '0';
|
2683 |
|
|
bench_sti_rxtx0_wb_we <= '0';
|
2684 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2685 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD*10;
|
2686 |
|
|
-- start many tx write cycle
|
2687 |
|
|
for i in 0 to CCSDS_RXTX_BENCH_RXTX0_WB_TX_WRITE_CYCLE_NUMBER-1 loop
|
2688 |
|
|
bench_sti_rxtx0_wb_we <= '1';
|
2689 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2690 |
|
|
bench_sti_rxtx0_wb_dat <= bench_sti_rxtx0_wb_random_dat;
|
2691 |
|
|
bench_sti_rxtx0_wb_cyc <= '1';
|
2692 |
|
|
bench_sti_rxtx0_wb_stb <= '1';
|
2693 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2694 |
|
|
bench_sti_rxtx0_wb_we <= '0';
|
2695 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2696 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2697 |
|
|
bench_sti_rxtx0_wb_cyc <= '0';
|
2698 |
|
|
bench_sti_rxtx0_wb_stb <= '0';
|
2699 |
|
|
if (bench_res_rxtx0_wb_ack = '0') or (bench_res_rxtx0_wb_err = '1') or (bench_res_rxtx0_wb_rty = '1') then
|
2700 |
|
|
if (CCSDS_RXTX_BENCH_RXTX0_WB_TX_OVERFLOW = true) then
|
2701 |
|
|
if (output_done = false) then
|
2702 |
|
|
output_done := true;
|
2703 |
|
|
report "WBRWP: OK - Many TX write cycles overflow appears after " & integer'image(i) & " WB write cycles (" & integer'image(i*CCSDS_RXTX_BENCH_RXTX0_WB_DATA_BUS_SIZE) & " bits max burst)" severity note;
|
2704 |
|
|
end if;
|
2705 |
|
|
else
|
2706 |
|
|
report "WBRWP: KO - TX write cycle fail: ACK=" & std_logic'image(bench_res_rxtx0_wb_ack) & " ERR=" & std_logic'image(bench_res_rxtx0_wb_err) & " RTY=" & std_logic'image(bench_res_rxtx0_wb_rty) severity warning;
|
2707 |
|
|
end if;
|
2708 |
|
|
else
|
2709 |
|
|
if (i = CCSDS_RXTX_BENCH_RXTX0_WB_TX_WRITE_CYCLE_NUMBER-1) then
|
2710 |
|
|
report "WBRWP: OK - Many TX write cycles terminated with success" severity note;
|
2711 |
|
|
end if;
|
2712 |
|
|
end if;
|
2713 |
|
|
if (CCSDS_RXTX_BENCH_RXTX0_WB_TX_OVERFLOW = true) then
|
2714 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2715 |
|
|
else
|
2716 |
|
|
wait for (CCSDS_RXTX_BENCH_RXTX0_WB_WRITE_CYCLES_MAX-1)*CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD*2 + CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2717 |
|
|
end if;
|
2718 |
|
|
end loop;
|
2719 |
|
|
bench_sti_rxtx0_wb_cyc <= '0';
|
2720 |
|
|
bench_sti_rxtx0_wb_stb <= '0';
|
2721 |
|
|
bench_sti_rxtx0_wb_we <= '0';
|
2722 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2723 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2724 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD*10;
|
2725 |
|
|
-- start a basic configuration write cycle -> enable tx + external serial data activation
|
2726 |
|
|
bench_sti_rxtx0_wb_we <= '1';
|
2727 |
|
|
bench_sti_rxtx0_wb_adr <= "0010";
|
2728 |
|
|
bench_sti_rxtx0_wb_dat <= "00000000000000000000000000000011";
|
2729 |
|
|
bench_sti_rxtx0_wb_cyc <= '1';
|
2730 |
|
|
bench_sti_rxtx0_wb_stb <= '1';
|
2731 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2732 |
|
|
if (bench_res_rxtx0_wb_ack = '1') and (bench_res_rxtx0_wb_err = '0') and (bench_res_rxtx0_wb_rty = '0') then
|
2733 |
|
|
report "WBRWP: OK - Basic configuration write cycle success (TX enabled + external serial data input activated)" severity note;
|
2734 |
|
|
else
|
2735 |
|
|
report "WBRWP: KO - Basic configuration write cycle fail" severity warning;
|
2736 |
|
|
end if;
|
2737 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2738 |
|
|
bench_sti_rxtx0_wb_cyc <= '0';
|
2739 |
|
|
bench_sti_rxtx0_wb_stb <= '0';
|
2740 |
|
|
bench_sti_rxtx0_wb_we <= '0';
|
2741 |
|
|
bench_sti_rxtx0_wb_dat <= (others => '0');
|
2742 |
|
|
bench_sti_rxtx0_wb_adr <= "0000";
|
2743 |
|
|
wait for CCSDS_RXTX_BENCH_RXTX0_WB_CLK_PERIOD;
|
2744 |
|
|
-- final state tests:
|
2745 |
|
|
if (bench_res_rxtx0_wb_ack = '0') then
|
2746 |
|
|
report "WBRWP: OK - Final state - ACK not enabled" severity note;
|
2747 |
|
|
else
|
2748 |
|
|
report "WBRWP: OK - Final state - ACK enabled" severity warning;
|
2749 |
|
|
end if;
|
2750 |
|
|
if (bench_res_rxtx0_wb_err = '0') then
|
2751 |
|
|
report "WBRWP: OK - Final state - ERR not enabled" severity note;
|
2752 |
|
|
else
|
2753 |
|
|
report "WBRWP: OK - Final state - ERR enabled" severity warning;
|
2754 |
|
|
end if;
|
2755 |
|
|
if (bench_res_rxtx0_wb_rty = '0') then
|
2756 |
|
|
report "WBRWP: OK - Final state - RTY not enabled" severity note;
|
2757 |
|
|
else
|
2758 |
|
|
report "WBRWP: OK - Final state - RTY enabled" severity warning;
|
2759 |
|
|
end if;
|
2760 |
|
|
report "WBRWP: END WISHBONE BUS READ-WRITE TESTS" severity note;
|
2761 |
|
|
-- bench_ena_rxtx0_random_data <= '0';
|
2762 |
|
|
wait;
|
2763 |
|
|
end process;
|
2764 |
|
|
end behaviour;
|
2765 |
|
|
--=============================================================================
|
2766 |
|
|
-- architecture end
|
2767 |
|
|
--=============================================================================
|