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

Parameterization and other fixes for downstream project #1950

Merged
merged 11 commits into from
Apr 5, 2024

Conversation

zarubaf
Copy link
Contributor

@zarubaf zarubaf commented Mar 21, 2024

I've encountered some smaller problems when trying to update. Mostly Bender file lists, etc. that shouldn't affect the majority of users here.

Additionally I've fixed some verilator lint warnings as we run a stricter lint deck in-house.

And fifo_v3 needs to be forked since it will clash with the original fifo_v3 from common_cells.

@zarubaf zarubaf requested a review from JeanRochCoulon as a code owner March 21, 2024 16:30
@zarubaf zarubaf requested a review from cathales March 21, 2024 16:31
core/acc_dispatcher.sv Outdated Show resolved Hide resolved
@@ -433,6 +433,9 @@ module cache_ctrl
state_d = IDLE;
end
end

default:;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
default:;
default: ;

Comment on lines +164 to +165
logic [31:0] halfword;
logic [$clog2(CVA6Cfg.DCACHE_LINE_WIDTH)-1:0] cl_offset;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
logic [31:0] halfword;
logic [$clog2(CVA6Cfg.DCACHE_LINE_WIDTH)-1:0] cl_offset;
logic [ 31:0] halfword;
logic [ $clog2(CVA6Cfg.DCACHE_LINE_WIDTH)-1:0] cl_offset;

Comment on lines +228 to +229
halfword = '0;
cl_offset = '0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
halfword = '0;
cl_offset = '0;
halfword = '0;
cl_offset = '0;

@@ -491,6 +495,8 @@
end
end
end

default:;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
default:;
default: ;

Comment on lines +176 to +179
// pragma translate_off
`ifndef VERILATOR
initial begin
assert (DEPTH > 0) else $error("DEPTH must be greater than 0.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
// pragma translate_off
`ifndef VERILATOR
initial begin
assert (DEPTH > 0) else $error("DEPTH must be greater than 0.");
// FIFO is in pass through mode -> do not change the pointers
if (FALL_THROUGH && (status_cnt_q == 0) && push_i) begin
data_o = data_i;
if (pop_i) begin
status_cnt_n = status_cnt_q;
read_pointer_n = read_pointer_q;
write_pointer_n = write_pointer_q;
end

initial begin
assert (DEPTH > 0) else $error("DEPTH must be greater than 0.");
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
end
// sequential process
always_ff @(posedge clk_i or negedge rst_ni) begin
if (~rst_ni) begin
read_pointer_q <= '0;
write_pointer_q <= '0;
status_cnt_q <= '0;
end else begin
if (flush_i) begin
read_pointer_q <= '0;
write_pointer_q <= '0;
status_cnt_q <= '0;
end else begin
read_pointer_q <= read_pointer_n;
write_pointer_q <= write_pointer_n;
status_cnt_q <= status_cnt_n;
end
end
end
if (FPGA_EN) begin : gen_fpga_queue
AsyncDpRam #(
.ADDR_WIDTH(ADDR_DEPTH),
.DATA_DEPTH(DEPTH),
.DATA_WIDTH($bits(dtype))
) fifo_ram (
.Clk_CI (clk_i),
.WrEn_SI (fifo_ram_we),
.RdAddr_DI(fifo_ram_read_address),
.WrAddr_DI(fifo_ram_write_address),
.WrData_DI(fifo_ram_wdata),
.RdData_DO(fifo_ram_rdata)
);
end else begin : gen_asic_queue
always_ff @(posedge clk_i or negedge rst_ni) begin
if (~rst_ni) begin
mem_q <= '0;
end else if (!gate_clock) begin
mem_q <= mem_n;
end
end
end

Comment on lines +182 to +188
full_write : assert property(
@(posedge clk_i) disable iff (~rst_ni) (full_o |-> ~push_i))
else $fatal (1, "Trying to push new data although the FIFO is full.");

