Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: File modification on the fly (Verilog)

by mavericknik (Sexton)
on Aug 02, 2016 at 21:43 UTC ( #1169049=note: print w/replies, xml ) Need Help??


in reply to Re: File modification on the fly (Verilog)
in thread File modification on the fly

Thank you so much for your help, I works perfectly. If I understand your script correctly, you are setting the line delimiter to a ";" and replacing all multiple spaces to single spaces? I have parsed the netlist using verilog-perl, but the time requirement seems to increase exponentially with number of cells. For older netlists with ~5k cells, the script takes about 12 hours. With my new netlist of about 450000 cells, I'm estimating a runtime of about 200 days which is unacceptable so I'm looking at alternative approaches.
  • Comment on Re^2: File modification on the fly (Verilog)

Replies are listed 'Best First'.
Re^3: File modification on the fly (Verilog)
by toolic (Bishop) on Aug 03, 2016 at 13:12 UTC
    Thank you so much for your help
    You're welcome.
    If I understand your script correctly, you are setting the line delimiter to a ";"
    Yes.
    and replacing all multiple spaces to single spaces?
    \s refers to all types of whitespace; refer to perlre. The key here is that \s includes the newline character (\n). So, \s+ replaces multiple adjacent spaces, tabs and newlines. s///g changes all whitespace on a line.
    For older netlists with ~5k cells, the script takes about 12 hours.
    That is a surprisingly long time. Can you post your code for that?
Re^3: File modification on the fly (Verilog)
by $h4X4_|=73}{ (Monk) on Aug 03, 2016 at 07:46 UTC

    Depending on how your program works you can maybe gain some speed from using auto flush $| = 1;. OUTPUT_AUTOFLUSH

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1169049]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2022-12-08 19:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?