Fix missing too many digits warning, bug1380.

This commit is contained in:
Wilson Snyder 2019-01-03 19:03:27 -05:00
parent 0198a2e9f3
commit e8636f987f
4 changed files with 9 additions and 4 deletions

View File

@ -15,6 +15,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
**** Fix error when no modules in $unit, bug1381. [Al Grant]
**** Fix missing too many digits warning, bug1380. [Jonathan Kimmitt]
* Verilator 4.008 2018-12-01

View File

@ -177,10 +177,9 @@ V3Number::V3Number(FileLine* fileline, const char* sourcep) {
}
else {
// Convert bin/octal number to hex
for (const char* cp=value_startp+strlen(value_startp)-1;
(cp>=value_startp
&& obit<=width());
cp--) {
for (const char* cp=value_startp+strlen(value_startp)-1;
cp >= value_startp;
cp--) {
if (*cp!='_' && *cp!='0' && obit>=width()) {
m_fileline->v3error("Too many digits for "<<width()<<" bit number: "<<sourcep);
break;

View File

@ -2,4 +2,5 @@
%Error: t/t_const_overflow_bad.v:10: Too many digits for 8 bit number: 8'habc
%Error: t/t_const_overflow_bad.v:11: Too many digits for 6 bit number: 6'o1234
%Error: t/t_const_overflow_bad.v:12: Too many digits for 3 bit number: 3'b1111
%Error: t/t_const_overflow_bad.v:18: Too many digits for 129 bit number: 129'hdeadbeefc001f00ddeadbeefc001f00ddeadbeefc001f00ddeadbeefc001f00d
%Error: Exiting due to

View File

@ -14,4 +14,7 @@ module t (/*AUTOARG*/);
// We'll allow this though; no reason to be cruel
parameter [200:0] OKH = 8'h000000001;
// bug1380
parameter [128:0] ALSO_SMALL = 129'hdeadbeefc001f00ddeadbeefc001f00ddeadbeefc001f00ddeadbeefc001f00d;
endmodule