netlist_carpentry.core.enums.direction
¶
Enum for the direction of a port in a digital circuit (input, output, inout, unknown).
Classes:
-
Direction–Enum for the direction of a port (or a directed element in general) in a digital circuit.
Direction
¶
Bases: Enum
Enum for the direction of a port (or a directed element in general) in a digital circuit.
A port is a connection point in a circuit that can be connected to another element within the circuit. The direction of a port refers to the direction of data flow between the two connected elements.
The direction of a port can be either input, output, or both input and output (inout).
Methods:
-
get–Retrieves a Direction enum member by its string value.
Attributes:
-
IN–This port direction refers to an input port.
-
OUT–This port direction refers to an output port.
-
IN_OUT–This port direction refers to a port that can be used as both an input and an output port.
-
UNKNOWN–This port direction refers to a port that has an unknown direction or unset.
-
is_input(bool) –Returns True if this port direction is input or inout.
-
is_output(bool) –Returns True if this port direction is output or inout.
-
is_defined(bool) –Returns True if this port direction is input, output or inout; and False if it is unknown or no direction is specified.
OUT
class-attribute
instance-attribute
¶
This port direction refers to an output port.
IN_OUT
class-attribute
instance-attribute
¶
This port direction refers to a port that can be used as both an input and an output port.
UNKNOWN
class-attribute
instance-attribute
¶
This port direction refers to a port that has an unknown direction or unset.
is_defined
property
¶
is_defined: bool
Returns True if this port direction is input, output or inout; and False if it is unknown or no direction is specified.
get
classmethod
¶
Retrieves a Direction enum member by its string value.
If the provided string does not match any existing Direction values, it returns the UNKNOWN Direction instead of raising an exception.
Direction will returned correctly, if the string is "in" or "input", and is case-insensitive, i.e. "in" and "IN" will both return Direction.IN. Analogously for Direction.OUT.
Parameters:
Returns:
-
Direction(Direction) –The corresponding Direction enum member, or UNKNOWN if no match is found.