question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Questa/Modelsim: don't force compilation unit settings

See original GitHub issue

I discovered an issue today while trying to simulate a medium-sized project (several files) which uses SystemVerilog packages for constant and property definitions; it complained about multiple declarations of the same properties through wildcard imports.

# ** Error: /path/to/file.sv(line): Identifier 'C_ABCDE' is not directly visible.
#    Found multiple Declaration of 'C_ABCDE' through wildcard imports from these packages : component_defs, component_defs, component_defs, component_defs, component_defs, component_defs, component_defs, component_defs, component_defs, component_defs, component_defs, component_defs

I fixed this by modifying the cocotb/makefiles/simulators/Makefile.questa file to remove the -mfcu option at line 98, allowing QuestaSim to treat each file as a separate compile unit (using the -sfcu option instead). If you want I could submit a pull request with this change.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cmarqucommented, Nov 6, 2018

So basically, if you need to replace default settings you should override the DEFAULT_COMPILE_ARGS. If you need to pass additional settings, you just define COMPILE_ARGS.

One small UX comment here - intuitively, I would have assumed that just by setting COMPILE_ARGS, I would completely override DEFAULT_COMPILE_ARGS, while your code example does not do this. Of course, one can get used to it, but this may be a small trap for users.

0reactions
tovinecommented, Mar 7, 2018

@mciepluc Just to clarify: I did not set VSIM_ARGS, it was correctly applied from the EXTRA_ARGS variable in the makefile so that problem has already been solved.

Using overridable DEFAULT_COMPILE_ARGS could be an idea.

@forensicgarlic I agree, it’s a mystery to me why it was deemed necessary to set the defaults like this - possibly to ensure consistent behavior across different compiler/simulator backends?

However it is a bit problematic as long as the compiler freaks out if both opposing arguments are applied at the same time, failing to execute instead of allowing the user to override the (perhaps wrongfully assumed) cocotb defaults.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModelSim User's Manual - Microsemi
The vcom command compiles VHDL design units. You must compile VHDL files in the order necessitate to any design requirements. Projects may assist...
Read more >
Compile and Run Options - EDA Playground Documentation
Option, Description. -2002, Forces the compiler to conform to VHDL 2002 (IEEE Std 1076™-2002). This is the default mode of operation.
Read more >
ModelSim SE User's Manual
ModelSim's compiler for VHDL design units is vcom (CR-311). ... simplify interaction with ModelSim; you don't need to understand the ...
Read more >
ModelSim® User's Manual
ModelSim ® User's Manual, v10.5b ... Macro Definitions and Compiler Directives in Compilation Unit Scope . ... Force and Release Statements in Verilog...
Read more >
ModelSim User's Manual - UCSD CSE
Modes of Operation. ModelSim User's Manual, v6.5e. 35. • force ... Library window — Shows design libraries and compiled design units. To update...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found