⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 armcoproc.vhd

📁 arm vhdl rtl code,can synthesis
💻 VHD
字号:
 

library ieee;
use ieee.std_logic_1164.all;
use work.corelib.all;

-- PREFIX: aco_xxx
package armcoproc is
--                                            locking>|<
--  +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
--  |IMSTG    |FESTG    |DESTG    |DRSTG    |RRSTG    |RSSTG    |EXSTG    |DMSTG    |MESTG    |WRSTG    |
--  |         |         |         |         |         |         |take     |         |         |         |
--  |         |         |         |[undef]  |         |         |[undef]  |         |         |         |
--  |         |         |         |         |         |         |         |         |         |         |
--  |         |         |[insn]   |         |         |         |         |         |         |         |
--  +---------+---------++--------++--------+-+-------+---------+---------+---------+---------+-------+-+
--                       V         /\         /\                                                      V   
--                      ++--------++--------+-+-------+---------+---------+---------+---------+-------+-+           
--                      |         | ldc/stc | reg/lock|                                       |ldc/mrc| |         
--                      |         | ctrl    | stc/mcr |                                       |[reg] <+ |         
--                      |         | busy    |         |                                       |commit   |                 
--                      |         |         |         |                                       |use id   | 
--                      +---------+---------+---------+                                       +---------+           
--                         CPFE      CPDEC     CPEX                                                                   
--                      |<  DRSTG.netxinsn controled >|
--
--

-------------------------------------------------------------------------------

type aco_in is record
                 
  hold_r : cli_hold;
                 
  -- PRDESTG ->CPFESTG
  fromPRDE_insn : std_logic_vector(31 downto 0);
  fromPRDE_valid : std_logic;
  -- PRDRSTG ->CPDESTG
  fromPRDR_nextinsn_v : std_logic;
  fromPRDR_valid : std_logic;
  -- PRRRSTG ->CPEXSTG
  fromPRRR_valid : std_logic;
  -- PRWRSTG ->CPWRSTG
  fromPRWR_data_v : std_logic_vector(31 downto 0);
  fromPRWR_valid : std_logic;
  
end record;

-------------------------------------------------------------------------------

type aco_CPDE_PRDR_out is record
  busy   : std_logic;              -- drive ctrlo.hold
  last   : std_logic;              -- drive cmd_cl/cmd_cs issue
  accept : std_logic;              -- udef trap
  active : std_logic;              -- udef trap
end record;

type aco_CPEX_PRRR_out is record
  data : std_logic_vector(31 downto 0);
  lock : std_logic;                -- lock regread
end record;

type aco_out is record
  -- PRDRSTG <- CPDESTG
  CPDE_PRDR : aco_CPDE_PRDR_out;
  -- PRRRSTG <- CPEXSTG
  CPEX_PRRR : aco_CPEX_PRRR_out;
end record;

-------------------------------------------------------------------------------

constant ACO_CREG_U : integer := 3;
constant ACO_CREG_D : integer := 0;
constant ACO_COPC_U : integer := 2;
constant ACO_COPC_D : integer := 0;
constant ACO_CPNUM_U : integer := 11;
constant ACO_CPNUM_D : integer := 8;

-- decode MCR
constant ACO_MCRMRC_CRN_U : integer := 19;
constant ACO_MCRMRC_CRN_D : integer := 16;
constant ACO_MCRMRC_CRM_U : integer := 3;
constant ACO_MCRMRC_CRM_D : integer := 0;
constant ACO_MCRMRC_OPCODE1_U : integer := 23;
constant ACO_MCRMRC_OPCODE1_D : integer := 21;
constant ACO_MCRMRC_OPCODE2_U : integer := 7;
constant ACO_MCRMRC_OPCODE2_D : integer := 5;
constant ACO_LDCSTC_CRD_U : integer := 15;
constant ACO_LDCSTC_CRD_D : integer := 12;

type aco_decinsn is (ACO_type_none, ACO_type_cdp, ACO_type_mrc, ACO_type_mcr, ACO_type_stc, ACO_type_ldc);
function aco_decodev4(
  insn : std_logic_vector(31 downto 0)
) return aco_decinsn;

