GfLogic class
A packed hardware signal representing an element of field.
This remains an ordinary Logic signal for synthesis and connectivity, but carries a field descriptor so incompatible fields cannot participate in finite-field operations accidentally.
- Inheritance
- Implemented types
- Available extensions
Constructors
- GfLogic(BinaryExtensionField field, {String? name, Naming? naming})
-
Creates an undriven signal representing an element of
field. - GfLogic.constant(GfValue value, {String? name})
-
Returns a constant field element as a typed signal.
factory
- GfLogic.of(Logic signal, {required BinaryExtensionField field, String? name})
-
Views
signalas an element offield.
Properties
- arrayIndex → int?
-
The index within the immediate parent array, if there is one.
no setterinherited
-
changed
→ Stream<
LogicValueChanged> -
A Stream of LogicValueChanged events which triggers at most once
per Simulator tick, iff the value of the Logic has changed.
no setterinherited
-
dstConnections
→ Iterable<
Logic> -
An Iterable of all Logics that are being directly driven by
this.latefinalinherited -
elements
→ List<
Logic> -
Provides a list of logical elements within this signal.
latefinalinherited
- field → BinaryExtensionField
-
The field represented by this signal.
final
- gfValue → GfValue
-
The current two-state semantic value.
no setter
-
glitch
→ SynchronousEmitter<
LogicValueChanged> -
A stream of LogicValueChanged events for every time the signal
transitions at any time during a Simulator tick.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isArrayMember → bool
-
Whether the immediate parentStructure is a
BaseLogicArray.no setterinherited - isEmpty → bool
-
Whether this signal has no bits.
no setterinherited
- isInOut → bool
-
Returns true iff this signal is an inOut of its parent Module.
latefinalinherited
- isInput → bool
-
Returns true iff this signal is an input of its parent Module.
latefinalinherited
- isNet → bool
-
Indicates whether this signal behaves like a LogicNet, allowing multiple
drivers.
no setterinherited
- isOutput → bool
-
Returns true iff this signal is an output of its parent Module.
latefinalinherited
- isPort → bool
-
Returns true iff this signal is an input, output, or inOut of its parent
Module.
latefinalinherited
- name → String
-
The name of this signal.
finalinherited
- naming → Naming
-
Controls the naming (and renaming) preferences of this signal in generated
outputs.
finalinherited
-
negedge
→ Stream<
LogicValueChanged> -
A Stream of LogicValueChanged events which triggers at most once
per Simulator tick, iff the value of the Logic has changed
from
1to0.no setterinherited -
nextChanged
→ Future<
LogicValueChanged> -
Triggers at most once, the next time that this Logic changes
value at the end of a Simulator tick.
no setterinherited
-
nextNegedge
→ Future<
LogicValueChanged> -
Triggers at most once, the next time that this Logic changes
value at the end of a Simulator tick from
1to0.no setterinherited -
nextPosedge
→ Future<
LogicValueChanged> -
Triggers at most once, the next time that this Logic changes
value at the end of a Simulator tick from
0to1.no setterinherited - packed → Logic
-
Returns a simple flattened Logic.
no setterinherited
- parentModule → Module?
-
The Module that this Logic exists within.
no setterinherited
- parentStructure → LogicStructure?
-
If this is a part of a LogicStructure, the structure which this is
a part of. Otherwise,
null.no setterinherited - payloadShapeMetadata → String
-
Stable identifier for this signal's semantic format.
no setteroverride
-
posedge
→ Stream<
LogicValueChanged> -
A Stream of LogicValueChanged events which triggers at most once
per Simulator tick, iff the value of the Logic has changed
from
0to1.no setterinherited - previousValue → LogicValue?
-
The value of this signal before the most recent Simulator.tick had
completed. It will be
nullbefore the first tick after this signal is created.no setterinherited - reversed → Logic
-
Returns a version of this Logic with the bit order reversed.
latefinalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- srcConnection → Logic?
-
The Logic signal that is driving
this, if any.no setterinherited -
srcConnections
→ Iterable<
Logic> -
All Logics driving
this, if any.latefinalinherited - structureName → String
-
Returns the name relative to the parentStructure-defined hierarchy, if
one exists. Otherwise, this is the same as name.
no setterinherited
- value → LogicValue
-
The current active value of this signal.
no setterinherited
- width → int
-
The number of bits in this signal.
no setterinherited
Methods
-
abs(
) → Logic -
Calculates the absolute value of a signal, assuming that the
number is a two's complement.
inherited
-
and(
) → Logic -
Unary AND.
inherited
-
assignSubset(
List< Logic> updatedSubset, {int start = 0}) → void -
Performs an assignment operation on a portion this signal to be driven by
updatedSubset. Each index ofupdatedSubsetwill be assigned to drive the corresponding index, plusstart, of this signal.inherited -
binaryToOneHot(
) → Logic -
Available on Logic, provided by the BinaryToOneHotLogic extension
Encodes this binary index using BinaryToOneHot. -
clone(
{String? name}) → GfLogic -
Creates an undriven signal with this same field descriptor.
override
-
cloneInterfacePort(
{String? name}) → LogicType -
Available on LogicType, provided by the TypedLogicUtilities extension
Clones an interface schema, normalizing a scalar Const widened to Logic to a driveable signal. Structured payloads retain their types and constant fields according to their normal typed clone contracts. -
cloneTyped(
{String? name}) → LogicType -
Available on LogicType, provided by the TypedLogicUtilities extension
Equivalent to Logic.clone, preserving the receiver's static type and any declared payload type and semantic shape. -
decr(
{Logic s(Logic)?, dynamic val = 1}) → Conditional -
Shorthand for a Conditional which decrements this by
val.inherited -
divAssign(
dynamic val, {Logic s(Logic)?}) → Conditional -
Shorthand for a Conditional which increments this by
val.inherited -
eq(
dynamic other) → Logic -
Compares two signals from the same field.
override
-
getRange(
int startIndex, [int? endIndex]) → Logic -
Returns a subset Logic. It is inclusive of
startIndex, exclusive ofendIndex.inherited -
gets(
Logic other) → void -
Connects this Logic directly to be driven by
other.inherited -
gt(
dynamic other) → Logic -
Greater-than.
inherited
-
gte(
dynamic other) → Logic -
Greater-than-or-equal-to.
inherited
-
incr(
{Logic s(Logic)?, dynamic val = 1}) → Conditional -
Shorthand for a Conditional which increments this by
val.inherited -
inject(
dynamic val, {bool fill = false}) → void -
Injects a compatible GfValue in the current simulator tick.
override
-
isIn(
List list) → Logic -
Returns
1(of width=1) if the Logic calling this function is inlist. Else0(of width=1) if not present.inherited -
lt(
dynamic other) → Logic -
Less-than.
inherited
-
lte(
dynamic other) → Logic -
Less-than-or-equal-to.
inherited
-
majority(
) → Logic -
Available on Logic, provided by the LogicMajority extension
Returns one if more than half of the bits are one. -
makeUnassignable(
{String? reason}) → void -
Makes it so that this signal cannot be assigned by any full (
<=) or conditional (<) assignment.inherited -
mulAssign(
dynamic val, {Logic s(Logic)?}) → Conditional -
Shorthand for a Conditional which increments this by
val.inherited -
named(
String name, {Naming? naming}) → GfLogic -
Creates a named signal driven by this signal.
override
-
namedTyped(
String name, {Naming? naming}) → LogicType -
Available on LogicType, provided by the TypedLogicUtilities extension
Creates a named driveable alias while preserving the static result type. -
neq(
dynamic other) → Logic -
Compares two signals from the same field.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
oneHotToBinary(
) → Logic -
Available on Logic, provided by the OneHotToBinaryLogic extension
Decodes this one-hot signal using the default OneHotToBinary codec. -
or(
) → Logic -
Unary OR.
inherited
-
pad(
{required int atLeast, bool lsbs = true, bool fill = false}) → Logic -
Returns a Logic that is at least
atLeastbits wide by inserting the minimum number of bits, each equal tofill, at the least significant end (lsbstrue) or the most significant end (lsbsfalse).inherited -
pow(
dynamic exponent) → Logic -
Field exponentiation requires an explicit hardware architecture.
override
-
put(
dynamic val, {bool fill = false}) → void -
Drives this signal with a compatible GfValue.
override
-
replicate(
int multiplier) → Logic -
Returns a replicated signal using ReplicationOp with new width =
this.width *
multiplierinherited -
rotateLeft(
dynamic rotateAmount, {int? maxAmount}) → Logic -
Available on Logic, provided by the RotateLogic extension
Returns a Logic rotated left byrotateAmount. -
rotateRight(
dynamic rotateAmount, {int? maxAmount}) → Logic -
Available on Logic, provided by the RotateLogic extension
Returns a Logic rotated right byrotateAmount. -
selectFrom<
LogicType extends Logic> (List< LogicType> busList, {dynamic defaultValue, LogicType outputGenerator({String? name})?, String name = 'selectFrom'}) → LogicType -
Performs a Logic
indexbased selection onbusList.inherited -
signExtend(
int newWidth) → Logic -
Returns a new Logic width width
newWidthwhere new bits added are sign bits as the most significant bits. The sign is determined using two's complement, so it takes the most significant bit of the original signal and extends with that.inherited -
slice(
int endIndex, int startIndex) → Logic -
Accesses a subset of this signal from
startIndextoendIndex, both inclusive.inherited -
split(
List< int> widths) → List<Logic> -
Splits this signal into LSB-first chunks with the provided
widths.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
waitCycles(
int numCycles, {Edge edge = Edge.pos}) → Future< void> -
Available on Logic, provided by the LogicWaiter extension
Returns a Future which completes after the specifiednumCycles, where each cycle is defined as the next occurence of the specifiededge. -
withSet(
int startIndex, Logic update) → Logic -
Returns a copy of this Logic with the bits starting from
startIndexup untilstartIndex+update.widthset toupdateinstead of their original value.inherited -
xor(
) → Logic -
Unary XOR.
inherited
-
zeroExtend(
int newWidth) → Logic -
Returns a Logic with width
newWidthwhere new bits added are zeros as the most significant bits.inherited
Operators
-
operator %(
dynamic other) → Logic -
Integer-style modulo is not a finite-field operation.
override
-
operator &(
Logic other) → Logic -
Logical bitwise AND.
inherited
-
operator *(
dynamic other) → GfLogic -
Multiplies
otherusing polynomial-basis combinational logic.override -
operator +(
dynamic other) → GfLogic -
Adds
otherin GF(2^m), implemented as bitwise XOR.override -
operator -(
dynamic other) → GfLogic -
Subtracts
other, which is identical to addition in characteristic two.override -
operator /(
dynamic other) → Logic -
Field division requires a dedicated inverse architecture.
override
-
operator <(
dynamic other) → Conditional -
Conditional assignment operator.
inherited
-
operator <<(
dynamic other) → Logic -
Logical left-shift.
inherited
-
operator <=(
Logic other) → void -
Connects this Logic directly to another Logic.
inherited
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >(
dynamic other) → Logic -
Greater-than.
inherited
-
operator >=(
dynamic other) → Logic -
Greater-than-or-equal-to.
inherited
-
operator >>(
dynamic other) → Logic -
Arithmetic right-shift.
inherited
-
operator >>>(
dynamic other) → Logic -
Logical right-shift.
inherited
-
operator [](
dynamic index) → Logic -
Accesses the
indexth bit of this signal.inherited -
operator ^(
Logic other) → Logic -
Logical bitwise XOR.
inherited
-
operator |(
Logic other) → Logic -
Logical bitwise OR.
inherited
-
operator ~(
) → Logic -
Logical bitwise NOT.
inherited