how to carefully setEnvVal() ?

F

fogh

Guest
Hi All,

rather than bluntly use setEnvVal, I would like to first check wether the user has saved something for this envvar in his .cdsenv
How should I do that ?
 
envGetVal and envGetDefVal
is there is a difference in the return values
the user should have modified the variable settings.

Bernd

fogh wrote:
Hi All,

rather than bluntly use setEnvVal, I would like to first check wether
the user has saved something for this envvar in his .cdsenv
How should I do that ?
 
Thanks , that is much nicer than grepping through the .cdsenv

Bernd Fischer wrote:
envGetVal and envGetDefVal
is there is a difference in the return values
the user should have modified the variable settings.

Bernd

fogh wrote:

Hi All,

rather than bluntly use setEnvVal, I would like to first check wether
the user has saved something for this envvar in his .cdsenv
How should I do that ?
 
Bernd,

In fact it is possible that the user has specified in his .cdsenv the same value as the default. So envGetVal==envGetDefVal , but I should still not call envSetVal.
Do you have an idea on how to check if the user has specified something at all (no matter wether it is the same as software default or not).

Bernd Fischer wrote:
envGetVal and envGetDefVal
is there is a difference in the return values
the user should have modified the variable settings.

Bernd

fogh wrote:

Hi All,

rather than bluntly use setEnvVal, I would like to first check wether
the user has saved something for this envvar in his .cdsenv
How should I do that ?
 
The .cdsenv search mechanism of DFII is the following

1. <inst_dir>/tools/dfII/etc/tools/<application/.cdsenv
2. [<inst_dir>/tools/dfII/local/.cdsenv]
optional if you have a /dfII/local/directory
3. $HOME/.cdsenv

What we do in our environment is, we use a project specific
..cdsinit file which loads a project specific .cdsenv file
with envLoadFile( "<path_to>/.cdsenv" ).

So the user can have a .cdsenv file in his $HOME directory
and the user .cdsenv settings do overwrite the project
specific settings. The user is free to do this if he wants
and yo do not overwrite specific user settings with this way.

Maybe this is worth to think about for you.

Bernd

fogh wrote:
Bernd,

In fact it is possible that the user has specified in his .cdsenv the
same value as the default. So envGetVal==envGetDefVal , but I should
still not call envSetVal.
Do you have an idea on how to check if the user has specified something
at all (no matter wether it is the same as software default or not).

Bernd Fischer wrote:

envGetVal and envGetDefVal
is there is a difference in the return values
the user should have modified the variable settings.

Bernd

fogh wrote:

Hi All,

rather than bluntly use setEnvVal, I would like to first check
wether the user has saved something for this envvar in his .cdsenv
How should I do that ?
 
We also have such a setting. In doesn help in that case: the offending envSetVal() is not in a cdsinit that we own, it is in the init procedure for a proprietary simulator. So it is also not loaded before cdsinit but only when when the user selects that simulator in ADE.
I think I am going to make a procedure that greps through the .cdsenv after all, and propose it to them.

Bernd Fischer wrote:
The .cdsenv search mechanism of DFII is the following

1. <inst_dir>/tools/dfII/etc/tools/<application/.cdsenv
2. [<inst_dir>/tools/dfII/local/.cdsenv]
optional if you have a /dfII/local/directory
3. $HOME/.cdsenv

What we do in our environment is, we use a project specific
.cdsinit file which loads a project specific .cdsenv file
with envLoadFile( "<path_to>/.cdsenv" ).

So the user can have a .cdsenv file in his $HOME directory
and the user .cdsenv settings do overwrite the project
specific settings. The user is free to do this if he wants
and yo do not overwrite specific user settings with this way.

Maybe this is worth to think about for you.

Bernd

fogh wrote:

Bernd,

In fact it is possible that the user has specified in his .cdsenv the
same value as the default. So envGetVal==envGetDefVal , but I should
still not call envSetVal.
Do you have an idea on how to check if the user has specified
something at all (no matter wether it is the same as software default
or not).

Bernd Fischer wrote:

envGetVal and envGetDefVal
is there is a difference in the return values
the user should have modified the variable settings.

Bernd

fogh wrote:

Hi All,

rather than bluntly use setEnvVal, I would like to first check
wether the user has saved something for this envvar in his .cdsenv
How should I do that ?
 
You may be better off reading the cdsenv file in SKILL. It's possible
for an individual cdsenv entry to span more than one line if the value
is a list type.

Here's an example of some code to compare the master cdsenv files
between two different installations:

/* abCompareCdsenv.il

Author A.D.Beckett
Group Custom IC (UK), Cadence Design Systems Ltd.
Language SKILL
Date Dec 09, 2003
Modified
By

For example:

abCompareCdsenv("layout" cdsGetInstPath() "/cds/hppa/IC446_hot")

***************************************************

SCCS Info: @(#) abCompareCdsenv.il 12/09/03.15:38:01 1.1

*/

(defun abReadCdsenv (toolname instDir)
(let (table prt line)
(setq table (makeTable 'envData nil))
(setq prt
(infile
(sprintf nil "%s/tools/dfII/etc/tools/%s/.cdsenv"
instDir toolname)))
(when prt
(while
(setq line (lineread prt))
(unless (or (eq line t) (stringp (car line)))
(setarray table (list (car line) (cadr line)) t)
)
) ; while
(close prt)
) ; when
table
)
)

(defun abCompareCdsenv (toolname instDir1 instDir2)
(let (tab1 tab2 inTab1Only inTab2Only)
(setq tab1 (abReadCdsenv toolname instDir1))
(setq tab2 (abReadCdsenv toolname instDir2))

;-----------------------------------------------------------------
; Find everything in tab1 not in tab2

;-----------------------------------------------------------------
(setq inTab1Only
(setof entry tab1 (null (arrayref tab2 entry))))
(setq inTab2Only
(setof entry tab2 (null (arrayref tab1 entry))))
(printf "In %s only\n" instDir1)
(pprint inTab1Only)
(newline)
(printf "In %s only\n" instDir2)
(pprint inTab2Only)
(newline)
t
))



On Fri, 24 Sep 2004 14:20:39 +0200, fogh
<cad_support@skipthisandunderscores.catena.nl> wrote:

We also have such a setting. In doesn help in that case: the offending envSetVal() is not in a cdsinit that we own, it is in the init procedure for a proprietary simulator. So it is also not loaded before cdsinit but only when when the user selects that simulator in ADE.
I think I am going to make a procedure that greps through the .cdsenv after all, and propose it to them.
 

Welcome to EDABoard.com

Sponsor

Back
Top