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

Subversion Repositories rise

[/] [rise/] [trunk/] [vhdl/] [rise_pack.vhd] - Blame information for rev 151

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jlechner
-------------------------------------------------------------------------------
2
-- File: rise_pack.vhd
3
-- Author: Jakob Lechner, Urban Stadler, Harald Trinkl, Christian Walter
4
-- Created: 2006-11-29
5
-- Last updated: 2006-11-29
6
 
7
-- Description:
8
-- Package for RISE project.
9
-------------------------------------------------------------------------------
10
 
11
 
12
library IEEE;
13
use IEEE.STD_LOGIC_1164.all;
14 8 jlechner
use IEEE.STD_LOGIC_ARITH.all;
15 70 jlechner
use work.RISE_PACK_SPECIFIC.all;
16 2 jlechner
 
17
package RISE_PACK is
18
 
19
  constant ARCHITECTURE_WIDTH : integer := 16;
20
  constant REGISTER_COUNT : integer := 16;
21
 
22
  constant PC_WIDTH : integer := ARCHITECTURE_WIDTH;
23
  constant IR_WIDTH : integer := ARCHITECTURE_WIDTH;
24
  constant SR_WIDTH : integer := ARCHITECTURE_WIDTH;
25
  constant MEM_DATA_WIDTH : integer := ARCHITECTURE_WIDTH;
26
  constant MEM_ADDR_WIDTH : integer := ARCHITECTURE_WIDTH;
27
 
28
  constant REGISTER_WIDTH : integer := ARCHITECTURE_WIDTH;
29 5 cwalter
  constant REGISTER_ADDR_WIDTH : integer := 4;
30 2 jlechner
  constant IMMEDIATE_WIDTH : integer := ARCHITECTURE_WIDTH;
31
  constant LOCK_WIDTH : integer := REGISTER_COUNT;
32 8 jlechner
 
33
  constant ALUOP1_WIDTH : integer := 3;
34
  constant ALUOP2_WIDTH : integer := 3;
35 2 jlechner
 
36
  subtype PC_REGISTER_T is std_logic_vector(PC_WIDTH-1 downto 0);
37
  subtype IR_REGISTER_T is std_logic_vector(IR_WIDTH-1 downto 0);
38
  subtype SR_REGISTER_T is std_logic_vector(SR_WIDTH-1 downto 0);
39
  subtype REGISTER_T is std_logic_vector(REGISTER_WIDTH-1 downto 0);
40
  subtype REGISTER_ADDR_T is std_logic_vector(REGISTER_ADDR_WIDTH-1 downto 0);
41
  subtype MEM_DATA_T is std_logic_vector(MEM_DATA_WIDTH-1 downto 0);
42
  subtype MEM_ADDR_T is std_logic_vector(MEM_ADDR_WIDTH-1 downto 0);
43
 
44
  subtype LOCK_REGISTER_T is std_logic_vector(LOCK_WIDTH-1 downto 0);
45 40 jlechner
 
46 2 jlechner
  subtype IMMEDIATE_T is std_logic_vector(IMMEDIATE_WIDTH-1 downto 0);
47
 
48 8 jlechner
  subtype ALUOP1_T is std_logic_vector(ALUOP1_WIDTH-1 downto 0);
49
  subtype ALUOP2_T is std_logic_vector(ALUOP2_WIDTH-1 downto 0);
50
 
51 5 cwalter
  --
52 12 cwalter
  constant SR_REGISTER_ADDR : REGISTER_ADDR_T := "1111";
53
  constant PC_REGISTER_ADDR : REGISTER_ADDR_T := "1110";
54
  constant LR_REGISTER_ADDR : REGISTER_ADDR_T := "1101";
55
 
56 5 cwalter
  constant SR_REGISTER_DI : INTEGER := 15;
57
  constant SR_REGISTER_IP_MASK : INTEGER := 12;
58
  constant SR_REGISTER_OVERFLOW : INTEGER := 3;
59
  constant SR_REGISTER_NEGATIVE : INTEGER := 2;
60
  constant SR_REGISTER_CARRY : INTEGER := 1;
61
  constant SR_REGISTER_ZERO : INTEGER := 0;
62
  constant RESET_PC_VALUE : PC_REGISTER_T := ( others => '0' );
63
  constant RESET_SR_VALUE : PC_REGISTER_T := ( others => '0' );
64 53 cwalter
 
65 8 jlechner
  constant PC_ADDR : REGISTER_ADDR_T := CONV_STD_LOGIC_VECTOR(14, REGISTER_ADDR_WIDTH);
66 46 cwalter
 
67
  constant PC_RESET_VECTOR : MEM_ADDR_T := x"FFFE";
68
 
69 8 jlechner
 
70
  -- STATUS REGISTER BITS --
71
  constant SR_ZERO_BIT          : integer := 0;
72
  constant SR_CARRY_BIT         : integer := 1;
73
  constant SR_NEGATIVE_BIT      : integer := 2;
74
  constant SR_OVERFLOW_BIT      : integer := 3;
75
 
76 2 jlechner
  type IF_ID_REGISTER_T is record
77
                             pc : PC_REGISTER_T;
78
                             ir : IR_REGISTER_T;
79
                           end record;
80
 
81
  type ID_EX_REGISTER_T is record
82
                             sr         : SR_REGISTER_T;
83
                             pc         : PC_REGISTER_T;
84
                             opcode     : OPCODE_T;
85
                             cond       : COND_T;
86
                             rX_addr    : REGISTER_ADDR_T;
87
                             rX         : REGISTER_T;
88
                             rY         : REGISTER_T;
89
                             rZ         : REGISTER_T;
90
                             immediate  : IMMEDIATE_T;
91
                           end record;
92 8 jlechner
 
93
  -- bit positions for aluop1
94
  constant ALUOP1_LD_MEM_BIT : integer := 0;
95
  constant ALUOP1_ST_MEM_BIT : integer := 1;
96
  constant ALUOP1_WB_REG_BIT : integer := 2;
97
 
98
  -- bit positions for aluop2
99
  constant ALUOP2_SR_BIT : integer := 0;
100
  constant ALUOP2_LR_BIT : integer := 1;
101
 
102 2 jlechner
  type EX_MEM_REGISTER_T is record
103 8 jlechner
                              aluop1        : ALUOP1_T;
104
                              aluop2        : ALUOP2_T;
105 2 jlechner
                              reg           : REGISTER_T;
106
                              alu           : REGISTER_T;
107
                              dreg_addr     : REGISTER_ADDR_T;
108
                              lr            : PC_REGISTER_T;
109 8 jlechner
                              sr            : SR_REGISTER_T;
110 2 jlechner
                            end record;
111 40 jlechner
 
112 2 jlechner
  type MEM_WB_REGISTER_T is record
113 8 jlechner
                              aluop1        : ALUOP1_T;
114
                              aluop2        : ALUOP2_T;
115 2 jlechner
                              reg           : REGISTER_T;
116 40 jlechner
                              mem_reg       : REGISTER_T;
117 2 jlechner
                              dreg_addr     : REGISTER_ADDR_T;
118
                              lr            : PC_REGISTER_T;
119 40 jlechner
                              sr            : SR_REGISTER_T;
120 2 jlechner
                            end record;
121
 
122 121 trinklhar
    constant CONST_UART_STATUS_ADDRESS: REGISTER_T := x"8000";
123 126 trinklhar
         constant CONST_UART_DATA_ADDRESS: REGISTER_T := x"8001";
124 2 jlechner
end RISE_PACK;
125
 

powered by: WebSVN 2.1.0

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