3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-25 00:22:34 +00:00

Extend latch policy.

This commit is contained in:
nella 2026-07-24 10:53:40 +02:00 committed by nella
parent affceca7df
commit 9f0a8ae8aa
5 changed files with 44 additions and 12 deletions

View file

@ -143,10 +143,9 @@ struct CheckPass : public Pass {
// latch-only mode only flags latches, skipping the (potentially false-positive mid-flow) undriven/driver/loop checks below
if (latchonly) {
for (auto cell : module->cells())
if ((
if (!cell->get_bool_attribute(ID::always_latch) && (
cell->type.in(ID($dlatch), ID($adlatch), ID($dlatchsr)) ||
cell->type.begins_with("$_DLATCH_") || cell->type.begins_with("$_DLATCHSR_")
) && !cell->get_bool_attribute(ID::always_latch)) {
cell->type.begins_with("$_DLATCH_") || cell->type.begins_with("$_DLATCHSR_"))) {
log_warning("Cell %s.%s is a latch of type %s.\n", module, cell, cell->type.unescape());
counter++;
}
@ -299,10 +298,9 @@ struct CheckPass : public Pass {
}
if (
nolatches && (
nolatches && !cell->get_bool_attribute(ID::always_latch) && (
cell->type.in(ID($dlatch), ID($adlatch), ID($dlatchsr)) ||
cell->type.begins_with("$_DLATCH_") || cell->type.begins_with("$_DLATCHSR_")) &&
!cell->get_bool_attribute(ID::always_latch)
cell->type.begins_with("$_DLATCH_") || cell->type.begins_with("$_DLATCHSR_"))
) {
log_warning("Cell %s.%s is a latch of type %s.\n", module, cell, cell->type.unescape());
counter++;