empty_read : assert property(
@(posedge clk_i) disable iff (~rst_ni) (empty_o |-> ~pop_i))
else $fatal (1, "Trying to pop data although the FIFO is empty.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
full_write : assert property(
@(posedge clk_i) disable iff (~rst_ni) (full_o |-> ~push_i))
else $fatal (1, "Trying to push new data although the FIFO is full.");
empty_read : assert property(
@(posedge clk_i) disable iff (~rst_ni) (empty_o |-> ~pop_i))
else $fatal (1, "Trying to pop data although the FIFO is empty.");
// pragma translate_off
`ifndef VERILATOR
initial begin
assert (DEPTH > 0)
else $error("DEPTH must be greater than 0.");
end
full_write :
assert property (@(posedge clk_i) disable iff (~rst_ni) (full_o |-> ~push_i))
else $fatal(1, "Trying to push new data although the FIFO is full.");
empty_read :
assert property (@(posedge clk_i) disable iff (~rst_ni) (empty_o |-> ~pop_i))
else $fatal(1, "Trying to pop data although the FIFO is empty.");

@(posedge clk_i) disable iff (~rst_ni) (empty_o |-> ~pop_i))
else $fatal (1, "Trying to pop data although the FIFO is empty.");
`endif
// pragma translate_on
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
// pragma translate_on
// pragma translate_on

`endif
// pragma translate_on

endmodule // fifo_v3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
endmodule // fifo_v3
endmodule // fifo_v3

Copy link
Contributor

❌ failed run, report available here.

Copy link
Contributor

✔️ successful run, report available here.

1 similar comment
Copy link
Contributor

✔️ successful run, report available here.

@JeanRochCoulon
Copy link
Contributor

To fix the Verible warning, the command is
image

@zarubaf
Copy link
Contributor Author

zarubaf commented Mar 22, 2024

To fix the Verible warning, the command is image

Do we want to fix this verible issues? And which one do we want to fix? Only data cache?

@JeanRochCoulon
Copy link
Contributor

All files contained in cva6/core/ should be fixed by Verible

Copy link
Contributor

@cathales cathales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of parametrization-related things.

core/amo_buffer.sv Show resolved Hide resolved
core/axi_shim.sv Outdated Show resolved Hide resolved
core/cva6_fifo_v3.sv Show resolved Hide resolved
core/include/build_config_pkg.sv Show resolved Hide resolved
core/include/config_pkg.sv Show resolved Hide resolved
Copy link
Contributor

❌ failed run, report available here.

@zarubaf zarubaf force-pushed the zarubaf/fix-integration branch from ba35588 to 1fab902 Compare April 4, 2024 10:56
Copy link
Contributor

github-actions bot commented Apr 4, 2024

❌ failed run, report available here.

zarubaf added 2 commits April 4, 2024 11:33
The interface made a bunch of problems with the
typedefs so I've removed it.
Comment on lines +1516 to +1540
.pck (clk_i),
.rstn (rst_ni),
.flush_unissued (flush_unissued_instr_ctrl_id),
.flush_all (flush_ctrl_ex),
.instruction (id_stage_i.fetch_entry_i.instruction),
.fetch_valid (id_stage_i.fetch_entry_valid_i),
.fetch_ack (id_stage_i.fetch_entry_ready_o),
.issue_ack (issue_stage_i.i_scoreboard.issue_ack_i),
.issue_sbe (issue_stage_i.i_scoreboard.issue_instr_o),
.waddr (waddr_commit_id),
.wdata (wdata_commit_id),
.we_gpr (we_gpr_commit_id),
.we_fpr (we_fpr_commit_id),
.commit_instr (commit_instr_id_commit),
.commit_ack (commit_ack),
.st_valid (ex_stage_i.lsu_i.i_store_unit.store_buffer_i.valid_i),
.st_paddr (ex_stage_i.lsu_i.i_store_unit.store_buffer_i.paddr_i),
.ld_valid (ex_stage_i.lsu_i.i_load_unit.req_port_o.tag_valid),
.ld_kill (ex_stage_i.lsu_i.i_load_unit.req_port_o.kill_req),
.ld_paddr (ex_stage_i.lsu_i.i_load_unit.paddr_i),
.resolve_branch (resolved_branch),
.commit_exception (commit_stage_i.exception_o),
.priv_lvl (priv_lvl),
.debug_mode (debug_mode),
.hart_id_i (hart_id_i)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
.pck (clk_i),
.rstn (rst_ni),
.flush_unissued (flush_unissued_instr_ctrl_id),
.flush_all (flush_ctrl_ex),
.instruction (id_stage_i.fetch_entry_i.instruction),
.fetch_valid (id_stage_i.fetch_entry_valid_i),
.fetch_ack (id_stage_i.fetch_entry_ready_o),
.issue_ack (issue_stage_i.i_scoreboard.issue_ack_i),
.issue_sbe (issue_stage_i.i_scoreboard.issue_instr_o),
.waddr (waddr_commit_id),
.wdata (wdata_commit_id),
.we_gpr (we_gpr_commit_id),
.we_fpr (we_fpr_commit_id),
.commit_instr (commit_instr_id_commit),
.commit_ack (commit_ack),
.st_valid (ex_stage_i.lsu_i.i_store_unit.store_buffer_i.valid_i),
.st_paddr (ex_stage_i.lsu_i.i_store_unit.store_buffer_i.paddr_i),
.ld_valid (ex_stage_i.lsu_i.i_load_unit.req_port_o.tag_valid),
.ld_kill (ex_stage_i.lsu_i.i_load_unit.req_port_o.kill_req),
.ld_paddr (ex_stage_i.lsu_i.i_load_unit.paddr_i),
.resolve_branch (resolved_branch),
.commit_exception (commit_stage_i.exception_o),
.priv_lvl (priv_lvl),
.debug_mode (debug_mode),
.hart_id_i (hart_id_i)
.pck(clk_i),
.rstn(rst_ni),
.flush_unissued(flush_unissued_instr_ctrl_id),
.flush_all(flush_ctrl_ex),
.instruction(id_stage_i.fetch_entry_i.instruction),
.fetch_valid(id_stage_i.fetch_entry_valid_i),
.fetch_ack(id_stage_i.fetch_entry_ready_o),
.issue_ack(issue_stage_i.i_scoreboard.issue_ack_i),
.issue_sbe(issue_stage_i.i_scoreboard.issue_instr_o),
.waddr(waddr_commit_id),
.wdata(wdata_commit_id),
.we_gpr(we_gpr_commit_id),
.we_fpr(we_fpr_commit_id),
.commit_instr(commit_instr_id_commit),
.commit_ack(commit_ack),
.st_valid(ex_stage_i.lsu_i.i_store_unit.store_buffer_i.valid_i),
.st_paddr(ex_stage_i.lsu_i.i_store_unit.store_buffer_i.paddr_i),
.ld_valid(ex_stage_i.lsu_i.i_load_unit.req_port_o.tag_valid),
.ld_kill(ex_stage_i.lsu_i.i_load_unit.req_port_o.kill_req),
.ld_paddr(ex_stage_i.lsu_i.i_load_unit.paddr_i),
.resolve_branch(resolved_branch),
.commit_exception(commit_stage_i.exception_o),
.priv_lvl(priv_lvl),
.debug_mode(debug_mode),
.hart_id_i(hart_id_i)

@zarubaf
Copy link
Contributor Author

zarubaf commented Apr 5, 2024

There are two other fixes that were needed for questa to understand the nested typedef structs. They are sometimes not that well supported.

/cc @domenicw

Copy link
Contributor

github-actions bot commented Apr 5, 2024

✔️ successful run, report available here.

@zarubaf zarubaf merged commit 38e8c05 into master Apr 5, 2024
10 checks passed
@zarubaf zarubaf deleted the zarubaf/fix-integration branch April 5, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants