MemoryStorage class abstract
A storage for memory models.
- Implementers
Constructors
- MemoryStorage({required int addrWidth, required int dataWidth, void onInvalidWrite()? = _defaultOnInvalidWrite, LogicValue onInvalidRead(LogicValue addr, int dataWidth)?, LogicValue alignAddress(LogicValue addr)?})
- Constrcuts a MemoryStorage with specified addrWidth and dataWidth.
Properties
- addrWidth → int
-
The width of addresses.
final
- alignAddress → LogicValue Function(LogicValue addr)
-
A function to align addresses when used for transactions.
final
- dataWidth → int
-
The width of data.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Returns true if there is no data stored in this memory.
no setter
- onInvalidRead → LogicValue Function(LogicValue addr, int dataWidth)
-
A function called if a read is made to an address that has no data.
final
- onInvalidWrite → void Function()
-
A function called if an invalid write is made when not isEmpty.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getData(
LogicValue addr) → LogicValue? -
Returns the data at
addr
, ornull
if it is not present. -
invalidWrite(
) → void - Triggers behavior associated with an invalid write, including calling onInvalidWrite and resetting all of memory.
-
loadMemHex(
String hexMemContents) → void - Reads a verilog-compliant hex file and preloads memory with it.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readData(
LogicValue addr) → LogicValue - Aligns the address with alignAddress, then returns either the getData result in storage or else onInvalidRead's result.
-
reset(
) → void - Resets all memory to initial state.
-
setData(
LogicValue addr, LogicValue data) → void -
Loads
data
intoaddr
directly into storage. -
toString(
) → String -
A string representation of this object.
inherited
-
writeData(
LogicValue addr, LogicValue data) → void - Performs some validation on a write, aligns the address with alignAddress, and then calls setData.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited