From 8dd06b5f9e9890018b34829a57c66c775cbf879a Mon Sep 17 00:00:00 2001 From: Nils Wistoff Date: Tue, 9 Nov 2021 19:11:57 +0100 Subject: [PATCH] ariane_pkg: Prevent overflow during `range_check` Signed-off-by: Nils Wistoff --- core/include/ariane_pkg.sv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/include/ariane_pkg.sv b/core/include/ariane_pkg.sv index 1bfc7a999..9c0e2b2dc 100644 --- a/core/include/ariane_pkg.sv +++ b/core/include/ariane_pkg.sv @@ -96,7 +96,7 @@ package ariane_pkg; function automatic logic range_check(logic[63:0] base, logic[63:0] len, logic[63:0] address); // if len is a power of two, and base is properly aligned, this check could be simplified - return (address >= base) && (address < (base+len)); + return (address >= base) && (address < (65'(base)+len)); endfunction : range_check function automatic logic is_inside_nonidempotent_regions (ariane_cfg_t Cfg, logic[63:0] address);