diff --git a/techlibs/common/simlib.v b/techlibs/common/simlib.v index 028e4e5a9..6e39aa60a 100644 --- a/techlibs/common/simlib.v +++ b/techlibs/common/simlib.v @@ -2224,10 +2224,10 @@ module \$print (EN, TRG, ARGS); parameter PRIORITY = 0; parameter FORMAT = ""; -parameter ARGS_WIDTH = 0; +parameter signed ARGS_WIDTH = 0; parameter TRG_ENABLE = 1; -parameter TRG_WIDTH = 0; +parameter signed TRG_WIDTH = 0; parameter TRG_POLARITY = 0; input EN; diff --git a/tests/cxxrtl/test_value_fuzz.cc b/tests/cxxrtl/test_value_fuzz.cc index 7e8fbb0a9..a77120136 100644 --- a/tests/cxxrtl/test_value_fuzz.cc +++ b/tests/cxxrtl/test_value_fuzz.cc @@ -241,7 +241,10 @@ struct CtlzTest { if (a == 0) return bits; - return __builtin_clzl(a) - (64 - bits); + if (sizeof(long) == 4) + return __builtin_clzll(a) - (64 - bits); + else + return __builtin_clzl(a) - (64 - bits); } template