7.2.1 The Signal class

class Signal( [val=None][, delay=0])
This class is used to construct a new signal and to initialize its value to val. Optionally, a delay can be specified.

A Signal object has the following attributes:

posedge
Attribute that represents the positive edge of a signal, to be used in sensitivity lists.
negedge
Attribute that represents the negative edge of a signal, to be used in sensitivity lists.

next
Read-write attribute that represents the next value of the signal.

val
Read-only attribute that represents the current value of the signal.

This attribute is always available to access the current value; however in many practical case it will not be needed. Whenever there is no ambiguity, the Signal object's current value is used implicitly. In particular, all Python's standard numeric, bit-wise, logical and comparison operators are implemented on a Signal object by delegating to its current value. The exception is augmented assignment. These operators are not implemented as they would break the rule that the current value should be a read-only attribute. In addition, when a Signal object is assigned to the next attribute of another Signal object, its current value is assigned instead.

min
Read-only attribute that is the minimum value (inclusive) of a numeric signal, or None for no minimum.
max
Read-only attribute that is the maximum value (exclusive) of a numeric signal, or None for no maximum.

driven
Writable attribute that can be used to indicate that the signal is supposed to be driven from the MyHDL code, and how it should be declared in Verilog after conversion. The allowed values are 'reg' and 'wire'.

This attribute is useful when the Verilog converter cannot infer automatically whether and how a signal is driven. This occurs when the signal is driven from user-defined Verilog code.

About this document