Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoccBlackBox fix #3035

Merged
merged 1 commit into from
Sep 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions src/main/resources/vsrc/RoccBlackBox.v
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// See LICENSE.SiFive for license details.

module RoccBlackBox
#( parameter xLen,
PRV_SZ,
coreMaxAddrBits,
dcacheReqTagBits,
M_SZ,
mem_req_bits_size_width,
coreDataBits,
coreDataBytes,
paddrBits,
vaddrBitsExtended,
FPConstants_RM_SZ,
fLen,
FPConstants_FLAGS_SZ )
#( parameter xLen = 64,
PRV_SZ = 2,
coreMaxAddrBits = 40,
dcacheReqTagBits = 9,
M_SZ = 5,
mem_req_bits_size_width = 2,
coreDataBits = 64,
coreDataBytes = 8,
paddrBits = 32,
vaddrBitsExtended = 40,
FPConstants_RM_SZ = 3,
fLen = 64,
FPConstants_FLAGS_SZ = 5)
( input clock,
input reset,
output rocc_cmd_ready,
Expand Down Expand Up @@ -164,7 +164,6 @@ module RoccBlackBox
input [FPConstants_FLAGS_SZ-1:0] rocc_fpu_resp_bits_exc );

assign rocc_cmd_ready = 1'b1;
assign rocc_resp_valid = 1'b0;

assign rocc_mem_req_valid = 1'b0;
assign rocc_mem_s1_kill = 1'b0;
Expand All @@ -182,20 +181,22 @@ module RoccBlackBox
reg [4:0] rocc_cmd_bits_inst_rd_d;
always @ (posedge clock) begin
if (reset) begin
acc <= 0;
acc <= {xLen{1'b0}};
doResp <= 1'b0;
rocc_cmd_bits_inst_rd_d <= 5'b0;
end
if (rocc_cmd_valid && rocc_cmd_ready) begin
else if (rocc_cmd_valid && rocc_cmd_ready) begin
doResp <= rocc_cmd_bits_inst_xd;
rocc_cmd_bits_inst_rd_d <= rocc_cmd_bits_inst_rd;
acc <= acc + rocc_cmd_bits_rs1 + rocc_cmd_bits_rs2;
end
else begin
doResp <= 0;
doResp <= 1'b0;
end
end

assign rocc_resp_valid = doResp;
assign rocc_resp_bits_rd = rocc_cmd_bits_inst_rd;
assign rocc_resp_bits_rd = rocc_cmd_bits_inst_rd_d;
assign rocc_resp_bits_data = acc;

endmodule