28use ieee.std_logic_1164.
all;
29use ieee.numeric_std.
all;
30use ieee.std_logic_textio.
all;
41component tbd_nx_cram_memctl
is
56 O_MEM_CE_N :
out slbit;
57 O_MEM_BE_N :
out slv2;
58 O_MEM_WE_N :
out slbit;
59 O_MEM_OE_N :
out slbit;
60 O_MEM_ADV_N :
out slbit;
61 O_MEM_CLK :
out slbit;
62 O_MEM_CRE :
out slbit;
63 I_MEM_WAIT :
in slbit;
64 O_MEM_ADDR :
out slv23;
65 IO_MEM_DATA :
inout slv16
141 UUT : tbd_nx_cram_memctl
169 file fstim : text open read_mode is "tb_nx_cram_memctl_stim";
170 variable iline : line;
171 variable oline : line;
172 variable ok : boolean;
173 variable dname : string(1 to 6) := (others=>' ');
174 variable idelta : integer := 0;
175 variable iaddr : slv22 := (others=>'0');
176 variable idata : slv32 := (others=>'0');
177 variable ibe : slv4 := (others=>'0');
178 variable ival : slbit := '0';
179 variable nbusy : integer := 0;
185 file_loop: while not endfile(fstim) loop
187 readline (fstim, iline);
189 readcomment(iline, ok);
190 next file_loop when ok;
192 readword(iline, dname, ok);
196 read_ea(iline, ival);
201 write(oline, string'(".reset"));
202 writeline(output, oline);
209 read_ea(iline, idelta);
213 readgen_ea(iline, iaddr, 16);
214 readgen_ea(iline, idata, 16);
219 writetimestamp(oline, CLK_CYCLE, ": stim read ");
220 writegen(oline, iaddr, right, 7, 16);
221 write(oline, string'(" "));
222 writegen(oline, idata, right, 9, 16);
230 write(oline, string'(" nbusy="));
231 write(oline, nbusy, right, 2);
232 writeline(output, oline);
242 readgen_ea(iline, iaddr, 16);
244 readgen_ea(iline, idata, 16);
251 writetimestamp(oline, CLK_CYCLE, ": stim write");
252 writegen(oline, iaddr, right, 7, 16);
253 writegen(oline, ibe , right, 5, 2);
254 writegen(oline, idata, right, 9, 16);
257 while BUSY = '1' loop
262 write(oline, string'(" nbusy="));
263 write(oline, nbusy, right, 2);
264 writeline(output, oline);
270 write(oline, string'("?? unknown directive: "));
272 writeline(output, oline);
273 report "aborting" severity failure;
276 report "failed to find command" severity failure;
286 writetimestamp(oline, CLK_CYCLE, ": DONE ");
287 writeline(output, oline);
294 end process proc_stim;
298 variable oline : line;
302 wait until rising_edge(CLK);
305 writetimestamp(oline, CLK_CYCLE, ": moni ");
306 writegen(oline, DO, right, 9, 16);
308 write(oline, string'(" CHECK"));
310 write(oline, string'(" OK"));
312 write(oline, string'(" FAIL, exp="));
314 write(oline, string'(" for a="));
319 writeline(output, oline);
336 end process proc_moni;
340 variable oline : line;
344 wait until rising_edge(CLK);
347 writetimestamp(oline, CLK_CYCLE, ": mem ");
348 write(oline, string'(" ce="));
350 write(oline, string'(" be="));
352 write(oline, string'(" we="));
354 write(oline, string'(" oe="));
356 write(oline, string'(" a="));
358 write(oline, string'(" d="));
360 writeline(output, oline);
365 end process proc_memon;
OFFSET Delay_length := 200 ns
PERIOD Delay_length := 20 ns
std_logic_vector( 22 downto 0) slv23
std_logic_vector( 3 downto 0) slv4
std_logic_vector( 31 downto 0) slv32
std_logic_vector( 15 downto 0) slv16
std_logic_vector( 21 downto 0) slv22
std_logic_vector( 1 downto 0) slv2
slv32 :=( others => '0') R_REF_DATA_DL
slv4 :=( others => '0') BE
slv32 :=( others => '0') DO
slbit := '0' R_CHK_DATA_DL
Delay_length := 12.0 ns c2out_time
Delay_length := 200 ns clock_offset
slv16 :=( others => '0') IO_MEM_DATA
slv22 :=( others => '0') R_REF_ADDR_DL
slbit := '0' R_CHK_DATA_AL
Delay_length := 7.5 ns setup_time
slv22 :=( others => '0') N_REF_ADDR
slv32 :=( others => '0') DI
slv2 :=( others => '0') O_MEM_BE_N
slv32 :=( others => '0') N_REF_DATA
slv23 :=( others => '0') O_MEM_ADDR
slv22 :=( others => '0') R_REF_ADDR_AL
slv32 :=( others => '0') R_REF_DATA_AL
slv22 :=( others => '0') ADDR
Delay_length := 20 ns clock_period