fix damage from pr #348
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
01ad7e5ed3
commit
8b8b86bb66
|
|
@ -232,18 +232,6 @@ VcdParse::parseVarValues()
|
||||||
reader_->varAppendValue(id, time_, char0);
|
reader_->varAppendValue(id, time_, char0);
|
||||||
}
|
}
|
||||||
else if (char0 == 'B') {
|
else if (char0 == 'B') {
|
||||||
char char1 = toupper(token[1]);
|
|
||||||
if (char1 == 'X'
|
|
||||||
|| char1 == 'U'
|
|
||||||
|| char1 == 'Z') {
|
|
||||||
string id = getToken();
|
|
||||||
if (!reader_->varIdValid(id))
|
|
||||||
report_->fileError(806, filename_, stmt_line_,
|
|
||||||
"unknown variable %s", id.c_str());
|
|
||||||
// Bus mixed 0/1/X/U not supported.
|
|
||||||
reader_->varAppendValue(id, time_, char1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
string bus_value = token.substr(1);
|
string bus_value = token.substr(1);
|
||||||
string id = getToken();
|
string id = getToken();
|
||||||
if (!reader_->varIdValid(id))
|
if (!reader_->varIdValid(id))
|
||||||
|
|
@ -255,7 +243,6 @@ VcdParse::parseVarValues()
|
||||||
reader_->varAppendBusValue(id, time_, bus_value);
|
reader_->varAppendBusValue(id, time_, bus_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
token = getToken();
|
token = getToken();
|
||||||
}
|
}
|
||||||
reader_->setTimeMax(time_);
|
reader_->setTimeMax(time_);
|
||||||
|
|
|
||||||
|
|
@ -335,8 +335,15 @@ VcdCountReader::varAppendBusValue(const string &id,
|
||||||
if (itr != vcd_count_map_.end()) {
|
if (itr != vcd_count_map_.end()) {
|
||||||
VcdCounts &vcd_counts = itr->second;
|
VcdCounts &vcd_counts = itr->second;
|
||||||
for (size_t bit_idx = 0; bit_idx < vcd_counts.size(); bit_idx++) {
|
for (size_t bit_idx = 0; bit_idx < vcd_counts.size(); bit_idx++) {
|
||||||
char bit_value = bus_value[bit_idx];
|
char bit_value;
|
||||||
|
if (bus_value.size() == 1)
|
||||||
|
bit_value = bus_value[0];
|
||||||
|
else if (bit_idx < bus_value.size())
|
||||||
|
bit_value = bus_value[bit_idx];
|
||||||
|
else
|
||||||
|
bit_value = '0';
|
||||||
VcdCount &vcd_count = vcd_counts[bit_idx];
|
VcdCount &vcd_count = vcd_counts[bit_idx];
|
||||||
|
vcd_count.incrCounts(time, bit_value);
|
||||||
if (debug_->check("read_vcd", 3)) {
|
if (debug_->check("read_vcd", 3)) {
|
||||||
for (const Pin *pin : vcd_count.pins()) {
|
for (const Pin *pin : vcd_count.pins()) {
|
||||||
debugPrint(debug_, "read_vcd", 3, "%s time %" PRIu64 " value %c",
|
debugPrint(debug_, "read_vcd", 3, "%s time %" PRIu64 " value %c",
|
||||||
|
|
@ -345,7 +352,6 @@ VcdCountReader::varAppendBusValue(const string &id,
|
||||||
bit_value);
|
bit_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vcd_count.incrCounts(time, bit_value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue