mirror of
https://github.com/YosysHQ/yosys
synced 2026-01-17 16:06:27 +00:00
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.
This commit is contained in:
parent
1b592c7f8d
commit
b6715cf74d
1 changed files with 3 additions and 3 deletions
|
|
@ -7,11 +7,11 @@ proc read_stats { file } {
|
|||
set ports 0
|
||||
set nets 0
|
||||
foreach line [split $result "\n"] {
|
||||
# Match upstream yosys stat format: " <count> <area> 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]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue