BankedIndexPool class

Composes independent index-allocation banks into one global identity pool.

The parent drives one allocate bit per bank, one release bit with a global index per release lane, and restore with a complete ownership bitmap. Global indices are mapped onto banks and bank-local rows through layout.

Each bank owns one allocation lane, so a lane is a bank identity rather than an age or a priority. Lane n offers allocationIndices[n], an index owned by bank n, while allocationValid[n] is high, and allocate[n] takes that index only while the offer is valid. An offer is irrevocable: one that is not taken on an edge is retained, with the same index, until it is taken. A lane has no offer once its own bank is exhausted, whatever the other banks hold. No offer depends on any allocate bit.

release[m] returns releaseIndices[m] and is taken only while canRelease[m] is high. An index outside capacity can always be taken; it is reported in invalidReleases and dropped. Otherwise canRelease[m] is the readiness of lane m of the bank that owns the index, so it depends combinationally on releaseIndices[m]. Every release lane has its own lane on every bank: several releases may enter one bank on one edge without arbitration. A bank applies them from lowest to highest lane, so a later duplicate, like a release of an index that is not allocated, is reported in doubleReleases and otherwise ignored.

quiesce is passed to every bank, and quiesced is high once every bank is quiesced. restore is taken only while canRestore is high, which requires every bank to be ready to restore; it then gives each bank its own rows of restoreMask on one edge, so the banks never hold parts of two different snapshots.

The banks are internal ready/valid allocators, and the rest of the timing is theirs. The default bank is a flat ReadyValidMultiIndexPool, with which canRelease is always high, an index released on an edge is a candidate for a fresh offer of its bank in that same cycle and stays allocated when it is taken on that edge, and canRestore requires quiesced and no offered in-range release. No allocation or release can then be taken on the same edge as a restore, except an out-of-range release, which changes no state. A bankImplementation substitutes another allocator, which may also lower canRelease.

Synchronous reset returns every bank to its share of the initially available indices and abandons every retained offer. ReadyValidBankedIndexPool attaches this core to ready/valid boundaries.

Inheritance
Available extensions

Constructors

BankedIndexPool({required Logic clk, required Logic reset, required Logic quiesce, required List<Logic> allocate, required List<Logic> release, required List<Logic> releaseIndices, required Logic restore, required Logic restoreMask, required int capacity, List<int>? initiallyAvailableIndices, MemoryBankingPolicy bankingPolicy = MemoryBankingPolicy.interleaved, IndexAllocationGenerator allocationGenerator = lowestFreeIndexAllocationGenerator, String allocationPolicyName = 'lowestFree', RestorableMultiIndexAllocatorFunctor? bankImplementation, String name = 'banked_index_pool'})
Creates a banked global index pool driven by explicit actions.

Properties

allocatedCount → Logic
Number of currently allocated indices.
no setter
allocatedMask → Logic
One bit per currently allocated index.
no setter
allocatedMasksAfterAllocationPrefixes ↔ List<Logic>
Ownership after releases and each taken allocation-lane prefix.
latefinal
allocationIndices ↔ List<Logic>
The global index offered by each allocation lane, meaningful while that lane's allocationValid is high.
latefinal
allocationLaneCount → int
Number of allocation lanes, which is the number of banks.
final
allocationPolicyName → String
Stable identity of each bank's allocation policy.
final
allocationValid ↔ List<Logic>
One bit per allocation lane, high while that lane offers an index.
latefinal
availableCount → Logic
Number of indices not yet taken from an allocation lane.
no setter
bankAvailableCounts ↔ List<Logic>
Free-entry count reported independently by each bank.
latefinal
bankExhausted → Logic
One exhausted indication per bank.
no setter
banks ↔ List<RestorableMultiIndexAllocator>
One independently allocatable ownership bank per allocation lane.
latefinal
canRelease ↔ List<Logic>
One bit per release lane, high when that lane's release would be taken.
latefinal
canRestore → Logic
High when restore would replace the ownership bitmap of every bank.
no setter
capacity → int
Number of independently managed indices.
final
definitionName → String
The definition name of this Module used when instantiating instances in generated code.
no setterinherited
doubleReleases → Logic
One bit per release of an index already available.
no setter
exhausted → Logic
High when every index is allocated.
no setter
hasBuilt → bool
Indicates whether this Module has had the build method called on it.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
hierarchicalName → String
Returns the hierarchical name of this Module with the parent hierarchy included, separated by .s, e.g. top.mid.leaf. Because it depends on hierarchy, this is only valid after build has been called.
no setterinherited
indexWidth → int
Width required to identify every managed index.
final
inOuts → Map<String, Logic>
A map from inOut port names to this Module to corresponding Logic signals.
no setterinherited
inputs → Map<String, Logic>
A map from input port names to this Module to corresponding Logic signals.
no setterinherited
internalSignals → Iterable<Logic>
An Iterable of all Logics contained within this Module which are not an input or output port of this Module.
no setterinherited
invalidAllocationSelections → Logic
One bit per malformed fresh allocation-policy selection.
no setter
invalidReleases → Logic
One bit per taken release outside the configured domain.
no setter
layout → BankedMemoryLayout
Flat index to bank and local-row geometry.
final
name → String
The name of this Module.
finalinherited
outputs → Map<String, Logic>
A map from output port names to this Module to corresponding Logic signals.
no setterinherited
parent → Module?
The parent Module of this Module.
no setterinherited
quiesced → Logic
High when every bank is quiesced.
no setter
releaseLaneCount → int
Number of ordered release lanes.
final
reserveDefinitionName → bool
If true, guarantees definitionName is maintained by a Synthesizer, or else it will fail.
finalinherited
reserveName → bool
If true, guarantees uniqueInstanceName matches name or else the build will fail.
finalinherited
retainedAllocationLanes → Logic
One bit per allocation lane retaining a stalled offer.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
signals → Iterable<Logic>
An Iterable of all Logics contained within this Module, including inputs, outputs, and internal signals of this Module.
no setterinherited
structuredInterfacePortBindings → List<StructuredInterfacePortBinding>
The experimental structured-interface bindings registered on this module.
no setterinherited
subModules → Iterable<Module>
An Iterable of all Modules contained within this Module.
no setterinherited
uniqueInstanceName → String
If this module has a parent, after build this will be a guaranteed unique name within its scope.
no setterinherited

