3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-01-18 08:18:56 +00:00

Fix test regex to match upstream stat output format

The test was using regexes that matched Silimate's modified stat output
format ('Number of wires:  <count>'), but upstream yosys uses a different
format (' <count> <area>  wires'). Update the regex to match the upstream
format.
This commit is contained in:
Natalia 2026-01-14 12:55:18 -08:00
parent 6503ad91c9
commit a4774cac02

View file

@ -7,10 +7,11 @@ proc read_stats { file } {
set ports 0
set nets 0
foreach line [split $result "\n"] {
if [regexp {Number of wires:[ \t]+([0-9]+)} $line tmp n] {
# Match upstream yosys stat format: " <count> <area> wires"
if [regexp {^\s*(\d+)\s+[\d.]+\s+wires\s*$} $line -> n] {
set nets [expr $nets + $n]
}
if [regexp {Number of ports:[ \t]+([0-9]+)} $line tmp n] {
if [regexp {^\s*(\d+)\s+[\d.]+\s+ports\s*$} $line -> n] {
set ports [expr $ports + $n]
}
}