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

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [vhdl/] [arm/] [armiu_dmstg.vhd] - Blame information for rev 2

Go to most recent revision | 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.armpctrl.all;
8
use work.arm_comp.all;
9
 
10
entity armiu_dmstg is
11
  port (
12
    rst     : in  std_logic;
13
    clk     : in  std_logic;
14
    i       : in  armiu_dmstg_typ_in;
15
    o       : out armiu_dmstg_typ_out
16
    );
17
end armiu_dmstg;
18
 
19
architecture rtl of armiu_dmstg is
20
 
21
  type armiu_dmstg_tmp_type is record
22
    o       : armiu_dmstg_typ_out;
23
    commit : std_logic;
24
  end record;
25
  type armiu_dmstg_reg_type is record
26
    pctrl : apc_pctrl;
27
  end record;
28
  type armiu_dmstg_dbg_type is record
29
     dummy : std_logic;
30
     -- pragma translate_off
31
     dbg : armiu_dmstg_tmp_type;
32
     -- pragma translate_on
33
  end record;
34
  signal r, c       : armiu_dmstg_reg_type;
35
  signal rdbg, cdbg : armiu_dmstg_dbg_type;
36
 
37
begin
38
 
39
  p0: process (clk, rst, r, i  )
40
    variable v    : armiu_dmstg_reg_type;
41
    variable t    : armiu_dmstg_tmp_type;
42
    variable vdbg : armiu_dmstg_dbg_type;
43
  begin
44
 
45
    -- $(init(t:armiu_dmstg_tmp_type))
46
 
47
    v := r;
48
    t.commit := not i.flush_v;
49
 
50
    -- reset
51
    if ( rst = '0' ) then
52
    end if;
53
 
54
    -- pipeline propagation
55
    t.o.pctrl_r := r.pctrl;
56
    t.o.toME_pctrl_v := v.pctrl;
57
 
58
    -- pipeline flush
59
    if not (t.commit = '1') then
60
      t.o.toME_pctrl_v.valid := '0';
61
    end if;
62
 
63
    if i.pstate.hold_r.hold = '0' then
64
      v.pctrl := i.fromEX_pctrl_v;
65
      if apc_is_straddr(r.pctrl) then
66
        v.pctrl.data1 := r.pctrl.data1;  -- address in writedata frame
67
      end if;
68
    end if;
69
 
70
    c <= v;
71
 
72
    o <= t.o;
73
 
74
    -- pragma translate_off
75
    vdbg := rdbg;
76
    vdbg.dbg := t;
77
    cdbg <= vdbg;
78
    -- pragma translate_on  
79
 
80
  end process p0;
81
 
82
  pregs : process (clk, c)
83
  begin
84
    if rising_edge(clk) then
85
      r <= c;
86
      -- pragma translate_off
87
      rdbg <= cdbg;
88
      -- pragma translate_on
89
    end if;
90
  end process;
91
 
92
end rtl;

powered by: WebSVN 2.1.0

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