Fix enum value comparison: it needs explicit cast to int (#1137)

QuestSim requires to explicitly cast to integer an enumeration variable
when comparing against an integer constant.
This commit is contained in:
Cesar Fuguet 2023-03-24 22:37:39 +01:00 committed by GitHub
parent 2a037ead17
commit 1b9f9c6763
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -81,7 +81,7 @@ module controller import ariane_pkg::*; (
flush_ex_o = 1'b1;
// this is not needed in the case since we
// have a write-through cache in this case
if (DCACHE_TYPE == cva6_config_pkg::WB) begin
if (DCACHE_TYPE == int'(cva6_config_pkg::WB)) begin
flush_dcache = 1'b1;
fence_active_d = 1'b1;
end
@ -99,7 +99,7 @@ module controller import ariane_pkg::*; (
flush_icache_o = 1'b1;
// this is not needed in the case since we
// have a write-through cache in this case
if (DCACHE_TYPE == cva6_config_pkg::WB) begin
if (DCACHE_TYPE == int'(cva6_config_pkg::WB)) begin
flush_dcache = 1'b1;
fence_active_d = 1'b1;
end
@ -107,7 +107,7 @@ module controller import ariane_pkg::*; (
// this is not needed in the case since we
// have a write-through cache in this case
if (DCACHE_TYPE == cva6_config_pkg::WB) begin
if (DCACHE_TYPE == int'(cva6_config_pkg::WB)) begin
// wait for the acknowledge here
if (flush_dcache_ack_i && fence_active_q) begin
fence_active_d = 1'b0;

View file

@ -684,7 +684,7 @@ module cva6 import ariane_pkg::*; #(
// Cache Subsystem
// -------------------
if (DCACHE_TYPE == cva6_config_pkg::WT) begin
if (DCACHE_TYPE == int'(cva6_config_pkg::WT)) begin
// this is a cache subsystem that is compatible with OpenPiton
wt_cache_subsystem #(
.ArianeCfg ( ArianeCfg ),

View file

@ -142,14 +142,14 @@ package ariane_pkg;
// depth of store-buffers, this needs to be a power of two
localparam int unsigned DEPTH_SPEC = 4;
localparam int unsigned DCACHE_TYPE = cva6_config_pkg::CVA6ConfigDcacheType;
localparam int unsigned DCACHE_TYPE = int'(cva6_config_pkg::CVA6ConfigDcacheType);
// if DCACHE_TYPE = cva6_config_pkg::WT
// we can use a small commit queue since we have a write buffer in the dcache
// we could in principle do without the commit queue in this case, but the timing degrades if we do that due
// to longer paths into the commit stage
// if DCACHE_TYPE = cva6_config_pkg::WB
// allocate more space for the commit buffer to be on the save side, this needs to be a power of two
localparam int unsigned DEPTH_COMMIT = (DCACHE_TYPE == cva6_config_pkg::WT) ? 4 : 8;
localparam int unsigned DEPTH_COMMIT = (DCACHE_TYPE == int'(cva6_config_pkg::WT)) ? 4 : 8;
localparam bit FPGA_EN = cva6_config_pkg::CVA6ConfigFPGAEn; // Is FPGA optimization of CV32A6