OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [rtl/] [w11a/] [pdp11_sequencer.vhd] - Diff between revs 2 and 8

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 8
Line 1... Line 1...
-- $Id: pdp11_sequencer.vhd 314 2010-07-09 17:38:41Z mueller $
-- $Id: pdp11_sequencer.vhd 335 2010-10-24 22:24:23Z mueller $
--
--
-- Copyright 2006-2010 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
-- Copyright 2006-2010 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
--
-- This program is free software; you may redistribute and/or modify it under
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
-- the terms of the GNU General Public License as published by the Free
Line 13... Line 13...
--
--
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Module Name:    pdp11_sequencer - syn
-- Module Name:    pdp11_sequencer - syn
-- Description:    pdp11: CPU sequencer
-- Description:    pdp11: CPU sequencer
--
--
-- Dependencies:   -
-- Dependencies:   ib_sel
-- Test bench:     tb/tb_pdp11_core (implicit)
-- Test bench:     tb/tb_pdp11_core (implicit)
-- Target Devices: generic
-- Target Devices: generic
-- Tool versions:  xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25
-- Tool versions:  xst 8.1, 8.2, 9.1, 9.2, 12.1; ghdl 0.18-0.29
 
--
-- Revision History: 
-- Revision History: 
-- Date         Rev Version  Comment
-- Date         Rev Version  Comment
 
-- 2010-10-23   335   1.4.1  use ib_sel
 
-- 2010-10-17   333   1.4    use ibus V2 interface
 
-- 2010-09-18   300   1.3.2  rename (adlm)box->(oalm)unit
-- 2010-06-20   307   1.3.1  rename cpacc to cacc in vm_cntl_type
-- 2010-06-20   307   1.3.1  rename cpacc to cacc in vm_cntl_type
-- 2010-06-13   305   1.3    remove CPDIN_WE, CPDOUT_WE out ports; set
-- 2010-06-13   305   1.3    remove CPDIN_WE, CPDOUT_WE out ports; set
--                           CNTL.cpdout_we instead of CPDOUT_WE
--                           CNTL.cpdout_we instead of CPDOUT_WE
-- 2010-06-12   304   1.2.8  signal cpuwait when spinning in s_op_wait
-- 2010-06-12   304   1.2.8  signal cpuwait when spinning in s_op_wait
-- 2009-05-30   220   1.2.7  final removal of snoopers (were already commented)
-- 2009-05-30   220   1.2.7  final removal of snoopers (were already commented)
Line 242... Line 246...
 
 
  signal IBSEL_CPUERR : slbit := '0';
  signal IBSEL_CPUERR : slbit := '0';
 
 
begin
begin
 
 
  proc_ibsel: process (IB_MREQ)
  SEL : ib_sel
    variable icpuerr : slbit := '0';
    generic map (
  begin
      IB_ADDR => ibaddr_cpuerr)
    icpuerr := '0';
    port map (
    if IB_MREQ.req='1' and IB_MREQ.addr=ibaddr_cpuerr(12 downto 1) then
      CLK     => CLK,
      icpuerr := '1';
      IB_MREQ => IB_MREQ,
    end if;
      SEL     => IBSEL_CPUERR
    IBSEL_CPUERR <= icpuerr;
    );
    IB_SRES.ack  <= icpuerr;
 
    IB_SRES.busy <= '0';
 
  end process proc_ibsel;
 
 
 
  proc_ibdout : process (IBSEL_CPUERR, R_CPUERR)
  proc_ibres : process (IBSEL_CPUERR, IB_MREQ, R_CPUERR)
    variable cpuerrout : slv16 := (others=>'0');
    variable idout : slv16 := (others=>'0');
  begin
  begin
    cpuerrout := (others=>'0');
    idout := (others=>'0');
    if IBSEL_CPUERR = '1' then
    if IBSEL_CPUERR = '1' then
      cpuerrout(cpuerr_ibf_illhlt) := R_CPUERR.illhlt;
      idout(cpuerr_ibf_illhlt) := R_CPUERR.illhlt;
      cpuerrout(cpuerr_ibf_adderr) := R_CPUERR.adderr;
      idout(cpuerr_ibf_adderr) := R_CPUERR.adderr;
      cpuerrout(cpuerr_ibf_nxm)    := R_CPUERR.nxm;
      idout(cpuerr_ibf_nxm)    := R_CPUERR.nxm;
      cpuerrout(cpuerr_ibf_iobto)  := R_CPUERR.iobto;
      idout(cpuerr_ibf_iobto)  := R_CPUERR.iobto;
      cpuerrout(cpuerr_ibf_ysv)    := R_CPUERR.ysv;
      idout(cpuerr_ibf_ysv)    := R_CPUERR.ysv;
      cpuerrout(cpuerr_ibf_rsv)    := R_CPUERR.rsv;
      idout(cpuerr_ibf_rsv)    := R_CPUERR.rsv;
    end if;
    end if;
    IB_SRES.dout <= cpuerrout;
    IB_SRES.dout <= idout;
  end process proc_ibdout;
    IB_SRES.ack  <= IBSEL_CPUERR and (IB_MREQ.re or IB_MREQ.we); -- ack all
 
    IB_SRES.busy <= '0';
 
  end process proc_ibres;
 
 
  proc_status: process (CLK)
  proc_status: process (CLK)
  begin
  begin
    if CLK'event and CLK='1' then
    if CLK'event and CLK='1' then
      if GRESET = '1' then
      if GRESET = '1' then
Line 371... Line 374...
                                nvmcntl  : inout vm_cntl_type;
                                nvmcntl  : inout vm_cntl_type;
                                wstate   : in state_type;
                                wstate   : in state_type;
                                nmmumoni : inout mmu_moni_type;
                                nmmumoni : inout mmu_moni_type;
                                updt_sp  : in slbit := '0') is
                                updt_sp  : in slbit := '0') is
    begin
    begin
      ndpcntl.abox_asel := c_abox_asel_dsrc;     -- ABOX A=DSRC
      ndpcntl.ounit_asel := c_ounit_asel_dsrc;   -- OUNIT A=DSRC
      ndpcntl.abox_const := "000000010";         -- ABOX const=2
      ndpcntl.ounit_const := "000000010";        -- OUNIT const=2
      ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const
      ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const
      ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
      ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
      ndpcntl.dsrc_sel := c_dpath_dsrc_res;      -- DSRC = DRES
      ndpcntl.dsrc_sel := c_dpath_dsrc_res;      -- DSRC = DRES
      ndpcntl.dsrc_we := '1';                    -- update DSRC
      ndpcntl.dsrc_we := '1';                    -- update DSRC
      if updt_sp = '1' then
      if updt_sp = '1' then
        nmmumoni.regmod := '1';
        nmmumoni.regmod := '1';
        nmmumoni.isdec := '0';
        nmmumoni.isdec := '0';
Line 425... Line 428...
                              isdef   : in slbit;
                              isdef   : in slbit;
                              regnum  : in slv3) is
                              regnum  : in slv3) is
    begin
    begin
      if bytop='0' or isdef='1' or
      if bytop='0' or isdef='1' or
         regnum=c_gpr_pc or regnum=c_gpr_sp then
         regnum=c_gpr_pc or regnum=c_gpr_sp then
        ndpcntl.abox_const := "000000010";
        ndpcntl.ounit_const := "000000010";
      else
      else
        ndpcntl.abox_const := "000000001";
        ndpcntl.ounit_const := "000000001";
      end if;
      end if;
    end procedure do_const_opsize;
    end procedure do_const_opsize;
 
 
    procedure do_fork_dstr(nstate : inout state_type;
    procedure do_fork_dstr(nstate : inout state_type;
                           idstat : in decode_stat_type) is
                           idstat : in decode_stat_type) is
Line 520... Line 523...
                           ndpcntl : inout dpath_cntl_type;
                           ndpcntl : inout dpath_cntl_type;
                           vector  : in slv9_2) is
                           vector  : in slv9_2) is
    begin
    begin
      ndpcntl.dtmp_sel := c_dpath_dtmp_psw;    -- DTMP = PSW 
      ndpcntl.dtmp_sel := c_dpath_dtmp_psw;    -- DTMP = PSW 
      ndpcntl.dtmp_we := '1';
      ndpcntl.dtmp_we := '1';
      ndpcntl.abox_azero := '1';               -- ABOX A = 0
      ndpcntl.ounit_azero := '1';              -- OUNIT A = 0
      ndpcntl.abox_const := vector & "00";     -- vector
      ndpcntl.ounit_const := vector & "00";    -- vector
      ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B=const(vector)
      ndpcntl.ounit_bsel := c_ounit_bsel_const;-- OUNIT B=const(vector)
      ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
      ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
      ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
      ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
      ndpcntl.dsrc_we := '1';                  -- DSRC = vector
      ndpcntl.dsrc_we := '1';                  -- DSRC = vector
      nstate := s_int_getpc;
      nstate := s_int_getpc;
    end procedure do_start_int;
    end procedure do_start_int;
 
 
Line 543... Line 546...
    nbreset := '0';
    nbreset := '0';
    nintack := '0';
    nintack := '0';
 
 
    nidstat := R_IDSTAT;
    nidstat := R_IDSTAT;
 
 
    if IB_MREQ.we='1' and IBSEL_CPUERR='1' then -- write to CPUERR clears it !!
    if IBSEL_CPUERR='1' and IB_MREQ.we='1' then -- write to CPUERR clears it !
      ncpuerr := cpuerr_init;
      ncpuerr := cpuerr_init;
    end if;
    end if;
 
 
    int_pending := '0';
    int_pending := '0';
    if unsigned(INT_PRI) > unsigned(PSW.pri) then
    if unsigned(INT_PRI) > unsigned(PSW.pri) then
Line 601... Line 604...
    ndpcntl.ddst_sel := c_dpath_ddst_dst;
    ndpcntl.ddst_sel := c_dpath_ddst_dst;
    ndpcntl.ddst_we := '0';
    ndpcntl.ddst_we := '0';
    ndpcntl.dtmp_sel := c_dpath_dtmp_dsrc;
    ndpcntl.dtmp_sel := c_dpath_dtmp_dsrc;
    ndpcntl.dtmp_we := '0';
    ndpcntl.dtmp_we := '0';
 
 
    ndpcntl.abox_asel := c_abox_asel_ddst;
    ndpcntl.ounit_asel  := c_ounit_asel_ddst;
    ndpcntl.abox_azero := '0';            -- DEFAULT
    ndpcntl.ounit_azero := '0';            -- DEFAULT
    ndpcntl.abox_const := (others=>'0');  -- DEFAULT
    ndpcntl.ounit_const := (others=>'0');  -- DEFAULT
    ndpcntl.abox_bsel := c_abox_bsel_const;
    ndpcntl.ounit_bsel  := c_ounit_bsel_const;
    ndpcntl.abox_opsub := '0';            -- DEFAULT
    ndpcntl.ounit_opsub := '0';            -- DEFAULT
 
 
    ndpcntl.dbox_srcmod := R_IDSTAT.dbox_srcmod; -- STATIC
    ndpcntl.aunit_srcmod := R_IDSTAT.aunit_srcmod; -- STATIC
    ndpcntl.dbox_dstmod := R_IDSTAT.dbox_dstmod; -- STATIC
    ndpcntl.aunit_dstmod := R_IDSTAT.aunit_dstmod; -- STATIC
    ndpcntl.dbox_cimod  := R_IDSTAT.dbox_cimod;  -- STATIC
    ndpcntl.aunit_cimod  := R_IDSTAT.aunit_cimod;  -- STATIC
    ndpcntl.dbox_cc1op  := R_IDSTAT.dbox_cc1op;  -- STATIC
    ndpcntl.aunit_cc1op  := R_IDSTAT.aunit_cc1op;  -- STATIC
    ndpcntl.dbox_ccmode := R_IDSTAT.dbox_ccmode; -- STATIC
    ndpcntl.aunit_ccmode := R_IDSTAT.aunit_ccmode; -- STATIC
    ndpcntl.dbox_bytop  := R_IDSTAT.is_bytop;    -- STATIC
    ndpcntl.aunit_bytop  := R_IDSTAT.is_bytop;     -- STATIC
 
 
    ndpcntl.lbox_func   := R_IDSTAT.lbox_func;   -- STATIC
    ndpcntl.lunit_func   := R_IDSTAT.lunit_func;   -- STATIC
    ndpcntl.lbox_bytop  := R_IDSTAT.is_bytop;    -- STATIC
    ndpcntl.lunit_bytop  := R_IDSTAT.is_bytop;     -- STATIC
 
 
    ndpcntl.mbox_func := R_IDSTAT.mbox_func;     -- STATIC
    ndpcntl.munit_func := R_IDSTAT.munit_func;     -- STATIC
 
 
    ndpcntl.ireg_we := '0';
    ndpcntl.ireg_we := '0';
 
 
    ndpcntl.cres_sel := R_IDSTAT.res_sel;        -- DEFAULT
    ndpcntl.cres_sel := R_IDSTAT.res_sel;        -- DEFAULT
    ndpcntl.dres_sel := c_dpath_res_abox;
    ndpcntl.dres_sel := c_dpath_res_ounit;
    ndpcntl.vmaddr_sel := c_dpath_vmaddr_dsrc;
    ndpcntl.vmaddr_sel := c_dpath_vmaddr_dsrc;
 
 
    if CP_CNTL.req='1' and R_STATUS.cmdbusy='0' then
    if CP_CNTL.req='1' and R_STATUS.cmdbusy='0' then
      nstatus.cmdbusy := '1';
      nstatus.cmdbusy := '1';
      nstatus.cpfunc  := CP_CNTL.func;
      nstatus.cpfunc  := CP_CNTL.func;
Line 764... Line 767...
          end if;
          end if;
 
 
        end if;
        end if;
 
 
      when s_cp_regread =>
      when s_cp_regread =>
        ndpcntl.abox_asel := c_abox_asel_ddst;   -- ABOX A = DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst;  -- OUNIT A = DDST
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B = const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const; -- OUNIT B = const(0)
        ndpcntl.dres_sel  := c_dpath_res_abox;   -- DRES = ABOX
        ndpcntl.dres_sel  := c_dpath_res_ounit;   -- DRES = OUNIT
        nstatus.cmdack := '1';
        nstatus.cmdack := '1';
        nstate := s_idle;
        nstate := s_idle;
 
 
      when s_cp_rps =>
      when s_cp_rps =>
        ndpcntl.abox_asel := c_abox_asel_dtmp;   -- ABOX A = DTMP
        ndpcntl.ounit_asel := c_ounit_asel_dtmp;  -- OUNIT A = DTMP
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B = const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const; -- OUNIT B = const(0)
        ndpcntl.dres_sel  := c_dpath_res_abox;   -- DRES = ABOX
        ndpcntl.dres_sel  := c_dpath_res_ounit;   -- DRES = OUNIT
        nstatus.cmdack := '1';
        nstatus.cmdack := '1';
        nstate := s_idle;
        nstate := s_idle;
 
 
      when s_cp_memr_w =>
      when s_cp_memr_w =>
        nstate := s_cp_memr_w;
        nstate := s_cp_memr_w;
Line 939... Line 942...
            do_fork_opg(nstate, R_IDSTAT);
            do_fork_opg(nstate, R_IDSTAT);
          end if;
          end if;
        end if;
        end if;
 
 
      when s_srcr_inc =>
      when s_srcr_inc =>
        ndpcntl.abox_asel := c_abox_asel_dsrc;   -- ABOX A=DSRC
        ndpcntl.ounit_asel := c_ounit_asel_dsrc;  -- OUNIT A=DSRC
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, SRCDEF, SRCREG);
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, SRCDEF, SRCREG);
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B=const
        ndpcntl.ounit_bsel := c_ounit_bsel_const; -- OUNIT B=const
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;    -- DRES = OUNIT
        ndpcntl.gpr_adst := SRCREG;
        ndpcntl.gpr_adst := SRCREG;
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        nmmumoni.regmod := '1';
        nmmumoni.regmod := '1';
        nmmumoni.isdec := '0';
        nmmumoni.isdec := '0';
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES (for if)
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES (for if)
Line 975... Line 978...
            end if;
            end if;
          end if;
          end if;
        end if;
        end if;
 
 
      when s_srcr_dec =>
      when s_srcr_dec =>
        ndpcntl.abox_asel := c_abox_asel_dsrc;   -- ABOX A=DSRC
        ndpcntl.ounit_asel := c_ounit_asel_dsrc; -- OUNIT A=DSRC
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, SRCDEF, SRCREG);
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, SRCDEF, SRCREG);
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B=const
        ndpcntl.ounit_bsel := c_ounit_bsel_const;-- OUNIT B=const
        ndpcntl.abox_opsub := '1';               -- ABOX = A-B
        ndpcntl.ounit_opsub := '1';              -- OUNIT = A-B
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
        ndpcntl.dsrc_we := '1';                  -- update DSRC
        ndpcntl.dsrc_we := '1';                  -- update DSRC
        ndpcntl.gpr_adst := SRCREG;
        ndpcntl.gpr_adst := SRCREG;
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        nmmumoni.regmod := '1';
        nmmumoni.regmod := '1';
