Hello,
I am in the process of porting a simulation from Vivado’s simulator (XSim if I am correct) to QuestaSim.
I am using Vivado 2017.2 and QuestaSim 10.5C.
The design uses SystemVerilog interfaces heavily, and the simulation code also uses classes defined within those to generate stimulus.
The system is based on the mechanism (polymorphism) outlined in this article:
http://verificationhorizons.verificationacademy.com/volume-7_issue-3/articles/stream/polymorphic-interfaces-an-alternative-for-systemverilog-interfaces_vh-v7-i3.pdf
The thing is the interfaces used can all be used to simulate the master and/or the slave of that interface. When simulating the master transactions can be issued by calling “read()” “write()” and when simulating the slave the interface emulates a “memory” and data can be retrieved by “read_mem()” and “write_mem()”.
Now the way I have made this works until now is by having a two variables inside the interface, called intf_is_master_bfm and intf_is_slave_bfm which are both initialized to zero. Then, in the begining of the simulation some of this variables might be setted throught setter functions. Then, inside the interface I have something like this:
assign AWAddr = intf_is_master_bfm ? awaddr : 'z;
assign AWId = ((PROTOCOL == "AXI4LITE") || (WID_WIDTH == 0)) ? 1'b0 : intf_is_master_bfm ? awid : 'z;
assign AWLen = intf_is_master_bfm ? awlen : 'z;
assign AWSize = intf_is_master_bfm ? awsize : 'z;
assign AWBurst = intf_is_master_bfm ? awburst : 'z;
assign AWLock = intf_is_master_bfm ? awlock : 'z;
assign AWCache = intf_is_master_bfm ? awcache : 'z;
assign AWProt = intf_is_master_bfm ? awprot : 'z;
assign AWValid = intf_is_master_bfm ? awvalid : 'z;
assign AWReady = intf_is_slave_bfm ? awready : 'z;
(...)
With this I can ensure the interface ports are only driven from the simulation code if the appropriate variable is set. Note that I actually use the lowercase signals (awaddr, awlen etc) from the simulation code.
Now the problem is Vivado has never given me an error with this (note I assign a 'Z to the signal if the variable is not set). However, whith question I get the following errors:
# Time: 0 ps Iteration: 0 Instance: /.../i_Module/mmAxiIf File: X:/.../AxiMmIf.sv
# ** Error: (vsim-3837) X:/.../AxiMmIf.sv(599): Variable '/.../ModuleGen[1]/i_Module/mmAxiIf/AWLock' written by more than one continuous assignment. See X:/.../<some_file>.sv(139).
# Time: 0 ps Iteration: 0 Instance: /.../i_Module/mmAxiIf File: X:/.../AxiMmIf.sv
# ** Error: (vsim-3837) X:/.../AxiMmIf.sv(598): Variable '/.../ModuleGen[1]/i_Module/mmAxiIf/AWBurst' written by more than one continuous assignment. See X:/.../<some_file>.sv(138).
Basically an error is thrown for every signal of every interface, which is at least connected to actual logic signals at one end.
How could I solve this?