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

Fix HPDCache to make it functional when ways=2 #1744

Merged
merged 12 commits into from
Jan 30, 2024
2 changes: 1 addition & 1 deletion .gitlab-ci/scripts/report_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Will fail if the number of cycles is different from this one
valid_cycles = {
'dhrystone': 217900,
'coremark': 665193,
'coremark': 683117,
}

for arg in sys.argv[1:]:
Expand Down
8 changes: 4 additions & 4 deletions core/include/cv32a6_embedded_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ package cva6_config_pkg;
localparam CVA6ConfigDataUserEn = 0;
localparam CVA6ConfigDataUserWidth = CVA6ConfigXlen;

localparam CVA6ConfigIcacheByteSize = 16384;
localparam CVA6ConfigIcacheSetAssoc = 4;
localparam CVA6ConfigIcacheByteSize = 2048;
localparam CVA6ConfigIcacheSetAssoc = 2;
localparam CVA6ConfigIcacheLineWidth = 128;
localparam CVA6ConfigDcacheByteSize = 32768;
localparam CVA6ConfigDcacheSetAssoc = 8;
localparam CVA6ConfigDcacheByteSize = 2048;
localparam CVA6ConfigDcacheSetAssoc = 2;
localparam CVA6ConfigDcacheLineWidth = 128;

localparam CVA6ConfigDcacheIdWidth = 1;
Expand Down
16 changes: 13 additions & 3 deletions core/include/cva6_hpdcache_default_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ package hpdcache_params_pkg;
import cva6_config_pkg::CVA6ConfigNrLoadBufEntries;
// }}}

// Definition of constants used only in this file
// Definition of constants and functions used only in this file
// {{{
localparam int unsigned __BYTES_PER_WAY = CVA6ConfigDcacheByteSize / CVA6ConfigDcacheSetAssoc;

localparam int unsigned __BYTES_PER_CACHELINE = CVA6ConfigDcacheLineWidth / 8;
localparam int unsigned __MAX_RAM_WORD_BITS = 128;

function int unsigned __minu(int unsigned x, int unsigned y);
return x < y ? x : y;
JeanRochCoulon marked this conversation as resolved.
Show resolved Hide resolved
endfunction

function int unsigned __maxu(int unsigned x, int unsigned y);
return y < x ? x : y;
JeanRochCoulon marked this conversation as resolved.
Show resolved Hide resolved
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
return y < x ? x : y;
return y < x ? x : y;

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
return y < x ? x : y;
return y < x ? x : y;

endfunction
// }}}

// Definition of global constants for the HPDcache data and directory
Expand Down Expand Up @@ -61,7 +69,9 @@ package hpdcache_params_pkg;

// Definition of constants and types for HPDcache data memory
// {{{
localparam int unsigned PARAM_DATA_WAYS_PER_RAM_WORD = 128 / PARAM_WORD_WIDTH;
localparam int unsigned PARAM_DATA_WAYS_PER_RAM_WORD =
__minu(__MAX_RAM_WORD_BITS / PARAM_WORD_WIDTH, PARAM_WAYS);
JeanRochCoulon marked this conversation as resolved.
Show resolved Hide resolved
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
localparam int unsigned PARAM_DATA_WAYS_PER_RAM_WORD =
__minu(__MAX_RAM_WORD_BITS / PARAM_WORD_WIDTH, PARAM_WAYS);
localparam int unsigned PARAM_DATA_WAYS_PER_RAM_WORD = __minu(
__MAX_RAM_WORD_BITS / PARAM_WORD_WIDTH, PARAM_WAYS
);


localparam int unsigned PARAM_DATA_SETS_PER_RAM = PARAM_SETS;

// HPDcache DATA RAM macros whether implements:
Expand Down
Loading