Line 1003... Line 1006...
        do_memread_i(nstate, ndpcntl, nvmcntl, s_srcr_ind1_w);
        do_memread_i(nstate, ndpcntl, nvmcntl, s_srcr_ind1_w);
 
 
      when s_srcr_ind1_w =>
      when s_srcr_ind1_w =>
        nstate := s_srcr_ind1_w;
        nstate := s_srcr_ind1_w;
        if R_IDSTAT.is_srcpc = '0' then
        if R_IDSTAT.is_srcpc = '0' then
          ndpcntl.abox_asel := c_abox_asel_dsrc; -- ABOX A = DSRC
          ndpcntl.ounit_asel := c_ounit_asel_dsrc; -- OUNIT A = DSRC
        else
        else
          ndpcntl.abox_asel := c_abox_asel_pc;   -- ABOX A = PC (for nn(pc))
          ndpcntl.ounit_asel := c_ounit_asel_pc;   -- OUNIT A = PC (for nn(pc))
        end if;
        end if;
        ndpcntl.abox_bsel := c_abox_bsel_vmdout; -- ABOX B = VMDOUT
        ndpcntl.ounit_bsel := c_ounit_bsel_vmdout; -- OUNIT B = VMDOUT
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
        ndpcntl.ddst_sel := c_dpath_ddst_dst;    -- DDST = R(DST)
        ndpcntl.ddst_sel := c_dpath_ddst_dst;    -- DDST = R(DST)
        do_memcheck(nstate, nstatus, imemok);
        do_memcheck(nstate, nstatus, imemok);
        if imemok then
        if imemok then
          ndpcntl.dsrc_we := '1';                -- update DSRC
          ndpcntl.dsrc_we := '1';                -- update DSRC
Line 1099... Line 1102...
          ndpcntl.ddst_we := '1';                -- update DDST
          ndpcntl.ddst_we := '1';                -- update DDST
          do_fork_opg(nstate, R_IDSTAT);
          do_fork_opg(nstate, R_IDSTAT);
        end if;
        end if;
 
 
      when s_dstr_inc =>
      when s_dstr_inc =>
        ndpcntl.abox_asel := c_abox_asel_ddst;   -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst; -- OUNIT A=DDST
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, DSTDEF, DSTREG);
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, DSTDEF, DSTREG);
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B=const
        ndpcntl.ounit_bsel := c_ounit_bsel_const;-- OUNIT B=const
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.gpr_adst := DSTREG;
        ndpcntl.gpr_adst := DSTREG;
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        nmmumoni.regmod := '1';
        nmmumoni.regmod := '1';
        nmmumoni.isdec := '0';
        nmmumoni.isdec := '0';
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_ddst; -- VA = DDST
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_ddst; -- VA = DDST
Line 1128... Line 1131...
            do_fork_opg(nstate, R_IDSTAT);
            do_fork_opg(nstate, R_IDSTAT);
          end if;
          end if;
        end if;
        end if;
 
 
      when s_dstr_dec =>
      when s_dstr_dec =>
        ndpcntl.abox_asel := c_abox_asel_ddst;   -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst; -- OUNIT A=DDST
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, DSTDEF, DSTREG);
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, DSTDEF, DSTREG);
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B=const
        ndpcntl.ounit_bsel := c_ounit_bsel_const;-- OUNIT B=const
        ndpcntl.abox_opsub := '1';               -- ABOX = A-B
        ndpcntl.ounit_opsub := '1';              -- OUNIT = A-B
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        ndpcntl.ddst_we := '1';                  -- update DDST
        ndpcntl.ddst_we := '1';                  -- update DDST
        ndpcntl.gpr_adst := DSTREG;
        ndpcntl.gpr_adst := DSTREG;
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        nmmumoni.regmod := '1';
        nmmumoni.regmod := '1';
Line 1154... Line 1157...
        do_memread_i(nstate, ndpcntl, nvmcntl, s_dstr_ind1_w);
        do_memread_i(nstate, ndpcntl, nvmcntl, s_dstr_ind1_w);
 
 
      when s_dstr_ind1_w =>
      when s_dstr_ind1_w =>
        nstate := s_dstr_ind1_w;
        nstate := s_dstr_ind1_w;
        if R_IDSTAT.is_dstpc = '0' then
        if R_IDSTAT.is_dstpc = '0' then
          ndpcntl.abox_asel := c_abox_asel_ddst; -- ABOX A = DDST
          ndpcntl.ounit_asel := c_ounit_asel_ddst; -- OUNIT A = DDST
        else
        else
          ndpcntl.abox_asel := c_abox_asel_pc;   -- ABOX A = PC (for nn(pc))
          ndpcntl.ounit_asel := c_ounit_asel_pc;   -- OUNIT A = PC (for nn(pc))
        end if;
        end if;
        ndpcntl.abox_bsel := c_abox_bsel_vmdout; -- ABOX B = VMDOUT
        ndpcntl.ounit_bsel := c_ounit_bsel_vmdout;-- OUNIT B = VMDOUT
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        do_memcheck(nstate, nstatus, imemok);
        do_memcheck(nstate, nstatus, imemok);
        if imemok then
        if imemok then
          ndpcntl.ddst_we := '1';                -- update DDST
          ndpcntl.ddst_we := '1';                -- update DDST
          nstate := s_dstr_ind2;
          nstate := s_dstr_ind2;
Line 1247... Line 1250...
        end if;
        end if;
 
 
      when s_dstw_inc =>
      when s_dstw_inc =>
        ndpcntl.psr_ccwe := '1';
        ndpcntl.psr_ccwe := '1';
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_ddst;   -- VA = DDST
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_ddst;   -- VA = DDST
        ndpcntl.abox_asel := c_abox_asel_ddst;       -- ABOX A=DDST  (for else)
        ndpcntl.ounit_asel := c_ounit_asel_ddst;     -- OUNIT A=DDST  (for else)
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, DSTDEF, DSTREG);  --(...)
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, DSTDEF, DSTREG);  --(...)
        ndpcntl.abox_bsel := c_abox_bsel_const;      -- ABOX B=const (for else)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;    -- OUNIT B=const (for else)
        if DSTDEF = '0' then
        if DSTDEF = '0' then
          ndpcntl.dres_sel := R_IDSTAT.res_sel;      -- DRES = choice of idec
          ndpcntl.dres_sel := R_IDSTAT.res_sel;      -- DRES = choice of idec
          nvmcntl.kstack := is_dstkstack1246;
          nvmcntl.kstack := is_dstkstack1246;
          do_memwrite(nstate, nvmcntl, s_dstw_inc_w);
          do_memwrite(nstate, nvmcntl, s_dstw_inc_w);
          nstatus.do_gprwe := '1';
          nstatus.do_gprwe := '1';
        else
        else
          ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
          ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
          ndpcntl.gpr_adst := DSTREG;
          ndpcntl.gpr_adst := DSTREG;
          ndpcntl.gpr_we := '1';
          ndpcntl.gpr_we := '1';
          nmmumoni.regmod := '1';
          nmmumoni.regmod := '1';
          nmmumoni.isdec := '0';
          nmmumoni.isdec := '0';
          do_memread_d(nstate, nvmcntl, s_dstw_incdef_w,
          do_memread_d(nstate, nvmcntl, s_dstw_incdef_w,
                       is_pci=>R_IDSTAT.is_dstpc);
                       is_pci=>R_IDSTAT.is_dstpc);
        end if;
        end if;
 
 
      when s_dstw_inc_w =>
      when s_dstw_inc_w =>
        nstate := s_dstw_inc_w;
        nstate := s_dstw_inc_w;
        ndpcntl.abox_asel := c_abox_asel_ddst;     -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst;   -- OUNIT A=DDST
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, DSTDEF, DSTREG);
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, DSTDEF, DSTREG);
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.gpr_adst := DSTREG;
        ndpcntl.gpr_adst := DSTREG;
        if R_STATUS.do_gprwe = '1' then
        if R_STATUS.do_gprwe = '1' then
          nmmumoni.regmod := '1';
          nmmumoni.regmod := '1';
          nmmumoni.isdec := '0';
          nmmumoni.isdec := '0';
          nmmumoni.trace_prev := '1';              -- ssr freeze of prev state
          nmmumoni.trace_prev := '1';              -- ssr freeze of prev state
