Previous: PRS Sizing, Up: PRS Basics


15.1.2 Internal Nodes

A literal may be optionally prefixed with ‘@’ to indicate that it is only an internal node, and is not declared as a normal bool. Internal nodes are useful for specifying more general circuit topologies that share common foot transistors. Internal nodes may appear on the left-hand-side of production rules arbitrarily many times.

     en -> @_en_int-         // defines an internal node
     ~@_en_int & Ld -> _rd-  // uses internal node as foot transistor
     ~@_en_int & Hd -> _md-

Above, _en_int is not declared as a bool, but the first rule that drives it effectively declares it – an implicit declaration. An internal node may only be referenced as the leftmost literal of any conjunctive (and) term. (TODO: position is not yet checked, currently performs straightforward expression substitution.)

The effective production rules are obtained by substituting the internal nodes' associated expressions wherever they are used. With the above example, the effective production rules are:

     en & Ld -> _rd-
     en & Hd -> _md-

Internal nodes are implicitly declared in the scope of the enclosing definition (or top-level) so their names cannot conflict with existing declarations. Likewise, subsequent declarations cannot re-use names of existing internal nodes.

Internal nodes can also be used in arrays, where the dimensions are implied by the indexing. (Warning: node arrays are not supported in ACT.) One can declare arrays of internal nodes in loops, for example:

     (:i:N:
       en & x[i] -> @_en_i[i]-
       ~@_en_i[i] & y[i] -> _z[i]-
     )

Each unique internal node may only be defined once in one direction, pull-up or pull-down. Using an internal node in the wrong sense constitutes an error, e.g.:

     x -> @y-
     @y & z -> w-

is an error because @y is defined as a pull-down only expression, but is being evaluated active-high in the rule for w-. Negations of internal nodes are bound to the referenced node and dictate the sense in which the node is pulled, unlike regular boolean expressions.

The following is an erroroneous attempt to define the same internal node in two directions:

     x -> @y-
     ~x -> @y+

Rules involving internal nodes may only use the plain -> notation.

Since internal nodes just define re-usable subexpressions, production rule attributes are not applicable to them; they are simply ignored.

Status: implemented and tested.