tools: dthex2vhdl added. read source for readme
[calu.git] / cpu / src / common_pkg.vhd
index 43603d29a9638626502ee2c9640678e2f3ed711c..a88336c7ec5f13f5ed8565761275a7bc2ec9be1f 100755 (executable)
@@ -25,6 +25,7 @@ package common_pkg is
 
        constant INSTR_ADDR_WIDTH       : INTEGER := 32;
        constant PHYS_INSTR_ADDR_WIDTH  : INTEGER := 11;
+       constant ROM_INSTR_ADDR_WIDTH : INTEGER := 7;
        constant REG_ADDR_WIDTH         : INTEGER := 4;
        constant DATA_ADDR_WIDTH        : INTEGER := 11;
        constant PHYS_DATA_ADDR_WIDTH   : INTEGER := 32;
@@ -33,6 +34,8 @@ package common_pkg is
        constant COND_WIDTH : INTEGER := 4;
        constant DATA_END_ADDR          : integer := ((2**DATA_ADDR_WIDTH)-1);
 
+       constant ROM_USE : std_logic := '1';
+       constant RAM_USE : std_logic := '0';
        
        subtype instruction_word_t is std_logic_vector(WORD_WIDTH-1 downto 0);
        subtype instruction_addr_t is std_logic_vector(INSTR_ADDR_WIDTH-1 downto 0);
@@ -56,6 +59,7 @@ package common_pkg is
        constant HWORD_OPT : integer := 1;
        constant PUSH_OPT : integer := 1;
        constant LOW_HIGH_OPT : integer := 1;
+       constant DIRECT_JUMP_OPT : integer := 1;
        
        constant CARRY_OPT : integer := 2;
        constant BYTE_OPT : integer := 2;
@@ -71,8 +75,14 @@ package common_pkg is
        
        type op_info_t is (ADDSUB_OP,AND_OP,OR_OP, XOR_OP,SHIFT_OP, LDST_OP, JMP_OP, JMP_ST_OP, STACK_OP);
        subtype op_opt_t is std_logic_vector(NUM_OP_OPT_WIDTH-1 downto 0);
+
+       type interrupt_t is (IDLE, UART);       
        
-       
+       constant UART_INT_EN_BIT : integer := 1;
+       constant GLOBAL_INT_EN_BIT : integer := 0;
+
+       constant UART_INT_VECTOR : std_logic_vector(PHYS_INSTR_ADDR_WIDTH-1 downto 0) := "00000000001"; --integer := 1;
+
        type instruction_rec is record
 
                predicates : std_logic_vector(3 downto 0);
@@ -89,7 +99,7 @@ package common_pkg is
 
                jmptype : std_logic_vector(1 downto 0);
 
-               high_low, fill, signext, bp: std_logic;
+               high_low, fill, signext, bp, int: std_logic;
 
                op_detail : op_opt_t;
                op_group : op_info_t;