• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. CSF search mechanism - load .cdsinit from $HOME even if...

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 125
  • Views 9281
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CSF search mechanism - load .cdsinit from $HOME even if its disabled in setup.loc

HoWei
HoWei over 6 years ago

I have read the article "Cadence Application Infrastructure User Guide IC6.1.7" to understand the CSF search mechanism. Whilst playing around with the settings, I found that it still loads the ".cdsinit" from $HOME, even if I explicitly did exclude/comment this location in "setup.loc".

In my workarea, the following files are used:

setup.loc:                only "." is enabled as search-location, all others are commented

csfLookupConfig:   only "NONE" is set

For my understanding, the above settings should result in not loading any .cdsinit. But I clearly see that the ~/.cdsinit is loaded (by printing a dedicated message into CIW). I am using ic6.1.7.500.1400.

# cdswhich -lookupconfig .cdsinit
Info (cdswhich): Cadence software is not configured to locate
                 file '.cdsinit' via Cadence Search File mechanism

Question1: Why does virtuoso load the ~/.cdsinit ? 

Another thing I did not clearly understand from the above mentioned article, is the requirement for the "csfLookupConfig" file. According to my tests it might be enough to have "cfsLookupConfig" in my workarea to define what file to load via CSF.

Question2: Do I need to have this file in all locations defined in setup.loc, or is it enough to just have it in my workarea (which is the first search location in setup.loc) ?

Rgds.

Holger

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    Hi Holger,

    The default behaviour of .cdsinit is that it is searched for in <ICinstDir>/tools/dfII/local, then the working dir and then the home dir (this mechanism predates the CSF mechanism, so it needed to be preserved as the default). It only uses CSF if you enable CSF (via the csfLookupConfig) and even then if it fails to find a .cdsinit using the CSF mechanism, it will continue to search using the standard (default) method.

    So to answer your questions:

    1. Because there is no "INCLUDE .cdsinit" in your csfLookupConfig, it looks in tools/dfII/local then working dir then home. Even if you did have the INCLUDE line in the csfLookupConfig, and just had "." in the setup.loc, it would still find it because no .cdsinit was found via the setup.loc locations. Note you can always do "virtuoso -nocdsinit" if  you don't want the cdsinit loading at all.
    2. The csfLookupConfig is searched for in the setup.loc locations. In fact the setup.loc file is also searched for using the CSF mechanism. Commonly people define $CDS_SITE as a directory containing csfLookupConfig and setup.loc so you can customise it yourself.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • HoWei
    HoWei over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    more questions to get a better understanding:

    1. Regarding the ".cdsenv".

    Considered I have set CSF_LOAD_ENV=CSF - is it required to list the ".cdsenv" in "csfLookupConfig" or not ?

    Will it change the search behavior if it is listed or not ?

    2. Another thing I tried and did not work was, that I added a filename ".cdsinit_personal" to the "csfLookupConfig" and I created this file in my $HOME.

    But apparently this file is not loaded - why ?  The "setup.loc" is configured to look in $HOME.

    Can only "official" filenames (e.g. .cdsinit, .cdsenv, ...) added to "csfLookupConfig" and no other arbitrary filenames ?

    3. Currently I am loading "display.drf" via a command in ".cdsinit":

    drLoadDrf("etc/cds/display.drf")
    envSetVal("graphic" "drfPath" 'string "etc/cds/display.drf")

    But when I am adding "display.drf" in "csfLookupConfig" AFTER .cdsinit - which display.drf has precendence ?

    I assume the file loaded via csfLookupConfig will have precedence - but will the virtuoso "envSetVal(("graphic" "drfPath"...)" also be set to the later "display.drf" ?

    I am trying to understand this mechanism to find the optimum solution for our environment.

    Rgds.

    Holger

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to HoWei

    Hi Holger,

    Some answers:

    1. The $CDS_LOAD_ENV=CSF is an older mechanism that predates the existence of csfLookupConfig. If you set that env var or if you add "INCLUDE .cdsenv" in the csfLookupConfig file, it has the same effect - causing the .cdsenv to be loaded from all the locations in the setup.loc. It's certainly not necessary to specify this both ways - one or the other will do.
    2. The load() function in SKILL doesn't use the Cadence Search File, so it's irrelevant whether the file is in the csfLookupConfig or not. In general, it only makes sense to add known file types into the csfLookupConfig because the code looking for them has to check whether it's been enabled for CSF or not before loading using its normal mechanism. However, you could just use load(ddGetStartup(".cdsinit_personal")) which will search for the file using CSF (no need to add to csfLookupConfig for this to work). You might want to do this conditionally so that it doesn't break if the file doesn't exist anywhere:
    3. Similarly drLoadDrf doesn't use the CSF mechanism (unless you called ddGetStartup in the call). An explicit load will always win over the auto-lookup mechanism. I must admit I don't know quite what happens with the drfPath variable if you set that (I'd probably just do an empirical experiment to find out). I think if this is set it uses that explicit path - but I'm not sure.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • HoWei
    HoWei over 6 years ago in reply to Andrew Beckett

    Gaaahhh - yet another method to initialize virtuoso via ddGetStartup() - I am wondering how I should ever explain these mechanisms to my designers.

    As you explained, a conditional load() would be required to not produce an error. Is there no function like "softload()" or so, which does not produce an error if not found ?

    As my SKILL-skills are NIL, could you provide a short code snippet how I would check if a files exists and load() it ?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • HoWei
    HoWei over 6 years ago in reply to Andrew Beckett

    Gaaahhh - yet another method to initialize virtuoso via ddGetStartup() - I am wondering how I should ever explain these mechanisms to my designers.

    As you explained, a conditional load() would be required to not produce an error. Is there no function like "softload()" or so, which does not produce an error if not found ?

    As my SKILL-skills are NIL, could you provide a short code snippet how I would check if a files exists and load() it ?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to HoWei

    Er, whoops. I meant to include the sample code in the answer 2 above - hit Reply too quickly. Note that ddGetStartup is not another method to initialise virtuoso - it's just a SKILL function to allow you to locate a file (of any type) using the CSF mechanism. You could use that anywhere in SKILL code that might need to locate a file in flexible locations - it could be SKILL code, it could be a file that is being read by a utility - all sorts of things.

    Anyway, you'd do:

    let((fileName)
      when(fileName=ddGetStartup(".cdsinit_personal")
        loadi(fileName)
      )
    )

    The loadi means that it will print an error if there is a problem reading the file - or an error in the file itself, but it will not stop the code in the calling location from executing. In other words, it catches any errors caused when loading the file.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • HoWei
    HoWei over 6 years ago in reply to Andrew Beckett

    I have the following code to my workarea ".cdsinit" (only this code - everything else is commented out ):

    printf("XXXXXXX ./.cdsinit")

    let((fileName)
      when(fileName=ddGetStartup(".cdsinit")
        loadi(fileName)
      )
    )

    The CSF is configured to load the ".cdsinit" from my workarea and from my $HOME. The "$HOME/.cdsinit" has only this line:

    printf("XXXXXXX HOME/.cdsinit")

    When starting virtuoso, I reliably get a CORE DUMP !

    # virtuoso &
    [1]+  Segmentation fault      (core dumped) virtuoso

    Does it not work with ".cdsinit" ?

    Using ddGetStartup(".cdsinit_personal") it is working properly - but if I have multiple ".cdsinit_personal" - it only loads the first match (like CSF does). That is not the intention. I want to load all ".cdsinit_personal" files found - just like ".cdsenv" is loaded.

    So far I did load("...cdsinit_personal") the files explicitly one after the other in explicitely given locations - but if a file is not existing it throws an error. I want to avoid this error and have a "silent" search. I just would need to check if the file exists and the load via load() or loadi(). Can you provide a code snippet ?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to HoWei

    The reason why it's a problem with .cdsinit is because you have an infinite loop - you are loading itself, which loads itself, which loads itself, ad infinitem.

    The ddGetStartup function only finds the first. There is another (currently private) function to retrieve all the files (i.e. the .cdsinit_personal in all the CSF locations) which you could loop over. I did request (via CCR 785995) that this is made public (I've not managed to convince them - not entirely sure why). So you might want to request a duplicate via customer support.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • HoWei
    HoWei over 6 years ago in reply to HoWei

    I found that the following code is doing what I need:

    when(  isFile(".cdsinit_personal") loadi(".cdsinit_personal"))

    when(  isFile("~/.cdsinit") loadi("~/.cdsinit"))
    when(  isFile("~/.cdsinit_personal") loadi("~/.cdsinit_personal"))

    As said - I need to give the locations explicitely.

    Do you see any issue with this ?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to HoWei

    Should be fine - you only need to make sure you don't  end up in a loop - probably wouldn't. I might be tempted to make the first one use "./.cdsinit_personal" (in both the isFile and loadi) to make sure that you don't accidentally load the wrong file if the SKILL path doesn't include "." at the beginning (isFile and load/loadi use the SKILL path - getSkillPath() to resolve local file names).

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information