mirror of
https://github.com/YosysHQ/yosys
synced 2026-01-18 16:28:57 +00:00
Fix regex to match only 'wires' and 'ports' lines
The regex was matching 'public wires' and other lines. Now use $ anchor to match only lines ending with 'wires' or 'ports'.
This commit is contained in:
parent
b6715cf74d
commit
8f80f8f655
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 - be permissive about whitespace
|
||||
if [regexp {([0-9]+).*wires} $line -> n] {
|
||||
# Match only lines ending with "wires" or "ports" (not "public wires", "wire bits", etc)
|
||||
if [regexp {([0-9]+)[ \t]+wires[ \t]*$} $line -> n] {
|
||||
set nets [expr $nets + $n]
|
||||
}
|
||||
if [regexp {([0-9]+).*ports} $line -> n] {
|
||||
if [regexp {([0-9]+)[ \t]+ports[ \t]*$} $line -> n] {
|
||||
set ports [expr $ports + $n]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue