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

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [vhdl/] [arm/] [armcmd_bl.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.armdecode.all;
9
use work.armcmd.all;
10
use work.armcmd_comp.all;
11
 
12
entity armcmd_bl is
13
  port (
14
    rst     : in  std_logic;
15
    clk     : in  std_logic;
16
    i       : in  armcmd_bl_typ_in;
17
    o       : out armcmd_bl_typ_out
18
    );
19
end armcmd_bl;
20
 
21
architecture rtl of armcmd_bl is
22
 
23
  type armcmd_bl_tmp_type is record
24
    o       : armcmd_bl_typ_out;
25
    off : std_logic_vector(23 downto 0);
26
  end record;
27
  type armcmd_bl_reg_type is record
28
    dummy      : std_logic;
29
  end record;
30
  type armcmd_bl_dbg_type is record
31
     dummy : std_logic;
32
     -- pragma translate_off
33
     dbg : armcmd_bl_tmp_type;
34
     -- pragma translate_on
35
  end record;
36
  signal r, c       : armcmd_bl_reg_type;
37
  signal rdbg, cdbg : armcmd_bl_dbg_type;
38
 
39
begin
40
 
41
  p0: process (clk, rst, r, i  )
42
    variable v    : armcmd_bl_reg_type;
43
    variable t    : armcmd_bl_tmp_type;
44
    variable vdbg : armcmd_bl_dbg_type;
45
  begin
46
 
47
    -- $(init(t:armcmd_bl_tmp_type))
48
 
49
    v := r;
50
    t.o.ctrlo := i.ctrli.ctrlo;
51
    t.o.ctrlo.nextinsn := '1';
52
 
53
    t.off := i.ctrli.insn.insn(ADE_BROFF_U downto ADE_BROFF_D);
54
 
55
    t.o.r2_src := acm_none;
56
    t.o.data2 := (others => '0');
57
    t.o.rsop_op2_src := apc_opsrc_none;
58
 
59
    -- b{cond} addr
60
    -- bl{cond} addr
61
    case i.ctrli.cnt is
62
      when ACM_CNT_ZERO =>
63
 
64
        --                           (branch) <-+
65
        --             RRSTG      RSSTG       EXSTG       DMSTG       MESTG       WRSTG
66
        --      --+-----------+-----------+-----+-----+-----------+-----------+----------+
67
        --        | pctrl.(pc)+----------op1    |     |           |           |
68
        --        |           |           | \   |     |           |           |
69
        --        |  (regread)|           | +(aluop)  |  (trans)  |  (dcache) | (write)
70
        --        |           |           | /         |           |           | 
71
        --   <off>|-----------+----------op2          |           |           | 
72
        --      --+-----------+-----------+-----------+-----------+-----------+----------+
73
 
74
        -- write pc
75
        t.o.r1_src := acm_local;
76
        if t.off(23) = '0' then
77
          t.o.data2 := (others => '0');
78
        else
79
          t.o.data2 := (others => '1');
80
        end if;
81
        t.o.data2(23+2 downto 0) := t.off & "00";
82
        t.o.rd_src := acm_rdpc;
83
 
84
        if i.ctrli.insn.insn(ADE_BRLINK_C) = '1' then
85
          t.o.ctrlo.nextinsn := '0';
86
        end if;
87
 
88
      when others =>
89
 
90
        --             RRSTG      RSSTG       EXSTG       DMSTG       MESTG       WRSTG
91
        --      --+-----------+-----------+-----------+-----------+-----------+----------+
92
        --        | pctrl.(pc)+----------op1          |           |           |
93
        --        |           |           | \         |           |           |
94
        --        |  (regread)|           | +(aluop)  |  (trans)  |  (dcache) | +-><r14>(write)
95
        --        |           |           | /   |     |           |           | | 
96
        --   <0>  |-----------+----------op2    |     |           |           | |  
97
        --      --+-----------+-----------+-----+-----+-----------+-----------+-+--------+
98
        --                                      |                               |  
99
        --         pctrl.data1 (as wrdata)  :   +-------------------------------+
100
 
101
        -- write link
102
        t.o.r1_src := acm_local;
103
        t.o.rd_src := acm_rdlink;
104
 
105
    end case;
106
 
107
    -- reset
108
    if ( rst = '0' ) then
109
    end if;
110
 
111
    c <= v;
112
 
113
    o <= t.o;
114
 
115
    -- pragma translate_off
116
    vdbg := rdbg;
117
    vdbg.dbg := t;
118
    cdbg <= vdbg;
119
    -- pragma translate_on  
120
 
121
  end process p0;
122
 
123
  pregs : process (clk, c)
124
  begin
125
    if rising_edge(clk) then
126
      r <= c;
127
      -- pragma translate_off
128
      rdbg <= cdbg;
129
      -- pragma translate_on
130
    end if;
131
  end process;
132
 
133
end rtl;

powered by: WebSVN 2.1.0

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