Java.java
A single class, no framework, no build tool required.
public class DPT_Feedback_Discrete_deployableCore {
// Tunable parameters (editable from the testbench)
public static class Params {
// blk2: ICore Blocks/Home/DPT_Feedback_Discrete/Ctrl_Gain
public double[][] blk2_gain = new double[][] {{1.8}};
}
public Params params = new Params();
// Signal storage (readable from the testbench)
public static class Signals {
// sig0: ICore Blocks/Home/DPT_Feedback_Discrete/In1/ICoreDouble-Out-0
public double[][] sig0 = new double[1][1];
// sig1: ICore Blocks/Home/DPT_Feedback_Discrete/Error/ICoreDouble-Out-0
public double[][] sig1 = new double[1][1];
// sig2: ICore Blocks/Home/DPT_Feedback_Discrete/Ctrl_Gain/ICoreDouble-Out-0
public double[][] sig2 = new double[1][1];
// sig3: ICore Blocks/Home/DPT_Feedback_Discrete/Plant/ICoreDouble-Out-0
public double[][] sig3 = new double[1][1];
// sig4 (boundary output): ICore Blocks/Home/DPT_Feedback_Discrete/ICoreDouble-Out-0
public double[][] sig4 = new double[1][1];
// External inputs: set before executeBlocks; input gates copy these in.
public static class Inputs {
public double[][] sig0 = new double[1][1];
}
public Inputs inputs = new Inputs();
}
public Signals signals = new Signals();
// blk0: ICore Blocks/Home/DPT_Feedback_Discrete/In1
class Blk0 {
void solve() {
signals.sig0 = signals.inputs.sig0;
}
}
// blk1: ICore Blocks/Home/DPT_Feedback_Discrete/Error
class Blk1 {
void solve() {
double[][] output = new double[1][1];
double[][] in0 = signals.sig0;
for (int i = 0; i < output.length; i++) {
for (int j = 0; j < output[0].length; j++) {
output[i][j] += in0[i][j];
}
}
double[][] in1 = signals.sig3;
for (int i = 0; i < output.length; i++) {
for (int j = 0; j < output[0].length; j++) {
output[i][j] -= in1[i][j];
}
}
signals.sig1 = output;
}
}
// blk2: ICore Blocks/Home/DPT_Feedback_Discrete/Ctrl_Gain
class Blk2 {
void solve() {
double[][] gain = params.blk2_gain;
double[][] input = signals.sig1;
double[][] output = new double[1][1];
for (int i = 0; i < output.length; i++) {
for (int j = 0; j < output[0].length; j++) {
output[i][j] = input[i][j] * gain[0][0];
}
}
signals.sig2 = output;
}
}
// blk3: ICore Blocks/Home/DPT_Feedback_Discrete/Plant
class Blk3 {
double[] num = {0, 0.40000000000000002};
double[] den = {-0.59999999999999998};
double[][][] uHist = new double[1][1][2];
double[][][] yHist = new double[1][1][1];
void solve() {
double[][] u = signals.sig2;
double[][] out = new double[1][1];
for (int r = 0; r < 1; r++) {
for (int c = 0; c < 1; c++) {
double uk = u[r][c];
for (int k = 1; k > 0; k--) uHist[r][c][k] = uHist[r][c][k - 1];
uHist[r][c][0] = uk;
double yk = 0.0;
for (int i = 0; i < 2; i++) yk += num[i] * uHist[r][c][i];
for (int i = 0; i < 1; i++) yk -= den[i] * yHist[r][c][i];
yHist[r][c][0] = yk;
out[r][c] = yk;
}
}
signals.sig3 = out;
}
}
// blk4: ICore Blocks/Home/DPT_Feedback_Discrete/Out1
class Blk4 {
void solve() {
signals.sig4 = signals.sig3;
}
}
Blk0 blk0 = new Blk0();
Blk1 blk1 = new Blk1();
Blk2 blk2 = new Blk2();
Blk3 blk3 = new Blk3();
Blk4 blk4 = new Blk4();
// Execution order generated automatically from block diagram
public void executeBlocks() {
// blk0: ICore Blocks/Home/DPT_Feedback_Discrete/In1
blk0.solve();
// blk1: ICore Blocks/Home/DPT_Feedback_Discrete/Error
blk1.solve();
// blk2: ICore Blocks/Home/DPT_Feedback_Discrete/Ctrl_Gain
blk2.solve();
// blk3: ICore Blocks/Home/DPT_Feedback_Discrete/Plant
blk3.solve();
// blk4: ICore Blocks/Home/DPT_Feedback_Discrete/Out1
blk4.solve();
}
}
What Deploy writes for the reference model below, with only the file's
header banner removed. One public class: nested Params and Signals holding
double[][] storage, an inner class per block, and executeBlocks()
calling them in order. No annotations, no framework, nothing to put on a classpath -
javac and java are the whole toolchain.
From the diagram to your Java build.
Deploy writes the folder, ICore checks it against the simulation, and your code calls it once per sample.
Deploy writes
<name>_deployableCore.java<name>_testbench.java
Built, run and compared
Built with javac and java, run across the simulation window and compared with the solver sample by sample, against a 0.1 % tolerance.
One call, one sample
Numbers are double, and 800 of 806 library blocks export to Java.
executeBlocks()Where Java fits.
One public class holding params, signals, inputs and state, with
executeBlocks() advancing it by a sample. It compiles with javac
and runs with java - there is no Maven or Gradle scaffolding to accept, and
nothing to exclude if you already have your own.
Useful where the model has to live inside an existing JVM service: a test harness, a simulation server, or an Android-side model that mirrors what the hardware runs.
| Target class | Tolerance | Observed |
|---|---|---|
| Software · 7 languages | 0.1 % | ≈1e-11 % |
| HDL · Q16.16 | 1 % | ≈1e-3 % |
One model, ten targets.
Every target page shows the same model, so the ten are directly
comparable: an input, an error junction, a gain of 1.8, a discrete plant and an output,
with the plant's output fed back into the junction. The export-verification suite calls it
DPT_Feedback_Discrete - which is where the names in the file come
from.
See it run on your own model.
Download the application from the customer portal, or read the documentation first - the manual, a page for every block, and the full command reference are public.