Hello,
In my system,
I have a port (which is not connected to the DUT) named LA_EN in the interface of my agent, the related code part in the interface is as follows:
interface example_if();
bit LA_EN;
endinterface: example_if
I use LA_EN as a control bit to drive an inout signal, whenever the agent wants to drive a value into the DUT, I set this bit high, then drive the data and set the bit low again. At the top module of my testbench, I check the LA_EN, if the LA_EN is high, I connect the internally generated data_bus to the DUT, otherwise I drive HZ.
The related code part in the top module is as follows:
wire [16:0] data_bus_buffer;
DUT DUT_0(
.data_bus (data_bus_buffer)
);
assign data_bus_buffer = (top.example_if.LA_EN === 1'b1) ? example_if.data_bus : 16'hZZZZ;
The problem is that when I drive the LA_EN high or low in the driver, it does not really change its value in the waveform.
The related code part in the driver is as follows:
task exmaple_driver::run_phase(uvm_phase phase)
example_seq_item req;
exmaple_vif.LA_EN = 1'b0;
forever begin
seq_item_port.get_nex_item(req);
case(req.example_op)
3'b000: begin ****** end
3'b001: begin ****** end
3'b010: begin ****** end
3'b011: begin ****** end
3'b100: begin ****** end
3'b101: begin ****** end
3'b110: begin ****** end
3'b111: begin
example_vif.LA_EN <= 1'b1;
example_vif.data_bus <= req.data_bus;
example_vif.LA_EN <= 1'b0;
end
endcase
seq_item_port.item_done();
end
endtask
Here I drive the LA_EN port, however the port always stays at low. I if drive the port before the “forever begin end” block, the port perfectly works.
Any idea on the problem?
Thank you…