29use ieee.std_logic_1164.
all;
30use ieee.numeric_std.
all;
31use ieee.std_logic_textio.
all;
109 file fstim : text open read_mode is "tb_fifo_2c_dram_stim";
110 variable iline : line;
111 variable oline : line;
112 variable dname : string(1 to 6) := (others=>' ');
113 variable ok : boolean;
114 variable dtime : Delay_length := 0 ns;
115 variable nwait : integer := 0;
116 variable nword : integer := 0;
117 variable nbusy : integer := 0;
118 variable idi : slv16 := (others=>'0');
120 variable ndataw : integer := 0;
122 variable iclkw_period : Delay_length := 20 ns;
123 variable iclkw_setup : Delay_length := 5 ns;
124 variable iclkr_period : Delay_length := 20 ns;
125 variable iclkr_c2out : Delay_length := 10 ns;
129 file_loop: while not endfile(fstim) loop
131 readline (fstim, iline);
133 readcomment(iline, ok);
134 next file_loop when ok;
136 readword(iline, dname, ok);
141 write(oline, string'(".chold"));
142 writeline(output, oline);
143 read_ea(iline, dtime);
147 wait until rising_edge(CLKW);
148 wait for iclkw_period-iclkw_setup;
151 write(oline, string'(".cdef "));
152 writeline(output, oline);
153 read_ea(iline, iclkw_period);
154 read_ea(iline, iclkw_setup);
155 read_ea(iline, iclkr_period);
156 read_ea(iline, iclkr_c2out);
161 wait until rising_edge(CLKW);
162 wait for iclkw_period-iclkw_setup;
166 read_ea(iline, ndataw);
170 read_ea(iline, dtime);
172 N_HOLD <= '1', '0' after dtime;
178 read_ea(iline, nwait);
179 wait for nwait*iclkw_period;
182 read_ea(iline, nwait);
184 wait for nwait*iclkw_period;
188 read_ea(iline, nwait);
192 read_ea(iline, nwait);
193 read_ea(iline, nword);
194 for i in 1 to nword loop
195 wait for nwait*iclkw_period;
197 idi := slv(to_unsigned(ndataw, 16));
198 ndataw := ndataw + 1;
205 wait for iclkw_period;
209 write(oline, idi, right, 18);
210 write(oline, SIZEW, right, 7);
211 write(oline, string'(" ("));
212 write(oline, to_integer(unsigned(idi)), right, 5);
213 write(oline, string'(","));
214 write(oline, to_integer(unsigned(SIZEW)), right, 2);
215 write(oline, string'(")"));
217 write(oline, string'(" nbusy="));
218 write(oline, nbusy, right, 2);
220 writeline(output, oline);
222 wait for iclkw_period;
228 write(oline, string'("?? unknown command: "));
230 writeline(output, oline);
231 report "aborting" severity failure;
235 report "failed to find command" severity failure;
245 wait for 20*(iclkw_period+iclkr_period);
248 writetimestamp(oline, CLKW_CYCLE, ": DONE-w ");
249 writeline(output, oline);
250 writetimestamp(oline, CLKR_CYCLE, ": DONE-r ");
251 writeline(output, oline);
255 end process proc_stim;
259 variable oline : line;
260 variable nhold : integer := 0;
261 variable isizer_last : slv4 := (others=>'0');
262 variable ido : slv16 := (others=>'0');
266 wait until rising_edge(CLKR);
277 write(oline, DO, right, 18);
278 write(oline, SIZER, right, 7);
279 write(oline, string'(" ("));
280 write(oline, to_integer(unsigned(DO)), right, 5);
281 write(oline, string'(","));
282 write(oline, to_integer(unsigned(SIZER)), right, 2);
283 write(oline, string'(")"));
285 write(oline, string'(" nhold="));
286 write(oline, nhold, right, 2);
290 write(oline, string'(" OK"));
292 write(oline, string'(" FAIL, exp="));
293 write(oline, ido, right, 18);
296 writeline(output, oline);
300 if SIZER /= isizer_last then
302 write(oline, string'(" "));
303 write(oline, SIZER, right, 7);
304 write(oline, string'(" ("));
305 write(oline, to_integer(unsigned(SIZER)), right, 2);
306 write(oline, string'(")"));
307 writeline(output, oline);
311 isizer_last := SIZER;
315 end process proc_moni;
319 if rising_edge(CLKR) then
329 end process proc_clkr;
in CLK_PERIOD Delay_length
std_logic_vector( 3 downto 0) slv4
std_logic_vector( 15 downto 0) slv16
Delay_length := 20 ns CLKR_PERIOD
slv4 :=( others => '0') SIZER
Delay_length := 20 ns CLKW_PERIOD
Delay_length := 10 ns CLKR_C2OUT
slv4 :=( others => '0') SIZEW
slv16 :=( others => '0') DI
shared integer :=:= 0 sv_nrstr
shared integer :=:= 0 sv_ndatar
slv16 :=( others => '0') DO