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

Subversion Repositories rise

[/] [rise/] [trunk/] [vhdl/] [rise_pack.vhd] - Diff between revs 53 and 70

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 53 Rev 70
Line 10... Line 10...
 
 
 
 
library IEEE;
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_ARITH.all;
use IEEE.STD_LOGIC_ARITH.all;
 
use work.RISE_PACK_SPECIFIC.all;
 
 
package RISE_PACK is
package RISE_PACK is
 
 
  constant ARCHITECTURE_WIDTH : integer := 16;
  constant ARCHITECTURE_WIDTH : integer := 16;
  constant REGISTER_COUNT : integer := 16;
  constant REGISTER_COUNT : integer := 16;
 
 
  constant PC_WIDTH : integer := ARCHITECTURE_WIDTH;
  constant PC_WIDTH : integer := ARCHITECTURE_WIDTH;
  constant IR_WIDTH : integer := ARCHITECTURE_WIDTH;
  constant IR_WIDTH : integer := ARCHITECTURE_WIDTH;
  constant SR_WIDTH : integer := ARCHITECTURE_WIDTH;
  constant SR_WIDTH : integer := ARCHITECTURE_WIDTH;
  constant OPCODE_WIDTH : integer := 5;
 
  constant COND_WIDTH : integer := 3;
 
  constant MEM_DATA_WIDTH : integer := ARCHITECTURE_WIDTH;
  constant MEM_DATA_WIDTH : integer := ARCHITECTURE_WIDTH;
  constant MEM_ADDR_WIDTH : integer := ARCHITECTURE_WIDTH;
  constant MEM_ADDR_WIDTH : integer := ARCHITECTURE_WIDTH;
 
 
  constant REGISTER_WIDTH : integer := ARCHITECTURE_WIDTH;
  constant REGISTER_WIDTH : integer := ARCHITECTURE_WIDTH;
  constant REGISTER_ADDR_WIDTH : integer := 4;
  constant REGISTER_ADDR_WIDTH : integer := 4;
Line 43... Line 42...
  subtype MEM_ADDR_T is std_logic_vector(MEM_ADDR_WIDTH-1 downto 0);
  subtype MEM_ADDR_T is std_logic_vector(MEM_ADDR_WIDTH-1 downto 0);
 
 
  subtype LOCK_REGISTER_T is std_logic_vector(LOCK_WIDTH-1 downto 0);
  subtype LOCK_REGISTER_T is std_logic_vector(LOCK_WIDTH-1 downto 0);
 
 
  subtype IMMEDIATE_T is std_logic_vector(IMMEDIATE_WIDTH-1 downto 0);
  subtype IMMEDIATE_T is std_logic_vector(IMMEDIATE_WIDTH-1 downto 0);
  subtype OPCODE_T is std_logic_vector(OPCODE_WIDTH-1 downto 0);
 
  subtype COND_T is std_logic_vector(COND_WIDTH-1 downto 0);
 
 
 
  subtype ALUOP1_T is std_logic_vector(ALUOP1_WIDTH-1 downto 0);
  subtype ALUOP1_T is std_logic_vector(ALUOP1_WIDTH-1 downto 0);
  subtype ALUOP2_T is std_logic_vector(ALUOP2_WIDTH-1 downto 0);
  subtype ALUOP2_T is std_logic_vector(ALUOP2_WIDTH-1 downto 0);
 
 
  --
  --
Line 67... Line 64...
 
 
  constant PC_ADDR : REGISTER_ADDR_T := CONV_STD_LOGIC_VECTOR(14, REGISTER_ADDR_WIDTH);
  constant PC_ADDR : REGISTER_ADDR_T := CONV_STD_LOGIC_VECTOR(14, REGISTER_ADDR_WIDTH);
 
 
  constant PC_RESET_VECTOR : MEM_ADDR_T := x"FFFE";
  constant PC_RESET_VECTOR : MEM_ADDR_T := x"FFFE";
 
 
  -- RISE OPCODES --
 
  -- load opcodes
 
  constant OPCODE_LD_IMM        : OPCODE_T := "10000";
 
  constant OPCODE_LD_IMM_HB     : OPCODE_T := "10010";
 
  constant OPCODE_LD_DISP       : OPCODE_T := "10100";
 
  constant OPCODE_LD_DISP_MS    : OPCODE_T := "11000";
 
  constant OPCODE_LD_REG        : OPCODE_T := "00001";
 
 
 
  -- store opcodes
 
  constant OPCODE_ST_DISP       : OPCODE_T := "11100";
 
 
 
  -- arithmethic opcodes
 
  constant OPCODE_ADD           : OPCODE_T := "00010";
 
  constant OPCODE_ADD_IMM       : OPCODE_T := "00011";
 
  constant OPCODE_SUB           : OPCODE_T := "00100";
 
  constant OPCODE_SUB_IMM       : OPCODE_T := "00101";
 
  constant OPCODE_NEG           : OPCODE_T := "00110";
 
  constant OPCODE_ARS           : OPCODE_T := "00111";
 
  constant OPCODE_ALS           : OPCODE_T := "01000";
 
 
 
  -- logical opcodes
 
  constant OPCODE_AND : OPCODE_T := "01001";
 
  constant OPCODE_NOT : OPCODE_T := "01010";
 
  constant OPCODE_EOR : OPCODE_T := "01011";
 
  constant OPCODE_LS :  OPCODE_T := "01100";
 
  constant OPCODE_RS :  OPCODE_T := "01101";
 
 
 
  -- program control
 
  constant OPCODE_JMP : OPCODE_T := "01110";
 
 
 
  -- other
 
  constant OPCODE_TST : OPCODE_T := "01111";
 
  constant OPCODE_NOP : OPCODE_T := "00000";
 
 
 
  -- CONDITION CODES --
 
  constant COND_UNCONDITIONAL   : COND_T := "000";
 
  constant COND_NOT_ZERO        : COND_T := "001";
 
  constant COND_ZERO            : COND_T := "010";
 
  constant COND_CARRY           : COND_T := "011";
 
  constant COND_NEGATIVE        : COND_T := "100";
 
  constant COND_OVERFLOW        : COND_T := "101";
 
  constant COND_ZERO_NEGATIVE   : COND_T := "110";
 
 
 
  -- STATUS REGISTER BITS --
  -- STATUS REGISTER BITS --
  constant SR_ZERO_BIT          : integer := 0;
  constant SR_ZERO_BIT          : integer := 0;
  constant SR_CARRY_BIT         : integer := 1;
  constant SR_CARRY_BIT         : integer := 1;
  constant SR_NEGATIVE_BIT      : integer := 2;
  constant SR_NEGATIVE_BIT      : integer := 2;

powered by: WebSVN 2.1.0

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