-------------------------------------------------------------------------------

end armcoproc;

package body armcoproc is

function aco_decodev4(
  insn : std_logic_vector(31 downto 0)
) return aco_decinsn is
  variable tmp : aco_decinsn;
begin
  tmp := ACO_type_none;
  case insn(27 downto 25) is
    when "111" => 
      if insn(24) = '0' then
        if insn(1) = '0' then
          if insn(20) = '0' then
            tmp := ACO_type_mcr;
          else
            tmp := ACO_type_mrc;
          end if;
        else
          tmp := ACO_type_cdp;
        end if;
      end if;
    when "110" =>
      if insn(20) = '0' then
        tmp := ACO_type_ldc;
      else
        tmp := ACO_type_stc;
      end if;
    when others =>
  end case;
  return tmp;
end;

end armcoproc;

/*
   File /tmp/build_html/vhdl/core/libs/corelib.vhd 
used by /tmp/build_html/vhdl/core/core_comp.vhd 
used by /tmp/build_html/vhdl/mem/cache/cache_comp.vhd 
used by /tmp/build_html/vhdl/mem/cache/genic.vhd 
used by /tmp/build_html/vhdl/mem/cache/gendc.vhd 
used by /tmp/build_html/vhdl/arm/armcache.vhd 
used by /tmp/build_html/vhdl/arm/libs/armdecode.vhd 
used by /tmp/build_html/vhdl/arm/libs/armpctrl.vhd 
used by /tmp/build_html/vhdl/arm/armiu_wrstg.vhd 
used by /tmp/build_html/vhdl/arm/cp/armcp_sctrl.vhd 
used by /tmp/build_html/vhdl/arm/armiu.vhd 
used by /tmp/build_html/vhdl/bus/apbmst.vhd 
used by /tmp/build_html/vhdl/core/ctrl/rstgen.vhd 
used by /tmp/build_html/soft/doc/test/.config.vhd 
 
   File /tmp/build_html/vhdl/arm/cp/libs/armcoproc.vhd 
used by /tmp/build_html/vhdl/arm/cp/armcp_comp.vhd 
used by /tmp/build_html/vhdl/arm/cp/armcp_sctrl.vhd 
used by /tmp/build_html/vhdl/arm/armiu.vhd 
 
   Enum cpu_state_type defined in /tmp/build_html/vhdl/sparc/pci_gr.vhd

type cpu_state_type is (idle, sync1, busy, sync2);
 
   Enum astates defined in /tmp/build_html/vhdl/sparc/mmu_acache.vhd

type astates is (idle, dcache, icache, mmu);
 
   Enum rdatatype defined in /tmp/build_html/vhdl/sparc/mmu_icache.vhd

type rdatatype is (itag, idata, memory);
 
   Type cli_hold defined in /tmp/build_html/vhdl/core/libs/corelib.vhd

type cli_hold is record
   hold : std_logic; -- hold
   dhold : std_logic; -- dcache hold
   ihold : std_logic; -- icache hold
end record;
 
   Type aco_in defined in /tmp/build_html/vhdl/arm/cp/libs/armcoproc.vhd

type aco_in is record
                 
  hold_r : cli_hold;
                 
  -- PRDESTG ->CPFESTG
  fromPRDE_insn : std_logic_vector(31 downto 0);
  fromPRDE_valid : std_logic;
  -- PRDRSTG ->CPDESTG
  fromPRDR_nextinsn_v : std_logic;
  fromPRDR_valid : std_logic;
  -- PRRRSTG ->CPEXSTG
  fromPRRR_valid : std_logic;
  -- PRWRSTG ->CPWRSTG
  fromPRWR_data_v : std_logic_vector(31 downto 0);
  fromPRWR_valid : std_logic;
  
end record;
 
   Enum mcycletype defined in /tmp/build_html/vhdl/peripherals/mem/sdmctrl.vhd

type mcycletype is (midle, active, leadout);
 
   Type aco_CPDE_PRDR_out defined in /tmp/build_html/vhdl/arm/cp/libs/armcoproc.vhd

type aco_CPDE_PRDR_out is record
  busy   : 
 
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -