36use ieee.std_logic_1164.
all;
37use ieee.numeric_std.
all;
38use ieee.std_logic_textio.
all;
148 file fstim : text open read_mode is "tb_s3_sram_memctl_stim";
149 variable iline : line;
150 variable oline : line;
151 variable ok : boolean;
152 variable dname : string(1 to 6) := (others=>' ');
153 variable idelta : integer := 0;
154 variable iaddr : slv18 := (others=>'0');
155 variable idata : slv32 := (others=>'0');
156 variable ibe : slv4 := (others=>'0');
157 variable ival : slbit := '0';
158 variable nbusy : integer := 0;
164 file_loop: while not endfile(fstim) loop
166 readline (fstim, iline);
168 readcomment(iline, ok);
169 next file_loop when ok;
171 readword(iline, dname, ok);
175 read_ea(iline, ival);
180 write(oline, string'(".reset"));
181 writeline(output, oline);
188 read_ea(iline, idelta);
192 readgen_ea(iline, iaddr, 16);
193 readgen_ea(iline, idata, 16);
198 writetimestamp(oline, CLK_CYCLE, ": stim read ");
199 writegen(oline, iaddr, right, 6, 16);
200 write(oline, string'(" "));
201 writegen(oline, idata, right, 9, 16);
204 while BUSY = '1' loop
209 write(oline, string'(" nbusy="));
210 write(oline, nbusy, right, 2);
211 writeline(output, oline);
221 readgen_ea(iline, iaddr, 16);
223 readgen_ea(iline, idata, 16);
230 writetimestamp(oline, CLK_CYCLE, ": stim write");
231 writegen(oline, iaddr, right, 6, 16);
232 writegen(oline, ibe , right, 5, 2);
233 writegen(oline, idata, right, 9, 16);
236 while BUSY = '1' loop
241 write(oline, string'(" nbusy="));
242 write(oline, nbusy, right, 2);
243 writeline(output, oline);
249 write(oline, string'("?? unknown directive: "));
251 writeline(output, oline);
252 report "aborting" severity failure;
255 report "failed to find command" severity failure;
265 writetimestamp(oline, CLK_CYCLE, ": DONE ");
266 writeline(output, oline);
273 end process proc_stim;
277 variable oline : line;
281 wait until rising_edge(CLK);
284 writetimestamp(oline, CLK_CYCLE, ": moni ");
285 writegen(oline, DO, right, 9, 16);
287 write(oline, string'(" CHECK"));
289 write(oline, string'(" OK"));
291 write(oline, string'(" FAIL, exp="));
293 write(oline, string'(" for a="));
298 writeline(output, oline);
315 end process proc_moni;
319 variable oline : line;
323 wait until rising_edge(CLK);
326 writetimestamp(oline, CLK_CYCLE, ": mem ");
327 write(oline, string'(" ce="));
329 write(oline, string'(" be="));
331 write(oline, string'(" we="));
333 write(oline, string'(" oe="));
335 write(oline, string'(" a="));
337 write(oline, string'(" d="));
339 writeline(output, oline);
344 end process proc_memon;
OFFSET Delay_length := 200 ns
PERIOD Delay_length := 20 ns
std_logic_vector( 3 downto 0) slv4
std_logic_vector( 17 downto 0) slv18
std_logic_vector( 31 downto 0) slv32
std_logic_vector( 1 downto 0) slv2
slv32 :=( others => '0') R_REF_DATA_DL
slv18 :=( others => '0') N_REF_ADDR
slv4 :=( others => '0') BE
slv32 :=( others => '0') DO
slbit := '0' R_CHK_DATA_DL
slv4 :=( others => '0') O_MEM_BE_N
Delay_length := 200 ns clock_offset
Delay_length := 5 ns setup_time
slbit := '0' R_CHK_DATA_AL
slv2 :=( others => '0') O_MEM_CE_N
slv18 :=( others => '0') O_MEM_ADDR
slv32 :=( others => '0') IO_MEM_DATA
Delay_length := 10 ns c2out_time
slv32 :=( others => '0') DI
slv18 :=( others => '0') R_REF_ADDR_DL
slv32 :=( others => '0') N_REF_DATA
slv32 :=( others => '0') R_REF_DATA_AL
slv18 :=( others => '0') R_REF_ADDR_AL
slv18 :=( others => '0') ADDR
Delay_length := 20 ns clock_period