From b6715cf74db7b494a8d437ea0ee69dd25383d759 Mon Sep 17 00:00:00 2001 From: Natalia Date: Wed, 14 Jan 2026 13:59:26 -0800 Subject: [PATCH] Simplify regex to be more permissive Make the regex less strict about exact whitespace and format. Just look for a number followed by 'wires' or 'ports' anywhere on the line. --- tests/various/test_splitnets.tcl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/various/test_splitnets.tcl b/tests/various/test_splitnets.tcl index a2af0f88b..73d62da7c 100644 --- a/tests/various/test_splitnets.tcl +++ b/tests/various/test_splitnets.tcl @@ -7,11 +7,11 @@ proc read_stats { file } { set ports 0 set nets 0 foreach line [split $result "\n"] { - # Match upstream yosys stat format: " wires" - if [regexp {^[ \t]*([0-9]+)[ \t]+[0-9.]+[ \t]+wires[ \t]*$} $line -> n] { + # Match upstream yosys stat format - be permissive about whitespace + if [regexp {([0-9]+).*wires} $line -> n] { set nets [expr $nets + $n] } - if [regexp {^[ \t]*([0-9]+)[ \t]+[0-9.]+[ \t]+ports[ \t]*$} $line -> n] { + if [regexp {([0-9]+).*ports} $line -> n] { set ports [expr $ports + $n] } }