Line 25... |
Line 25... |
use work.mlite_pack.all;
|
use work.mlite_pack.all;
|
|
|
entity control is
|
entity control is
|
port(opcode : in std_logic_vector(31 downto 0);
|
port(opcode : in std_logic_vector(31 downto 0);
|
intr_signal : in std_logic;
|
intr_signal : in std_logic;
|
pause_in : in std_logic;
|
|
rs_index : out std_logic_vector(5 downto 0);
|
rs_index : out std_logic_vector(5 downto 0);
|
rt_index : out std_logic_vector(5 downto 0);
|
rt_index : out std_logic_vector(5 downto 0);
|
rd_index : out std_logic_vector(5 downto 0);
|
rd_index : out std_logic_vector(5 downto 0);
|
imm_out : out std_logic_vector(15 downto 0);
|
imm_out : out std_logic_vector(15 downto 0);
|
alu_func : out alu_function_type;
|
alu_func : out alu_function_type;
|
Line 61... |
Line 60... |
-- from_reg_source_nez, from_reg_source_eqz);
|
-- from_reg_source_nez, from_reg_source_eqz);
|
-- type pc_source_type is (from_inc4, from_inc8, from_reg_source,
|
-- type pc_source_type is (from_inc4, from_inc8, from_reg_source,
|
-- from_opcode25_0, from_branch, from_lbranch);
|
-- from_opcode25_0, from_branch, from_lbranch);
|
begin
|
begin
|
|
|
control_proc: process(opcode, intr_signal, pause_in)
|
control_proc: process(opcode, intr_signal)
|
variable op, func : std_logic_vector(5 downto 0);
|
variable op, func : std_logic_vector(5 downto 0);
|
variable rs, rt, rd : std_logic_vector(5 downto 0);
|
variable rs, rt, rd : std_logic_vector(5 downto 0);
|
variable rtx : std_logic_vector(4 downto 0);
|
variable rtx : std_logic_vector(4 downto 0);
|
variable imm : std_logic_vector(15 downto 0);
|
variable imm : std_logic_vector(15 downto 0);
|
variable alu_function : alu_function_type;
|
variable alu_function : alu_function_type;
|
Line 416... |
Line 415... |
when "111110" => --SDC2
|
when "111110" => --SDC2
|
when "111111" => --SDC3
|
when "111111" => --SDC3
|
when others =>
|
when others =>
|
end case;
|
end case;
|
|
|
if c_source = c_from_null or pause_in = '1' then
|
if c_source = c_from_null then
|
rd := "000000";
|
rd := "000000";
|
end if;
|
end if;
|
|
|
if intr_signal = '1' then
|
if intr_signal = '1' then
|
rs := "111111"; --interrupt vector
|
rs := "111111"; --interrupt vector
|