From 26774eb04592cc8c3d008c11586d07afb8822dc9 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 8 Sep 2016 21:30:35 -0400 Subject: [PATCH] Fix error on wide numbers that represent small msb/lsb, msg1991. --- Changes | 2 ++ src/V3Number.cpp | 10 ++++++++-- test_regress/t/t_param_wide_io.pl | 16 ++++++++++++++++ test_regress/t/t_param_wide_io.v | 19 +++++++++++++++++++ 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100755 test_regress/t/t_param_wide_io.pl create mode 100644 test_regress/t/t_param_wide_io.v diff --git a/Changes b/Changes index 5ff7557ed..2095c0bad 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix SystemC compiles with VPI, bug1081. [Arthur Kahlich] +**** Fix error on wide numbers that represent small msb/lsb, msg1991. [Mandy Xu] + * Verilator 3.886 2016-07-30 diff --git a/src/V3Number.cpp b/src/V3Number.cpp index 3f741e97c..fadbd91d9 100644 --- a/src/V3Number.cpp +++ b/src/V3Number.cpp @@ -605,7 +605,10 @@ string V3Number::displayed(FileLine*fl, const string& vformat) const { uint32_t V3Number::toUInt() const { UASSERT(!isFourState(),"toUInt with 4-state "<<*this); - UASSERT((width()<33 || (width()<65 && m_value[1]==0)), "Value too wide "<<*this); + // We allow wide numbers that represent values <= 32 bits + for (int i=1; i