Jump to content

Why doesn't this virtual interface connection crash and burn


Recommended Posts

Hi Everyone,

I got some strange code (at least strange to me) from a college of mine and I can not understand why it works, reading the code I expect the tools to fail at compilation and elaboration but to my surprise it works fine.

 

This is a description of what he trying to accomplish and how he did it:

  1. We have chip and within it we have a register bank that use an interface with modports to all the subblocks in the design.
  2. My college use an SPI to access the register bank but needed to "control" some of the signals going from the subblock to the regbank which are internal and already connected.
  3. To control these signals he probed down to the regbank and connected a virtual interface to the interface of the regbank (the virtual interface declaration use the same modport as the regbank)
  4. To control the signal he now simple write "virtual_itf.signal_name = 1'b0" to override the value from the subblock.

 

To me this is strange for the following reasons:

  1. The interface signals are declared as "logic" and since we now have multiple drivers I would expect the tools to complain
  2. Different signal values are driven by the subblock and the virtual interface. I would expect the result to be 'X' but apparently the virtual interface has higher precedence than the subblock but I can not understand why
  3. Virtual interface is declared with the same modport as the regbank which means the UVM testbench drives an input signal which should also be flagged.

By the way we use Cadence irun(64): 14.20-s002

 

I'm not an expert in SystemVerilog/UVM verification so I'm grateful for any help to understand it for the RTL coder within me is just  skeptic about how this is hooked up and that it will work for any other vendor than Cadence

 

Thanks

Mikael

Link to comment
Share on other sites

Some tools ignore modports when using them in virtual interfaces. Also, some tools might not implement any checks for multiple drivers if one of those drivers is procedural code that's doing it's thing through a virtual interface. This is because this would be a run time check and it would be too expensive in terms of performance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...