The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 23rd, 2024, 9:26am
Pages: 1
Send Topic Print
Feature like IFDEF for Spectre? (Read 4368 times)
Daniel_Platte
Junior Member
**
Offline



Posts: 11
Munich/Germany
Feature like IFDEF for Spectre?
Feb 06th, 2007, 7:04am
 
Hi,

I would like to change Spectre netlists controlled by an environment variable within a script-automated simulation. Is there a feature like IFDEF for the Spectre netlist parser? How can I access environment variables within the netlist?

Example:
-> if $DEBUG is set, add additional netlist entries to the simulation

Thanks
Daniel
Back to top
 
 
View Profile   IP Logged
bernd
Senior Member
****
Offline



Posts: 229
Munich/Germany
Re: Feature like IFDEF for Spectre?
Reply #1 - Feb 6th, 2007, 8:14am
 
In my opinion this is not directly possible within the
Analog Environment. I would use a programming language
either SKILL or PERL to parse the netlist after it's creation and
make the modification.

Bernd
Back to top
 
 

Just another lonesome cad guy
View Profile WWW   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: Feature like IFDEF for Spectre?
Reply #2 - Feb 6th, 2007, 4:17pm
 
If using spectre from the command line, you can use the -E option to spectre to tell it to use the C preprocessor before spectre parses it.

For example:

Code:
#ifdef MYDEF
// something you want to include
#endif
 



You can then use spectre -E -DMYDEF mynetlist.scs to pass in particular definitions from the outside.

Regards,

Andrew.
Back to top
 
 
View Profile WWW   IP Logged
Daniel_Platte
Junior Member
**
Offline



Posts: 11
Munich/Germany
Re: Feature like IFDEF for Spectre?
Reply #3 - Feb 7th, 2007, 12:48am
 
Thanks for the advice!

Unfortunately, the C-preprocessor does not evaluate Spectre's include statement. As I would need the #ifdef in an options file (that is typically included with Spectre include), the C-preprocessor does not evaluate the #ifdef. Replacing all includes by #include does not solve the problem (and would be very tedious). Shouldn't the C-preprocessor evaluate the #include statements?

Is it possible to combine Spectre's include and the #ifdef directive?

Back to top
 
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: Feature like IFDEF for Spectre?
Reply #4 - Feb 7th, 2007, 3:38am
 
The C preprocessor does process the #include statements. But it won't process any files which are included with spectre's include statements - because these are processed after cpp has done its job.

I can only assume you didn't replace all the includes with #includes?

Regards,

Andrew.
Back to top
 
 
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.