The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 8:20pm
Pages: 1
Send Topic Print
file write (Read 3114 times)
kamath
Junior Member
**
Offline



Posts: 16

file write
Sep 30th, 2012, 9:34am
 
Hi All,

I have a circuit whose node voltage is being saved into file in Virtuoso.

I am able to open a file and store the same. The problem is when I run a parametric sweep of a given variable lets say x=1:10, I get all the data into one single file. i would ideally want a file dataX.txt where X is 1:10 for each run.

I checked the concatenation method in Verilog-A and been able to reach until a point where i am unable to find the right typecasting for X. Is there a way to do this to string from integer in verilog-a.


Regards
Kamath
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: file write
Reply #1 - Oct 1st, 2012, 6:35am
 
Some simulators may support sprintf.  It's not mentioned explicitly in the LRM, but many features from 1364 Verilog or 1800 System Verilog are available in Verilog-AMS.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
kamath
Junior Member
**
Offline



Posts: 16

Re: file write
Reply #2 - Oct 3rd, 2012, 7:34am
 
Thanks Geoffrey.

Yes $fstrobe or $sprintf works for writing.

I was trying to know the parametric sweep number via verilog-a block than going for ocean. But may be I will have to check it by having an external file with the counter number since the schematic is re-run during every sim.


Regards
Kamath
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: file write
Reply #3 - Oct 10th, 2012, 2:40pm
 
I was thinking about using $sprintf to write to a string, generating the filename.  But I suppose that requires not just $sprintf but also support for strings and an $fopen that can take a variable string argument (not just a fixed string literal).
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.