Data Store Memory — Control Systems/Signal Routing
Control_Systems/Signal_Routing/Data_Store_Memory · 0 input / 0 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text
Description#
The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.
Data Store Memory
Control Systems / Signal Routing
Declares a named data store: a matrix that Data Store Write blocks
write and Data Store Read blocks read, by name, with no wire between them. The
store holds Initial value until a Write replaces it, and keeps what was
last written from one step to the next. Simulink’s Data Store
Memory (BlockType=DataStoreMemory).
Ports
None.
Parameters
- Data store name –
A(default). The name a Read or a Write gives to reach this store. Names are case-sensitive:Dxanddxare two stores. It is a name, never looked up in the variables space. - Initial value –
0(default); a scalar or a matrix, or a variable’s name. What a Read gives before any Write, at the start of every run. - Dimensions –
-1(default) takes the store’s size from Initial value. A size,n(a 1×n row) or[r c], expands a scalar initial value to that size; a matrix initial value must already have it. - Read before write – none (default), warning or error: what a run reports when a Read, in a step, reads the store before any Write has written it in that step – which includes every Read of a store nothing writes.
- Write after write – warning (default), none or error: a Write, in a step, after another Write has already written the store in that step.
- Write after read – none (default), warning or error: a Write, in a step, after a Read has read the store in that step.
- Sampling Time (s) – zero or less inherits the solver’s
rate; a positive value runs the block at that period. The block computes
nothing, so its rate changes no value, and Simulink’s Data Store Memory has
no
SampleTime: it does not cross the bridge.
Each of the three is reported once per run, in Simulink’s words and with its message ID; error stops the run.
Scope
- A store is visible at the level its Memory sits in and in every subsystem below it, never above it or in a sibling. A Read or a Write that finds none stops the run: Data store memory with name 'A' was not found for block …, as Simulink says it.
- A Memory inside a subsystem shadows one of the same name further out, for the blocks at its level and below. Two Memories with one name at the same level stop the run.
Code export
All ten targets: the store is a named global of the exported core
(ds0, ds1, …), held beside the signals and
seeded with the initial value where the target seeds its state; Python, MATLAB,
Java, Rust, C and C++ hold it in doubles, VHDL, Verilog and SystemVerilog in
their Q16.16 fixed point, and PLC Structured Text in LREAL. The
block itself emits no statement. An export of a subsystem whose Reads or Writes
reach a store declared outside it is refused by name, because the core would
have nowhere to hold the store. The three diagnostics are the simulation’s;
an exported core does not report them.
Simulink bridge
Both directions, as simulink/Signal Routing/Data Store Memory.
Data store name goes to DataStoreName, Initial
value to InitialValue, Dimensions to
Dimensions, and the three diagnostics to
ReadBeforeWriteMsg, WriteAfterWriteMsg and
WriteAfterReadMsg, one value for one value. Simulink’s block
has no SampleTime, so none is written. Its data type
(OutDataTypeStr), signal type, storage class and logging settings
do not cross: a store here is double.
Notes
- A store written in one step is read by a Read later in the same step: a Write is ordered before the Reads of its store wherever no data path or loop says otherwise, as Simulink orders them. A data path from a Read to a Write of the same store wins, so Read → +1 → Write counts 0, 1, 2, … with no delay block.
- Simulink’s block
Priority, which reverses that order, has no counterpart here; an import names each block that carries one. - A global store backed by a workspace
Simulink.Signalis not supported.
Code facts#
| Fact | Value |
|---|---|
| registered type | Control_Systems/Signal_Routing/Data_Store_Memory |
| family | Control_Systems/Signal_Routing |
| solver environment class | ICoreBlock_0_Control_Systems_1_Signal_Routing_2_Data_Store_Memory |
| source | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Signal_Routing/Data_Store_Memory/ICoreBlock_0_Control_Systems_1_Signal_Routing_2_Data_Store_Memory.cpp |
| header | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Signal_Routing/Data_Store_Memory/ICoreBlock_0_Control_Systems_1_Signal_Routing_2_Data_Store_Memory.h |
| default size on canvas | 80 × 60 px |
| ports at insert | 0 in, 0 out |
| code generators implemented | Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text |
Ports#
The constructor creates no port explicitly — the port list comes from registerInitialPorts (0 in, 0 out) or from the block's configuration.
Configuration variables#
| Config variable | Default | Simulink parameter |
|---|---|---|
Data store name | A | DataStoreName |
Initial value | 0 | InitialValue |
Dimensions | -1 | Dimensions |
Read before write | none%~%warning%~%error~~none | ReadBeforeWriteMsg |
Write after write | none%~%warning%~%error~~warning | WriteAfterWriteMsg |
Write after read | none%~%warning%~%error~~none | WriteAfterReadMsg |
Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.
Simulink bridge#
| support | Support::Both |
| Simulink path | simulink/Signal Routing/Data Store Memory |
| port-count rule | PortsParam::None |
SampleTime parameter | no — the counterpart defines none; the rate stays on the ICore side |
| ICore config | Simulink parameter | Value translation |
|---|---|---|
Data store name | DataStoreName | passes through |
Initial value | InitialValue | passes through |
Dimensions | Dimensions | passes through |
Read before write | ReadBeforeWriteMsg | none → none, warning → warning, error → error |
Write after write | WriteAfterWriteMsg | none → none, warning → warning, error → error |
Write after read | WriteAfterReadMsg | none → none, warning → warning, error → error |
Caveat (shown to the user): A store here is double: Simulink's OutDataTypeStr, SignalType, storage class and logging settings do not cross. A global store backed by a workspace Simulink.Signal is not supported.
Catalog contract: src/ICoreBlocks/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h
Description vs code#
The checker has a blind spot here — it could not resolve something (a grouped port bullet, a computed config name), which is reported and never counted as a pass. A reader has to settle it:
B0no sample under docs/generated/samples/ — nothing to cross-check (P8.1)
The verdict above is
tools/docs/check_block_descriptions.py(P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.
Sample results#
No sample run is committed for this block. Samples come from the headless harness (DOCS_PLAN.md P8.1) into docs/generated/samples/; until one exists this block's behaviour is witnessed by the parity and export-verification suites, not by a plot here.