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

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [vhdl/] [arm/] [armcmd_cr.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tarookumic
-- $(lic)
2
-- $(help_generic)
3
-- $(help_local)
4
 
5
library ieee;
6
use ieee.std_logic_1164.all;
7
use work.armdecode.all;
8
use work.armpctrl.all;
9
use work.armpmodel.all;
10
use work.armcmd.all;
11
use work.armcmd_comp.all;
12
 
13
entity armcmd_cr is
14
  port (
15
    rst     : in  std_logic;
16
    clk     : in  std_logic;
17
    i       : in  armcmd_cr_typ_in;
18
    o       : out armcmd_cr_typ_out
19
    );
20
end armcmd_cr;
21
 
22
architecture rtl of armcmd_cr is
23
 
24
  type armcmd_cr_tmp_type is record
25
    o       : armcmd_cr_typ_out;
26
    off : std_logic_vector(23 downto 0);
27
  end record;
28
  type armcmd_cr_reg_type is record
29
    dummy      : std_logic;
30
  end record;
31
  type armcmd_cr_dbg_type is record
32
     dummy : std_logic;
33
     -- pragma translate_off
34
     dbg : armcmd_cr_tmp_type;
35
     -- pragma translate_on
36
  end record;
37
  signal r, c       : armcmd_cr_reg_type;
38
  signal rdbg, cdbg : armcmd_cr_dbg_type;
39
 
40
begin
41
 
42
  p0: process (clk, rst, r, i  )
43
    variable v    : armcmd_cr_reg_type;
44
    variable t    : armcmd_cr_tmp_type;
45
    variable vdbg : armcmd_cr_dbg_type;
46
  begin
47
 
48
    -- $(init(t:armcmd_cr_tmp_type))
49
 
50
    v := r;
51
    t.o.ctrlo := i.ctrli.ctrlo;
52
    t.o.ctrlo.nextinsn := '1';
53
 
54
    t.o.rd_src  := acm_rdnone;
55
    t.o.r1_src  := acm_none;
56
 
57
    if i.ctrli.insn.insn(ADE_MRC_MCR_C) = '1' then -- '1':MRC '0':MCR
58
 
59
      -- move coprocessor to arm:
60
      -- MRC{cond} <copro>,<opcode_1>,<rd>,<crn>,<crm>{,<opcode2>}
61
      -- MRC2      <copro>,<opcode_1>,<rd>,<crn>,<crm>{,<opcode2>}
62
 
63
      -- [frame:] 
64
      --
65
      --             RRSTG      RSSTG       EXSTG       DMSTG       MESTG       WRSTG
66
      --      --+-----------+-----------+-----------+-----------+-----------+----------+
67
      --        |           |           |           |           |           |
68
      --        |           |           |           |           |           |
69
      --        | (regread) |(regshieft)|  (aluop)  |  +(trans) |  (dcache) | +->(write)
70
      --        |           |           |           |           |           | |
71
      --        |  [copro]  |           |           |           |           | |
72
      --      --+-----+-----+-----------+-----------+-----------+-----------+-+--------+
73
      --              V                                                       |
74
      --         pctrl.data1 (as wrdata)  : o---------------------------------+          
75
      --
76
 
77
      t.o.rd_src  := acm_rdrrd;
78
    else
79
 
80
      -- move arm to coprocessor:
81
      -- MCR{cond} <copro>,<opcode_1>,<rd>,<crn>,<crm>{,<opcode2>}
82
      -- MCR2      <copro>,<opcode_1>,<rd>,<crn>,<crm>{,<opcode2>}
83
 
84
      -- [frame:] 
85
      --
86
      --             RRSTG      RSSTG       EXSTG       DMSTG       MESTG       WRSTG
87
      --      --+-----------+-----------+-----------+-----------+-----------+----------+
88
      --  <rd>--+-----+     |           |           |           |           |           
89
      --        |     |     |           |           |           |           |
90
      --        | (regread) |(regshieft)|  (aluop)  |   (trans) |  (dcache) | (write)
91
      --        |     |     |           |           |           |           | 
92
      --        |     |     |           |           |           |           | 
93
      --      --+-----+-----+-----------+-----------+-----------+-----------+----------+
94
      --              V                                                        
95
      --         pctrl.data1 (as wrdata)  : o--------------------------------->[copro]          
96
 
97
      t.o.r1_src  := acm_rrd;
98
    end if;
99
 
100
    if i.fromCP_busy = '1' then
101
      t.o.ctrlo.hold := '1';
102
    end if;
103
 
104
    -- reset
105
    if ( rst = '0' ) then
106
    end if;
107
 
108
    o <= t.o;
109
 
110
    -- pragma translate_off
111
    vdbg := rdbg;
112
    vdbg.dbg := t;
113
    cdbg <= vdbg;
114
    -- pragma translate_on  
115
 
116
  end process p0;
117
 
118
  pregs : process (clk, c)
119
  begin
120
    if rising_edge(clk) then
121
      r <= c;
122
      -- pragma translate_off
123
      rdbg <= cdbg;
124
      -- pragma translate_on
125
    end if;
126
  end process;
127
 
128
end rtl;

powered by: WebSVN 2.1.0

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