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

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [vhdl/] [arm/] [cp/] [libs/] [armcoproc.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tarookumic
library ieee;
2
use ieee.std_logic_1164.all;
3
use work.corelib.all;
4
 
5
-- PREFIX: aco_xxx
6
package armcoproc is
7
--                                            locking>|<
8
--  +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
9
--  |IMSTG    |FESTG    |DESTG    |DRSTG    |RRSTG    |RSSTG    |EXSTG    |DMSTG    |MESTG    |WRSTG    |
10
--  |         |         |         |         |         |         |take     |         |         |         |
11
--  |         |         |         |[undef]  |         |         |[undef]  |         |         |         |
12
--  |         |         |         |         |         |         |         |         |         |         |
13
--  |         |         |[insn]   |         |         |         |         |         |         |         |
14
--  +---------+---------++--------++--------+-+-------+---------+---------+---------+---------+-------+-+
15
--                       V         /\         /\                                                      V   
16
--                      ++--------++--------+-+-------+---------+---------+---------+---------+-------+-+           
17
--                      |         | ldc/stc | reg/lock|                                       |ldc/mrc| |         
18
--                      |         | ctrl    | stc/mcr |                                       |[reg] <+ |         
19
--                      |         | busy    |         |                                       |commit   |                 
20
--                      |         |         |         |                                       |use id   | 
21
--                      +---------+---------+---------+                                       +---------+           
22
--                         CPFE      CPDEC     CPEX                                                                   
23
--                      |<  DRSTG.netxinsn controled >|
24
--
25
--
26
 
27
-------------------------------------------------------------------------------
28
 
29
type aco_in is record
30
 
31
  hold_r : cli_hold;
32
 
33
  -- PRDESTG ->CPFESTG
34
  fromPRDE_insn : std_logic_vector(31 downto 0);
35
  fromPRDE_valid : std_logic;
36
  -- PRDRSTG ->CPDESTG
37
  fromPRDR_nextinsn_v : std_logic;
38
  fromPRDR_valid : std_logic;
39
  -- PRRRSTG ->CPEXSTG
40
  fromPRRR_valid : std_logic;
41
  -- PRWRSTG ->CPWRSTG
42
  fromPRWR_data_v : std_logic_vector(31 downto 0);
43
  fromPRWR_valid : std_logic;
44
 
45
end record;
46
 
47
-------------------------------------------------------------------------------
48
 
49
type aco_CPDE_PRDR_out is record
50
  busy   : std_logic;              -- drive ctrlo.hold
51
  last   : std_logic;              -- drive cmd_cl/cmd_cs issue
52
  accept : std_logic;              -- udef trap
53
  active : std_logic;              -- udef trap
54
end record;
55
 
56
type aco_CPEX_PRRR_out is record
57
  data : std_logic_vector(31 downto 0);
58
  lock : std_logic;                -- lock regread
59
end record;
60
 
61
type aco_out is record
62
  -- PRDRSTG <- CPDESTG
63
  CPDE_PRDR : aco_CPDE_PRDR_out;
64
  -- PRRRSTG <- CPEXSTG
65
  CPEX_PRRR : aco_CPEX_PRRR_out;
66
end record;
67
 
68
-------------------------------------------------------------------------------
69
 
70
constant ACO_CREG_U : integer := 3;
71
constant ACO_CREG_D : integer := 0;
72
constant ACO_COPC_U : integer := 2;
73
constant ACO_COPC_D : integer := 0;
74
constant ACO_CPNUM_U : integer := 11;
75
constant ACO_CPNUM_D : integer := 8;
76
 
77
-- decode MCR
78
constant ACO_MCRMRC_CRN_U : integer := 19;
79
constant ACO_MCRMRC_CRN_D : integer := 16;
80
constant ACO_MCRMRC_CRM_U : integer := 3;
81
constant ACO_MCRMRC_CRM_D : integer := 0;
82
constant ACO_MCRMRC_OPCODE1_U : integer := 23;
83
constant ACO_MCRMRC_OPCODE1_D : integer := 21;
84
constant ACO_MCRMRC_OPCODE2_U : integer := 7;
85
constant ACO_MCRMRC_OPCODE2_D : integer := 5;
86
constant ACO_LDCSTC_CRD_U : integer := 15;
87
constant ACO_LDCSTC_CRD_D : integer := 12;
88
 
89
type aco_decinsn is (ACO_type_none, ACO_type_cdp, ACO_type_mrc, ACO_type_mcr, ACO_type_stc, ACO_type_ldc);
90
function aco_decodev4(
91
  insn : std_logic_vector(31 downto 0)
92
) return aco_decinsn;
93
 
94
-------------------------------------------------------------------------------
95
 
96
end armcoproc;
97
 
98
package body armcoproc is
99
 
100
function aco_decodev4(
101
  insn : std_logic_vector(31 downto 0)
102
) return aco_decinsn is
103
  variable tmp : aco_decinsn;
104
begin
105
  tmp := ACO_type_none;
106
  case insn(27 downto 25) is
107
    when "111" =>
108
      if insn(24) = '0' then
109
        if insn(1) = '0' then
110
          if insn(20) = '0' then
111
            tmp := ACO_type_mcr;
112
          else
113
            tmp := ACO_type_mrc;
114
          end if;
115
        else
116
          tmp := ACO_type_cdp;
117
        end if;
118
      end if;
119
    when "110" =>
120
      if insn(20) = '0' then
121
        tmp := ACO_type_ldc;
122
      else
123
        tmp := ACO_type_stc;
124
      end if;
125
    when others =>
126
  end case;
127
  return tmp;
128
end;
129
 
130
end armcoproc;
131
 

powered by: WebSVN 2.1.0

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