Methods

addInOut(String name, Logic source, {int width = 1}) → LogicNet
Registers a signal as an inOut to this Module and returns an inOut port that can be consumed inside this Module.
inherited
addInOutArray(String name, Logic source, {List<int> dimensions = const [1], int elementWidth = 1, int numUnpackedDimensions = 0}) → LogicArray
Registers and returns an inOut LogicArray port to this Module with the specified dimensions, elementWidth, and numUnpackedDimensions named name.
inherited
addInput(String name, Logic source, {int width = 1}) → Logic
Registers a signal as an input to this Module and returns an input port that can be consumed.
inherited
addInputArray(String name, Logic source, {List<int> dimensions = const [1], int elementWidth = 1, int numUnpackedDimensions = 0}) → LogicArray
Registers and returns an input LogicArray port to this Module with the specified dimensions, elementWidth, and numUnpackedDimensions named name.
inherited
addInterface<InterfaceType extends Interface<TagType>, TagType extends Enum>(InterfaceType source, {Iterable<TagType>? inputTags, Iterable<TagType>? outputTags, Iterable<TagType>? inOutTags, String uniquify(String original)?}) → InterfaceType

Available on Module, provided by the RohdHclModuleInterfacePorts extension

Clones source, registers its selected ports on this module, and returns the clone for use by the module implementation.
addInterfaceFrom<InterfaceType extends Interface<TagType>, TagType extends Enum>(InterfaceType target, Interface<TagType> source, {Iterable<TagType>? inputTags, Iterable<TagType>? outputTags, Iterable<TagType>? inOutTags, String uniquify(String original)?}) → InterfaceType
Registers a deliberately constructed local target against source and returns target.
inherited
addInterfacePorts<InterfaceType extends Interface<TagType>, TagType extends Enum>(InterfaceType source, {Iterable<TagType>? inputTags, Iterable<TagType>? outputTags, Iterable<TagType>? inOutTags, String uniquify(String original)?}) → InterfaceType
Registers source on this Module and returns its internal clone.
inherited
addOutput(String name, {int width = 1}) → Logic
Registers an output to this Module and returns an output port that can be driven by this Module or consumed outside of it.
inherited
addOutputArray(String name, {List<int> dimensions = const [1], int elementWidth = 1, int numUnpackedDimensions = 0}) → LogicArray
Registers and returns an output LogicArray port to this Module with the specified dimensions, elementWidth, and numUnpackedDimensions named name.
inherited
addPairConsumerFrom<TargetInterfaceType extends PairInterface, SourceInterfaceType extends PairInterface>(TargetInterfaceType target, PairConsumer<SourceInterfaceType> source, {String uniquify(String original)?}) → TargetInterfaceType
Registers target against a consumer source endpoint and returns it.
inherited
addPairConsumerPorts<InterfaceType extends PairInterface>(PairConsumer<InterfaceType> source, {String uniquify(String original)?}) → InterfaceType
Registers a consumer source endpoint and returns its internal clone.
inherited
addPairInterface<InterfaceType extends PairInterface>(InterfaceType source, PairRole role, {String uniquify(String original)?}) → InterfaceType

Available on Module, provided by the RohdHclModuleInterfacePorts extension

Clones source, registers it for the selected role, and returns the clone for use by the module implementation.
addPairInterfaceFrom<InterfaceType extends PairInterface>(InterfaceType target, PairInterface source, PairRole role, {String uniquify(String original)?}) → InterfaceType

Available on Module, provided by the RohdHclModuleInterfacePorts extension

