LogicStructure class

Collects a group of Logic signals into one entity which can be manipulated in a similar way as an individual Logic.

Implemented types
Implementers
Available extensions

Constructors

LogicStructure(Iterable<Logic> elements, {String? name})
Creates a new LogicStructure with elements as elements.

Properties

arrayIndex → int?
The index within the immediate parent array, if there is one.
no setteroverride
changed → Stream<LogicValueChanged>
A Stream of LogicValueChanged events which triggers at most once per Simulator tick, iff the value of the Logic has changed.
latefinal
dstConnections → Iterable<Logic>
An Iterable of all Logics that are being directly driven by this.
no setteroverride
elements → List<Logic>
All elements of this structure.
latefinal
glitch → SynchronousEmitter<LogicValueChanged>
A stream of LogicValueChanged events for every time the signal transitions at any time during a Simulator tick.
latefinal
hasConsts → bool
Indicates whether this structure contains a Const at any depth.
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasNets → bool
Indicates whether this structure or any of its elements isNet.
no setter
isArrayMember → bool
Whether the immediate parentStructure is a BaseLogicArray.
no setteroverride
isEmpty → bool
Whether this signal has no bits.
no setteroverride
isInOut → bool
Returns true iff this signal is an inOut of its parent Module.
latefinal
isInput → bool
Returns true iff this signal is an input of its parent Module.
latefinal
isNet → bool
Indicates whether this signal behaves like a LogicNet, allowing multiple drivers.
no setteroverride
isOutput → bool
Returns true iff this signal is an output of its parent Module.
latefinal
isPort → bool
Returns true iff this signal is an input, output, or inOut of its parent Module.
latefinal
leafElements → List<Logic>
A list of all leaf-level elements at the deepest hierarchy of this structure provided in index order.
latefinal
name → String
The name of this signal.
final
naming → Naming
Controls the naming (and renaming) preferences of this signal in generated outputs.
no setteroverride
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 1 to 0.
no setteroverride
nextChanged → Future<LogicValueChanged>
Triggers at most once, the next time that this Logic changes value at the end of a Simulator tick.
no setteroverride
nextNegedge → Future<LogicValueChanged>
Triggers at most once, the next time that this Logic changes value at the end of a Simulator tick from 1 to 0.
no setteroverride
nextPosedge → Future<LogicValueChanged>
Triggers at most once, the next time that this Logic changes value at the end of a Simulator tick from 0 to 1.
no setteroverride
packed → Logic
Packs all elements into one flattened Logic bus.
no setteroverride
parentModule → Module?
The Module that this Logic exists within.
no setteroverride
parentStructure → LogicStructure?
If this is a part of a LogicStructure, the structure which this is a part of. Otherwise, null.
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 0 to 1.
no setteroverride
previousValue → LogicValue?
The value of this signal before the most recent Simulator.tick had completed. It will be null before the first tick after this signal is created.
no setteroverride
reversed → Logic
Returns a version of this Logic with the bit order reversed.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
srcConnection → Logic?
A LogicStructure never has a direct source driving it, only its elements do, so always returns null.
no setteroverride
srcConnections → Iterable<Logic>
All Logics driving this, if any.
no setteroverride
structureName → String
Returns the name relative to the parentStructure-defined hierarchy, if one exists. Otherwise, this is the same as name.
no setteroverride
value → LogicValue
The current active value of this signal.
no setteroverride
width → int
The number of bits in this signal.
latefinal

Methods

