[Scons-users] Dealing with an odd dependency

Dirk Bächle tshortik at gmx.de
Fri Dec 5 15:55:37 EST 2014


On 05.12.2014 21:02, Brian Cody wrote:
> Hey, no argument from me about SCons having a legitimate complaint.
>
> The tool is modelsim. Modelsim relies on an INI file to tell it where 
> things exist in your file system, e.g. lib_a is c:\here\liba, lib_b is 
> c:\here\libb, etc. The library is the location of where compiled 
> objects have been replaced. A caveat to this is that if lib B depends 
> on lib A, then lib A must be compiled and in the ini file before lib B 
> is compiled. Then if there's a lib C with a similar dependency on lib 
> B, things start to chain together.
>
> [...]
>
> The library creation does not depend on the ini file. They all can 
> (and do) run simultaneously. It really just creates a directory with a 
> text file with some internal modelsim information.
> Next vcom can run on any library that depends on no other library.
> Next vmap should be run to place those libraries in the ini file (vmap 
> would definitely need to treat the ini as a side effect at least)
> Next vcom can run on any library that depends on just the previously 
> created libraries.
> etc.
>
I googled around a bit and had a short look at what Modelsim does:

http://www.tkt.cs.tut.fi/tools/public/tutorials/mentor/modelsim/getting_started/gsms.html

I would keep the "init" step of creating libraries separate from 
compiling them. You could define an option like "INIT", and when it's 
given on the command-line you only include an "SConscript.init" with the 
required steps to setup your libs. In "normal" mode, you include the 
main "SConscript" for running the compiler on the libraries. (could also 
be solved using Aliases, I guess)
About the vcom/vmap commands: you could try to define your Builder from 
a "list of actions", such that it always automatically runs "vmap" after 
your actual build command. Then you would probably have to define your 
*.ini file as both, SideEffect() and Precious().

Regards,

Dirk




More information about the Scons-users mailing list