Line 1296... Line 1299...
          nstate := s_dstw_def246;
          nstate := s_dstw_def246;
        end if;
        end if;
 
 
      when s_dstw_dec =>
      when s_dstw_dec =>
        ndpcntl.psr_ccwe := '1';
        ndpcntl.psr_ccwe := '1';
        ndpcntl.abox_asel := c_abox_asel_ddst;   -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst; -- OUNIT A=DDST
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, DSTDEF, DSTREG);
        do_const_opsize(ndpcntl, R_IDSTAT.is_bytop, DSTDEF, DSTREG);
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B=const
        ndpcntl.ounit_bsel := c_ounit_bsel_const;-- OUNIT B=const
        ndpcntl.abox_opsub := '1';               -- ABOX = A-B
        ndpcntl.ounit_opsub := '1';              -- OUNIT = A-B
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        ndpcntl.ddst_we := '1';                  -- update DDST
        ndpcntl.ddst_we := '1';                  -- update DDST
        ndpcntl.gpr_adst := DSTREG;
        ndpcntl.gpr_adst := DSTREG;
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        nmmumoni.regmod := '1';
        nmmumoni.regmod := '1';
Line 1326... Line 1329...
        do_memread_i(nstate, ndpcntl, nvmcntl, s_dstw_ind_w);
        do_memread_i(nstate, ndpcntl, nvmcntl, s_dstw_ind_w);
 
 
      when s_dstw_ind_w =>
      when s_dstw_ind_w =>
        nstate := s_dstw_ind_w;
        nstate := s_dstw_ind_w;
        if R_IDSTAT.is_dstpc = '0' then
        if R_IDSTAT.is_dstpc = '0' then
          ndpcntl.abox_asel := c_abox_asel_ddst; -- ABOX A = DDST
          ndpcntl.ounit_asel := c_ounit_asel_ddst; -- OUNIT A = DDST
        else
        else
          ndpcntl.abox_asel := c_abox_asel_pc;   -- ABOX A = PC (for nn(pc))
          ndpcntl.ounit_asel := c_ounit_asel_pc;   -- OUNIT A = PC (for nn(pc))
        end if;
        end if;
        ndpcntl.abox_bsel := c_abox_bsel_vmdout; -- ABOX B = VMDOUT
        ndpcntl.ounit_bsel := c_ounit_bsel_vmdout;-- OUNIT B = VMDOUT
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        do_memcheck(nstate, nstatus, imemok);
        do_memcheck(nstate, nstatus, imemok);
        if imemok then
        if imemok then
          ndpcntl.ddst_we := '1';                -- update DDST
          ndpcntl.ddst_we := '1';                -- update DDST
          nstate := s_dstw_dec1;
          nstate := s_dstw_dec1;
Line 1376... Line 1379...
  --               s_dsta_dec1          req n(r)
  --               s_dsta_dec1          req n(r)
  --               s_dsta_incdef_w      get n(r)
  --               s_dsta_incdef_w      get n(r)
  --               -> do_fork_opa
  --               -> do_fork_opa
 
 
      when s_dsta_inc =>
      when s_dsta_inc =>
        ndpcntl.abox_asel := c_abox_asel_ddst;     -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst;   -- OUNIT A=DDST
        ndpcntl.abox_const := "000000010";
        ndpcntl.ounit_const := "000000010";
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const(2)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const(2)
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.gpr_adst := DSTREG;
        ndpcntl.gpr_adst := DSTREG;
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        nmmumoni.regmod := '1';
        nmmumoni.regmod := '1';
        nmmumoni.isdec := '0';
        nmmumoni.isdec := '0';
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;      -- DSRC = DRES (for if)
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;      -- DSRC = DRES (for if)
Line 1407... Line 1410...
          ndpcntl.ddst_we := '1';                -- update DDST
          ndpcntl.ddst_we := '1';                -- update DDST
          do_fork_opa(nstate, R_IDSTAT);
          do_fork_opa(nstate, R_IDSTAT);
        end if;
        end if;
 
 
      when s_dsta_dec =>
      when s_dsta_dec =>
        ndpcntl.abox_asel := c_abox_asel_ddst;   -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst; -- OUNIT A=DDST
        ndpcntl.abox_const := "000000010";
        ndpcntl.ounit_const := "000000010";
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B=const(2)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;-- OUNIT B=const(2)
        ndpcntl.abox_opsub := '1';               -- ABOX = A-B
        ndpcntl.ounit_opsub := '1';              -- OUNIT = A-B
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        ndpcntl.ddst_we := '1';                  -- update DDST
        ndpcntl.ddst_we := '1';                  -- update DDST
        ndpcntl.gpr_adst := DSTREG;
        ndpcntl.gpr_adst := DSTREG;
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        nmmumoni.regmod := '1';
        nmmumoni.regmod := '1';
Line 1438... Line 1441...
        do_memread_i(nstate, ndpcntl, nvmcntl, s_dsta_ind_w);
        do_memread_i(nstate, ndpcntl, nvmcntl, s_dsta_ind_w);
 
 
      when s_dsta_ind_w =>
      when s_dsta_ind_w =>
        nstate := s_dsta_ind_w;
        nstate := s_dsta_ind_w;
        if R_IDSTAT.is_dstpc = '0' then
        if R_IDSTAT.is_dstpc = '0' then
          ndpcntl.abox_asel := c_abox_asel_ddst; -- ABOX A = DDST
          ndpcntl.ounit_asel := c_ounit_asel_ddst; -- OUNIT A = DDST
        else
        else
          ndpcntl.abox_asel := c_abox_asel_pc;   -- ABOX A = PC (for nn(pc))
          ndpcntl.ounit_asel := c_ounit_asel_pc;   -- OUNIT A = PC (for nn(pc))
        end if;
        end if;
        ndpcntl.abox_bsel := c_abox_bsel_vmdout; -- ABOX B = VMDOUT
        ndpcntl.ounit_bsel := c_ounit_bsel_vmdout;-- OUNIT B = VMDOUT
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        ndpcntl.ddst_sel := c_dpath_ddst_res;    -- DDST = DRES
        do_memcheck(nstate, nstatus, imemok);
        do_memcheck(nstate, nstatus, imemok);
        if imemok then
        if imemok then
          ndpcntl.ddst_we := '1';                -- update DDST
          ndpcntl.ddst_we := '1';                -- update DDST
          nstate := s_dsta_dec1;
          nstate := s_dsta_dec1;
Line 1490... Line 1493...
          nbreset := '1';
          nbreset := '1';
        end if;
        end if;
        nstate := s_idle;
        nstate := s_idle;
 
 
      when s_op_rts =>                  -- RTS
      when s_op_rts =>                  -- RTS
        ndpcntl.abox_asel := c_abox_asel_ddst;     -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst;   -- OUNIT A=DDST
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const(0)
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_we := '1';                     -- load PC with reg(dst)
        ndpcntl.gpr_we := '1';                     -- load PC with reg(dst)
        nstate := s_op_rts_pop;
        nstate := s_op_rts_pop;
 
 
      when s_op_rts_pop =>
      when s_op_rts_pop =>
Line 1532... Line 1535...
        do_fork_next(nstate, nstatus, nmmumoni);
        do_fork_next(nstate, nstatus, nmmumoni);
 
 
      when s_op_br =>                   -- BR
      when s_op_br =>                   -- BR
        nvmcntl.dspace := '0';                   -- prepare do_fork_next_pref
        nvmcntl.dspace := '0';                   -- prepare do_fork_next_pref
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_pc; -- VA = PC
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_pc; -- VA = PC
        ndpcntl.abox_asel := c_abox_asel_pc;     -- ABOX A = PC
        ndpcntl.ounit_asel := c_ounit_asel_pc;   -- OUNIT A = PC
        ndpcntl.abox_bsel := c_abox_bsel_ireg8;  -- ABOX B = IREG8
        ndpcntl.ounit_bsel := c_ounit_bsel_ireg8;-- OUNIT B = IREG8
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        -- note: cc are NZVC
        -- note: cc are NZVC
        case brcode(3 downto 1) is
        case brcode(3 downto 1) is
          when "000" =>                 -- BR
          when "000" =>                 -- BR
            brcond := '1';
            brcond := '1';
          when "001" =>                 -- BNE/BEQ: if Z = x
          when "001" =>                 -- BNE/BEQ: if Z = x
