CSR ops: wait until oldest

This commit is contained in:
Eric Matthews 2021-03-29 11:28:40 -07:00
parent 26bf60871f
commit b60ceb7384
3 changed files with 12 additions and 4 deletions

View file

@ -78,7 +78,11 @@ module gc_unit(
output logic [31:0] gc_fetch_pc,
//Ordering support
input logic ls_is_idle,
input logic [LOG2_MAX_IDS:0] post_issue_count,
//WB
unit_writeback_interface.unit wb
);
@ -358,7 +362,7 @@ module gc_unit(
.result(processing_csr)
);
assign csr_ready_to_complete = processing_csr & ls_is_idle;
assign csr_ready_to_complete = processing_csr & (post_issue_count == 1);
always_ff @(posedge clk) begin
csr_ready_to_complete_r <= csr_ready_to_complete;
csr_id <= instruction_id;

View file

@ -71,6 +71,8 @@ module instruction_metadata_and_id_management
output id_t retire_ids [RETIRE_PORTS],
output logic retire_ids_retired [RETIRE_PORTS],
//CSR
output logic [LOG2_MAX_IDS:0] post_issue_count,
//Exception
input id_t exception_id,
output logic [31:0] exception_pc
@ -88,12 +90,11 @@ module instruction_metadata_and_id_management
logic [$bits(branch_metadata_t)-1:0] branch_metadata_table [MAX_IDS];
logic [$bits(fetch_metadata_t)-1:0] fetch_metadata_table [MAX_IDS];
localparam LOG2_MAX_IDS = $clog2(MAX_IDS);
id_t decode_id;
logic [LOG2_MAX_IDS:0] fetched_count; //MSB used as valid for decode stage
logic [LOG2_MAX_IDS:0] pre_issue_count;
logic [LOG2_MAX_IDS:0] post_issue_count;
//logic [LOG2_MAX_IDS:0] post_issue_count;
logic [LOG2_MAX_IDS:0] inflight_count;
genvar i;

View file

@ -130,6 +130,7 @@ module taiga (
logic gc_tlb_flush;
logic [31:0] gc_fetch_pc;
logic ls_is_idle;
logic [LOG2_MAX_IDS:0] post_issue_count;
//Decode Unit and Fetch Unit
logic illegal_instruction;
@ -230,7 +231,8 @@ module taiga (
.retire (retire),
.retire_ids (retire_ids),
.retire_ids_retired(retire_ids_retired),
.exception_id (exception_id),
.post_issue_count(post_issue_count),
.exception_id (exception_id),
.exception_pc (exception_pc)
);
@ -501,6 +503,7 @@ module taiga (
.gc_tlb_flush (gc_tlb_flush),
.gc_fetch_pc (gc_fetch_pc),
.ls_is_idle (ls_is_idle),
.post_issue_count (post_issue_count),
.wb (unit_wb[GC_UNIT_ID])
);