3

To test my Verilog design I'm using two differents simulators : Icarus and Verilator. It's work, but there are some variations between them.

For example, I can't read module parameter with verilator, but Icarus works.

Is there a way to know which simulator is in use in python testfile ?

I would like to write something like that :

        if SIM == 'icarus':
            self.PULSE_PER_NS = int(dut.PULSE_PER_NS)
            self.DEBOUNCE_PER_NS = int(dut.DEBOUNCE_PER_NS)
        else:
            self.PULSE_PER_NS = 4096 
            self.DEBOUNCE_PER_NS = 16777216

To be able to manage both simulator and compare them.

FabienM
  • 3,421
  • 23
  • 45

1 Answers1

6

The running simulator name (as a string) can be determined using cocotb.SIM_NAME. If cocotb was not loaded from a simulator, it returns None.

Qiu
  • 5,651
  • 10
  • 49
  • 56