3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00

off by 1 bug

This commit is contained in:
Alain Dargelas 2024-11-04 18:03:51 -08:00
parent 1cba744712
commit 3aea9cca79

View file

@ -71,16 +71,18 @@ struct ActivityProp {
// $ACKT: 0.1 0.2 .... (Each bit in a bus has its own activity, index 0 of the bus is left most)
std::string act = wire->get_string_attribute("$ACKT");
std::string duty = wire->get_string_attribute("$DUTY");
//std::cout << "WIRE: " << wire->name.c_str() << " act: " << act << std::endl;
// Split the activity lists
std::vector<std::string> activities = tokenize(act, " ", true);
std::vector<std::string> duties = tokenize(duty, " ", true);
// Assign them to each SigBit (1 signal bit)
for (int i = 0; i < GetSize(sig); i++) {
SigBit bit(sig[i]);
if (i < activities.size() -1) {
if (i <= activities.size() -1) {
ActivityMap.emplace(bit, activities[i]);
DutyMap.emplace(bit, duties[i]);
} else {
log_warning("Zeroing out activity for module: %s, wire: %s, wiresize: %d, actisize: %d", module->name.c_str(), wire->name.c_str(), GetSize(sig), activities.size());
ActivityMap.emplace(bit, "0.0");
DutyMap.emplace(bit, "0.0");
}