@ -36,6 +36,8 @@ entity control is
execute_next_tag : in instr_tag_t;
execute_next_tag : in instr_tag_t;
execute_next_cr_tag : in instr_tag_t;
execute_next_cr_tag : in instr_tag_t;
execute2_next_tag : in instr_tag_t;
execute2_next_cr_tag : in instr_tag_t;
cr_read_in : in std_ulogic;
cr_read_in : in std_ulogic;
cr_write_in : in std_ulogic;
cr_write_in : in std_ulogic;
@ -44,10 +46,10 @@ entity control is
stall_out : out std_ulogic;
stall_out : out std_ulogic;
stopped_out : out std_ulogic;
stopped_out : out std_ulogic;
gpr_bypass_a : out std_ulogic;
gpr_bypass_a : out std_ulogic_vector(1 downto 0);
gpr_bypass_b : out std_ulogic;
gpr_bypass_b : out std_ulogic_vector(1 downto 0);
gpr_bypass_c : out std_ulogic;
gpr_bypass_c : out std_ulogic_vector(1 downto 0);
cr_bypass : out std_ulogic;
cr_bypass : out std_ulogic_vector(1 downto 0);
instr_tag_out : out instr_tag_t
instr_tag_out : out instr_tag_t
);
);
@ -142,11 +144,11 @@ begin
variable tag_s : instr_tag_t;
variable tag_s : instr_tag_t;
variable tag_t : instr_tag_t;
variable tag_t : instr_tag_t;
variable incr_tag : tag_number_t;
variable incr_tag : tag_number_t;
variable byp_a : std_ulogic;
variable byp_a : std_ulogic_vector(1 downto 0);
variable byp_b : std_ulogic;
variable byp_b : std_ulogic_vector(1 downto 0);
variable byp_c : std_ulogic;
variable byp_c : std_ulogic_vector(1 downto 0);
variable tag_cr : instr_tag_t;
variable tag_cr : instr_tag_t;
variable byp_cr : std_ulogic;
variable byp_cr : std_ulogic_vector(1 downto 0);
begin
begin
tag_a := instr_tag_init;
tag_a := instr_tag_init;
for i in tag_number_t loop
for i in tag_number_t loop
@ -179,26 +181,32 @@ begin
tag_c.valid := '0';
tag_c.valid := '0';
end if;
end if;
byp_a := '0';
byp_a := "00";
if EX1_BYPASS and tag_match(execute_next_tag, tag_a) then
if EX1_BYPASS and tag_match(execute_next_tag, tag_a) then
byp_a := '1';
byp_a := "10";
elsif EX1_BYPASS and tag_match(execute2_next_tag, tag_a) then
byp_a := "11";
end if;
end if;
byp_b := '0';
byp_b := "00";
if EX1_BYPASS and tag_match(execute_next_tag, tag_b) then
if EX1_BYPASS and tag_match(execute_next_tag, tag_b) then
byp_b := '1';
byp_b := "10";
elsif EX1_BYPASS and tag_match(execute2_next_tag, tag_b) then
byp_b := "11";
end if;
end if;
byp_c := '0';
byp_c := "00";
if EX1_BYPASS and tag_match(execute_next_tag, tag_c) then
if EX1_BYPASS and tag_match(execute_next_tag, tag_c) then
byp_c := '1';
byp_c := "10";
elsif EX1_BYPASS and tag_match(execute2_next_tag, tag_c) then
byp_c := "11";
end if;
end if;
gpr_bypass_a <= byp_a;
gpr_bypass_a <= byp_a;
gpr_bypass_b <= byp_b;
gpr_bypass_b <= byp_b;
gpr_bypass_c <= byp_c;
gpr_bypass_c <= byp_c;
gpr_tag_stall <= (tag_a.valid and not byp_a) or
gpr_tag_stall <= (tag_a.valid and not byp_a(1)) or
(tag_b.valid and not byp_b) or
(tag_b.valid and not byp_b(1)) or
(tag_c.valid and not byp_c);
(tag_c.valid and not byp_c(1));
incr_tag := curr_tag;
incr_tag := curr_tag;
instr_tag.tag <= curr_tag;
instr_tag.tag <= curr_tag;
@ -215,13 +223,15 @@ begin
if tag_match(tag_cr, complete_in) then
if tag_match(tag_cr, complete_in) then
tag_cr.valid := '0';
tag_cr.valid := '0';
end if;
end if;
byp_cr := '0';
byp_cr := "00";
if EX1_BYPASS and tag_match(execute_next_cr_tag, tag_cr) then
if EX1_BYPASS and tag_match(execute_next_cr_tag, tag_cr) then
byp_cr := '1';
byp_cr := "10";
elsif EX1_BYPASS and tag_match(execute2_next_cr_tag, tag_cr) then
byp_cr := "11";
end if;
end if;
cr_bypass <= byp_cr;
cr_bypass <= byp_cr;
cr_tag_stall <= tag_cr.valid and not byp_cr;
cr_tag_stall <= tag_cr.valid and not byp_cr(1);
end process;
end process;
control1 : process(all)
control1 : process(all)