36use ieee.std_logic_1164.
all;
37use ieee.numeric_std.
all;
38use ieee.std_logic_textio.
all;
85 file fconf : text open read_mode is "rlink_cext_conf";
86 variable iline : line;
87 variable oline : line;
88 variable ok : boolean;
89 variable dname : string(1 to 6) := (others=>' ');
90 variable ien : slbit := '0';
91 variable ibit : integer := 0;
92 variable twait : Delay_length := 0 ns;
93 variable iaddr : slv8 := (others=>'0');
94 variable idata : slv16 := (others=>'0');
100 SB_CNTL <= (others=>'L');
102 SB_ADDR <= (others=>'L');
103 SB_DATA <= (others=>'L');
105 file_loop: while not endfile(fconf) loop
107 readline (fconf, iline);
108 readcomment(iline, ok);
109 next file_loop when ok;
110 readword(iline, dname, ok);
116 read_ea(iline, ibit);
118 assert (ibit>=SB_CNTL'low and ibit<=SB_CNTL'high)
119 report "assert bit number in range of SB_CNTL"
123 SB_CNTL(ibit) <= 'H';
125 SB_CNTL(ibit) <= 'L';
132 SB_CNTL(sbcntl_sbf_rlmon) <= 'H';
134 SB_CNTL(sbcntl_sbf_rlmon) <= 'L';
141 SB_CNTL(sbcntl_sbf_rbmon) <= 'H';
143 SB_CNTL(sbcntl_sbf_rbmon) <= 'L';
147 readgen_ea(iline, iaddr, 16);
148 readgen_ea(iline, idata, 16);
155 SB_ADDR <= (others=>'L');
156 SB_DATA <= (others=>'L');
159 read_ea(iline, twait);
163 write(oline, string'("?? unknown command: "));
165 writeline(output, oline);
166 report "aborting" severity failure;
169 report "failed to find command" severity failure;
177 SB_ADDR <= (others=>'L');
178 SB_DATA <= (others=>'L');
184 end process proc_conf;
187 variable irxint : integer := 0;
188 variable irxslv : slv24 := (others=>'0');
189 variable ibit : integer := 0;
190 variable oline : line;
191 variable r_sb_cntl : slv16 := (others=>'Z');
192 variable iaddr : slv8 := (others=>'0');
193 variable idata : slv16 := (others=>'0');
201 SB_ADDR <= (others=>'Z');
202 SB_DATA <= (others=>'Z');
203 SB_CNTL <= (others=>'Z');
209 wait until rising_edge(CLK);
211 for i in 0 to 39 loop
212 wait until rising_edge(CLK);
215 writetimestamp(oline, CLK_CYCLE, ": START");
216 writeline(output, oline);
220 wait until falling_edge(CLK);
222 SB_ADDR <= (others=>'Z');
223 SB_DATA <= (others=>'Z');
232 if irxint <= 16#ff# then
235 elsif irxint >= 16#1000000# then
236 irxslv := slv(to_unsigned(irxint mod 16#1000000#, 24));
237 iaddr := irxslv(23 downto 16);
238 idata := irxslv(15 downto 0);
239 writetimestamp(oline, CLK_CYCLE, ": OOB-MSG");
240 write(oline, irxslv(23 downto 16), right, 9);
241 write(oline, irxslv(15 downto 8), right, 9);
242 write(oline, irxslv( 7 downto 0), right, 9);
243 write(oline, string'(" : "));
244 writeoct(oline, iaddr, right, 3);
245 writeoct(oline, idata, right, 7);
246 writeline(output, oline);
247 if unsigned(iaddr) = 0 then
248 ibit := to_integer(unsigned(idata(15 downto 8)));
249 r_sb_cntl(ibit) := idata(0);
262 elsif irxint = -1 then
265 report "rlink_cext_getbyte error: " & integer'image(-irxint)
271 SB_CNTL <= r_sb_cntl;
276 for i in 0 to 49 loop
277 wait until rising_edge(CLK);
280 writetimestamp(oline, CLK_CYCLE, ": DONE ");
281 writeline(output, oline);
285 report "Simulation Finished" severity failure;
287 end process proc_stim;
std_logic_vector( 31 downto 0) slv32
std_logic_vector( 15 downto 0) slv16
std_logic_vector( 7 downto 0) slv8
std_logic_vector( 23 downto 0) slv24
slv32 :=( others => '0') CEXT_CYCLE
slv32 :=( others => '0') CEXT_RXDATA