From 859b245eb5e1de4d9e8984dafd209a3335ee0d53 Mon Sep 17 00:00:00 2001 From: nella Date: Fri, 18 Sep 2026 23:40:55 +0200 Subject: [PATCH] Don't divide by zero with zero delays. --- passes/cmds/portarcs.cc | 3 +++ tests/abc_new/generate_mk.py | 1 - tests/abc_new/whitebox_equiv.ys | 2 +- .../{whitebox_portarcs_fpe.ys => whitebox_no_timing.ys} | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) rename tests/abc_new/{whitebox_portarcs_fpe.ys => whitebox_no_timing.ys} (88%) diff --git a/passes/cmds/portarcs.cc b/passes/cmds/portarcs.cc index 89a4581ce..8f1e8a657 100644 --- a/passes/cmds/portarcs.cc +++ b/passes/cmds/portarcs.cc @@ -262,6 +262,9 @@ struct PortarcsPass : Pass { max_delay = p[i]; } + if (max_delay == 0) + max_delay = 1; + log("Delay legend:\n\n"); log(" "); for (int i = 0; i < 24; i++) diff --git a/tests/abc_new/generate_mk.py b/tests/abc_new/generate_mk.py index 3ea1cb6ec..94dd12723 100644 --- a/tests/abc_new/generate_mk.py +++ b/tests/abc_new/generate_mk.py @@ -11,7 +11,6 @@ skip = [ "hier_check.ys", "keep_wire.ys", "scopeinfo.ys", - "whitebox_portarcs_fpe.ys", ] def create_tests(): diff --git a/tests/abc_new/whitebox_equiv.ys b/tests/abc_new/whitebox_equiv.ys index 2c5c01ce1..69c0e0028 100644 --- a/tests/abc_new/whitebox_equiv.ys +++ b/tests/abc_new/whitebox_equiv.ys @@ -1,4 +1,4 @@ -# lib_whitebox mux box mapped itself, then used as timing box (needs -unit_delay, see whitebox_portarcs_fpe.ys) +# lib_whitebox mux box mapped itself, then used as timing box (needs -unit_delay, see whitebox_no_timing.ys) read_verilog -specify <