You are on page 1of 2

5.5.

3 Accessing attributes
Attributes are attached to the nature of a potential or flow.
The attributes for a net or a branch can be accessed by using the hierarchical referencing operator (.)
to the potential or flow for the net or branch.
Example:
module twocap(a, b, n1, n2);
inout a, b, n1, n2;
electrical a, b, n1, n2;
branch (n1, n2) cap;
parameter real c= 1p;
analog begin
I(a,b) <+ c*ddt(V(a,b), a.potential.abstol);
I(cap) <+ c*ddt(V(cap), n1.potential.abstol);
end
endmodule
Here,abstol is tolerance after ddt o/p.

The syntax for referencing access attributes is shown below
nature_attribute_reference ::= // from A.8.9
net_identifier . potential_or_flow . nature_attribute_identifier
potential_or_flow ::= potential | flow

5.5.4 Creating unnamed branches using hierarchical net references
An access function in a module can have one or more hierarchical net references to nets in other
module instances.
In these cases, a new unnamed branch is created in the module containing the access function call.
Example:
module signal_monitor;
parameter refv = 2.3;
electrical a;
analog begin
V(a) <+ refv;
// Creates an unnamed branch in module signal_monitor between
// nets top.drv.a and implicit ground.
$strobe("voltage at top.drv.a = %g volts", V(top.drv.a));
// Creates an unnamed branch in module signal_monitor between
// nets top.drv.a and top.drv.b
$strobe("voltage diff in top.drv = %g volts", V(top.drv.a, top.drv.b));
// Creates an unnamed branch in module signal_monitor between
// local net a and top.drv.a
$strobe("voltage diff from ref in top.drv = %g volts", V(a,top.drv.a));
// References the unnamed branch created in the first $strobe()
// statement
if(V(top.drv.a) > 10.0) $strobe("voltage limit exceeded at top.drv.a");
end
endmodule
Note that even if the instance top.drv already has an unnamed branch between nodes a and ground
and a
and b, the new unnamed branches are created in the module signal_monitor.

You might also like