32use ieee.std_logic_1164.
all;
33use ieee.numeric_std.
all;
435 if rising_edge(CLK) then
438 end process proc_regs;
444 variable ibhold : slbit := '0';
445 variable idout : slv16 := (others=>'0');
446 variable ibrem : slbit := '0';
447 variable ibreq : slbit := '0';
448 variable ibrd : slbit := '0';
449 variable ibw0 : slbit := '0';
450 variable ibw1 : slbit := '0';
451 variable ibwrem : slbit := '0';
452 variable ilam : slbit := '0';
453 variable iei_req : slbit := '0';
455 variable imem_we0 : slbit := '0';
456 variable imem_we1 : slbit := '0';
457 variable imem_addr : slv5 := (others=>'0');
458 variable imem_din : slv16 := (others=>'0');
460 variable ieunit : slv2 := (others=>'0');
462 variable iomux : slv4 := (others=>'0');
463 variable iamap : slv5 := (others=>'0');
464 variable imask : slv16 := (others=>'0');
465 variable imbreg : slbit := '0';
466 variable inormr : slbit := '0';
468 variable idte : slv3 := (others=>'0');
469 variable idtyp : slv6 := (others=>'0');
470 variable icamax : slv10 := (others=>'0');
471 variable itamax : slv5 := (others=>'0');
472 variable isamax : slv6 := (others=>'0');
474 variable ined : slbit := '0';
475 variable icerm : slbit := '0';
477 variable iclrreg : slbit := '0';
479 variable iscinc : slbit := '0';
487 idout := (others=>'0');
493 ibwrem := IB_MREQ.we and ibrem;
500 imem_din := r.dinmsk;
502 ieunit := (others=>'0');
504 iomux := (others=>'0');
505 iamap := (others=>'0');
506 imask := (others=>'1');
510 idte := (others=>'0');
511 idtyp := (others=>'0');
512 icamax := (others=>'0');
513 itamax := (others=>'0');
514 isamax := (others=>'0');
546 idte(2) := r.dtrm(to_integer(unsigned(r.cs2unit)));
547 idte(1) := r.dte1(to_integer(unsigned(r.cs2unit)));
548 idte(0) := r.dte0(to_integer(unsigned(r.cs2unit)));
581 idtyp := (others=>'0');
582 icamax := (others=>'0');
583 itamax := (others=>'0');
584 isamax := (others=>'0');
592 if r.dsdpr(to_integer(unsigned(r.cs2unit))) = '0' or
593 r.cs2unit2 = '1' then
598 icerm := r.dtrm(to_integer(unsigned(ieunit)));
602 case IB_MREQ.addr(5 downto 1) is
614 imask := "1111111111111110";
619 imask := "0001111100111111";
663 imask := "0001110011111111";
669 imask := "0000001111111111";
717 n.dinmsk := imask and IB_MREQ.din;
721 case IB_MREQ.addr(5 downto 1) is
758 if ibrem = '0' and imbreg='1' then
765 (r.dspip(to_integer(unsigned(r.cs2unit)))='1' or
766 (r.cs1rdy='0' and (r.funit = r.cs2unit))
773 if ibrem='0' and imbreg='1' and ined='1' then
789 n.state := s_oot_clr0;
792 if unsigned(r.idlycnt) = 0 then
793 n.dsata := r.dsata or r.dspip;
794 n.dspip := (others=>'0');
797 n.idlycnt := slv(unsigned(r.idlycnt) - 1);
808 imem_din := r.dinmsk;
820 if r.cs1rdy = '1' then
835 n.state := s_funcchk;
863 n.dsata(to_integer(unsigned(r.funit))) := '1';
890 n.state := s_oot_clr0;
907 n.er1uns(to_integer(unsigned(r.eunit))) := '1';
910 n.er1wle(to_integer(unsigned(r.eunit))) := '1';
913 n.er1iae(to_integer(unsigned(r.eunit))) := '1';
916 n.er1aoe(to_integer(unsigned(r.eunit))) := '1';
919 n.er1ilf(to_integer(unsigned(r.eunit))) := '1';
929 n.dsata := r.dsata and not IB_MREQ.din(r.dsata'range);
955 n.dsata(to_integer(unsigned(r.runit))) := '1';
958 n.dsvv(to_integer(unsigned(r.runit))) := '0';
961 n.er1uns(to_integer(unsigned(r.eunit))) := '0';
962 n.er1wle(to_integer(unsigned(r.eunit))) := '0';
963 n.er1iae(to_integer(unsigned(r.eunit))) := '0';
964 n.er1aoe(to_integer(unsigned(r.eunit))) := '0';
965 n.er1rmr(to_integer(unsigned(r.eunit))) := '0';
966 n.er1ilf(to_integer(unsigned(r.eunit))) := '0';
984 imem_din := r.dinmsk;
1001 imem_addr := r.amap;
1002 imem_din := r.dinmsk;
1015 if r.cs1rdy = '0' and
1019 n.eunit := r.cs2unit;
1021 n.state := s_oot_clr0;
1022 elsif r.dserp(to_integer(unsigned(r.cs2unit))) = '1' then
1023 n.er1ilf(to_integer(unsigned(r.cs2unit))) := '1';
1026 n.state := s_funcgo;
1031 n.dsata(to_integer(unsigned(r.cs2unit))) := '0';
1042 if r.dtrm(to_integer(unsigned(r.cs2unit))) = '0' then
1043 n.dsmol(to_integer(unsigned(r.cs2unit))) := '0';
1044 n.dswrl(to_integer(unsigned(r.cs2unit))) := '0';
1045 n.dsvv(to_integer(unsigned(r.cs2unit))) := '0';
1046 n.dsom(to_integer(unsigned(r.cs2unit))) := '0';
1048 n.er1ilf(to_integer(unsigned(r.cs2unit))) := '1';
1050 n.dsata(to_integer(unsigned(r.cs2unit))) := '1';
1058 n.dsata(to_integer(unsigned(r.cs2unit))) := '1';
1060 if r.dsmol(to_integer(unsigned(r.cs2unit))) = '0' then
1061 n.er1uns(to_integer(unsigned(r.cs2unit))) := '1';
1064 n.dsom(to_integer(unsigned(r.cs2unit))) := '1';
1066 n.dsom(to_integer(unsigned(r.cs2unit))) := '0';
1071 n.dsvv(to_integer(unsigned(r.cs2unit))) := '1';
1072 n.eunit := r.cs2unit;
1074 n.state := s_oot_clr0;
1077 n.dsvv(to_integer(unsigned(r.cs2unit))) := '1';
1105 if r.dswrl(to_integer(unsigned(r.cs2unit))) = '1' then
1106 n.er1wle(to_integer(unsigned(r.cs2unit))) := '1';
1111 if r.dsmol(to_integer(unsigned(r.cs2unit))) = '0' then
1112 n.er1uns(to_integer(unsigned(r.cs2unit))) := '1';
1113 n.dsata(to_integer(unsigned(r.cs2unit))) := '1';
1121 n.er1ilf(to_integer(unsigned(r.cs2unit))) := '1';
1122 n.dsata(to_integer(unsigned(r.cs2unit))) := '1';
1129 n.er1iae(to_integer(unsigned(r.cs2unit))) := '1';
1138 n.er1iae(to_integer(unsigned(r.cs2unit))) := '1';
1144 if r.er1iae(to_integer(unsigned(r.cs2unit))) = '1' or
1145 r.er1wle(to_integer(unsigned(r.cs2unit))) = '1' then
1146 n.dsata(to_integer(unsigned(r.cs2unit))) := '1';
1148 if r.fxfer = '0' then
1149 n.dspip(to_integer(unsigned(r.cs2unit))) := '1';
1150 n.idlycnt := r.idlyval;
1153 n.funit := r.cs2unit;
1167 imem_addr := r.amap;
1205 idout(ds_ibf_ata) := r.dsata(to_integer(unsigned(r.eunit)));
1206 idout(ds_ibf_erp) := r.dserp(to_integer(unsigned(r.eunit)));
1207 idout(ds_ibf_pip) := r.dspip(to_integer(unsigned(r.eunit)));
1208 idout(ds_ibf_mol) := r.dsmol(to_integer(unsigned(r.eunit)));
1209 idout(ds_ibf_wrl) := r.dswrl(to_integer(unsigned(r.eunit)));
1210 idout(ds_ibf_lbt) := r.dslbt(to_integer(unsigned(r.eunit)));
1211 idout(ds_ibf_dpr) := r.dsdpr(to_integer(unsigned(r.eunit)));
1215 if r.dsmol(to_integer(unsigned(r.eunit))) = '1' then
1216 if (r.cs1rdy = '1' or r.funit /= r.eunit) and
1217 r.dspip(to_integer(unsigned(r.eunit))) = '0' then
1222 idout(ds_ibf_vv) := r.dsvv (to_integer(unsigned(r.eunit)));
1223 idout(ds_ibf_om) := r.dsom (to_integer(unsigned(r.eunit)));
1226 idout(er1_ibf_uns) := r.er1uns(to_integer(unsigned(r.eunit)));
1227 idout(er1_ibf_wle) := r.er1wle(to_integer(unsigned(r.eunit)));
1228 idout(er1_ibf_iae) := r.er1iae(to_integer(unsigned(r.eunit)));
1229 idout(er1_ibf_aoe) := r.er1aoe(to_integer(unsigned(r.eunit)));
1230 idout(er1_ibf_rmr) := r.er1rmr(to_integer(unsigned(r.eunit)));
1231 idout(er1_ibf_ilf) := r.er1ilf(to_integer(unsigned(r.eunit)));
1234 idout(r.dsata'range) := r.dsata;
1242 idout(r.dtyp'range) := r.dtyp;
1244 idout(dt_ibf_rm) := r.dtrm(to_integer(unsigned(r.runit)));
1245 idout(dt_ibf_e1) := r.dte1(to_integer(unsigned(r.runit)));
1246 idout(dt_ibf_e0) := r.dte0(to_integer(unsigned(r.runit)));
1262 idout(8) := r.dtrm(to_integer(unsigned(r.eunit)));
1263 idout(5) := r.dte1(to_integer(unsigned(r.eunit)));
1264 idout(4) := r.dte0(to_integer(unsigned(r.eunit)));
1266 idout(1) := not r.eunit(1);
1267 idout(0) := not r.eunit(0);
1293 idout := (others=>'0');
1295 when others => null;
1299 n.er1rmr(to_integer(unsigned(r.cs2unit))) := '1';
1314 n.cs2unit := (others=>'0');
1315 n.bae := (others=>'0');
1320 n.er1uns(to_integer(unsigned(r.eunit))) := '0';
1321 n.er1wle(to_integer(unsigned(r.eunit))) := '0';
1322 n.er1iae(to_integer(unsigned(r.eunit))) := '0';
1323 n.er1aoe(to_integer(unsigned(r.eunit))) := '0';
1324 n.er1rmr(to_integer(unsigned(r.eunit))) := '0';
1325 n.er1ilf(to_integer(unsigned(r.eunit))) := '0';
1328 n.cerm := r.dtrm(to_integer(unsigned(ieunit)));
1332 n.state := s_oot_clr1;
1335 imem_addr := r.eunit & r.clrreg;
1336 imem_din := (others=>'0');
1348 when others => null;
1354 when others => null;
1362 when others => null;
1365 when others => null;
1367 if iclrreg = '1' then
1371 n.clrreg := slv(unsigned(r.clrreg) + 1);
1374 if r.clrreg = "111" then
1375 n.state := s_oot_clr2;
1379 n.eunit := slv(unsigned(r.eunit) + 1);
1384 r.eunit /= "11" then
1385 n.state := s_oot_clr0;
1390 when others => null;
1394 n.cs1tre := r.cs2wce or r.cs2ned or r.cs2nem or r.cs2pge or r.cs2mxf;
1395 n.cs1sc := n.cs1tre or r.dsata(0) or r.dsata(1) or r.dsata(2) or r.dsata(3);
1397 n.dserp := r.er1uns or
1407 n.uscnt := slv(unsigned(r.uscnt) + 1);
1408 if unsigned(r.uscnt) = 0 then
1416 if iscinc = '1' then
1417 if unsigned(r.sc) >= unsigned(r.samax) then
1418 n.sc := (others=>'0');
1420 n.sc := slv(unsigned(r.sc) + 1);
1430 iei_req := r.ireq or (r.cs1sc and r.cs1ie and r.cs1rdy);
1445 IB_SRES.ack <= r.ibsel and ibreq;
1446 IB_SRES.busy <= ibhold and ibreq;
1451 end process proc_next;
slv5 := "00101" func_pore
slv5 := "01111" ibaddr_m13
slv16 :=( others => '0') MEM_DOUT
slv5 := "00110" ibaddr_er1
integer := 11 cs1_ibf_dva
slv5 := "00010" ibaddr_ba
integer range 1 downto 0 cs2_ibf_unit
integer := 0 cs3_ibf_rseekdone
slv5 := "00001" rfunc_wunit
slv5 := slv( to_unsigned( 19- 1, 5) ) rm05_tamax
integer range 11 downto 6 la_ibf_sc
slv10 := slv( to_unsigned( 411- 1, 10) ) rp04_camax
slv5 := "00100" func_dclr
integer := 14 cs2_ibf_wce
(s_idle,s_wcs1,s_wcs2,s_wcs3,s_wer1,s_was,s_wdt,s_wds,s_wbae,s_wmem,s_wmembe,s_whr,s_funcchk,s_funcgo,s_chkdc,s_chkda,s_chkdo,s_read,s_setrmr,s_oot_clr0,s_oot_clr1,s_oot_clr2) state_type
slv6 := slv( to_unsigned( 32- 1, 6) ) rm03_samax
integer range 15 downto 8 cs1_ibf_ridly
integer range 2 downto 0 amap_f_reg
slv5 := "01010" ibaddr_mr1
slv5 :=( others => '0') MEM_ADDR
slv5 := "01110" ibaddr_dc
slv5 := "01100" func_sear
slv16 :=( others => '0') MEM_DIN
integer := 14 cs1_ibf_tre
slv5 := "10000" ibaddr_m14
integer := 3 cs3_ibf_rseardone
slv5 := "01001" func_pack
slv5 := "00001" ibaddr_wc
slv5 := "00101" ibaddr_ds
slv5 := "10011" ibaddr_ec2
slv5 := "01001" ibaddr_db
slv5 := "00110" func_offs
slv5 := "10001" ibaddr_m15
slv5 := slv( to_unsigned( 19- 1, 5) ) rp04_tamax
slv5 := "00010" func_seek
slv5 := "00011" ibaddr_da
slv16 := slv( to_unsigned( 8#176700#, 16) ) ibaddr_rhrp
slv5 := slv( to_unsigned( 32- 1, 5) ) rp07_tamax
slv10 := slv( to_unsigned( 559- 1, 10) ) rm80_camax
slv5 := "01100" ibaddr_sn
integer := 14 er1_ibf_uns
slv5 := "00000" func_noop
slv5 := slv( to_unsigned( 19- 1, 5) ) rp06_tamax
slv5 := "10100" func_xfer
integer := 2 cs3_ibf_rpackdone
slv5 := "01000" func_pres
slv5 := "00111" ibaddr_as
slv6 := slv( to_unsigned( 8#20#, 6) ) rp04_dtyp
slv10 := slv( to_unsigned( 823- 1, 10) ) rm05_camax
integer := 11 cs3_ibf_wce
slv6 := slv( to_unsigned( 32- 1, 6) ) rm05_samax
slv5 := "10101" ibaddr_cs3
slv6 := slv( to_unsigned( 8#42#, 6) ) rp07_dtyp
integer := 10 er1_ibf_iae
slv10 := slv( to_unsigned( 815- 1, 10) ) rp06_camax
integer := 12 cs2_ibf_ned
slv6 := slv( to_unsigned( 8#27#, 6) ) rm05_dtyp
integer := 8 cs1_ibf_rata
slv5 := "11000" func_write
integer := 12 cs3_ibf_wco
slv5 := "10101" func_wchd
integer range 9 downto 8 cs1_ibf_bae
slv2 := "10" clrmode_fdclr
integer := 11 er1_ibf_wle
slv2 := "01" clrmode_cs2clr
integer := 15 cs2_ibf_rwco
regs_type := regs_init R_REGS
slv6 := slv( to_unsigned( 50- 1, 6) ) rp07_samax
slv2 := "11" clrmode_fpres
integer range 12 downto 8 da_ibf_ta
slv6 := slv( to_unsigned( 22- 1, 6) ) rp04_samax
integer range 5 downto 1 cs1_ibf_func
slv5 := "00100" ibaddr_cs2
slv5 := "00010" rfunc_cunit
slv5 := "10010" ibaddr_ec1
slv5 := "01101" ibaddr_of
slv5 := "00111" func_retc
slv5 := slv( to_unsigned( 14- 1, 5) ) rm80_tamax
integer := 2 cs2_ibf_unit2
slv5 := "01011" ibaddr_dt
regs_type :=( '0', s_idle,( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'), '0', '0', '1', '0',( others => '0'), '0', '0', '0', '0', '0', '0', '0', '0', '0',( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'), '0', x"0a",( others => '0'), '0', '0', '0', '0', '0', '0',( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'), '0') regs_init
slv10 := slv( to_unsigned( 630- 1, 10) ) rp07_camax
slv5 := "10100" ibaddr_bae
slv10 := slv( to_unsigned( 823- 1, 10) ) rm03_camax
slv5 := "11100" func_read
integer range 9 downto 0 dc_ibf_ca
slv2 := "00" clrmode_breset
slv6 := slv( to_unsigned( 31- 1, 6) ) rm80_samax
integer := 11 cs2_ibf_nem
slv5 := slv( to_unsigned( 5- 1, 5) ) rm03_tamax
slv5 := "00011" rfunc_done
slv5 := "00100" rfunc_widly
integer := 10 cs2_ibf_pge
integer := 1 cs3_ibf_rporedone
slv6 := slv( to_unsigned( 22- 1, 6) ) rp06_samax
slv6 := slv( to_unsigned( 8#24#, 6) ) rm03_dtyp
slv5 := "00000" ibaddr_cs1
integer range 9 downto 8 cs1_ibf_runit
slv5 := "00011" func_recal
slv6 := slv( to_unsigned( 8#22#, 6) ) rp06_dtyp
integer range 5 downto 0 bae_ibf_bae
integer range 4 downto 3 amap_f_unit
slv5 := "01000" ibaddr_la
slv6 := slv( to_unsigned( 8#26#, 6) ) rm80_dtyp
integer range 5 downto 0 da_ibf_sa
in ADDR slv( AWIDTH- 1 downto 0)
out DO slv( DWIDTH- 1 downto 0)
in DI slv( DWIDTH- 1 downto 0)
std_logic_vector( 9 downto 0) slv10
std_logic_vector( 3 downto 0) slv4
std_logic_vector( 4 downto 0) slv5
std_logic_vector( 6 downto 0) slv7
std_logic_vector( 2 downto 0) slv3
std_logic_vector( 15 downto 0) slv16
std_logic_vector( 5 downto 0) slv6
std_logic_vector( 7 downto 0) slv8
std_logic_vector( 1 downto 0) slv2