# Getting multiply-driven warnings from vsim with passive agent

**URL:** <https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536>\
**Category:** UVM\
**Tags:** multiply-driven, SystemVerilog, UVM, vsim\
**Created:** [November 12, 2016, 1:58am UTC](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536 "2016-11-12T01:58:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![drogoff](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/edb3f5/32.png) [@drogoff](https://verificationacademy.com/forums/u/drogoff)\
**Post date:** [November 12, 2016, 1:58am UTC](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/1 "2016-11-12T01:58:55Z")

</div>

I don’t know what’s causing this or how to pin it down. I have an interface with producer, consumer, and monitor clocking blocks and modports. Most go from my DUT to agents that instantiate drivers or receivers based on an env member or just a monitor is is\_active== UVM\_PASSIVE. A couple of interfaces go to an RTL model so they are set to UVM\_PASSIVE. However, for those interfaces, I’m getting warning like this:

> # \*\* Warning: (vsim-3839) my\_if.sv(xx):

Variable ‘/tb\_top/my\_if[yy]/ZZZ’, driven via a port connection, is multiply driven.  
See my\_rtl\_model.sv(xx).

# Region: /tb\_top/my\_if[yy]

In my\_rtl\_model, the port ZZZ is an output. In my DUT, it’s an input. In tb\_top, the actual to the port of the instance of my\_rtl\_model is a modport where ZZZ is an output. And, in my agent, if is\_active==UVM\_PASSIVE, I only instantiate the monitor which only has inputs for the interface.

Any idea how to get a better idea of what QuestaSim is complaining about?

Thanks,

David

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [November 13, 2016, 12:35pm UTC](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/2 "2016-11-13T12:35:33Z")

</div>

_In reply to [drogoff](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536):_

Could you please explain the difference between my rtl\_model and your DUT.

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [November 13, 2016, 2:50pm UTC](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/3 "2016-11-13T14:50:31Z")

</div>

_In reply to [drogoff](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/2):_  
The warning you are getting is from the compiler before the   
is\_active flag gets set during simulation. When it comes to procedural code the compiler does not know what source code will or will not get executed. It has to generate the machine code to execute everything.

without seeing the actual code, the only thing I can suggest to change the code to make it work in for any setting of   
is\_active. That might mean changing the interface signal to a wire.

---

<div class="post-metadata">

**Author:** ![drogoff](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/edb3f5/32.png) [@drogoff](https://verificationacademy.com/forums/u/drogoff)\
**Post date:** [November 13, 2016, 6:24pm UTC](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/4 "2016-11-13T18:24:10Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/3):_

DUT is the RTL module being tested.  
rtl\_model is another RTL module that is needed as part of the testbench but isn’t being tested.

FYI, looks like Dave has the answer. I’ll post a response to his in a minute.

---

<div class="post-metadata">

**Author:** ![drogoff](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/edb3f5/32.png) [@drogoff](https://verificationacademy.com/forums/u/drogoff)\
**Post date:** [November 13, 2016, 6:29pm UTC](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/5 "2016-11-13T18:29:02Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/4):_

> _In reply to [drogoff](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/4):_  
> The warning you are getting is from the compiler before the   
> is\_active flag gets set during simulation. When it comes to procedural code the compiler does not know what source code will or will not get executed. It has to generate the machine code to execute everything.  
> without seeing the actual code, the only thing I can suggest to change the code to make it work in for any setting of   
> is\_active. That might mean changing the interface signal to a wire.

Yep - that was it. This also explains why I see examples of SV Interfaces with the signals declared as wires and not logic. I couldn’t figure out why this was being done since, with modports, no signal was bidirectional or multiply driven. Now it makes sense although it’s a bit ugly.

Thanks!

David

---

<div class="post-metadata">

**Author:** ![drogoff](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/edb3f5/32.png) [@drogoff](https://verificationacademy.com/forums/u/drogoff)\
**Post date:** [November 18, 2016, 10:14pm UTC](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/6 "2016-11-18T22:14:11Z")

</div>

_In reply to [drogoff](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/5):_

> _In reply to [dave\_59](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/5):_  
> Yep - that was it. This also explains why I see examples of SV Interfaces with the signals declared as wires and not logic. I couldn’t figure out why this was being done since, with modports, no signal was bidirectional or multiply driven. Now it makes sense although it’s a bit ugly.

Dave, this solution of using wires just hit a speed bump. In one of my agents using the interface and clocking blocks, I need to look for an input signal and change an output signal in the same clock cycle. This is to model the RTL which is combinatorial. I can’t figure out a legal way to do this. I tried driving my\_vif.signal\_a directly to avoid the clocking block delay but got an error since signal\_a is defined as a wire in the interface. I also tried using $deposit, but this gave an error since the signal is automatic.

So, any suggestion on modelling one output signal in an interface being combinatorial?

Thanks,

David

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [November 18, 2016, 11:00pm UTC](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/7 "2016-11-18T23:00:24Z")

</div>

_In reply to [drogoff](https://verificationacademy.com/forums/t/getting-multiply-driven-warnings-from-vsim-with-passive-agent/32536/6):_

I don’t know what you meant by the signal being _automatic_. You said you defined   
signal\_a as a wire, and there’s no such thing as an automatic wire.

You can try doing this inside your interface

```verilog
wire signal_a;
logic signal_a_driver = 'z;
assign signal_a = signal_a_driver;

```

Then you can procedurally assign   
signal\_a\_driver from your driver class, setting it back to 'z when you want to turn it off.

It’s hard to help you further without seeing more code. You may want to contact your local support group for more help where you can share all the necessary code.
