Skip to content

Commit

Permalink
[hardware] 👽 Retime handshake between lanes and FUs
Browse files Browse the repository at this point in the history
  • Loading branch information
suehtamacv committed Oct 15, 2021
1 parent 12c1422 commit ca3e810
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
12 changes: 3 additions & 9 deletions hardware/src/lane/operand_requester.sv
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,14 @@ module operand_requester import ara_pkg::*; import rvv_pkg::*; #(
strb_t ldu_result_be;
logic ldu_result_req;
logic ldu_result_gnt;
logic ldu_result_ready;
assign ldu_result_gnt_o = ldu_result_req_i && ldu_result_ready;
stream_register #(.T(stream_register_payload_t)) i_ldu_stream_register (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.clr_i (1'b0 ),
.testmode_i(1'b0 ),
.data_i ({ldu_result_id_i, ldu_result_addr_i, ldu_result_wdata_i, ldu_result_be_i}),
.valid_i (ldu_result_req_i ),
.ready_o (ldu_result_ready ),
.ready_o (ldu_result_gnt_o ),
.data_o ({ldu_result_id, ldu_result_addr, ldu_result_wdata, ldu_result_be} ),
.valid_o (ldu_result_req ),
.ready_i (ldu_result_gnt )
Expand All @@ -114,16 +112,14 @@ module operand_requester import ara_pkg::*; import rvv_pkg::*; #(
strb_t sldu_result_be;
logic sldu_result_req;
logic sldu_result_gnt;
logic sldu_result_ready;
assign sldu_result_gnt_o = sldu_result_req_i && sldu_result_ready;
stream_register #(.T(stream_register_payload_t)) i_sldu_stream_register (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.clr_i (1'b0 ),
.testmode_i(1'b0 ),
.data_i ({sldu_result_id_i, sldu_result_addr_i, sldu_result_wdata_i, sldu_result_be_i}),
.valid_i (sldu_result_req_i ),
.ready_o (sldu_result_ready ),
.ready_o (sldu_result_gnt_o ),
.data_o ({sldu_result_id, sldu_result_addr, sldu_result_wdata, sldu_result_be} ),
.valid_o (sldu_result_req ),
.ready_i (sldu_result_gnt )
Expand All @@ -136,16 +132,14 @@ module operand_requester import ara_pkg::*; import rvv_pkg::*; #(
strb_t masku_result_be;
logic masku_result_req;
logic masku_result_gnt;
logic masku_result_ready;
assign masku_result_gnt_o = masku_result_req_i && masku_result_ready;
stream_register #(.T(stream_register_payload_t)) i_masku_stream_register (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.clr_i (1'b0 ),
.testmode_i(1'b0 ),
.data_i ({masku_result_id_i, masku_result_addr_i, masku_result_wdata_i, masku_result_be_i}),
.valid_i (masku_result_req_i ),
.ready_o (masku_result_ready ),
.ready_o (masku_result_gnt_o ),
.data_o ({masku_result_id, masku_result_addr, masku_result_wdata, masku_result_be} ),
.valid_o (masku_result_req ),
.ready_i (masku_result_gnt )
Expand Down
5 changes: 3 additions & 2 deletions hardware/src/masku/masku.sv
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ module masku import ara_pkg::*; import rvv_pkg::*; #(

// Received a grant from the VRF.
// Deactivate the request, but do not bump the pointers for now.
if (masku_result_gnt_i[lane]) begin
if (masku_result_req_o[lane] && masku_result_gnt_i[lane]) begin
result_queue_valid_d[result_queue_read_pnt_q][lane] = 1'b0;
result_queue_d[result_queue_read_pnt_q][lane] = '0;
end
Expand Down Expand Up @@ -673,7 +673,8 @@ module masku import ara_pkg::*; import rvv_pkg::*; #(

// Finished committing the results of a vector instruction
// When the masku acts as a master for the VRF, wait the grant from the operand requester
if (vinsn_commit_valid && commit_cnt_d == '0 && (!(vinsn_issue.op inside {[VMFEQ:VMSBC]}) || masku_result_gnt_i)) begin
if (vinsn_commit_valid && commit_cnt_d == '0 && (!(vinsn_issue.op inside {[VMFEQ:VMSBC]}) ||
&(masku_result_req_o & masku_result_gnt_i))) begin
// Mark the vector instruction as being done
pe_resp.vinsn_done[vinsn_commit.id] = 1'b1;

Expand Down
2 changes: 1 addition & 1 deletion hardware/src/sldu/sldu.sv
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ module sldu import ara_pkg::*; import rvv_pkg::*; #(

// Received a grant from the VRF.
// Deactivate the request, but do not bump the pointers for now.
if (sldu_result_gnt_i[lane]) begin
if (sldu_result_req_o[lane] && sldu_result_gnt_i[lane]) begin
result_queue_valid_d[result_queue_read_pnt_q][lane] = 1'b0;
result_queue_d[result_queue_read_pnt_q][lane] = '0;
end
Expand Down
2 changes: 1 addition & 1 deletion hardware/src/vlsu/vldu.sv
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ module vldu import ara_pkg::*; import rvv_pkg::*; #(

// Received a grant from the VRF.
// Deactivate the request, but do not bump the pointers for now.
if (ldu_result_gnt_i[lane]) begin
if (ldu_result_req_o[lane] && ldu_result_gnt_i[lane]) begin
result_queue_valid_d[result_queue_read_pnt_q][lane] = 1'b0;
result_queue_d[result_queue_read_pnt_q][lane] = '0;
end
Expand Down

0 comments on commit ca3e810

Please sign in to comment.