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

Conversation

JeanRochCoulon
Copy link
Contributor

In embedded configuration, caches do not need to be so big.

Copy link
Contributor

github-actions bot commented Jan 3, 2024

❌ failed run, report available here.

2 similar comments
Copy link
Contributor

github-actions bot commented Jan 3, 2024

❌ failed run, report available here.

Copy link
Contributor

github-actions bot commented Jan 3, 2024

❌ failed run, report available here.

Copy link
Contributor

github-actions bot commented Jan 3, 2024

❌ failed run, report available here.

@JeanRochCoulon
Copy link
Contributor Author

@Gchauvon Can you approve it ?

@JeanRochCoulon
Copy link
Contributor Author

Hello @AyoubJalali
I modified the cache configuration. The modification should be without impact on CI, but the generated smoke tests failed. Do you have any idea ?

@AyoubJalali
Copy link
Contributor

Hello @AyoubJalali I modified the cache configuration. The modification should be without impact on CI, but the generated smoke tests failed. Do you have any idea ?

I'll debug it !!

@JeanRochCoulon
Copy link
Contributor Author

@cfuguet When HPDcache is configured with 2 ways of 2048 bytes, it fails. To be discussed at the workshop. See u

@cfuguet
Copy link

cfuguet commented Jan 26, 2024

@cfuguet When HPDcache is configured with 2 ways of 2048 bytes, it fails. To be discussed at the workshop. See u

Oh ! I will check this. In theory, there is no reason why the HPDcache does not support this configuration.

Copy link
Contributor

❌ failed run, report available here.

@JeanRochCoulon
Copy link
Contributor Author

@cfuguet

The HPDCache package does not compile when number of ways = 2

As HPDCACHE_DATA_RAM_Y_CUTS = HPDCACHE_WAYS / HPDCACHE_DATA_WAYS_PER_RAM_WORD,
when 8 ways, HPDCACHE_WAYS = 8 and HPDCACHE_DATA_WAYS_PER_RAM_WORD =4, it is ok
when 2 ways, HPDCACHE_WAYS = 2 and HPDCACHE_DATA_WAYS_PER_RAM_WORD =4, it is KO

image

@cfuguet
Copy link

cfuguet commented Jan 30, 2024

@cfuguet

The HPDCache package does not compile when number of ways = 2

As HPDCACHE_DATA_RAM_Y_CUTS = HPDCACHE_WAYS / HPDCACHE_DATA_WAYS_PER_RAM_WORD, when 8 ways, HPDCACHE_WAYS = 8 and HPDCACHE_DATA_WAYS_PER_RAM_WORD =4, it is ok when 2 ways, HPDCACHE_WAYS = 2 and HPDCACHE_DATA_WAYS_PER_RAM_WORD =4, it is KO

image

Ok ! now I see why. The issue comes from the computation of the HPDCACHE_DATA_WAYS_PER_RAM_WORD parameter. It is currently computed as 128 (bits) / PARAM_WORD_WIDTH. In the embedded case, PARAM_WORD_WIDTH is 32, then the HPDcache expects to be able to fit 4 ways in a single word of the RAM. If the number of ways is less than 4, you have a bad computation of the HPDCACHE_DATA_RAM_Y_CUTS parameter which in this case will be 0... It should be at least 1.

I will change the way that the HPDCACHE_DATA_WAYS_PER_RAM_WORD parameter is computed in the core/include/cva6_hpdcache_default_config_pkg.sv. That should fix the issue. I will let you know when it is done. I can either push the commit in this PR or make another Pull-Request on the CVA6, what is your preference ?

Thank you @JeanRochCoulon,

César

@JeanRochCoulon
Copy link
Contributor Author

Committing in the current PR could test the HPDCache fix, let's commit in it.

Copy link
Contributor

❌ failed run, report available here.

@cfuguet
Copy link

cfuguet commented Jan 30, 2024

Committing in the current PR could test the HPDCache fix, let's commit in it.

Ok ! let me do a quick local test and then I will push the modifications

JeanRochCoulon and others added 3 commits January 30, 2024 16:06
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
endfunction

function int unsigned __maxu(int unsigned x, int unsigned 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;

Comment on lines 72 to 73
localparam int unsigned PARAM_DATA_WAYS_PER_RAM_WORD =
__minu(__MAX_RAM_WORD_BITS / PARAM_WORD_WIDTH, PARAM_WAYS);
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
);

endfunction

function int unsigned __maxu(int unsigned x, int unsigned 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;

@cfuguet
Copy link

cfuguet commented Jan 30, 2024

@JeanRochCoulon, FYI, this should fix issues on simulation, but it may fail on synthesis. Actually when the HPDCACHE_DATA_RAM_Y_CUTS = 1, there are some types that have null ranges ([$clog2(HPDCACHE_DATA_RAM_Y_CUTS)-1:0] => [-1:0]). This is not well supported by some tools. I will open an issue on the HPDcache and make a fix ASAP to support correctly this case.

Copy link
Contributor

❌ failed run, report available here.

1 similar comment
Copy link
Contributor

❌ failed run, report available here.

Copy link
Contributor

❌ failed run, report available here.

Copy link
Contributor

❌ failed run, report available here.

Copy link
Contributor

❌ failed run, report available here.

@JeanRochCoulon JeanRochCoulon changed the title Downsize the I and D caches Fix HPDCache to make it functional when ways=2 Jan 30, 2024
@JeanRochCoulon
Copy link
Contributor Author

ok, thanks for the information. I will commit your fix and resize the I and D cache in another PR.

Copy link
Contributor

❌ failed run, report available here.

Copy link
Contributor

✔️ successful run, report available here.

@JeanRochCoulon JeanRochCoulon merged commit 5378031 into master Jan 30, 2024
36 checks passed
@JeanRochCoulon JeanRochCoulon deleted the JeanRochCoulon-patch-4 branch January 30, 2024 20:50
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