Learning BSV‎ > ‎Compiler Options‎ > ‎

BSC Options

The environment variable BSC_OPTIONS enables the user to set
default flag values to be used each time the compiler is called.  If
set, the value of BSC_OPTIONS is automatically  prepended to the
compiler option values  typed on the bsc command line.  This avoids
the need to set specified flag values each time the compiler is called.

For instance, in order to control the default value of the -p (path)
option, the BSC_OPTIONS environment variable could be set as follows:

 # Bluespec Environment for csh/tcsh
 setenv BSC_OPTIONS "-p .:./MyLib:+"

 # Bluespec Environment for bash/ksh
 export BSC_OPTIONS="-p .:./MyLib:+"

Once set, the BSV compiler would now search for packages in the
./MyLib directory before looking in the default Prelude and Library
areas. Note that since the bsc  recognizes multiple uses of
the same flag on the command line, the user can use the -p
flag along with  the BSC_OPTIONS environment variable to control
the search path. For example, if in addition to the BSC_OPTIONS
set above the user enters the following bsc
command, :

    bsc -verilog -p ./MyLib2:+ Foo.bsv

the compiler would now use the path

    ./MyLib2:.:./MyLib:+

which is a prepending of the -p  command line value to the value set by the
BSC_OPTIONS environment variable.

Comments