mirror of
https://github.com/openhwgroup/cva5.git
synced 2025-04-20 12:07:53 -04:00
moved some branch logic out of decode
This commit is contained in:
parent
17e1215b11
commit
272adbf077
3 changed files with 12 additions and 15 deletions
|
@ -33,13 +33,13 @@ module branch_unit(
|
|||
ras_interface.branch_unit ras,
|
||||
output branch_flush,
|
||||
|
||||
input branch_issued,
|
||||
|
||||
//Trace signals
|
||||
output logic tr_branch_misspredict,
|
||||
output logic tr_return_misspredict
|
||||
);
|
||||
|
||||
logic branch_issued;
|
||||
|
||||
logic[19:0] jal_imm;
|
||||
logic[11:0] jalr_imm;
|
||||
logic[11:0] br_imm;
|
||||
|
@ -75,6 +75,16 @@ module branch_unit(
|
|||
////////////////////////////////////////////////////
|
||||
assign issue.ready = 1;
|
||||
|
||||
//Branch new request is held if the following instruction hasn't arrived at decode/issue yet
|
||||
always_ff @(posedge clk) begin
|
||||
if (rst)
|
||||
branch_issued <= 0;
|
||||
else if (issue.new_request)
|
||||
branch_issued <= 1;
|
||||
else if (branch_inputs.dec_pc_valid )
|
||||
branch_issued <= 0;
|
||||
end
|
||||
|
||||
branch_comparator bc (
|
||||
.use_signed(branch_inputs.use_signed),
|
||||
.less_than(branch_inputs.fn3[2]),
|
||||
|
|
|
@ -47,7 +47,6 @@ module decode(
|
|||
input logic gc_fetch_flush,
|
||||
input logic gc_issue_flush,
|
||||
output logic gc_flush_required,
|
||||
output logic branch_issued,
|
||||
|
||||
output logic load_store_issue,
|
||||
|
||||
|
@ -406,17 +405,6 @@ module decode(
|
|||
end
|
||||
endgenerate
|
||||
|
||||
//Special case for branch unit:
|
||||
//Branch new request is held if the following instruction hasn't arrived at decode/issue yet
|
||||
always_ff @(posedge clk) begin
|
||||
if (rst)
|
||||
branch_issued <= 0;
|
||||
else if (issue[BRANCH_UNIT_ID])
|
||||
branch_issued <= 1;
|
||||
else if (fb_valid)
|
||||
branch_issued <= 0;
|
||||
end
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
//Illegal Opcode check
|
||||
always_comb begin
|
||||
|
|
|
@ -118,7 +118,6 @@ module taiga (
|
|||
logic instruction_issued_with_rd;
|
||||
logic instruction_complete;
|
||||
logic gc_flush_required;
|
||||
logic branch_issued;
|
||||
|
||||
//Trace Interface Signals
|
||||
logic tr_operand_stall;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue