how to carefully setEnvVal() ?

Discussion in 'Cadence' started by fogh, Sep 22, 2004.

  1. fogh

    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 ?
     
    fogh, Sep 22, 2004
    #1
  2. envGetVal and envGetDefVal
    is there is a difference in the return values
    the user should have modified the variable settings.

    Bernd
     
    Bernd Fischer, Sep 22, 2004
    #2
  3. fogh

    fogh Guest

    Thanks , that is much nicer than grepping through the .cdsenv
     
    fogh, Sep 23, 2004
    #3
  4. fogh

    fogh Guest

    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).
     
    fogh, Sep 24, 2004
    #4
  5. 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
     
    Bernd Fischer, Sep 24, 2004
    #5
  6. fogh

    fogh Guest

    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.

     
    fogh, Sep 24, 2004
    #6
  7. 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
    ))
     
    Andrew Beckett, Sep 26, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.