The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> assign file name to a variable in ADEXL
https://designers-guide.org/forum/YaBB.pl?num=1487222058

Message started by sutapanaki on Feb 15th, 2017, 9:14pm

Title: assign file name to a variable in ADEXL
Post by sutapanaki on Feb 15th, 2017, 9:14pm

Hi,

I have a variable which I want to get a file name as a value. This is supposed to go into the corners setup and for each corner modify the file name based on the values of two other variables that get set up with the corner. Something like file_70MHz_4pf.dat, file_75MHz_150ff.dat etc.
Of course, I can manually go and write the file in the particular corner but I would prefer to have that file variable track the values of the other two variables and automatically modify the file name.
Is this possible to be done and how can I do it?

Thanks
S

Title: Re: assign file name to a variable in ADEXL
Post by Andrew Beckett on Feb 16th, 2017, 9:48am

I thought that this should work if you define the filename as a global variable:

THEFILE: sprintf(nil "\"file_%n.dat\"" VAR("vdd"))

(I'm just referencing vdd here, but you get the idea). This works fine if it's a sweep, but if I do it where I vary vdd over corners, it breaks for some reason - the netlist actually looks OK, but it states that there's an error.

Rather surprising (to me), if I omit the quotes (I would normally expect to need to embed quotes in the string value so that the parameter in the spectre netlist has quotes around it), then all works fine:

sprintf(nil "file_%n.dat" VAR("vdd"))

Spectre is quite happy with it, and I see that the file is being consumed OK (I used write=VAR("THEFILE") on my dc analysis, and I see the appropriate filename being created in each corner).

Looks like I was over-complicating matters!

Regards,

Andrew.

Title: Re: assign file name to a variable in ADEXL
Post by sutapanaki on Feb 16th, 2017, 11:59am

Thanks, Andrew,

I'll try this right now. Hopefully works for me too.

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.