Skip to content

Error running sim modelsim with VHDL file as top level #265

Description

@yoav-karmon
sim_args=["+acc", "-gG_APP_ID=243", "-L","work"]

vsim output:

vsim -c -onfinish exit -foreign "cocotb_init /home/ykarmon/.local/lib/python3.10/site-packages/cocotb/libs/libcocotbfli_modelsim.so" "+acc" -L work top_level.top_level-do "run -all; quit" ```

the problem is that it assume toplevel is set to top_level lib.

work around:
site-packages/cocotb_test/simulator.py:588
            cmd.append(
                ["vsim"]
                + ["-gui" if self.gui else "-c"]
                + ["-onfinish", "stop" if self.gui else "exit"]
                + [
                    "-foreign",
                    "cocotb_init " + as_tcl_value(cocotb.config.lib_name_path("fli", "questa")),
                ]
                + self.simulation_args
                + [as_tcl_value(v) for v in self.get_parameter_commands(self.parameters)]
                + self.toplevel
                +

remove  + self.toplevel

and set             

sim_args=["+acc", "-g<generics", "-L",f"{work_lib}",f"{work_lib}.{top_level_file}"], # Simulation arguments


on run command.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions