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:
parent
a4774cac02
commit
1b592c7f8d
1 changed files with 2 additions and 2 deletions
|
|
@ -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]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue