Check Dynamic Upper Bound — Control Systems/Model Verification
Control_Systems/Model_Verification/Check_Dynamic_Upper_Bound · 2 input / 1 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.
Check Dynamic Upper Bound
Control Systems / Model Verification
Verifies that a signal stays strictly below a bound that is itself a signal, and publishes the verdict: y = 1 where the entry passes, y = 0 where it fails. The test is u < max, taken entry by entry, with both operands read from ports at the same step – so the bound may move every sample.
Ports
- max (input 1) – the moving upper bound. The bound comes FIRST, which is Simulink's order and the opposite of what most people guess.
- u (input 2) – the signal under test.
- Output – the verdict y, the SAME size as u: one 1.0/0.0 flag per entry.
Both inputs must be the same size [m,n]; a scalar bound is not broadcast against a wider signal, and a mismatch is reported rather than guessed at.
Parameters
- Enabled – whether a failing sample is REPORTED. It does not
change the output signal: an entry that fails still reads 0 with this off, which
is what Simulink's counterpart does.
- on – a failure is logged once per run, with the block's path and the time it first happened (the default).
- off – the block computes its verdict silently.
- Stop When Assertion Fails – whether a reported failure also ends
the run.
- on – the run stops at the first failing sample and is marked failed (the default).
- off – the run continues and the failure is a warning.
- Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.
There is deliberately no bound parameter and no inclusion flag: the bound arrives on a port, and the comparison is always strict. For a constant bound, or to choose whether the boundary itself passes, use Check Static Upper Bound.
Code export
All ten targets: Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog and PLC Structured Text. Nothing is inlined as a constant – both operands are signals – so the generated body is a bare comparison and the block has no tunable parameters. Only the VERDICT SIGNAL is exported: Enabled and Stop When Assertion Fails have no meaning in a deployed core, which has no simulation to stop.
Simulink bridge
Import and export, mapped to simulink/Model Verification/Check Dynamic
Upper Bound. "Enabled" to enabled – lowercase here, unlike
its Lower Bound neighbour – and "Stop When Assertion Fails"
to stopWhenAssertionFail, both as plain pass-through values, so the
round trip is lossless. The block always sets Simulink's export to
on: ICore's block always has its verdict output, whereas Simulink's
grows one only when that box is ticked. The Simulink counterpart has no
SampleTime parameter, so "Sampling Time (s)" does not cross –
the block runs at the surrounding Simulink rate.
Notes
- Algebraic, with no signal state. The only state is a one-shot latch so that a failing run logs its complaint once rather than once per sample.
- Not linear, and so deliberately carries no state space – model reduction reports it as unmergeable rather than absorbing a comparison.
- The comparison is one-sided: an arbitrarily large NEGATIVE input passes. Pair it with Check Dynamic Lower Bound, or use Check Dynamic Range, to bound both sides.
Code facts#
| Fact | Value |
|---|---|
| registered type | Control_Systems/Model_Verification/Check_Dynamic_Upper_Bound |
| family | Control_Systems/Model_Verification |
| solver environment class | ICoreBlock_0_Control_Systems_1_Model_Verification_2_Check_Dynamic_Upper_Bound |
| source | src/ICoreSDK/ICoreBlockLibrary/Blocks/Control_Systems/Model_Verification/Check_Dynamic_Upper_Bound/ICoreBlock_0_Control_Systems_1_Model_Verification_2_Check_Dynamic_Upper_Bound.cpp |
| header | src/ICoreSDK/ICoreBlockLibrary/Blocks/Control_Systems/Model_Verification/Check_Dynamic_Upper_Bound/ICoreBlock_0_Control_Systems_1_Model_Verification_2_Check_Dynamic_Upper_Bound.h |
| default size on canvas | 80 × 80 px |
| ports at insert | 2 in, 1 out |
| code generators implemented | Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text |
Ports#
| # | Direction | Signal type | Description label |
|---|---|---|---|
| 1 | in | ICoreDouble | max |
| 2 | in | ICoreDouble | u |
| 3 | out | ICoreDouble | — |
Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.
Configuration variables#
| Config variable | Default | Simulink parameter |
|---|---|---|
Enabled | on%~%off~~on | enabled |
Stop When Assertion Fails | on%~%off~~on | stopWhenAssertionFail |
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/Model Verification/Check Dynamic Upper Bound |
| port-count rule | PortsParam::None |
SampleTime parameter | no — the counterpart defines none; the rate stays on the ICore side |
| always set | export = on |
| ICore config | Simulink parameter | Value translation |
|---|---|---|
Enabled | enabled | passes through |
Stop When Assertion Fails | stopWhenAssertionFail | passes through |
Caveat (shown to the user): the band arrives on ports (max, u); the block runs at the surrounding Simulink rate, so "Sampling Time (s)" does not cross. ICore's block always carries its verdict output, so the bridge pins Simulink's "export" to on
Catalog contract: src/ICoreSDK/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:
B0every stimulus in the sample errored — cross-checks skipped
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.
File banner (developer view)#
The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).
Check Dynamic Upper Bound -- verifies a signal stays below a bound that arrives on a port y = 1 where u < max, 0 elsewhere. The bound is a SIGNAL, so it may move every step. Applied entry by entry, so the output keeps the signal port's size.
PORT ORDER IS (max, u) -- bound first. Measured against Simulink R2026a by driving distinguishable signals through the real block; the masks are S-Function based, so MaskDisplay is empty and there is nothing to read the order off.
The comparison is STRICT, with no inclusion flag: a sample exactly ON the bound fails. Also measured, at a sample where the two signals are exactly equal.
The verdict SIGNAL and the ASSERTION are two separate things, and only the first crosses into generated code -- see Check Static Lower Bound, which documents the split in full.
Sample results#
No stimulus produced a sampled output in this rig — Check Dynamic Upper Bound failed at t = 0.000000 s: ICore Blocks/Home/Check Dynamic Upper Bound. That is a fact about the single-block rig, not a verdict on the block: an offline batch fit, a block whose output only appears at onSolverFinish, or one that needs a driven environment cannot be exercised alone.
Category unsampled · sample time 0.1 · 60 steps · commit ccf005c8 · produced by docsSample --out <folder> --steps 60
Sample data: docs/generated/samples/Control_Systems__Model_Verification__Check_Dynamic_Upper_Bound.json