23use ieee.std_logic_1164.
all;
24use ieee.numeric_std.
all;
25use ieee.std_logic_textio.
all;
89 file fstim : text open read_mode is "tb_fifo_simple_dram_stim";
90 variable iline : line;
91 variable oline : line;
92 variable dname : string(1 to 6) := (others=>' ');
93 variable ok : boolean;
94 variable nwait : integer := 0;
95 variable idi : slv16 := (others=>'0');
96 variable ido : slv16 := (others=>'0');
97 variable isize : slv4 := (others=>'0');
101 wait until rising_edge(CLK);
103 file_loop: while not endfile(fstim) loop
105 readline (fstim, iline);
107 readcomment(iline, ok);
108 next file_loop when ok;
110 readword(iline, dname, ok);
114 read_ea(iline, nwait);
115 for i in 1 to nwait loop
116 wait until rising_edge(CLK);
120 writetimestamp(oline, CLK_CYCLE, ": reset");
121 writeline(output, oline);
127 wait until rising_edge(CLK);
132 readgen_ea(iline, idi, 16);
133 writetimestamp(oline, CLK_CYCLE, ": write");
134 write(oline, idi, right, 18);
135 writeline(output, oline);
139 isize := slv(unsigned(isize) + 1);
142 if isize = "1111" then
146 wait until rising_edge(CLK);
152 readgen_ea(iline, ido, 16);
155 isize := slv(unsigned(isize) - 1);
158 if isize = "0000" then
163 writetimestamp(oline, CLK_CYCLE, ": read ");
164 write(oline, DO, right, 18);
166 write(oline, string'(" OK"));
168 write(oline, string'(" FAIL, exp="));
169 write(oline, ido, right, 18);
171 writeline(output, oline);
173 wait until rising_edge(CLK);
178 write(oline, string'("?? unknown command: "));
180 writeline(output, oline);
181 report "aborting" severity failure;
185 report "failed to find command" severity failure;
190 writetimestamp(oline, CLK_CYCLE, ": DONE ");
191 writeline(output, oline);
200 end process proc_stim;
204 variable oline : line;
205 variable iempty_1 : slbit := '1';
210 wait until rising_edge(CLK);
218 if EMPTY='0' or iempty_1 ='0' then
219 writetimestamp(oline, CLK_CYCLE, ": moni ");
220 write(oline, DO, right, 18);
221 write(oline, EMPTY, right, 3);
222 write(oline, FULL, right, 2);
223 write(oline, SIZE, right, 6);
224 write(oline, string'(" ("));
225 write(oline, to_integer(unsigned(SIZE)), right, 2);
226 write(oline, string'(")"));
228 write(oline, string'(" FAIL EMPTY exp="));
232 write(oline, string'(" FAIL FULL exp="));
236 write(oline, string'(" FAIL SIZE exp="));
239 writeline(output, oline);
246 end process proc_moni;
OFFSET Delay_length := 200 ns
PERIOD Delay_length := 20 ns
std_logic_vector( 3 downto 0) slv4
std_logic_vector( 15 downto 0) slv16
slv4 :=( others => '0') N_SIZE
slv4 :=( others => '0') SIZE
slv4 :=( others => '0') R_SIZE
Delay_length := 200 ns clock_offset
Delay_length := 5 ns setup_time
Delay_length := 10 ns c2out_time
slv16 :=( others => '0') DI
slv16 :=( others => '0') DO
Delay_length := 20 ns clock_period