0
\$\begingroup\$

Say I have this module:

module Test(
 input logic a,
 output logic b
);
 assign output = a ? 1'bZ : 1'b1;
endmodule;

Currently, when testing the module with a C++ testbench, the output of the simulation shows the High-Z state as 0 (I assume because Verilator models logic lines as integers).

Is there any capability to test whether a 0 is a numerical 0 or a High-Z?

toolic
10.8k11 gold badges31 silver badges35 bronze badges
asked Apr 26, 2019 at 14:05
\$\endgroup\$
2
  • \$\begingroup\$ Is case equality (===) something that can help with your problem? \$\endgroup\$ Commented Apr 27, 2019 at 8:12
  • \$\begingroup\$ I think verilator does not support X or Z \$\endgroup\$ Commented Jun 16, 2024 at 8:37

1 Answer 1

1
\$\begingroup\$

I don't think so. I believe you can write the expression b === 'bz within your SystemVerilog code, and that returns true (1'b1) within your code when b should have had a z state, but the actual output gets converted to a 0.

answered Apr 27, 2019 at 4:35
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.