Closed dgptha closed 6 months ago
Thank you @dgptha for reporting this issue.
I knew about the inconsistency but I did not knew that this would generate an issue in some tools (or specific versions). I actually use QuestaSim to validate the HPDcache but more recent versions.
Currently the issue is that the type hpdcache_victim_sel_policy_t is defined in the hpdcache_pkg but the actual parameter value comes from the system specific hpdcache_params_pkg. If I define the PARAM_VICTIM_SEL parameter as hpdcache_victim_sel_policy_t in the hpdcache_params_pkg, there is a circular dependency between packages. This is not valid. That is why, I defined it as a integer into the hpdcache_params_pkg.
I will try a different approach to fix the issue.
Oh, I see the problem you had now. I do not know if I'm not finding the problem you're talking about because I'm using a CVA6 configuration without the hpdcache or because of the Questa version, but for the moment my design without the hpdcache activated can be simulated on my Questa without issues once I do the change mentioned in my previous message. Maybe a solution would be to externalize the types definition in a different file? Only for types like the victim selection policy, not for derived types which depend on parameters (e.g. hpdcache_dir_entry_t).
This is now fixed with the new parametrization scheme (commit 00e36514e4fed8684be2f3dc90aea4e5e28908a9).
I close the issue but please feel free to reopen it if you still have the issue.
https://github.com/openhwgroup/cv-hpdcache/blob/645e4222c3d23fbedb5b0fec1922f72fd692a40a/rtl/src/hpdcache_pkg.sv#L76C1-L82C89
The type of the
HPDCACHE_VICTIM_SEL
parameter defined in line 82 of rtl/src/hpdcache_pkg.sv should behpdcache_victim_sel_policy_t
and notint unsigned
. Having it asint unsigned
fails on Questa (version 2019.4) when used in rtl/src/hpdcache_victim_sel.sv line 49 as the types ofHPDCACHE_VICTIM_SEL
andHPDCACHE_VICTIM_RANDOM
do not match (int unsigned
vshpdcache_victim_sel_policy_t
).PS: problem found when using CVA6 v5.0.1.