Open imphil opened 1 year ago
I have workaround that limitation by overriding the Cocotb internal function _get_simulator_precision
. Tested with Cocotb 1.9.0
and Cadence Xcelium 24.03.005
. It works perfectly fine with VHDL as top level design. I can confirm that the vhpi_get_phys
is not implemented and VPI version is not working correctly (it returns -9
). But there is no problem to generate signals like clocks with precision below 1ns
using VHPI. Maximum value is -15
(fs
resolution) according to VHDL specification and Cadence Xcelium prints time with fs
resolution as well.
Example workaround:
import cocotb
cocotb.utils._get_simulator_precision = lambda: -12 # Enforce picosecond (ps) resolution
# Cocotb tests
# ...
Getting the simulator's precision in Xcelium with VHDL toplevels is impossible currently for two reasons:
vhpi_get_phys(vhpiResolutionLimitP, NULL);
, returning invalid data (high == -1, low == 0).cocotb.simulator.get_precision()
call only queries the first GPI implementation, which is always VPI.-timescale
to xrun, a precision of 1 ns (-9) is returned.So there are multiple things to sort out for us and Cadence. I opened a Cadence case to ask for support for
vhpi_get_phys()
, but that alone won't do the trick. Ideally, we want to load VPI only if Verilog is used. We'll need to look into what's preventing that.