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

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [vhdl/] [arm/] [armiu_festg.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.arm_comp.all;
9
 
10
entity armiu_festg is
11
  port (
12
    rst     : in  std_logic;
13
    clk     : in  std_logic;
14
    i       : in  armiu_festg_typ_in;
15
    o       : out armiu_festg_typ_out
16
    );
17
end armiu_festg;
18
 
19
architecture rtl of armiu_festg is
20
 
21
  type armiu_festg_tmp_type is record
22
    o   : armiu_festg_typ_out;
23
    commit : std_logic;
24
    ico_insn : std_logic_vector(31 downto 0);
25
    reqinsn : std_logic;
26
  end record;
27
  type armiu_festg_reg_type is record
28
    cmp_valid : std_logic;
29
    toDE_insn : ade_feinsn;
30
    branch, trap : std_logic;
31
  end record;
32
  type armiu_festg_dbg_type is record
33
     dummy : std_logic;
34
     -- pragma translate_off
35
     dbg : armiu_festg_tmp_type;
36
     -- pragma translate_on
37
  end record;
38
  signal r, c       : armiu_festg_reg_type;
39
  signal rdbg, cdbg : armiu_festg_dbg_type;
40
 
41
begin
42
 
43
  p0: process (clk, rst, r, i  )
44
    variable v    : armiu_festg_reg_type;
45
    variable t    : armiu_festg_tmp_type;
46
    variable vdbg : armiu_festg_dbg_type;
47
  begin
48
 
49
    -- $(init(t:armiu_festg_tmp_type))
50
 
51
    v := r;
52
 
53
    t.commit := not i.flush_v;
54
    t.ico_insn := i.ico.dat_line_v.data(0);
55
 
56
    t.reqinsn := (i.pstate.nextinsn_v and r.cmp_valid and (not r.trap));
57
 
58
    -- streaming
59
    if i.pstate.hold_r.hold = '0' and i.pstate.nextinsn_v = '1' then  -- and t.ici_null = '0
60
      v.toDE_insn.insn := t.ico_insn;
61
      v.toDE_insn.valid := r.cmp_valid;
62
      v.toDE_insn.trap := r.trap;
63
    end if;
64
 
65
    -- pipeline overrun, memory-data-strobe while holding pipeline
66
    if i.ico.mstrobe = '1' then
67
      v.toDE_insn.insn := t.ico_insn;
68
      v.toDE_insn.valid := r.cmp_valid;
69
      v.toDE_insn.trap := r.trap;
70
    end if;
71
 
72
    -- flush pipeline
73
    if not (t.commit = '1') then
74
      v.toDE_insn.trap := '0';
75
      v.toDE_insn.valid := '0';
76
      v.cmp_valid := '0';
77
      v.trap := '0';
78
    end if;
79
 
80
    -- pipeline step
81
    if i.pstate.hold_r.hold = '0' then
82
      v.cmp_valid := i.fromIM_addrvalid_v;
83
      v.trap := i.fromIM_trap_v;
84
      if i.pstate.nextinsn_v = '1' then
85
        v.toDE_insn.pc := i.fromIM_addrphy_v;
86
        v.toDE_insn.pc_vir := i.fromIM_addrvir_v;
87
        v.branch := i.fromIM_branch_v;
88
      end if;
89
    end if;
90
 
91
    -- reset
92
    if ( rst = '0' ) then
93
      v.cmp_valid := '0';
94
      v.toDE_insn.valid := '0';
95
    end if;
96
 
97
    -- icache input
98
    t.o.ici.pc_v := i.fromIM_addrphy_v;
99
    t.o.ici.pc_r := r.toDE_insn.pc;
100
    t.o.ici.bra_v := i.fromIM_branch_v;
101
    t.o.ici.bra_r := r.branch;
102
    t.o.ici.annul := not (t.reqinsn);
103
    t.o.ici.flush := '0';
104
 
105
    t.o.toDE_insn_v := v.toDE_insn;
106
    t.o.toDE_insn_r := r.toDE_insn;
107
 
108
    -- reset
109
    if ( rst = '0' ) then
110
    end if;
111
 
112
    c <= v;
113
 
114
    o <= t.o;
115
 
116
    -- pragma translate_off
117
    vdbg := rdbg;
118
    vdbg.dbg := t;
119
    cdbg <= vdbg;
120
    -- pragma translate_on  
121
 
122
  end process p0;
123
 
124
  pregs : process (clk, c)
125
  begin
126
    if rising_edge(clk) then
127
      r <= c;
128
      -- pragma translate_off
129
      rdbg <= cdbg;
130
      -- pragma translate_on
131
    end if;
132
  end process;
133
 
134
end rtl;

powered by: WebSVN 2.1.0

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