The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 7:24pm
Pages: 1
Send Topic Print
VerilogA writing to text file (Read 2519 times)
jjrice
New Member
*
Offline



Posts: 1

VerilogA writing to text file
Mar 01st, 2013, 3:05pm
 
I have a simple verilogA model that samples some nodes in my circuit and writes these out to  a text file for post processing with matlab, ie:

@(initial_step)
  fp=$fopen("/path/data.txt")
@(cross(V(clk) - Vt, +1))
  $fwrite(fp, formatstuff, datastuff)

I'd like to run monte-carlo on this circuit, and have this block write to a different file for each run so that I could analyze each in matlab, ie:

fp=$fopen( cat("/path/data", MonteCarloRunNumber, ".txt"))

Any ideas on how to accomplish this?
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: VerilogA writing to text file
Reply #1 - Mar 12th, 2013, 8:36am
 
I don't see anything in the Verilog-AMS LRM that would let you do this -- no %-code for Monte-Carlo run.  You could check with your vendor to see if they've added any extensions.

I noticed in one simulator's documentation that there are some %-codes that you can use on the command line, including one that can be used to replace quoted strings within the netlist.  It's a little round-about, then, to open a file using the name provided by a string parameter of your verilog-a module, the parameter would get set to a (quoted string) value in the netlist, and then you replace the quoted string with the command-line argument, and you have to hope that the command-line replacement allows you to specify the Monte-Carlo run number.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.