23use ieee.std_logic_1164.
all;
24use ieee.numeric_std.
all;
25use ieee.std_logic_textio.
all;
103 file fstim : text open read_mode is "tb_fifo_2c_dram2_stim";
104 variable iline : line;
105 variable oline : line;
106 variable dname : string(1 to 6) := (others=>' ');
107 variable ok : boolean;
108 variable dtime : Delay_length := 0 ns;
109 variable nwait : integer := 0;
110 variable nword : integer := 0;
111 variable nbusy : integer := 0;
112 variable idi : slv16 := (others=>'0');
114 variable ndataw : integer := 0;
116 variable iclkw_period : Delay_length := 20 ns;
117 variable iclkw_setup : Delay_length := 5 ns;
118 variable iclkr_period : Delay_length := 20 ns;
119 variable iclkr_c2out : Delay_length := 10 ns;
123 file_loop: while not endfile(fstim) loop
125 readline (fstim, iline);
127 readcomment(iline, ok);
128 next file_loop when ok;
130 readword(iline, dname, ok);
135 write(oline, string'(".chold"));
136 writeline(output, oline);
137 read_ea(iline, dtime);
141 wait until rising_edge(CLKW);
142 wait for iclkw_period-iclkw_setup;
145 write(oline, string'(".cdef "));
146 writeline(output, oline);
147 read_ea(iline, iclkw_period);
148 read_ea(iline, iclkw_setup);
149 read_ea(iline, iclkr_period);
150 read_ea(iline, iclkr_c2out);
155 wait until rising_edge(CLKW);
156 wait for iclkw_period-iclkw_setup;
160 read_ea(iline, ndataw);
164 read_ea(iline, dtime);
166 N_HOLD <= '1', '0' after dtime;
172 read_ea(iline, nwait);
173 wait for nwait*iclkw_period;
176 read_ea(iline, nwait);
178 wait for nwait*iclkw_period;
182 read_ea(iline, nwait);
186 read_ea(iline, nwait);
187 read_ea(iline, nword);
188 for i in 1 to nword loop
189 wait for nwait*iclkw_period;
191 idi := slv(to_unsigned(ndataw, 16));
192 ndataw := ndataw + 1;
199 wait for iclkw_period;
203 write(oline, idi, right, 18);
204 write(oline, SIZEW, right, 7);
205 write(oline, string'(" ("));
206 write(oline, to_integer(unsigned(idi)), right, 5);
207 write(oline, string'(","));
208 write(oline, to_integer(unsigned(SIZEW)), right, 2);
209 write(oline, string'(")"));
211 write(oline, string'(" nbusy="));
212 write(oline, nbusy, right, 2);
214 writeline(output, oline);
216 wait for iclkw_period;
222 write(oline, string'("?? unknown command: "));
224 writeline(output, oline);
225 report "aborting" severity failure;
229 report "failed to find command" severity failure;
239 wait for 20*(iclkw_period+iclkr_period);
242 writetimestamp(oline, CLKW_CYCLE, ": DONE-w ");
243 writeline(output, oline);
244 writetimestamp(oline, CLKR_CYCLE, ": DONE-r ");
245 writeline(output, oline);
249 end process proc_stim;
253 variable oline : line;
254 variable nhold : integer := 0;
255 variable isizer_last : slv4 := (others=>'0');
256 variable ido : slv16 := (others=>'0');
260 wait until rising_edge(CLKR);
271 write(oline, DO, right, 18);
272 write(oline, SIZER, right, 7);
273 write(oline, string'(" ("));
274 write(oline, to_integer(unsigned(DO)), right, 5);
275 write(oline, string'(","));
276 write(oline, to_integer(unsigned(SIZER)), right, 2);
277 write(oline, string'(")"));
279 write(oline, string'(" nhold="));
280 write(oline, nhold, right, 2);
284 write(oline, string'(" OK"));
286 write(oline, string'(" FAIL, exp="));
287 write(oline, ido, right, 18);
290 writeline(output, oline);
294 if SIZER /= isizer_last then
296 write(oline, string'(" "));
297 write(oline, SIZER, right, 7);
298 write(oline, string'(" ("));
299 write(oline, to_integer(unsigned(SIZER)), right, 2);
300 write(oline, string'(")"));
301 writeline(output, oline);
305 isizer_last := SIZER;
309 end process proc_moni;
313 if rising_edge(CLKR) then
323 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