63use ieee.std_logic_1164.
all;
64use ieee.numeric_std.
all;
173 signal IB_MREQ : ib_mreq_type := ib_mreq_init;
174 signal IB_SRES : ib_sres_type := ib_sres_init;
199 ADDR_UB => CP_ADDR.addr
(17 downto 1),
231 variable idout : slv16 := (others=>'0');
233 idout := (others=>'0');
235 idout(ibf_byte1) := R_SLIM;
240 end process proc_ibres;
244 if rising_edge(CLK) then
253 end process proc_slim;
257 if rising_edge(CLK) then
264 end process proc_regs;
273 variable ivm_stat : vm_stat_type := vm_stat_init;
274 variable ivm_dout : slv16 := (others=>'0');
275 variable iem_mreq : em_mreq_type := em_mreq_init;
276 variable immu_cntl : mmu_cntl_type := mmu_cntl_init;
278 variable ipaddr : slv22 := (others=>'0');
279 variable ipaddr_iopage : slv9 := (others=>'0');
281 variable iib_aval : slbit := '0';
283 variable ato_go : slbit := '0';
284 variable ato_end : slbit := '0';
286 variable is_stackyellow : slbit := '1';
287 variable is_stackred : slbit := '1';
289 variable iubmap_mreq : slbit := '0';
290 variable paddr_mmu : slbit := '0';
291 variable paddr_sel : slv2 := "00";
292 constant c_paddr_sel_vmaddr
: slv2 := "00";
293 constant c_paddr_sel_rpaddr
: slv2 := "01";
294 constant c_paddr_sel_cacc
: slv2 := "10";
295 constant c_paddr_sel_ubmap
: slv2 := "11";
305 ivm_stat := vm_stat_init;
307 immu_cntl := mmu_cntl_init;
311 iem_mreq := em_mreq_init;
323 iem_mreq.din(ibf_byte1) := VM_DIN(ibf_byte0);
334 paddr_sel := c_paddr_sel_vmaddr;
337 paddr_sel := c_paddr_sel_ubmap;
339 paddr_sel := c_paddr_sel_cacc;
349 ipaddr_iopage := "111111111";
351 if CP_ADDR.ena_22bit = '0' then
352 ipaddr_iopage := "000000111";
356 ipaddr_iopage := "000000111";
359 ipaddr_iopage := "000011111";
366 if unsigned(r.atocnt) = 0 then
370 is_stackyellow := '0';
374 unsigned(VM_ADDR(7 downto 5)) = 7 then
375 is_stackyellow := '1';
381 if VM_ADDR(15 downto 1) = "111111111111111" then
385 immu_cntl.wacc := VM_CNTL.wacc;
386 immu_cntl.macc := VM_CNTL.macc;
387 immu_cntl.cacc := VM_CNTL.cacc;
388 immu_cntl.dspace := VM_CNTL.dspace;
389 immu_cntl.mode := VM_CNTL.mode;
405 n.mdin := iem_mreq.din;
409 immu_cntl.req := '1';
422 n.ysv := is_stackyellow;
430 if r.bytop='0' and r.paddr(0)='1' then
432 ivm_stat.err_odd := '1';
433 ivm_stat.err_ser := r.kstack;
434 iem_mreq.cancel := '1';
437 elsif r.vaok = '0' then
439 ivm_stat.err_mmu := '1';
440 ivm_stat.err_ser := r.kstack;
441 iem_mreq.cancel := '1';
445 if r.paddr(21 downto 13) = r.paddr_iopage then
447 iem_mreq.cancel := '1';
449 n.ibre := not r.wacc;
452 n.ibracc := r.cacc and CP_ADDR.racc;
457 if r.bytop = '1' then
458 if r.paddr(0) = '0' then
469 if unsigned(r.paddr(21 downto 6)) > sys_conf_mem_losize then
471 ivm_stat.err_nxm := '1';
472 ivm_stat.err_ser := r.kstack;
473 iem_mreq.cancel := '1';
480 if r.macc='1' and r.wacc='0' then
481 n.state := s_idle_mw_mem;
507 n.state := s_ib_wend;
512 n.ibcacc := r.ibcacc;
513 n.ibracc := r.ibracc;
516 n.state := s_ib_rend;
518 elsif IB_SRES.busy='1' and ato_end='0' then
523 n.ibcacc := r.ibcacc;
524 n.ibracc := r.ibracc;
536 ivm_dout := r.ibdout;
539 n.state := s_idle_mw_ib;
545 n.state := s_idle_mw_ib;
547 if r.ibbe = "10" then
548 iem_mreq.din(ibf_byte1) := VM_DIN(ibf_byte0);
553 n.mdin := iem_mreq.din;
563 when s_idle_mw_mem =>
564 n.state := s_idle_mw_mem;
567 paddr_sel := c_paddr_sel_rpaddr;
572 if r.paddr(0) = '0' then
576 iem_mreq.din(ibf_byte1) := VM_DIN(ibf_byte0);
584 n.mdin := iem_mreq.din;
591 n.state := s_mem_mw_w;
600 n.state := s_mem_mw_w;
604 ivm_stat.fail := '1';
609 ivm_stat.err_rsv := '1';
610 ivm_stat.err_ser := '1';
615 ivm_stat.err_iobto := '1';
616 ivm_stat.err_ser := r.kstack;
622 if r.bytop='1' and r.paddr(0)='1' then
623 ivm_dout(ibf_byte0) := ivm_dout(ibf_byte1);
629 n.atocnt := slv(unsigned(r.atocnt) - 1);
632 ipaddr := (others=>'0');
633 if paddr_mmu = '1' then
634 ipaddr( 5 downto 0) := VM_ADDR(5 downto 0);
635 ipaddr(21 downto 6) := PADDRH;
637 ipaddr(21 downto 18) := (others=>'0');
641 when c_paddr_sel_vmaddr =>
642 ipaddr(15 downto 0) := VM_ADDR(15 downto 0);
643 when c_paddr_sel_rpaddr =>
645 when c_paddr_sel_cacc =>
647 if CP_ADDR.ena_22bit = '0' then
648 ipaddr(21 downto 16) := (others=>'0');
650 when c_paddr_sel_ubmap =>
656 if r.state = s_idle then
658 n.paddr_iopage := ipaddr_iopage;
661 ivm_stat.trap_ysv := r.ysv;
662 ivm_stat.trap_mmu := r.trap_mmu;
664 iem_mreq.addr := ipaddr(21 downto 1);
678 IB_MREQ.addr <= r.paddr(12 downto 1);
687 end process proc_next;
in IB_SRES_2 ib_sres_type := ib_sres_init
out IB_SRES_OR ib_sres_type
in IB_SRES_1 ib_sres_type
in IB_SRES_2 ib_sres_type := ib_sres_init
in IB_SRES_3 ib_sres_type := ib_sres_init
out IB_SRES_OR ib_sres_type
in IB_SRES_4 ib_sres_type := ib_sres_init
in IB_SRES_1 ib_sres_type
slv16 := slv( to_unsigned( 8#177774#, 16) ) ibaddr_slim
vm_stat_type := vm_stat_init VM_STAT_L
ib_mreq_type := ib_mreq_init IB_MREQ
ib_sres_type := ib_sres_init IB_SRES_UBMAP
ib_sres_type := ib_sres_init IB_SRES_SLIM
mmu_cntl_type := mmu_cntl_init MMU_CNTL
regs_type := regs_init R_REGS
ib_sres_type := ib_sres_init IB_SRES_MMU
em_mreq_type := em_mreq_init EM_MREQ_L
slv16 :=( others => '0') VM_DOUT_L
slv16 :=( others => '0') PADDRH
slv8 :=( others => '0') R_SLIM
mmu_stat_type := mmu_stat_init MMU_STAT
regs_type :=( s_idle, '0', '0', '0', '0', '0', '0', '0', '0',( others => '0'),( others => '0'),( others => '0'), atocnt_init, '0', '0', "00", '0', '0', '0',( others => '0')) regs_init
ib_sres_type := ib_sres_init IB_SRES
slv22_1 :=( others => '0') UBMAP_ADDR_PM
(s_idle,s_mem_w,s_ib_w,s_ib_wend,s_ib_rend,s_idle_mw_ib,s_idle_mw_mem,s_mem_mw_w,s_fail,s_errrsv,s_errib) state_type
ib_sres_type := ib_sres_init IB_SRES_INT
slv( atowidth- 1 downto 0) :=( others => '1') atocnt_init
in MMU_MONI mmu_moni_type
in IB_SRES_EXT ib_sres_type
out IB_MREQ_M ib_mreq_type
out DM_STAT_VM dm_stat_vm_type
in IB_SRES_CPU ib_sres_type
std_logic_vector( 21 downto 1) slv22_1
std_logic_vector( 8 downto 0) slv9
std_logic_vector( 15 downto 0) slv16
std_logic_vector( 21 downto 0) slv22
std_logic_vector( 7 downto 0) slv8
std_logic_vector( 1 downto 0) slv2