Term Class
Term Overview
In najaeda, a najaeda.netlist.Term (also referred to as a Port in Verilog terminology)
can represent the following scenarios:
Single Bit Scalar Terminal: A terminal representing a single scalar signal. See
najaeda.netlist.Term.is_scalar().Full Bus Terminal: A terminal representing an entire bus. See
najaeda.netlist.Term.is_bus().Single Bus Bit Terminal: A terminal representing a single bit of a bus. See
najaeda.netlist.Term.is_bus_bit().
Term Attributes
- class najaeda.netlist.Term(path, term)[source]
Bases:
object- class Direction(new_class_name, /, names, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
EnumEnum for the direction of a term.
- bit: int | None
- connect_lower_net(net: Net)[source]
Connect this term to the given lower Net.
- Parameters:
net (Net) – the lower Net to connect to.
- connect_upper_net(net: Net)[source]
Connect this term to the given upper Net.
- Parameters:
net (Net) – the upper Net to connect to.
- count_attributes() int[source]
Count the attributes of this Term.
- Returns:
the number of attributes of this Term.
- Return type:
int
- get_attributes() Iterator[Attribute][source]
Iterate over the attributes of this Term.
- Returns:
the attributes of this Term.
- Return type:
Iterator[Attribute]
- get_bit(index: int)[source]
- Parameters:
index (int) – the index of the bit to get.
- Returns:
the Term bit at the given index or None if it does not exist.
- Return type:
Term or None
- get_bit_number()[source]
- Returns:
the bit index of the term if it is a bit.
- Return type:
int or None
- get_bits()[source]
- Returns:
an iterator over the bits of the term. If the term is scalar, it will return an iterator over itself.
- Return type:
Iterator[Term]
Get all input terms that are related to the given clock term.
- Parameters:
clock_term – the clock term to check for related inputs.
- Returns:
a list of input terms that are related to the clock term.
- Return type:
List[Term]
Get all output terms that are related to the given clock term.
- Parameters:
clock_term – the clock term to check for related outputs.
- Returns:
a list of output terms that are related to the clock term.
- Return type:
List[Term]
- get_combinatorial_inputs()[source]
Get all combinatorial input terms of this instance.
- Returns:
a list of combinatorial input terms.
- Return type:
List[Term]
- get_combinatorial_outputs()[source]
Get all combinatorial output terms of this instance.
- Returns:
a list of combinatorial output terms.
- Return type:
List[Term]
- get_equipotential() Equipotential[source]
- Returns:
the Equipotential of this Term.
- Return type:
- get_lsb() int[source]
- Returns:
the least significant bit of the term if it is a bus.
- Return type:
int or None
- get_msb() int[source]
- Returns:
the most significant bit of the term if it is a bus.
- Return type:
int or None