Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile args provided to both ghdl import and ghdl make #230

Open
delafthi opened this issue Mar 10, 2023 · 1 comment
Open

Compile args provided to both ghdl import and ghdl make #230

delafthi opened this issue Mar 10, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@delafthi
Copy link

delafthi commented Mar 10, 2023

My problem
I want to provide some options to ghdl make (ghdl -m) (e.g. -WX,OPTION). However, since the compile arguments are also given to the ghdl import (ghdl -i) command I get an error message that I provided an unkown option.

Additional context
The compile_args provided with run() are used for both ghdl import and ghdl make . However, both commands do not share the same amount of options (ghdl make and ghdl run however share the same options).

~ ghdl --version
GHDL 4.0.0-dev (3.0.0.r8.g82e970042) [Dunoon edition]
 Compiled with GNAT Version: 12.2.1 20230201
 GCC 11.2.0 code generator
Written by Tristan Gingold.

Copyright (C) 2003 - 2023 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~ ghdl help import
import [OPTS] FILEs
  Import units of FILEs
  alias: -i
Main options (try --options-help for details):
 --std=XX
   Use XX as VHDL standard (87,93c,93,00,02 or 08)
 --work=NAME
   Set the name of the WORK library
 -PDIR
   Add DIR in the library search path
 --workdir=DIR
   Specify the directory of the WORK library
 -fsynopsys
   Allow to use synopsys packages in ieee library
 -frelaxed
   Relax semantic rules
 -fexplicit
   Gives priority to explicit operator redefinitions
~ ghdl help run
run UNIT [ARCH] [RUNOPTS]
  Run design UNIT
  alias: -r
Main options (try --options-help for details):
 --std=XX
   Use XX as VHDL standard (87,93c,93,00,02 or 08)
 --work=NAME
   Set the name of the WORK library
 -PDIR
   Add DIR in the library search path
 --workdir=DIR
   Specify the directory of the WORK library
 -fsynopsys
   Allow to use synopsys packages in ieee library
 -frelaxed
   Relax semantic rules
 -fexplicit
   Gives priority to explicit operator redefinitions
 -v
   Be verbose
 --GHDL1=PATH
   Set the path of the ghdl1 compiler
 --AS=as
   Use as for the assembler
 --LINK=gcc
   Use gcc for the linker driver
 -S
   Do not assemble
 -o FILE
   Set the name of the output file
 -WX,OPTION
   Pass OPTION to X, where X is one of
  c: compiler, a: assembler, l: linker
 -g[XX]
   Pass debugging option to the compiler
 -O[XX]/-f[XX]
   Pass optimization option to the compiler
 -Q
   Do not add -quiet option to compiler
 --expect-failure
   Expect analysis/elaboration failure

A possible solution
A possible solution to solve the problem, would be to provide the base options for all of the ghdl commands in one argument and the extra options not supported in ghdl import with an additional argument (to the run function).

@themperek
Copy link
Owner

A way would be to add elborte_args that is separate from compile_args. You can also make your own version see:

class IcarusCustom(Icarus):
def __init__(self, logfile, *argv, **kwargs):
self.logfile = logfile
super().__init__(*argv, **kwargs)
def run_command(self):
return (
["vvp", "-v", "-l", self.logfile, "-M", self.lib_dir, "-m", cocotb.config.lib_name("vpi", "icarus")]
+ self.simulation_args
+ [self.sim_file]
+ self.plus_args
)

@themperek themperek added the enhancement New feature or request label Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants