In reply to Verif Engg:
If I have a port on the DUT that is ‘inout’ how do I debug the activity on this port? How do I tell which component is driving which value?
Another approach that is tool independent is to use the $onehot0() method.
Here, you write an assertion (concurrent or immediate) that tests that all tri-state drives are one hot or are all in the OFF state. Below is an example:
import uvm_pkg::*; `include "uvm_macros.svh"
module top;
logic clk=0, s1, s2, b, c;
wire w1, w2;
assign w1 = s1 ? b : 'Z;
assign w2 = s2 ? c : 'Z;
initial forever #10 clk=!clk;
initial begin
repeat(200) begin
@(posedge clk); #2;
a_1hot: assert ($onehot0( {s1, s2} )); // <-- THE DEBUG Assertion
if (!randomize(s1, s2, b, c) with
{ s1 dist {1'b1:=1, 1'b0:=4};
s2 dist {1'b1:=1, 1'b0:=3};
b dist {1'b1:=1, 1'b0:=2};
c dist {1'b1:=1, 1'b0:=2};
}) `uvm_error("MYERR", "This is a randomize error")
end
$stop;
end
endmodule
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact Home - My cvcblr
- SVA Handbook 4th Edition, 2016 ISBN 978-1518681448
- A Pragmatic Approach to VMM Adoption 2006 ISBN 0-9705394-9-5
- Using PSL/SUGAR for Formal and Dynamic Verification 2nd Edition, 2004, ISBN 0-9705394-6-0
- Real Chip Design and Verification Using Verilog and VHDL, 2002 isbn 978-1539769712
- Component Design by Example ", 2001 ISBN 0-9705394-0-1
- VHDL Coding Styles and Methodologies, 2nd Edition, 1999 ISBN 0-7923-8474-1
- VHDL Answers to Frequently Asked Questions, 2nd Edition ISBN 0-7923-8115