35use ieee.std_logic_1164.
all;
36use ieee.numeric_std.
all;
219 if rising_edge(CLK) then
232 end process proc_regs;
239 variable ibhold : slbit := '0';
240 variable idout : slv16 := (others=>'0');
241 variable ibreq : slbit := '0';
242 variable ibrd : slbit := '0';
243 variable ibw0 : slbit := '0';
244 variable ibw1 : slbit := '0';
245 variable int_or : slbit := '0';
246 variable tcnt256_end : slbit := '0';
247 variable tcntsnd_end : slbit := '0';
248 variable eff_id : slv2 := "00";
249 variable eff_bus : iist_bus_type := iist_bus_init;
250 variable par_err : slbit := '0';
251 variable act_ibit : slbit := '0';
252 variable act_bbit : slbit := '0';
253 variable iout : iist_line_type := iist_line_init;
260 idout := (others=>'0');
266 int_or := r.pgc_grj or r.pgc_pgrmr or r.pgc_strmr;
267 for i in r.dcf_dcf'range loop
268 int_or := int_or or r.dcf_dcf(i) or
275 if CE_USEC='1' and r.stc_enb='1'then
276 n.tcnt256 := slv(unsigned(r.tcnt256) + 1);
277 if unsigned(r.tcnt256) = 255 then
283 n.tcntsnd := slv(unsigned(r.tcntsnd) + 1);
284 if unsigned(r.tcntsnd) = tdlysnd-1 then
289 if r.mtc_enmxd = '1' then
298 iout := iist_line_init;
310 n.tcntsnd := (others=>'0');
311 if r.req_stsnd = '1' then
313 elsif r.req_pgsnd = '1' then
324 if tcntsnd_end = '1' then
328 iout.imask := r.ste_sie;
329 iout.bmask := r.ste_sbe;
330 iout.par := not r.stc_stp;
336 if tcntsnd_end = '1' then
340 iout.imask := r.pge_pie;
341 iout.bmask := r.pge_pbe;
342 iout.par := r.pgc_ptp;
350 if r.mtc_enmxd = '1' then
351 iout.stf := r.mtc_mttp;
352 iout.frm := r.mtc_mfrm;
356 if r.ibsel = '1' and ibhold='0' then
358 if IB_MREQ.addr(1 downto 1) = "0" then
383 if r.req_pgsnd = '0' then
398 idout(pgc_ibf_err) := r.pgc_grj or r.pgc_pgrmr or r.pgc_strmr;
419 if r.req_pgsnd = '0' then
434 if r.req_stsnd = '0' then
458 n.tcnt256 := (others=>'0');
553 if unsigned(r.acr_ac) <= unsigned(ac_exc) then
555 n.acr_ac := slv(unsigned(r.acr_ac) + 1);
565 if tcnt256_end = '1' then
566 n.stc_count := slv(unsigned(r.stc_count) - 1);
567 if unsigned(r.stc_count) = 0 then
570 if r.stc_lke = '1' then
578 if r.mtc_enmlp = '1' then
579 for i in eff_bus'range loop
581 eff_bus(i).dcf := '0';
585 for i in eff_bus'range loop
587 par_err := eff_bus(i).stf xor
588 eff_bus(i).imask(0) xor eff_bus(i).imask(1) xor
589 eff_bus(i).imask(2) xor eff_bus(i).imask(3) xor
590 eff_bus(i).bmask(0) xor eff_bus(i).bmask(1) xor
591 eff_bus(i).bmask(2) xor eff_bus(i).bmask(3) xor
594 act_ibit := eff_bus(i).imask(to_integer(unsigned(eff_id)));
595 act_bbit := eff_bus(i).bmask(to_integer(unsigned(eff_id)));
597 n.dcf_brk(i) := eff_bus(i).dcf;
599 if eff_bus(i).dcf = '1' then
600 if r.msk_im(i) = '0' then
605 if eff_bus(i).req = '1' then
606 if eff_bus(i).frm='1' or
608 if r.msk_im(i) = '0' then
613 if act_ibit = '1' then
614 if r.msk_im(i) = '1' then
618 if eff_bus(i).stf = '0' then
626 if act_bbit = '1' then
627 if r.msk_bm(i) = '1' then
630 if r.mtc_dsbt = '0' then
634 if eff_bus(i).stf = '0' then
659 IB_SRES.ack <= r.ibsel and ibreq;
660 IB_SRES.busy <= ibhold and ibreq;
662 EI_REQ <= r.pgc_ie and int_or;
664 if r.mtc_dsdrv = '1' then
673 end process proc_next;
integer range 3 downto 0 msk_ibf_im
integer range 3 downto 0 pge_ibf_pie
integer range 11 downto 8 ste_ibf_sbe
integer range 11 downto 8 exc_ibf_ui
integer range 11 downto 8 dcf_ibf_brk
integer range 15 downto 8 stc_ibf_count
integer := 0 mtc_ibf_dsdrv
integer := 11 mtc_ibf_mttp
integer range 11 downto 8 pge_ibf_pbe
integer range 3 downto 0 stf_ibf_sif
slv16 := slv( to_unsigned( 8#177500#, 16) ) ibaddr_iist
integer range 3 downto 0 pgf_ibf_pif
integer range 3 downto 0 dcf_ibf_dcf
integer range 3 downto 0 ste_ibf_sie
integer range 11 downto 8 stf_ibf_sbf
integer := 12 pgc_ibf_strmr
integer range 11 downto 8 msk_ibf_bm
integer := 3 mtc_ibf_dsbt
regs_type :=( '0', "0000", "0000", "0000", '0', '0', '0', '0', '0', "0000", "0000",( others => '0'), '0', '0', '0', '0', "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", '0', '0', "00", '0', '0', '0', '0', s_idle, '0', '0', '0',( others => '0'),( others => '0'), '0', '0') regs_init
regs_type := regs_init R_REGS
(s_idle,s_clear,s_stsnd,s_pgsnd) state_type
integer := 10 mtc_ibf_mfrm
integer range 9 downto 8 pgc_ibf_sid
integer := 15 pgc_ibf_err
integer := 2 mtc_ibf_enmxd
integer range 9 downto 8 acr_ibf_sid
integer := 15 acr_ibf_clr
integer := 1 mtc_ibf_enmlp
integer range 11 downto 8 pgf_ibf_pbf
integer range 3 downto 0 exc_ibf_rte
integer range 3 downto 0 acr_ibf_ac
integer := 13 pgc_ibf_pgrmr
integer range 9 downto 8 mtc_ibf_mid
integer := 11 pgc_ibf_rdy
integer := 14 pgc_ibf_grj
out IIST_OUT iist_line_type
out IIST_MREQ iist_mreq_type
in IIST_SRES iist_sres_type
in IIST_BUS iist_bus_type
std_logic_vector( 3 downto 0) slv4
std_logic_vector( 0 downto 0) slv1
std_logic_vector( 15 downto 0) slv16
std_logic_vector( 7 downto 0) slv8
std_logic_vector( 1 downto 0) slv2