Line 1565... Line 1568...
        else
        else
          do_fork_next_pref(nstate, nstatus, ndpcntl, nvmcntl, nmmumoni);
          do_fork_next_pref(nstate, nstatus, ndpcntl, nvmcntl, nmmumoni);
        end if;
        end if;
 
 
      when s_op_mark =>                 -- MARK 
      when s_op_mark =>                 -- MARK 
        ndpcntl.abox_asel := c_abox_asel_pc;     -- ABOX A = PC
        ndpcntl.ounit_asel := c_ounit_asel_pc;   -- OUNIT A = PC
        ndpcntl.abox_bsel := c_abox_bsel_ireg6;  -- ABOX B = IREG6
        ndpcntl.ounit_bsel := c_ounit_bsel_ireg6;-- OUNIT B = IREG6
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
        ndpcntl.dsrc_we := '1';                  -- update DSRC (with PC+2*nn)
        ndpcntl.dsrc_we := '1';                  -- update DSRC (with PC+2*nn)
        ndpcntl.gpr_adst := c_gpr_r5;            -- fetch r5
        ndpcntl.gpr_adst := c_gpr_r5;            -- fetch r5
        ndpcntl.ddst_sel := c_dpath_ddst_dst;
        ndpcntl.ddst_sel := c_dpath_ddst_dst;
        ndpcntl.ddst_we := '1';
        ndpcntl.ddst_we := '1';
        nstate := s_op_mark1;
        nstate := s_op_mark1;
 
 
      when s_op_mark1 =>
      when s_op_mark1 =>
        ndpcntl.abox_asel := c_abox_asel_ddst;   -- ABOX A = DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst; -- OUNIT A = DDST
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B = const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;-- OUNIT B = const(0)
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_we := '1';                   -- load PC with r5
        ndpcntl.gpr_we := '1';                   -- load PC with r5
        nstate := s_op_mark_pop;
        nstate := s_op_mark_pop;
 
 
      when s_op_mark_pop =>
      when s_op_mark_pop =>
Line 1613... Line 1616...
          --do_fork_next_pref(nstate, ndpcntl, nvmcntl, nmmumoni);
          --do_fork_next_pref(nstate, ndpcntl, nvmcntl, nmmumoni);
          do_fork_next(nstate, nstatus, nmmumoni);
          do_fork_next(nstate, nstatus, nmmumoni);
        end if;
        end if;
 
 
      when s_op_sob1 =>                 -- SOB (br) 
      when s_op_sob1 =>                 -- SOB (br) 
        ndpcntl.abox_asel := c_abox_asel_pc;     -- ABOX A = PC
        ndpcntl.ounit_asel := c_ounit_asel_pc;   -- OUNIT A = PC
        ndpcntl.abox_bsel := c_abox_bsel_ireg6;  -- ABOX B = IREG6
        ndpcntl.ounit_bsel := c_ounit_bsel_ireg6;-- OUNIT B = IREG6
        ndpcntl.abox_opsub := '1';               -- ABOX = A - B
        ndpcntl.ounit_opsub := '1';              -- OUNIT = A - B
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        do_fork_next(nstate, nstatus, nmmumoni);
        do_fork_next(nstate, nstatus, nmmumoni);
 
 
      when s_opg_gen =>
      when s_opg_gen =>
Line 1675... Line 1678...
        ndpcntl.dtmp_sel := c_dpath_dtmp_drese; -- DTMP = DRESE
        ndpcntl.dtmp_sel := c_dpath_dtmp_drese; -- DTMP = DRESE
        ndpcntl.dtmp_we := '1';                 -- capture low order part
        ndpcntl.dtmp_we := '1';                 -- capture low order part
        nstate := s_opg_mul1;
        nstate := s_opg_mul1;
 
 
      when s_opg_mul1 =>                -- MUL (write odd reg)
      when s_opg_mul1 =>                -- MUL (write odd reg)
        ndpcntl.abox_asel := c_abox_asel_dtmp;   -- ABOX A = DTMP
        ndpcntl.ounit_asel := c_ounit_asel_dtmp; -- OUNIT A = DTMP
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B = const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;-- OUNIT B = const(0)
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.gpr_adst := SRCREG(2 downto 1) & "1";-- write odd reg !
        ndpcntl.gpr_adst := SRCREG(2 downto 1) & "1";-- write odd reg !
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        ndpcntl.psr_ccwe := '1';
        ndpcntl.psr_ccwe := '1';
        do_fork_next(nstate, nstatus, nmmumoni);
        do_fork_next(nstate, nstatus, nmmumoni);
 
 
      when s_opg_div =>                 -- DIV (load dd_low)
      when s_opg_div =>                 -- DIV (load dd_low)
        ndpcntl.mbox_s_div := '1';
        ndpcntl.munit_s_div := '1';
        ndpcntl.gpr_asrc := SRCREG(2 downto 1) & "1";-- read odd reg !
        ndpcntl.gpr_asrc := SRCREG(2 downto 1) & "1";-- read odd reg !
        ndpcntl.dtmp_sel := c_dpath_dtmp_dsrc;
        ndpcntl.dtmp_sel := c_dpath_dtmp_dsrc;
        ndpcntl.dtmp_we := '1';
        ndpcntl.dtmp_we := '1';
        nstate := s_opg_div_cn;
        nstate := s_opg_div_cn;
 
 
      when s_opg_div_cn =>              -- DIV (1st...16th cycle)
      when s_opg_div_cn =>              -- DIV (1st...16th cycle)
        ndpcntl.mbox_s_div_cn := '1';
        ndpcntl.munit_s_div_cn := '1';
        ndpcntl.dres_sel := R_IDSTAT.res_sel;     -- DRES = choice of idec
        ndpcntl.dres_sel := R_IDSTAT.res_sel;     -- DRES = choice of idec
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;     -- DSRC = DRES
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;     -- DSRC = DRES
        ndpcntl.dtmp_sel := c_dpath_dtmp_drese;   -- DTMP = DRESE
        ndpcntl.dtmp_sel := c_dpath_dtmp_drese;   -- DTMP = DRESE
        nstate := s_opg_div_cn;
        nstate := s_opg_div_cn;
        if DP_STAT.div_zero='1' or DP_STAT.div_ovfl='1' then
        if DP_STAT.div_zero='1' or DP_STAT.div_ovfl='1' then
