User guide

2-36
Modeling Your Design
The designer actually meant for a code of Z to be returned, input
tristated. To achieve this code, the input A needs to be assigned a
value of z. This is achieved by removing the comment from the line,
// assign A = 1'bz;, in the above code. Now when the code is
executed, VCS is able to identify that the wire A going into DUT_1 is
being driven to a z. With the wire driven from the outside and not the
inside, $lsi_dumpports returns a code of Z.
Code Values at Time 0
Another issue can occur at time 0, before values have been assigned
to ports as you intended. As a result, $lsi_dumpports makes an
evaluation for drivers when all of the users intended assignments
haven't been made. To correct this situation, you need to advance
simulation time just enough to have your assignments take place.
This can be accomplished by adding a #1 before $lsi_dumpports
as follows:
initial
begin
#1 $lsi_dumpports(instance,"dump.out");
end
Cross Module Forces and No Instance Instantiation
In the following example there are two problems.
module test;
initial
begin
force top.u1.a = 1'b0;
$lsi_dumpports(top.u1,"dump.out");
end
endmodule