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

Add the mem wrappers and bender flags for the backend flow #56

Merged
merged 6 commits into from
Oct 8, 2024

Conversation

Konste11ation
Copy link

This PR adds the support for the memory wrappers at the host level.

  1. Add the spm_1p_adv_mem_wrapper.sv
  2. Add the cva6_icache_data.sv and cva6_icache_tag.sv
  3. Add the std_nbdcache_data.sv, std_nbdcache_tag.sv, and std_nbdcache_valid_dirty.sv

Besides it also fix some problems on the occamy_chip

  1. Width of the bootrom address is fixed to 32bits
  2. The rerror_o port of spm_1p_adv is removed

The bender flag is also updated to include the hemaia_chip_top with pads

Copy link

@rgantonio rgantonio left a comment

Choose a reason for hiding this comment

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

OK! But please clean comments and newline?

Why is CI failing? hmm

Comment on lines 184 to 205
// tc_sram_impl #(
// .NumWords (NumWords),
// .DataWidth(SPMDataWidth),
// .ByteWidth(ByteWidth),
// .NumPorts (1),
// .SimInit (SimInit),
// .PrintSimCfg (PrintSimCfg),
// .Latency (1),
// .impl_in_t (sram_cfg_t)
// ) i_mem (
// .clk_i(clk_i),
// .rst_ni(rst_ni),
// .impl_i (sram_cfg_i),
// .impl_o ( ),
// .req_i(req_q),
// .we_i(we_q),
// .addr_i(addr_q),
// .wdata_i(wdata_q),
// .be_i(be_q),
// .rdata_o(rdata_sram)
// );

Choose a reason for hiding this comment

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

You can clean this :)

@@ -253,4 +272,4 @@ module spm_1p_adv #(
assign rerror_q = rerror_d & {2{rvalid_d}};
end

endmodule
endmodule

Choose a reason for hiding this comment

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

newline please!

.rdata_o(rdata_o)
);

endmodule

Choose a reason for hiding this comment

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

newline please!

Comment on lines 481 to 527
// for (genvar i = 0; i < ICACHE_SET_ASSOC; i++) begin : gen_sram
// // Tag RAM
// tc_sram_impl #(
// .impl_in_t ( sram_cfg_t ),
// // tag + valid bit
// .DataWidth ( ICACHE_TAG_WIDTH+1 ),
// .NumWords ( ICACHE_NUM_WORDS ),
// .NumPorts ( 1 )
// ) tag_sram (
// .clk_i ( clk_i ),
// .rst_ni ( rst_ni ),
// .impl_i ( sram_cfg_tag_i ),
// .impl_o ( ),
// .req_i ( vld_req[i] ),
// .we_i ( vld_we ),
// .addr_i ( vld_addr ),
// // we can always use the saved tag here since it takes a
// // couple of cycle until we write to the cache upon a miss
// .wdata_i ( {vld_wdata[i], cl_tag_q} ),
// .be_i ( '1 ),
// .rdata_o ( cl_tag_valid_rdata[i] )
// );

// assign cl_tag_rdata[i] = cl_tag_valid_rdata[i][ICACHE_TAG_WIDTH-1:0];
// assign vld_rdata[i] = cl_tag_valid_rdata[i][ICACHE_TAG_WIDTH];

// // Data RAM
// tc_sram_impl #(
// .impl_in_t ( sram_cfg_t ),
// .DataWidth ( ICACHE_LINE_WIDTH ),
// .NumWords ( ICACHE_NUM_WORDS ),
// .NumPorts ( 1 )
// ) data_sram (
// .clk_i ( clk_i ),
// .rst_ni ( rst_ni ),
// .impl_i ( sram_cfg_data_i ),
// .impl_o ( ),
// .req_i ( cl_req[i] ),
// .we_i ( cl_we ),
// .addr_i ( cl_index ),
// .wdata_i ( mem_rtrn_i.data ),
// .be_i ( '1 ),
// .rdata_o ( cl_rdata[i] )
// );

// assign cl_ruser[i] = '0;
// end

Choose a reason for hiding this comment

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

Can clean too!

@@ -564,4 +611,4 @@ end else begin : gen_piton_offset
`endif
//pragma translate_on

endmodule // cva6_icache
endmodule // cva6_icache

Choose a reason for hiding this comment

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

newline please :)

Comment on lines 308 to 324
// tc_sram_impl #(
// .impl_in_t ( sram_cfg_t ),
// .DataWidth ( 4*DCACHE_DIRTY_WIDTH ),
// .NumWords ( DCACHE_NUM_WORDS ),
// .NumPorts ( 1 )
// ) valid_dirty_sram (
// .clk_i ( clk_i ),
// .rst_ni ( rst_ni ),
// .impl_i ( sram_cfg_valid_dirty_i ),
// .impl_o ( ),
// .req_i ( |req_ram ),
// .we_i ( we_ram ),
// .addr_i ( addr_ram[DCACHE_INDEX_WIDTH-1:DCACHE_BYTE_OFFSET] ),
// .wdata_i ( dirty_wdata ),
// .be_i ( be_ram.vldrty ),
// .rdata_o ( dirty_rdata )
// );

Choose a reason for hiding this comment

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

Clean!

@@ -297,4 +356,4 @@ import std_cache_pkg::*;
assert (DCACHE_LINE_WIDTH/AXI_DATA_WIDTH inside {2, 4, 8, 16}) else $fatal(1, "Cache line size needs to be a power of two multiple of AXI_DATA_WIDTH");
end
//pragma translate_on
endmodule
endmodule

Choose a reason for hiding this comment

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

newline!

);
end

endmodule

Choose a reason for hiding this comment

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

newline!

);
end

endmodule

Choose a reason for hiding this comment

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

newline!

.rdata_o ( rdata_o )
);

endmodule

Choose a reason for hiding this comment

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

new line!

@Konste11ation Konste11ation force-pushed the fanchen/add-mem-wrappers branch from 6440eab to 86f2731 Compare October 8, 2024 14:51
@Konste11ation Konste11ation merged commit c50197c into chip_antwerp Oct 8, 2024
2 checks passed
@Konste11ation Konste11ation deleted the fanchen/add-mem-wrappers branch October 8, 2024 14:52
IveanEx pushed a commit that referenced this pull request Nov 2, 2024
* Add the mem wrappers

* Update the spm_1p_adv

* clean newline and comments

* remove the local snitch_read_only_cache_tb

* Update some ports

* update the snitch_ro_cache
@IveanEx IveanEx mentioned this pull request Nov 2, 2024
IveanEx added a commit that referenced this pull request Nov 2, 2024
* Add the mem wrappers and bender flags for the backend flow (#56)

* Add the mem wrappers

* Update the spm_1p_adv

* clean newline and comments

* remove the local snitch_read_only_cache_tb

* Update some ports

* update the snitch_ro_cache

* Update the bender target (#59)

* Fix I/O Error in occamy_chip.sv (#58)

* Fix IO Error

* Bug Fix

* Bug Fix

* Update Implementation Strategy

* Update Implementation Strategy

* Update the port definition of occamy_chip (#60)

---------

Co-authored-by: Fanchen Kong <[email protected]>
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.

2 participants