mirror of https://github.com/YosysHQ/yosys.git
check: stitch info about $connect ports together for driver analysis
This commit is contained in:
parent
bbf5b3c738
commit
c5d4b435bd
|
|
@ -267,6 +267,27 @@ struct CheckPass : public Pass {
|
|||
cell_allowed:;
|
||||
}
|
||||
|
||||
if (cell->type == ID($connect)) {
|
||||
// Inefficient, but rare case in sane design
|
||||
auto sig_a = cell->getPort(ID::A);
|
||||
auto sig_b = cell->getPort(ID::B);
|
||||
for (int i = 0; i < sig_a.size(); i++) {
|
||||
int count_a = wire_drivers_count[sig_a[i]];
|
||||
int count_b = wire_drivers_count[sig_b[i]];
|
||||
wire_drivers_count[sig_a[i]] += count_b;
|
||||
wire_drivers_count[sig_b[i]] += count_a;
|
||||
auto& drivers_a = wire_drivers[sig_a[i]];
|
||||
auto& drivers_b = wire_drivers[sig_b[i]];
|
||||
vector<string> drivers;
|
||||
drivers.reserve(std::max(drivers_a.size(), drivers_b.size()));
|
||||
for (auto driver : drivers_a)
|
||||
drivers.push_back(driver);
|
||||
for (auto driver : drivers_b)
|
||||
drivers.push_back(driver);
|
||||
drivers_a = drivers;
|
||||
drivers_b = drivers;
|
||||
}
|
||||
}
|
||||
for (auto &conn : cell->connections()) {
|
||||
bool input = cell->input(conn.first);
|
||||
bool output = cell->output(conn.first);
|
||||
|
|
|
|||
Loading…
Reference in New Issue