abs() → Logic
Calculates the absolute value of a signal, assuming that the number is a two's complement.
override
and() → Logic
Unary AND.
override
assignSubset(List<Logic> updatedSubset, {int start = 0}) → void
Performs an assignment operation on a portion this signal to be driven by updatedSubset. Each index of updatedSubset will be assigned to drive the corresponding index, plus start, of this signal.
override
clone({String? name}) → LogicStructure
Creates a new LogicStructure with the same structure as this and cloned elements, optionally with the provided name.
override
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
Decrements each element of elements using Logic.decr.
override
divAssign(dynamic val, {Logic s(Logic)?}) → Conditional
Divide-assigns each element of elements using Logic.divAssign.
override
eq(dynamic other) → Logic
Logical equality.
override
getRange(int startIndex, [int? endIndex]) → Logic
Returns a subset Logic. It is inclusive of startIndex, exclusive of endIndex.
override
gets(Logic other) → void
Connects this Logic directly to be driven by other.
override
gt(dynamic other) → Logic
Greater-than.
override
gte(dynamic other) → Logic
Greater-than-or-equal-to.
override
incr({Logic s(Logic)?, dynamic val = 1}) → Conditional
Increments each element of elements using Logic.incr.
override
inject(dynamic val, {bool fill = false}) → void
Injects a value onto this signal in the current Simulator tick.
override
isIn(List list) → Logic
Returns 1 (of width=1) if the Logic calling this function is in list. Else 0 (of width=1) if not present.
override
lt(dynamic other) → Logic
Less-than.
override
lte(dynamic other) → Logic
Less-than-or-equal-to.
override
makeUnassignable({String? reason}) → void
Makes it so that this signal cannot be assigned by any full (<=) or conditional (<) assignment.
override
mulAssign(dynamic val, {Logic s(Logic)?}) → Conditional
Multiply-assigns each element of elements using Logic.mulAssign.
override
named(String name, {Naming? naming}) → LogicStructure
Makes a clone, optionally with the specified name, then assigns it to be driven by this.
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
Logical inequality.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
or() → Logic
Unary OR.
override
pad({required int atLeast, bool lsbs = true, bool fill = false}) → Logic
Returns a Logic that is at least atLeast bits wide by inserting the minimum number of bits, each equal to fill, at the least significant end (lsbs true) or the most significant end (lsbs false).
override
pow(dynamic exponent) → Logic
Power operation
override
put(dynamic val, {bool fill = false}) → void
Puts a value val onto this signal, which may or may not be picked up for changed in this Simulator tick.
override
replicate(int multiplier) → Logic
Returns a replicated signal using ReplicationOp with new width = this.width * multiplier
override
selectFrom<LogicType extends Logic>(List<LogicType> busList, {dynamic defaultValue, LogicType outputGenerator({String? name})?, String name = 'selectFrom'}) → LogicType
Performs a Logic index based selection on busList.
override
signExtend(int newWidth) → Logic
Returns a new Logic width width newWidth where 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.
override
slice(int endIndex, int startIndex) → Logic
Accesses a subset of this signal from startIndex to endIndex, both inclusive.
override
split(List<int> widths) → List<Logic>
Splits this signal into LSB-first chunks with the provided widths.
override
toString() → String
A string representation of this object.
override
withSet(int startIndex, Logic update) → Logic
Returns a copy of this Logic with the bits starting from startIndex up until startIndex + update.width set to update instead of their original value.
override
xor() → Logic
Unary XOR.
override
zeroExtend(int newWidth) → Logic
Returns a Logic with width newWidth where new bits added are zeros as the most significant bits.
override

Operators

operator %(dynamic other) → Logic
Modulo operation.
override
operator &(Logic other) → Logic
Logical bitwise AND.
override
operator *(dynamic other) → Logic
Multiplication.
override
operator +(dynamic other) → Logic
Addition.
override
operator -(dynamic other) → Logic
Subtraction.
override
operator /(dynamic other) → Logic
Division.
override
operator <(dynamic other) → Conditional
Conditional assignment operator.
override
operator <<(dynamic other) → Logic
Logical left-shift.
override
operator <=(Logic other) → void
Connects this Logic directly to another Logic.
override
operator ==(Object other) → bool
The equality operator.
inherited
operator >(dynamic other) → Logic
Greater-than.
override
operator >=(dynamic other) → Logic
Greater-than-or-equal-to.
override
operator >>(dynamic other) → Logic
Arithmetic right-shift.
override
operator >>>(dynamic other) → Logic
Logical right-shift.
override
operator [](dynamic index) → Logic
Accesses the indexth bit of this signal.
override
operator ^(Logic other) → Logic
Logical bitwise XOR.
override
operator |(Logic other) → Logic
Logical bitwise OR.
override
operator ~() → Logic
Logical bitwise NOT.
override