Is there a different way to bind an interface to a module that uses output logic ports? Bind works just fine if the ports on the dut were declared as output wire, but not as output logic. I can’t change the DUT so I’d be interested if anyone has a different connection bind method that works in this case.
In reply to tonynguyen:
You need to explain what you intend to do with the bind interface. If you are only monitoring, then the interface needs to declare its ports as inputs. But if the interface is driving, then we need to know how the DUT is driving the same variables you want to drive from the interface. And what would be the protocol for determining who gets to drive. This is all built-in to wires. But for variables, there are a number of options, like using forces, to control who drives.
I realize I didn’t include the problem. I’m trying to bind an inout wire port of the interface to this output logic on the module. Obviously the LRM doesn’t allow this so I’m looking for another solution. I’ve read your paper on testbench DUT connection and am trying to apply much of that methodology to my problem but the example DUT has output wires.
The thought is to have both monitor and driver modports/clocking blocks in the same interface so it can be reused by various people.
In reply to dave_59:
So I came across this paper referencing port coercion and I tried this to no avail. Maybe my understanding is incomplete, but I thought all that was necessary was to declare the interface ports as input wires. I do get a simulator warning but upon checking waves, nothing is driven.
In reply to tonynguyen:
Port coercion is a concept that works when you have a network of drivers and receivers. The port becomes irrelevant—it’s just a signal name change. You can always add more drivers to the network because wires have a built-in resolution function. But you can’t do that with variables. They can only have a single driver, or procedurally assigned with many assignments.
So you need to know what is driving the DUT variable output you want to override. If it procedurally assigned, you can add more procedural assignments. But if it’s continuously assigned, a force statement is the only construct that can override it.
You can use a ref variable port in your bind interface to connect to another variable.