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

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [vhdl/] [arm/] [armiu_rsstg.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.armshiefter.all;
8
use work.armpctrl.all;
9
use work.armctrl.all;
10
use work.armpmodel.all;
11
use work.armdecode.all;
12
use work.arm_comp.all;
13
 
14
entity armiu_rsstg is
15
  port (
16
    rst     : in  std_logic;
17
    clk     : in  std_logic;
18
    i       : in  armiu_rsstg_typ_in;
19
    o       : out armiu_rsstg_typ_out
20
    );
21
end armiu_rsstg;
22
 
23
architecture rtl of armiu_rsstg is
24
 
25
  type armiu_rsstg_tmp_type is record
26
    o       : armiu_rsstg_typ_out;
27
    commit : std_logic;
28
    shieftout      : std_logic_vector(31 downto 0);
29
    cond_fail : std_logic;
30
  end record;
31
  type armiu_rsstg_reg_type is record
32
    pctrl : apc_pctrl;
33
    buf1 : std_logic_vector(31 downto 0);
34
    buf2 : std_logic_vector(31 downto 0);
35
  end record;
36
  type armiu_rsstg_dbg_type is record
37
     dummy : std_logic;
38
     -- pragma translate_off
39
     dbg : armiu_rsstg_tmp_type;
40
     -- pragma translate_on
41
  end record;
42
  signal r, c       : armiu_rsstg_reg_type;
43
  signal rdbg, cdbg : armiu_rsstg_dbg_type;
44
 
45
begin
46
 
47
  p0: process (clk, rst, r, i  )
48
    variable v    : armiu_rsstg_reg_type;
49
    variable t    : armiu_rsstg_tmp_type;
50
    variable vdbg : armiu_rsstg_dbg_type;
51
  begin
52
 
53
    -- $(init(t:armiu_rsstg_tmp_type))
54
 
55
    v := r;
56
    t.commit := not i.flush_v;
57
 
58
    aas_shieft( r.pctrl.insn.insn,
59
                r.pctrl.rs.rsop_sdir,
60
                r.pctrl.rs.rsop_styp,
61
                r.pctrl.data1,
62
                r.pctrl.data2,
63
                i.pstate.fromEX_cpsr_r.ex.c,
64
                t.shieftout,
65
                v.pctrl.rs.rs_shieftcarryout
66
                );
67
 
68
    -- reset
69
    if ( rst = '0' ) then
70
    end if;
71
 
72
    -- pipeline propagation
73
    t.o.pctrl_r := r.pctrl;
74
    t.o.toEX_pctrl_v := v.pctrl;
75
 
76
    -- pipeline flush
77
    if not (t.commit = '1') then
78
      t.o.toEX_pctrl_v.valid := '0';
79
    end if;
80
 
81
    case r.pctrl.rs.rsop_op1_src is
82
      when apc_opsrc_through => t.o.toEX_pctrl_v.data1 := r.pctrl.data1;
83
      when apc_opsrc_buf     => t.o.toEX_pctrl_v.data1 := r.buf1;
84
      when apc_opsrc_alures  => t.o.toEX_pctrl_v.data1 := i.fromEX_alures_v;
85
      when apc_opsrc_none    =>
86
      when others =>
87
    end case;
88
 
89
    case r.pctrl.rs.rsop_op2_src is
90
      when apc_opsrc_through => t.o.toEX_pctrl_v.data2 := t.shieftout;
91
      when apc_opsrc_buf     => t.o.toEX_pctrl_v.data2 := r.buf2;
92
      when apc_opsrc_alures  => t.o.toEX_pctrl_v.data2 := i.fromEX_alures_v;
93
      when apc_opsrc_none    =>
94
      when others =>
95
    end case;
96
 
97
    case r.pctrl.rs.rsop_buf1_src is
98
      when apc_bufsrc_through => v.buf1 := r.pctrl.data1;
99
      when apc_bufsrc_alures  => v.buf1 := i.fromEX_alures_v;
100
      when apc_bufsrc_none    =>
101
      when others =>
102
    end case;
103
 
104
    case r.pctrl.rs.rsop_buf2_src is
105
      when apc_bufsrc_through => v.buf2 := t.shieftout;
106
      when apc_bufsrc_alures  => v.buf2 := i.fromEX_alures_v;
107
      when apc_bufsrc_none    =>
108
      when others =>
109
    end case;
110
 
111
    t.cond_fail := '0';                 -- tmp for dbg
112
    if act_checkcond(i.fromEX_cpsr_v,r.pctrl.insn.insn(ADE_COND_U downto ADE_COND_D)) = '0' then
113
      t.cond_fail := '1';                 -- tmp for dbg
114
      t.o.toEX_pctrl_v.valid := '0';
115
    end if;
116
 
117
    -- todo: add pctrl owner propagation
118
 
119
    if i.pstate.hold_r.hold = '0' then
120
      if apc_is_valid(i.fromRR_pctrl_v) then
121
        v.pctrl := i.fromRR_pctrl_v;
122
      else
123
        if not apc_is_straddr(r.pctrl) then
124
          v.pctrl := i.fromRR_pctrl_v;
125
        else
126
          -- wait for store data (coming after this one)
127
          t.o.toEX_pctrl_v.valid := '0';
128
        end if;
129
      end if;
130
    end if;
131
 
132
    c <= v;
133
 
134
    o <= t.o;
135
 
136
    -- pragma translate_off
137
    vdbg := rdbg;
138
    vdbg.dbg := t;
139
    cdbg <= vdbg;
140
    -- pragma translate_on  
141
 
142
  end process p0;
143
 
144
  pregs : process (clk, c)
145
  begin
146
    if rising_edge(clk) then
147
      r <= c;
148
      -- pragma translate_off
149
      rdbg <= cdbg;
150
      -- pragma translate_on
151
    end if;
152
  end process;
153
 
154
end rtl;

powered by: WebSVN 2.1.0

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