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

Fix TCL regex to use POSIX character classes

TCL doesn't support \d and \s escape sequences in regexes. Use [0-9] and
[ \t] instead to match digits and whitespace.
This commit is contained in:
Natalia 2026-01-14 13:21:16 -08:00
parent a4774cac02
commit 1b592c7f8d

View file

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