Registers an already-constructed target against source for cases where a module intentionally changes the concrete pair-interface type.
addPairInterfaceFrom<InterfaceType extends PairInterface>(InterfaceType target, PairInterface source, PairRole role, {String uniquify(String original)?}) → InterfaceType
Registers a deliberately retyped pair target against source for role and returns target.
inherited
addPairInterfacePorts<InterfaceType extends PairInterface>(InterfaceType source, PairRole role, {String uniquify(String original)?}) → InterfaceType
Registers source for role and returns its internal clone.
inherited
addPairProviderFrom<TargetInterfaceType extends PairInterface, SourceInterfaceType extends PairInterface>(TargetInterfaceType target, PairProvider<SourceInterfaceType> source, {String uniquify(String original)?}) → TargetInterfaceType
Registers target against a provider source endpoint and returns it.
inherited
addPairProviderPorts<InterfaceType extends PairInterface>(PairProvider<InterfaceType> source, {String uniquify(String original)?}) → InterfaceType
Registers a provider source endpoint and returns its internal clone.
inherited
addStructuredInterface<InterfaceType extends Interface<TagType>, TagType extends Enum>(InterfaceType source, {Iterable<TagType>? inputTags, Iterable<TagType>? outputTags, Iterable<TagType>? inOutTags, String uniquify(String original)?, String? name}) → InterfaceType
Registers source on this Module and returns its internal clone.
inherited
addStructuredPairInterface<InterfaceType extends PairInterface>(InterfaceType source, PairRole role, {String uniquify(String original)?, String? name}) → InterfaceType
Registers source for role and returns its internal clone.
inherited
addTypedInOut<LogicType extends Logic>(String name, LogicType source) → LogicType
Registers a signal as an inOut to this Module and returns an inOut port that can be consumed inside this Module. The type of the port will be LogicType and constructed via Logic.clone, so it is required that the source implements clone functionality that matches the type and properly updates the Logic.name as well. A declared payload must retain its runtime type and recursive shape, including any PayloadShapeMetadata.
inherited
addTypedInput<LogicType extends Logic>(String name, LogicType source, {bool preserveStructuredConstants = true}) → LogicType
Registers a signal as an input to this Module and returns an input port that can be consumed. The type of the port will be LogicType and constructed via Logic.clone, so it is required that the source implements clone functionality that matches the type and properly updates the Logic.name as well. A declared payload must retain its runtime type and recursive shape, including any PayloadShapeMetadata.
inherited
addTypedOutput<LogicType extends Logic>(String name, LogicType logicGenerator({String name}), {LogicType? schema}) → LogicType
Registers an output to this Module and returns an output port that can be driven by this Module or consumed outside of it. The type of the port will be LogicType and constructed via logicGenerator, which must properly update the name of the generated LogicType as well.
inherited
build() → Future<void>
Builds the Module and all subModules within it.
inherited
dumpSystemVerilog() → String

Available on Module, provided by the RohdModuleCompatibility extension

Generates in-memory SystemVerilog for this module.
dumpSystemVerilog({SystemVerilogSynthesizerConfiguration configuration = const SystemVerilogSynthesizerConfiguration()}) → String
Generates synthesized SystemVerilog for this Module.
inherited
dumpWaves({String outputPath = 'waves.vcd'}) → WaveformService

Available on Module, provided by the RohdModuleCompatibility extension

Attaches VCD waveform dumping to this module.
dumpWaves({String outputPath = 'waves.vcd'}) → WaveformService
Attaches waveform dumping for this Module to a VCD at outputPath.
inherited
generateNetlist({NetlistSynthesizerConfiguration configuration = const NetlistSynthesizerConfiguration()}) → String

Available on Module, provided by the RohdModuleCompatibility extension

Generates the complete netlist JSON for this module.
hierarchy() → Iterable<Module>
Returns an Iterable of Modules representing the hierarchical path to this Module.
inherited
hierarchyString([int indent = 0]) → String
Returns a pretty-print String of the heirarchy of all Modules within this Module.
inherited
inOut(String name) → Logic
Accesses the Logic associated with this Modules inOut port named name.
inherited
inOutSource(String name) → Logic
The original source provided to the creation of the inOut port name via addInOut or addInOutArray.
inherited
input(String name) → Logic
Accesses the Logic associated with this Modules input port named name.
inherited
inputSource(String name) → Logic
The original source provided to the creation of the input port name via addInput or addInputArray.
inherited
isInOut(Logic signal) → bool
Returns true iff signal is the same Logic as the inOut port of this Module with the same name.
inherited
isInput(Logic signal) → bool
Returns true iff signal is the same Logic as the input port of this Module with the same name.
inherited
isOutput(Logic signal) → bool
Returns true iff signal is the same Logic as the output port of this Module with the same name.
inherited
isPort(Logic signal) → bool
Returns true iff signal is the same Logic as an input, output, or inOut port of this Module with the same name.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
output(String name) → Logic
Accesses the Logic associated with this Modules output port named name.
inherited
toString() → String
A string representation of this object.
inherited
tryInOut(String name) → Logic?
Provides the inOut named name if it exists, otherwise null.
inherited
tryInput(String name) → Logic?
Provides the input named name if it exists, otherwise null.
inherited
tryOutput(String name) → Logic?
Provides the output named name if it exists, otherwise null.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited