changing saveDir and projectDir as library changes

W

Whisker

Guest
Hi,

I'm having problems figuring out how to do the following:

Instead of just using fixed defaults for saveDir and projectDir (such
as ./artist_states and ./simulation respectively - and I don't care
how these were set - either by .cdsenv entry or use of envSetVal) , I
would like to have projectDir and saveDir follow the library of the
schematic being simulated.

In other words, if I opened MyLib->MyCell->schematic and then invoked
Analog Artist, I would like the projectDir to already be defaulted to
../simulation/MyLib and I would like the saveDir to already be
defaulted to ./simulation/MyLib/artist_states. Similarly, if I then
opened YourLib->YourCell->schematic and invoked Analog Artist or just
chose YourLib->YourCell->schematic from the Setup - Design form , I
would want these two values to automatically be changed to
../simulation/YourLib and ./simulation/YourLib/artist_states
respectively.

I've thought about adding skill to run after a trigger event, but I am
not sure which trigger is appropriate. Also, I haven't found a
foolproof method of grabbing the library name which works under all
the different ways to switch what will be simulated. Additionally, it
would be awesome if whatever solution would also work for Ocean as
well.

Any and all help/ideas would be great. Thanks.
Whisker
 
Hi,

Have you tried to use envSetVal within the libraries libInit.il
files? This is just a guess and I either don't know if this
is the right approach.

Bernd

Whisker wrote:
Hi,

I'm having problems figuring out how to do the following:

Instead of just using fixed defaults for saveDir and projectDir (such
as ./artist_states and ./simulation respectively - and I don't care
how these were set - either by .cdsenv entry or use of envSetVal) , I
would like to have projectDir and saveDir follow the library of the
schematic being simulated.

In other words, if I opened MyLib->MyCell->schematic and then invoked
Analog Artist, I would like the projectDir to already be defaulted to
./simulation/MyLib and I would like the saveDir to already be
defaulted to ./simulation/MyLib/artist_states. Similarly, if I then
opened YourLib->YourCell->schematic and invoked Analog Artist or just
chose YourLib->YourCell->schematic from the Setup - Design form , I
would want these two values to automatically be changed to
./simulation/YourLib and ./simulation/YourLib/artist_states
respectively.

I've thought about adding skill to run after a trigger event, but I am
not sure which trigger is appropriate. Also, I haven't found a
foolproof method of grabbing the library name which works under all
the different ways to switch what will be simulated. Additionally, it
would be awesome if whatever solution would also work for Ocean as
well.

Any and all help/ideas would be great. Thanks.
Whisker
 
this is a nice problem, hard to solve without having to hack artist's
code.
maybe what you could do is register a trigger for analogArtist-schematic
subview type.

deRegUserTriggers( "analogArtist-schematic" nil nil 'myFunc )

tried it, and it looks it is called whenever artist in invoked, but also
when changing design inside artist.


"Whisker" <whiskerville83-google@yahoo.com> wrote in message
news:6941ff49.0404272141.67e97bfd@posting.google.com...
Hi,

I'm having problems figuring out how to do the following:

Instead of just using fixed defaults for saveDir and projectDir (such
as ./artist_states and ./simulation respectively - and I don't care
how these were set - either by .cdsenv entry or use of envSetVal) , I
would like to have projectDir and saveDir follow the library of the
schematic being simulated.

In other words, if I opened MyLib->MyCell->schematic and then invoked
Analog Artist, I would like the projectDir to already be defaulted to
./simulation/MyLib and I would like the saveDir to already be
defaulted to ./simulation/MyLib/artist_states. Similarly, if I then
opened YourLib->YourCell->schematic and invoked Analog Artist or just
chose YourLib->YourCell->schematic from the Setup - Design form , I
would want these two values to automatically be changed to
./simulation/YourLib and ./simulation/YourLib/artist_states
respectively.

I've thought about adding skill to run after a trigger event, but I am
not sure which trigger is appropriate. Also, I haven't found a
foolproof method of grabbing the library name which works under all
the different ways to switch what will be simulated. Additionally, it
would be awesome if whatever solution would also work for Ocean as
well.

Any and all help/ideas would be great. Thanks.
Whisker
 
Bernd,

You touched upon one idea that I tried, however, I couldn't seem to
automatically generate the library name in a dynamic way - I was
hoping for one libInit.il that I could just copy from library to
library without any edits. I tried
dbGetCellViewDdId(deGetCellView())->lib->name and
dbGetCellViewDdId(geGetEditCellView())->lib->name both of which work
from the CIW, but neither worked from libInit.il. I figure this is
because the library manager is a separate executable. Perhaps I need
to create a cdsLibMgr.il file? I've read the Library Manager User
Guide and it indicates that SKILL callback procedures always receive
the argument list selection currently specified in the library
manager. The library manager sends the data selection specification
fully corresponding to the 5.X architecture as a list of five strings:
LIBNAME CELLNAME VIEWNAME FILENAME CATEGORY. But I couldn't figure
out how to access this list. It seems like it had the data I was
after (LIBNAME). Any ideas out there?

Whisker

Bernd Fischer <bernd.fischer@xignal.de> wrote in message news:<408F7C56.9010103@xignal.de>...
Hi,

Have you tried to use envSetVal within the libraries libInit.il
files? This is just a guess and I either don't know if this
is the right approach.

Bernd
 
Stephane,

I think you may have my solution. I will follow your lead and see if
I can get it working. Thank you and I'll post back how things turn
out.

Whisker

"S. Badel" <stephane.badel@epfl.ch> wrote in message news:<408f92ad$1@epflnews.epfl.ch>...
this is a nice problem, hard to solve without having to hack artist's
code.
maybe what you could do is register a trigger for analogArtist-schematic
subview type.

deRegUserTriggers( "analogArtist-schematic" nil nil 'myFunc )

tried it, and it looks it is called whenever artist in invoked, but also
when changing design inside artist.
 
Stephane,

Here's what I have so far, but it's not working yet. When I query
values in the CIW, the saveDir and projectDir read properly. However,
when I open the forms that should be showing these variables, the
values are not correct. It's as if a callback is not getting
triggered. If I do a netlist or save a state, the incorrect values
are used.
-----------------------------------------------------------------------------------------------------------
In my ~/.cdsenv file I have these two lines:
asimenv saveDir string "./simulation/"
asimenv.startup projectDir string "./simulation/"
-----------------------------------------------------------------------------------------------------------
In my ~/.cdsinit file I have these two lines:
envSetVarDefaultToCurrVal( "asimenv" "saveDir" )
envSetVarDefaultToCurrVal( "asimenv.startup" "projectDir" )
-----------------------------------------------------------------------------------------------------------
if( !deGetAppInfo("analogArtist-schematic")->userPostInstallTrigger
then
printf("\nNo analogArtist-schematic user trigger is
registered.\nInstalling My_asimenv_defaults_appTrigger.\n\n")
deRegUserTriggers( "analogArtist-schematic" nil nil
'My_asimenv_defaults_appTrigger)
else
hiGetAttention(50)
printf("\nWARNING!: A analogArtist-schematic user trigger is
already registered as: %s\n"
deGetAppInfo("analogArtist-schematic")->userPostInstallTrigger)
printf("\nThis user trigger will be replaced by
My_asimenv_defaults_appTrigger.\n")
deUnRegUserTriggers( "analogArtist-schematic")
deRegUserTriggers( "analogArtist-schematic" nil nil
'My_asimenv_defaults_appTrigger)
hiGetAttention(50)
)

procedure( My_asimenv_defaults_appTrigger( args "l")
let( (My_debug libSimPath libStatePath)
My_debug=t
; My_debug=nil
if(My_debug then println(args))
libSimPath = strcat( envGetDefVal( "asimenv.startup"
"projectDir" ) args->libName )
envSetVal( "asimenv.startup" "projectDir" 'string libSimPath )
printf("Set projectDir environment value to %s\n" libSimPath)
;
libStatePath = strcat( libSimPath "/artist_states" )
envSetVal( "asimenv" "saveDir" 'string libStatePath )
printf("Set saveDir environment value to %s\n" libStatePath)
) ; end of let
) ; end of procedure

So close, but yet so far away... Any ideas? All help is greatly
appreciated.

Whisker

whiskerville83-google@yahoo.com (Whisker) wrote in message news:<6941ff49.0404281055.6c9727ae@posting.google.com>...
Stephane,

I think you may have my solution. I will follow your lead and see if
I can get it working. Thank you and I'll post back how things turn
out.

Whisker

"S. Badel" <stephane.badel@epfl.ch> wrote in message news:<408f92ad$1@epflnews.epfl.ch>...
this is a nice problem, hard to solve without having to hack artist's
code.
maybe what you could do is register a trigger for analogArtist-schematic
subview type.

deRegUserTriggers( "analogArtist-schematic" nil nil 'myFunc )

tried it, and it looks it is called whenever artist in invoked, but also
when changing design inside artist.
 
yep, probably those variable are only read once. This is the
case with many tools, you cannot change environment options
procedurally once they are loaded.

for your problem have a look at the asi* and sev* functions,
described in Cadence Analog Environment SKILL Reference.

i found this one to set the .artist_states directory.
sevSetTopSaveDir()

you'll probably find what you need there.

stéphane

"Whisker" <whiskerville83-google@yahoo.com> wrote in message
news:6941ff49.0404281546.420dc88e@posting.google.com...
Stephane,

Here's what I have so far, but it's not working yet. When I query
values in the CIW, the saveDir and projectDir read properly. However,
when I open the forms that should be showing these variables, the
values are not correct. It's as if a callback is not getting
triggered. If I do a netlist or save a state, the incorrect values
are used.
--------------------------------------------------------------------------
---------------------------------
In my ~/.cdsenv file I have these two lines:
asimenv saveDir string "./simulation/"
asimenv.startup projectDir string "./simulation/"
--------------------------------------------------------------------------
---------------------------------
In my ~/.cdsinit file I have these two lines:
envSetVarDefaultToCurrVal( "asimenv" "saveDir" )
envSetVarDefaultToCurrVal( "asimenv.startup" "projectDir" )
--------------------------------------------------------------------------
---------------------------------
if( !deGetAppInfo("analogArtist-schematic")->userPostInstallTrigger
then
printf("\nNo analogArtist-schematic user trigger is
registered.\nInstalling My_asimenv_defaults_appTrigger.\n\n")
deRegUserTriggers( "analogArtist-schematic" nil nil
'My_asimenv_defaults_appTrigger)
else
hiGetAttention(50)
printf("\nWARNING!: A analogArtist-schematic user trigger is
already registered as: %s\n"
deGetAppInfo("analogArtist-schematic")->userPostInstallTrigger)
printf("\nThis user trigger will be replaced by
My_asimenv_defaults_appTrigger.\n")
deUnRegUserTriggers( "analogArtist-schematic")
deRegUserTriggers( "analogArtist-schematic" nil nil
'My_asimenv_defaults_appTrigger)
hiGetAttention(50)
)

procedure( My_asimenv_defaults_appTrigger( args "l")
let( (My_debug libSimPath libStatePath)
My_debug=t
; My_debug=nil
if(My_debug then println(args))
libSimPath = strcat( envGetDefVal( "asimenv.startup"
"projectDir" ) args->libName )
envSetVal( "asimenv.startup" "projectDir" 'string libSimPath )
printf("Set projectDir environment value to %s\n" libSimPath)
;
libStatePath = strcat( libSimPath "/artist_states" )
envSetVal( "asimenv" "saveDir" 'string libStatePath )
printf("Set saveDir environment value to %s\n" libStatePath)
) ; end of let
) ; end of procedure

So close, but yet so far away... Any ideas? All help is greatly
appreciated.

Whisker

whiskerville83-google@yahoo.com (Whisker) wrote in message
news:<6941ff49.0404281055.6c9727ae@posting.google.com>...
Stephane,

I think you may have my solution. I will follow your lead and see if
I can get it working. Thank you and I'll post back how things turn
out.

Whisker

"S. Badel" <stephane.badel@epfl.ch> wrote in message
news:<408f92ad$1@epflnews.epfl.ch>...
this is a nice problem, hard to solve without having to hack artist's
code.
maybe what you could do is register a trigger for
analogArtist-schematic
subview type.

deRegUserTriggers( "analogArtist-schematic" nil nil 'myFunc )

tried it, and it looks it is called whenever artist in invoked, but
also
when changing design inside artist.
 

Welcome to EDABoard.com

Sponsor

Back
Top