Line 1707... Line 1710...
        if DP_STAT.shc_tc = '1' then
        if DP_STAT.shc_tc = '1' then
          nstate := s_opg_div_cr;
          nstate := s_opg_div_cr;
        end if;
        end if;
 
 
      when s_opg_div_cr =>              -- DIV (reminder correction)
      when s_opg_div_cr =>              -- DIV (reminder correction)
        ndpcntl.mbox_s_div_cr := '1';
        ndpcntl.munit_s_div_cr := '1';
        ndpcntl.dres_sel := R_IDSTAT.res_sel;     -- DRES = choice of idec
        ndpcntl.dres_sel := R_IDSTAT.res_sel;     -- DRES = choice of idec
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;     -- DSRC = DRES
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;     -- DSRC = DRES
        ndpcntl.dsrc_we := DP_STAT.div_cr;        -- update DSRC
        ndpcntl.dsrc_we := DP_STAT.div_cr;        -- update DSRC
        nstate := s_opg_div_sq;
        nstate := s_opg_div_sq;
 
 
      when s_opg_div_sq =>              -- DIV (store quotient)
      when s_opg_div_sq =>              -- DIV (store quotient)
        ndpcntl.abox_asel := c_abox_asel_dtmp;    -- ABOX A=DTMP
        ndpcntl.ounit_asel := c_ounit_asel_dtmp;  -- OUNIT A=DTMP
        ndpcntl.abox_const := "00000000"&DP_STAT.div_cq;-- ABOX const = Q corr.
        ndpcntl.ounit_const := "00000000"&DP_STAT.div_cq;-- OUNIT const = Q corr.
        ndpcntl.abox_bsel := c_abox_bsel_const;   -- ABOX B=const (q cor)
        ndpcntl.ounit_bsel := c_ounit_bsel_const; -- OUNIT B=const (q cor)
        ndpcntl.dres_sel := c_dpath_res_abox;     -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;    -- DRES = OUNIT
        ndpcntl.gpr_adst := SRCREG;               -- write result
        ndpcntl.gpr_adst := SRCREG;               -- write result
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        ndpcntl.dtmp_sel := c_dpath_dtmp_dres;    -- DTMP = DRES
        ndpcntl.dtmp_sel := c_dpath_dtmp_dres;    -- DTMP = DRES
        ndpcntl.dtmp_we := '1';                   -- update DTMP (Q)
        ndpcntl.dtmp_we := '1';                   -- update DTMP (Q)
        nstate := s_opg_div_sr;
        nstate := s_opg_div_sr;
 
 
      when s_opg_div_sr =>              -- DIV (store reminder)
      when s_opg_div_sr =>              -- DIV (store reminder)
        ndpcntl.abox_asel := c_abox_asel_dsrc;    -- ABOX A=DSRC
        ndpcntl.ounit_asel := c_ounit_asel_dsrc;  -- OUNIT A=DSRC
        ndpcntl.abox_bsel := c_abox_bsel_const;   -- ABOX B=const (0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const; -- OUNIT B=const (0)
        ndpcntl.dres_sel := c_dpath_res_abox;     -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;    -- DRES = OUNIT
        ndpcntl.gpr_adst := SRCREG(2 downto 1) & "1";-- write odd reg !
        ndpcntl.gpr_adst := SRCREG(2 downto 1) & "1";-- write odd reg !
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        ndpcntl.psr_ccwe := '1';
        ndpcntl.psr_ccwe := '1';
        do_fork_next(nstate, nstatus, nmmumoni);
        do_fork_next(nstate, nstatus, nmmumoni);
 
 
      when s_opg_div_zero =>            -- DIV (/0 or 0/ abort)
      when s_opg_div_zero =>            -- DIV (/0 or 0/ abort)
        ndpcntl.psr_ccwe := '1';
        ndpcntl.psr_ccwe := '1';
        do_fork_next(nstate, nstatus, nmmumoni);
        do_fork_next(nstate, nstatus, nmmumoni);
 
 
      when s_opg_ash =>                 -- ASH (load shc)
      when s_opg_ash =>                 -- ASH (load shc)
        ndpcntl.mbox_s_ash := '1';
        ndpcntl.munit_s_ash := '1';
        nstate := s_opg_ash_cn;
        nstate := s_opg_ash_cn;
 
 
      when s_opg_ash_cn =>              -- ASH (shift cycles)
      when s_opg_ash_cn =>              -- ASH (shift cycles)
        nvmcntl.dspace := '0';                    -- prepare do_fork_next_pref
        nvmcntl.dspace := '0';                    -- prepare do_fork_next_pref
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;     -- DSRC = DRES
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;     -- DSRC = DRES
        ndpcntl.abox_asel := c_abox_asel_dsrc;    -- ABOX A=DSRC
        ndpcntl.ounit_asel := c_ounit_asel_dsrc;  -- OUNIT A=DSRC
        ndpcntl.abox_bsel := c_abox_bsel_const;   -- ABOX B=const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const; -- OUNIT B=const(0)
        ndpcntl.gpr_adst := SRCREG;               -- write result
        ndpcntl.gpr_adst := SRCREG;               -- write result
        ndpcntl.mbox_s_ash_cn := '1';
        ndpcntl.munit_s_ash_cn := '1';
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_pc;  -- VA = PC
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_pc;  -- VA = PC
        nstate := s_opg_ash_cn;
        nstate := s_opg_ash_cn;
        if DP_STAT.shc_tc = '0' then
        if DP_STAT.shc_tc = '0' then
          ndpcntl.dres_sel := R_IDSTAT.res_sel;   -- DRES = choice of idec
          ndpcntl.dres_sel := R_IDSTAT.res_sel;   -- DRES = choice of idec
          ndpcntl.dsrc_we := '1';                 -- update DSRC
          ndpcntl.dsrc_we := '1';                 -- update DSRC
        else
        else
          ndpcntl.dres_sel := c_dpath_res_abox;   -- DRES = ABOX
          ndpcntl.dres_sel := c_dpath_res_ounit;  -- DRES = OUNIT
          ndpcntl.gpr_we := '1';
          ndpcntl.gpr_we := '1';
          ndpcntl.psr_ccwe := '1';
          ndpcntl.psr_ccwe := '1';
          do_fork_next_pref(nstate, nstatus, ndpcntl, nvmcntl, nmmumoni);
          do_fork_next_pref(nstate, nstatus, ndpcntl, nvmcntl, nmmumoni);
        end if;
        end if;
 
 
      when s_opg_ashc =>                -- ASHC (load low, load shc)
      when s_opg_ashc =>                -- ASHC (load low, load shc)
        ndpcntl.gpr_asrc := SRCREG(2 downto 1) & "1";-- read odd reg !
        ndpcntl.gpr_asrc := SRCREG(2 downto 1) & "1";-- read odd reg !
        ndpcntl.dtmp_sel := c_dpath_dtmp_dsrc;
        ndpcntl.dtmp_sel := c_dpath_dtmp_dsrc;
        ndpcntl.dtmp_we := '1';
        ndpcntl.dtmp_we := '1';
        ndpcntl.mbox_s_ashc := '1';
        ndpcntl.munit_s_ashc := '1';
        nstate := s_opg_ashc_cn;
        nstate := s_opg_ashc_cn;
 
 
      when s_opg_ashc_cn =>             -- ASHC (shift cycles)
      when s_opg_ashc_cn =>             -- ASHC (shift cycles)
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;     -- DSRC = DRES
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;     -- DSRC = DRES
        ndpcntl.dtmp_sel := c_dpath_dtmp_drese;   -- DTMP = DRESE
        ndpcntl.dtmp_sel := c_dpath_dtmp_drese;   -- DTMP = DRESE
        ndpcntl.abox_asel := c_abox_asel_dsrc;    -- ABOX A=DSRC
        ndpcntl.ounit_asel := c_ounit_asel_dsrc;  -- OUNIT A=DSRC
        ndpcntl.abox_bsel := c_abox_bsel_const;   -- ABOX B=const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const; -- OUNIT B=const(0)
        ndpcntl.gpr_adst := SRCREG;               -- write result
        ndpcntl.gpr_adst := SRCREG;               -- write result
        ndpcntl.mbox_s_ashc_cn := '1';
        ndpcntl.munit_s_ashc_cn := '1';
        nstate := s_opg_ashc_cn;
        nstate := s_opg_ashc_cn;
        if DP_STAT.shc_tc = '0' then
        if DP_STAT.shc_tc = '0' then
          ndpcntl.dres_sel := R_IDSTAT.res_sel;   -- DRES = choice of idec
          ndpcntl.dres_sel := R_IDSTAT.res_sel;   -- DRES = choice of idec
          ndpcntl.dsrc_we := '1';                 -- update DSRC
          ndpcntl.dsrc_we := '1';                 -- update DSRC
          ndpcntl.dtmp_we := '1';                 -- update DTMP
          ndpcntl.dtmp_we := '1';                 -- update DTMP
        else
        else
          ndpcntl.dres_sel := c_dpath_res_abox;   -- DRES = ABOX
          ndpcntl.dres_sel := c_dpath_res_ounit;  -- DRES = OUNIT
          ndpcntl.gpr_we := '1';
          ndpcntl.gpr_we := '1';
          ndpcntl.psr_ccwe := '1';
          ndpcntl.psr_ccwe := '1';
          nstate := s_opg_ashc_wl;
          nstate := s_opg_ashc_wl;
        end if;
        end if;
 
 
      when s_opg_ashc_wl =>             -- ASHC (write low)
      when s_opg_ashc_wl =>             -- ASHC (write low)
        ndpcntl.abox_asel := c_abox_asel_dtmp;   -- ABOX A = DTMP
        ndpcntl.ounit_asel := c_ounit_asel_dtmp; -- OUNIT A = DTMP
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B = const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;-- OUNIT B = const(0)
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.gpr_adst := SRCREG(2 downto 1) & "1";-- write odd reg !
        ndpcntl.gpr_adst := SRCREG(2 downto 1) & "1";-- write odd reg !
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        do_fork_next(nstate, nstatus, nmmumoni);
        do_fork_next(nstate, nstatus, nmmumoni);
 
 
  -- dsta mode operations -----------------------------------------------------
  -- dsta mode operations -----------------------------------------------------
Line 1811... Line 1814...
      when s_opa_jsr1 =>
      when s_opa_jsr1 =>
        ndpcntl.gpr_asrc := SRCREG;
        ndpcntl.gpr_asrc := SRCREG;
        ndpcntl.dtmp_sel := c_dpath_dtmp_dsrc;     -- DTMP = regfile
        ndpcntl.dtmp_sel := c_dpath_dtmp_dsrc;     -- DTMP = regfile
        ndpcntl.dtmp_we := '1';
        ndpcntl.dtmp_we := '1';
 
 
        ndpcntl.abox_asel := c_abox_asel_dsrc;     -- ABOX A=DSRC
        ndpcntl.ounit_asel := c_ounit_asel_dsrc;   -- OUNIT A=DSRC
        ndpcntl.abox_const := "000000010";
        ndpcntl.ounit_const := "000000010";
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const(2)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const(2)
        ndpcntl.abox_opsub := '1';                 -- ABOX = A-B
        ndpcntl.ounit_opsub := '1';                -- OUNIT = A-B
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;      -- DDST = DRES
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;      -- DDST = DRES
        ndpcntl.dsrc_we := '1';                    -- update DDST
        ndpcntl.dsrc_we := '1';                    -- update DDST
        ndpcntl.gpr_adst := c_gpr_sp;
        ndpcntl.gpr_adst := c_gpr_sp;
        ndpcntl.gpr_we := '1';                     -- update SP
        ndpcntl.gpr_we := '1';                     -- update SP
        nmmumoni.regmod := '1';
        nmmumoni.regmod := '1';
        nmmumoni.isdec := '1';
        nmmumoni.isdec := '1';
        nstate := s_opa_jsr_push;
        nstate := s_opa_jsr_push;
 
 
      when s_opa_jsr_push =>
      when s_opa_jsr_push =>
        ndpcntl.abox_asel := c_abox_asel_dtmp;     -- ABOX A=DTMP
        ndpcntl.ounit_asel := c_ounit_asel_dtmp;   -- OUNIT A=DTMP
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const(0)
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_dsrc; -- VA = DSRC
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_dsrc; -- VA = DSRC
        nvmcntl.dspace := '1';
        nvmcntl.dspace := '1';
        nvmcntl.kstack := is_kmode;
        nvmcntl.kstack := is_kmode;
        nvmcntl.wacc := '1';
        nvmcntl.wacc := '1';
        nvmcntl.req := '1';
        nvmcntl.req := '1';
        nstate := s_opa_jsr_push_w;
        nstate := s_opa_jsr_push_w;
 
 
      when s_opa_jsr_push_w =>
      when s_opa_jsr_push_w =>
        nstate := s_opa_jsr_push_w;
        nstate := s_opa_jsr_push_w;
        ndpcntl.abox_asel := c_abox_asel_pc;       -- ABOX A=PC
        ndpcntl.ounit_asel := c_ounit_asel_pc;     -- OUNIT A=PC
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const(0)
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.gpr_adst := SRCREG;
        ndpcntl.gpr_adst := SRCREG;
        do_memcheck(nstate, nstatus, imemok);
        do_memcheck(nstate, nstatus, imemok);
        if imemok then
        if imemok then
          ndpcntl.gpr_we := '1';                   -- load R with PC
          ndpcntl.gpr_we := '1';                   -- load R with PC
          nstate := s_opa_jsr2;
          nstate := s_opa_jsr2;
        end if;
        end if;
 
 
      when s_opa_jsr2 =>
      when s_opa_jsr2 =>
        ndpcntl.abox_asel := c_abox_asel_ddst;     -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst;   -- OUNIT A=DDST
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const(0)
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_we := '1';                     -- load PC with dsta
        ndpcntl.gpr_we := '1';                     -- load PC with dsta
        do_fork_next(nstate, nstatus, nmmumoni);
        do_fork_next(nstate, nstatus, nmmumoni);
 
 
      when s_opa_jmp =>
      when s_opa_jmp =>
        ndpcntl.abox_asel := c_abox_asel_ddst;     -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst;   -- OUNIT A=DDST
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const(0)
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_adst := c_gpr_pc;
        if R_IDSTAT.is_dstmode0 = '1' then
        if R_IDSTAT.is_dstmode0 = '1' then
          nstate := s_trap_10;                     -- trap 10 like 11/70
          nstate := s_trap_10;                     -- trap 10 like 11/70
        else
        else
          ndpcntl.gpr_we := '1';                   -- load PC with dsta
          ndpcntl.gpr_we := '1';                   -- load PC with dsta
Line 1894... Line 1897...
        end if;
        end if;
        ndpcntl.ddst_sel := c_dpath_ddst_dst;     -- DDST = R(DST)
        ndpcntl.ddst_sel := c_dpath_ddst_dst;     -- DDST = R(DST)
        ndpcntl.ddst_we  := '1';                  -- update DDST (needed for sp)
        ndpcntl.ddst_we  := '1';                  -- update DDST (needed for sp)
 
 
      when s_opa_mtp_reg =>
      when s_opa_mtp_reg =>
        ndpcntl.abox_asel := c_abox_asel_dtmp;    -- ABOX A = DTMP
        ndpcntl.ounit_asel := c_ounit_asel_dtmp;  -- OUNIT A = DTMP
        ndpcntl.abox_bsel := c_abox_bsel_const;   -- ABOX B = const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const; -- OUNIT B = const(0)
        ndpcntl.dres_sel := c_dpath_res_abox;     -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;    -- DRES = OUNIT
        ndpcntl.psr_ccwe := '1';                  -- set cc (from abox too)
        ndpcntl.psr_ccwe := '1';                  -- set cc (from ounit too)
        ndpcntl.gpr_mode := PSW.pmode;            -- load reg in pmode
        ndpcntl.gpr_mode := PSW.pmode;            -- load reg in pmode
        ndpcntl.gpr_we := '1';
        ndpcntl.gpr_we := '1';
        do_fork_next(nstate, nstatus, nmmumoni);
        do_fork_next(nstate, nstatus, nmmumoni);
 
 
      when s_opa_mtp_mem =>
      when s_opa_mtp_mem =>
        ndpcntl.abox_asel := c_abox_asel_dtmp;    -- ABOX A = DTMP
        ndpcntl.ounit_asel := c_ounit_asel_dtmp;  -- OUNIT A = DTMP
        ndpcntl.abox_bsel := c_abox_bsel_const;   -- ABOX B = const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const; -- OUNIT B = const(0)
        ndpcntl.dres_sel := c_dpath_res_abox;     -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;    -- DRES = OUNIT
        ndpcntl.psr_ccwe := '1';                  -- set cc (from abox too)
        ndpcntl.psr_ccwe := '1';                  -- set cc (from ounit too)
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_ddst;-- VA = DDST
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_ddst;-- VA = DDST
        nvmcntl.dspace := IREG(15);            -- msb indicates I/D: 0->I, 1->D
        nvmcntl.dspace := IREG(15);            -- msb indicates I/D: 0->I, 1->D
        nvmcntl.mode := PSW.pmode;
        nvmcntl.mode := PSW.pmode;
        nvmcntl.wacc := '1';
        nvmcntl.wacc := '1';
        nvmcntl.req := '1';
        nvmcntl.req := '1';
Line 1950... Line 1953...
          ndpcntl.ddst_we := '1';
          ndpcntl.ddst_we := '1';
          nstate := s_opa_mfp_dec;
          nstate := s_opa_mfp_dec;
        end if;
        end if;
 
 
      when s_opa_mfp_dec =>
      when s_opa_mfp_dec =>
        ndpcntl.abox_asel := c_abox_asel_dsrc;     -- ABOX A=DSRC
        ndpcntl.ounit_asel := c_ounit_asel_dsrc;   -- OUNIT A=DSRC
        ndpcntl.abox_const := "000000010";
        ndpcntl.ounit_const := "000000010";
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const(2)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const(2)
        ndpcntl.abox_opsub := '1';                 -- ABOX = A-B
        ndpcntl.ounit_opsub := '1';                -- OUNIT = A-B
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;      -- DSRC = DRES
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;      -- DSRC = DRES
        ndpcntl.dsrc_we := '1';                    -- update DSRC
        ndpcntl.dsrc_we := '1';                    -- update DSRC
        ndpcntl.gpr_adst := c_gpr_sp;
        ndpcntl.gpr_adst := c_gpr_sp;
        ndpcntl.gpr_we := '1';                     -- update SP
        ndpcntl.gpr_we := '1';                     -- update SP
        nmmumoni.regmod := '1';
        nmmumoni.regmod := '1';
        nmmumoni.isdec := '1';
        nmmumoni.isdec := '1';
        nstate := s_opa_mfp_push;
        nstate := s_opa_mfp_push;
 
 
      when s_opa_mfp_push =>
      when s_opa_mfp_push =>
        ndpcntl.abox_asel := c_abox_asel_ddst;     -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst;   -- OUNIT A=DDST
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const(0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const(0)
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.psr_ccwe := '1';                   -- set cc (from abox too)
        ndpcntl.psr_ccwe := '1';                   -- set cc (from ounit too)
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_dsrc; -- VA = DSRC
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_dsrc; -- VA = DSRC
        nvmcntl.dspace := '1';
        nvmcntl.dspace := '1';
        nvmcntl.kstack := is_kmode;
        nvmcntl.kstack := is_kmode;
        nvmcntl.wacc := '1';
        nvmcntl.wacc := '1';
        nvmcntl.req := '1';
        nvmcntl.req := '1';
Line 2054... Line 2057...
        ndpcntl.gpr_asrc := c_gpr_sp;
        ndpcntl.gpr_asrc := c_gpr_sp;
        ndpcntl.dsrc_we := '1';                  -- DSRC = SP (in new mode)
        ndpcntl.dsrc_we := '1';                  -- DSRC = SP (in new mode)
        nstate := s_int_decsp;
        nstate := s_int_decsp;
 
 
      when s_int_decsp =>
      when s_int_decsp =>
        ndpcntl.abox_asel := c_abox_asel_dsrc;   -- ABOX A=DSRC
        ndpcntl.ounit_asel := c_ounit_asel_dsrc; -- OUNIT A=DSRC
        ndpcntl.abox_const := "000000010";       -- ABOX const=2
        ndpcntl.ounit_const := "000000010";      -- OUNIT const=2
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B=const
        ndpcntl.ounit_bsel := c_ounit_bsel_const;-- OUNIT B=const
        ndpcntl.abox_opsub := '1';               -- ABOX = A-B
        ndpcntl.ounit_opsub := '1';              -- OUNIT = A-B
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
        ndpcntl.dsrc_we := '1';                  -- update DSRC
        ndpcntl.dsrc_we := '1';                  -- update DSRC
        ndpcntl.gpr_adst := c_gpr_sp;
        ndpcntl.gpr_adst := c_gpr_sp;
        ndpcntl.gpr_we := '1';                   -- update SP too
        ndpcntl.gpr_we := '1';                   -- update SP too
        nstate := s_int_pushps;
        nstate := s_int_pushps;
 
 
      when s_int_pushps =>
      when s_int_pushps =>
        ndpcntl.abox_asel := c_abox_asel_dtmp;     -- ABOX A=DTMP (old PS)
        ndpcntl.ounit_asel := c_ounit_asel_dtmp;   -- OUNIT A=DTMP (old PS)
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const (0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const (0)
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_dsrc; -- VA = DSRC
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_dsrc; -- VA = DSRC
        nvmcntl.wacc := '1';                       -- write mem
        nvmcntl.wacc := '1';                       -- write mem
        nvmcntl.dspace := '1';
        nvmcntl.dspace := '1';
        nvmcntl.kstack := is_kmode;
        nvmcntl.kstack := is_kmode;
        nvmcntl.req := '1';
        nvmcntl.req := '1';
        nstate := s_int_pushps_w;
        nstate := s_int_pushps_w;
 
 
      when s_int_pushps_w =>
      when s_int_pushps_w =>
        ndpcntl.abox_asel := c_abox_asel_dsrc;   -- ABOX A=DSRC
        ndpcntl.ounit_asel := c_ounit_asel_dsrc; -- OUNIT A=DSRC
        ndpcntl.abox_const := "000000010";       -- ABOX const=2
        ndpcntl.ounit_const := "000000010";      -- OUNIT const=2
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B=const
        ndpcntl.ounit_bsel := c_ounit_bsel_const;-- OUNIT B=const
        ndpcntl.abox_opsub := '1';               -- ABOX = A-B
        ndpcntl.ounit_opsub := '1';              -- OUNIT = A-B
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;   -- DRES = OUNIT
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
        ndpcntl.dsrc_sel := c_dpath_dsrc_res;    -- DSRC = DRES
        ndpcntl.gpr_adst := c_gpr_sp;
        ndpcntl.gpr_adst := c_gpr_sp;
 
 
        nstate := s_int_pushps_w;
        nstate := s_int_pushps_w;
        do_memcheck(nstate, nstatus, imemok);
        do_memcheck(nstate, nstatus, imemok);
Line 2094... Line 2097...
          ndpcntl.gpr_we := '1';                 -- update SP too
          ndpcntl.gpr_we := '1';                 -- update SP too
          nstate := s_int_pushpc;
          nstate := s_int_pushpc;
        end if;
        end if;
 
 
      when s_int_pushpc =>
      when s_int_pushpc =>
        ndpcntl.abox_asel := c_abox_asel_pc;       -- ABOX A=PC
        ndpcntl.ounit_asel := c_ounit_asel_pc;     -- OUNIT A=PC
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const (0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const (0)
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_dsrc; -- VA = DSRC
        ndpcntl.vmaddr_sel := c_dpath_vmaddr_dsrc; -- VA = DSRC
        nvmcntl.wacc := '1';                       -- write mem
        nvmcntl.wacc := '1';                       -- write mem
        nvmcntl.dspace := '1';
        nvmcntl.dspace := '1';
        nvmcntl.kstack := is_kmode;
        nvmcntl.kstack := is_kmode;
        nvmcntl.req := '1';
        nvmcntl.req := '1';
        nstate := s_int_pushpc_w;
        nstate := s_int_pushpc_w;
 
 
      when s_int_pushpc_w =>
      when s_int_pushpc_w =>
        ndpcntl.abox_asel := c_abox_asel_ddst;     -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst;   -- OUNIT A=DDST
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const (0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const;  -- OUNIT B=const (0)
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;     -- DRES = OUNIT
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_adst := c_gpr_pc;
 
 
        nstate := s_int_pushpc_w;
        nstate := s_int_pushpc_w;
        do_memcheck(nstate, nstatus, imemok);
        do_memcheck(nstate, nstatus, imemok);
        if imemok then
        if imemok then
Line 2153... Line 2156...
          ndpcntl.psr_we := '1';                  -- load new PS
          ndpcntl.psr_we := '1';                  -- load new PS
          nstate := s_rti_newpc;
          nstate := s_rti_newpc;
        end if;
        end if;
 
 
      when s_rti_newpc =>
      when s_rti_newpc =>
        ndpcntl.abox_asel := c_abox_asel_ddst;     -- ABOX A=DDST
        ndpcntl.ounit_asel := c_ounit_asel_ddst;  -- OUNIT A=DDST
        ndpcntl.abox_bsel := c_abox_bsel_const;    -- ABOX B=const (0)
        ndpcntl.ounit_bsel := c_ounit_bsel_const; -- OUNIT B=const (0)
        ndpcntl.dres_sel := c_dpath_res_abox;      -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;    -- DRES = OUNIT
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_adst := c_gpr_pc;
        ndpcntl.gpr_we := '1';                     -- load new PC
        ndpcntl.gpr_we := '1';                     -- load new PC
        if R_IDSTAT.op_rtt = '1' then              -- if RTT instruction
        if R_IDSTAT.op_rtt = '1' then              -- if RTT instruction
          nstate := s_ifetch;                      --   force fetch
          nstate := s_ifetch;                      --   force fetch
        else                                       -- otherwise RTI
        else                                       -- otherwise RTI
Line 2170... Line 2173...
 
 
      when s_vmerr =>
      when s_vmerr =>
        nstate := s_cpufail;
        nstate := s_cpufail;
 
 
                                            -- setup for R_VMSTAT.err_rsv='1'
                                            -- setup for R_VMSTAT.err_rsv='1'
        ndpcntl.abox_azero := '1';               -- ABOX A = 0
        ndpcntl.ounit_azero := '1';               -- OUNIT A = 0
        ndpcntl.abox_const := "000000100";       -- emergency stack pointer
        ndpcntl.ounit_const := "000000100";       -- emergency stack pointer
        ndpcntl.abox_bsel := c_abox_bsel_const;  -- ABOX B=const(vector)
        ndpcntl.ounit_bsel := c_ounit_bsel_const; -- OUNIT B=const(vector)
        ndpcntl.dres_sel := c_dpath_res_abox;    -- DRES = ABOX
        ndpcntl.dres_sel := c_dpath_res_ounit;    -- DRES = OUNIT
        ndpcntl.gpr_mode := c_psw_kmode;         -- set kmode SP to 4
        ndpcntl.gpr_mode := c_psw_kmode;         -- set kmode SP to 4
        ndpcntl.gpr_adst := c_gpr_sp;
        ndpcntl.gpr_adst := c_gpr_sp;
 
 
        nstatus.trap_mmu :='0';                  -- drop pending mmu trap
        nstatus.trap_mmu :='0';                  -- drop pending mmu trap
 
 
Line 2249... Line 2252...
 
 
    DP_CNTL <= ndpcntl;
    DP_CNTL <= ndpcntl;
    VM_CNTL <= nvmcntl;
    VM_CNTL <= nvmcntl;
 
 
    nmmumoni.regnum := ndpcntl.gpr_adst;
    nmmumoni.regnum := ndpcntl.gpr_adst;
    nmmumoni.delta := ndpcntl.abox_const(3 downto 0);
    nmmumoni.delta  := ndpcntl.ounit_const(3 downto 0);
    MMU_MONI <= nmmumoni;
    MMU_MONI <= nmmumoni;
 
 
  end process proc_next;
  end process proc_next;
 
 
  proc_cpstat : process (R_STATUS)
  proc_cpstat : process (R_STATUS)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.