HARDWARE & DEVICE SECURITY

RTL Anti-Tampering15/16

RTL Anti-Tampering Design Lesson 15: Calibrating Physical Fault-Injection Models

A simulated fault target has engineering value only when it maps to physical behavior. Calibration is not tuning RTL parameters until a fault “looks successful”; it compares target, window, effect, repeatability, and residual mismatch against traceable measurements.

7 min read

A simulated fault target has engineering value only when it maps to physical behavior. Calibration is not tuning RTL parameters until a fault “looks successful”; it compares target, window, effect, repeatability, and residual mismatch against traceable measurements.

Learning objectives and classroom plan

By the end of this lesson, you should be able to:

  • Recompute six threshold matrices and error costs record by record.
  • Calculate a Wilson recall interval under explicit sampling assumptions.
  • Plan validation separately for in-matrix FN and out-of-model unknowns.

Suggested 50-minute teaching plan: Label definitions 10 minutes; thresholds and lab 15; interval calculations 15; independent validation plan 10. This includes student calculations, lab work, and discussion. It is a teaching plan, not measured student completion time.

Go to the interactive lab

Lesson 15: Calibrating Physical Fault-Injection Models

From instrument readings to logic effects

A clinical thermometer needs comparison against a traceable standard; smooth readings do not prove accuracy. Voltage/clock glitches, laser, or EM injection likewise require instrument settings, probe/location, voltage/temperature, trigger timing, chip revision, and repeats. The analogy motivates traceability; it does not claim any injection method necessarily causes a particular RTL flip.

Classify physical outcomes as invalidated, reset, skipped, delayed, corrupted data, checker alert, permanent damage, or no observed effect. Map them conditionally to the digital model: under settings X, location Y, and window Z, estimate the frequency and interval for each effect. One successful attempt does not imply a deterministic bit flip.

Place measurements and models in a layered table: physical stimulus, observable chip response, netlist effect, RTL abstraction. Report sample count, misses, non-repeatability, spatial resolution, and confidence intervals. If the setup sees only reset and not internal nodes, mark that observability limit; do not infer an internal state change.

Separate calibration and validation sets. Estimate the model on one set and check predictive coverage on independent windows; stratify by chip, lot, environment, and revision. Do not extrapolate to untested locations or tools. The interactive lab uses synthetic samples only; it reads no physical measurements and performs no fault injection.

Find model mismatch

For defined effect classes and observation conditions, compare measured labels with predictions using a confusion matrix, especially false negatives: positive labels predicted negative. Keep out-of-model effects as separate unknowns. Version and hash every revision, then rerun the campaign. Conclusions cover only the calibration domain; few samples or zero observations do not make an event impossible.

Worked case: unpack a “hit-rate” table

Open this lesson’s interactive lab

Lesson 14’s digital campaign specifies target, time, and effect, but we do not yet know whether those abstractions represent physical stimuli. A reviewer now receives eight records summarized as “the model predicts hits half the time.” Before accepting that summary, ask: does half mean predicted effects, observed effects, or missed positive cases? These questions use different denominators.

The table follows the interactive model’s eight synthetic pairs. Score is a model input; physicalLabel is a separately assigned teaching label. Score was not estimated from measurements after physical stimulation. The model predicts positive solely when score >= threshold. The word physical in the field name does not mean this lesson measured a chip.

Synthetic rowscorephysicalLabelPrediction at threshold 3Prediction at threshold 4
11100
24111
35111
42100
51000
63010
75011
82000

At threshold 3, rows 2 and 3 are true positives; rows 6 and 7 are false positives; rows 1 and 4 are false negatives; rows 5 and 8 are true negatives. Thus TP = 2, FP = 2, FN = 2, and TN = 2. Predicted positives total 4/8, as do positive labels, but these are different sets. Equal aggregate proportions do not establish calibration.

What does a higher threshold improve, and what remains?

At threshold 4, only row 6 changes from predicted 1 to 0. Its label is 0, so FP decreases by one and TN increases by one; TP and FN both remain 2. The new matrix is TP = 2, FP = 1, FN = 2, TN = 3, with predicted positives down to 3/8. On this finite dataset, the adjustment reduces false alarms without recovering either missed positive.

Write denominators when reporting rates. At threshold 3, precision is TP/(TP+FP) = 2/4 and recall is TP/(TP+FN) = 2/4. At threshold 4, precision becomes 2/3 while recall stays 2/4. Overall accuracy changes from (TP+TN)/8 = 4/8 to 5/8. These are calculations on eight synthetic records, without physical confidence or a generalization guarantee.

A security review must also consider the consequences of misses. An unmodeled physical effect crossing the key-release boundary may warrant more attention than several false alarms. That does not justify arbitrarily minimizing the threshold: a lower threshold can increase false alarms and evaluation workload. Decisions depend on assets, effect types, measurement cost, and remaining unknowns. This small model neither selects a product threshold nor makes eight records statistically representative.

What connects a digital effect to an instrument?

Suppose a digital model evaluates a flag flip at an acceptance edge, while the physical setup records only a system restart after voltage stimulation. Internal state, timing, and causal correspondence remain missing. One reset is not measurement evidence for that particular flag flip. Start the experimental plan with observables: stimulus waveform and trigger position, board supply and temperature, external chip response, and access to the required internal signals. Preserve unobservable layers as limitations.

Build the mapping in stages: physical stimulus conditions → observable response → candidate digital effects → evidence still needed. A response may have multiple candidate effects. Data corruption, delay, or reset may produce similar external behavior; do not choose the most convenient explanation without further observation. Calibration estimates effect distributions and repeatability under specified conditions. Mapping a stimulus to a particular RTL bit operation requires evidence that distinguishes other candidate effects.

The lesson separately lists two out-of-model unknowns: multi-bit upset and power-rail coupling. They are outside the eight-record confusion matrix and must not be inserted as true negatives. Hiding their names does not reduce the unknown count to 0. Display is an interface choice; the state remains two unknowns. When new evidence arrives, revise the effect model, version, and campaign, then identify which previous conclusions still hold.

Deeper exercises: repair, validate, and extrapolate

Exercise A: check the threshold record by record. Without using the summary, move threshold from 3 to 4. Identify the only changed row and calculate the matrix, precision, recall, and accuracy.

Answer and reasoning: Row 6 changes. The new matrix is 2, 1, 2, 3; precision is 2/3, recall 2/4, and accuracy 5/8. Retain fractions so the small denominators remain visible. No added FN in this dataset does not mean higher thresholds can never add FN in other datasets.

Exercise B: hold out genuinely new samples. An engineer selects threshold 4 using these eight records, then declares validation successful using the same eight records’ 5/8 accuracy. What is missing? Outline the next sampling plan.

Answer and reasoning: This is still performance on tuning data, without independent validation. Fix the revision and criteria first, obtain samples unused for tuning, stratify by device, condition, and effect type, and retain misses and unobservable cases. Required sample count depends on the evaluation objective and experimental conditions. This lesson invents no signoff-ready sample count.

Exercise C: preserve unknowns. A report contains only the eight-record matrix and omits both out-of-model effects. Which fields would help the Lesson 16 reviewer decide the next step?

Answer and reasoning: For each unknown, record effect name, observable conditions, missing evidence, potentially affected asset boundary, owner, and status. Incomplete measurement remains incomplete; aggregate accuracy cannot relabel it as covered. This is a proposed plan, not physical data obtained by the lesson.

Classroom derivation: scan thresholds, costs, and small-sample intervals

Separate two sets first. An in-matrix FN has a defined positive label of 1 but a prediction of 0. An out-of-model unknown has an effect class or observation method outside the definition. Rows 1 and 4 are the former. Multi-bit upset and power-rail coupling are the latter in this construction and are outside its eight labeled records. Improving FN does not close unmodeled gaps.

Scan threshold from 1 through 6, applying score >= threshold to the same eight records each time. This exposes the full change instead of selecting two attractive points. Threshold 6 predicts no positives, leaving precision’s denominator at 0. The program outputs null: undefined, rather than 0% or 100%.

The original HTML slider covers thresholds 1–5. Row 6 is an extension in the downloadable program that demonstrates the no-predicted-positive boundary.

thresholdTPFPFNTNAssumed cost 10×FN + FP
144004
2331113
3222222
4212321
5113331
6004440

Assume an FN costs 10, an FP costs 1, and other costs are zero. At threshold 4, cost is 10×2+1=21. For these records and weights, threshold 1 minimizes cost at 4, while predicting every record positive. That optimum in a finite teaching dataset does not specify actual measurement costs, service loss, or other error classes. Neither does it resolve the two unknown effects.

Different weights can change the decision. Counting only FP and ignoring FN makes threshold 6 inexpensive, although it misses all four positives. That objective cannot support the original safety requirement. Define each error’s affected asset and boundary before assigning weights, then evaluate the chosen threshold on independent data. Finding the minimum on eight tuning records is only one step.

How uncertain is recall of 2/4?

Treat detection among known-positive samples as independent Bernoulli trials under one fixed condition. Set p̂=2/4=0.5, n=4, and z≈1.96. A two-sided 95% Wilson interval has center c=(p̂+z²/(2n))/(1+z²/n) and half-width h=z×sqrt(p̂(1−p̂)/n+z²/(4n²))/(1+z²/n). Substitution gives c=0.5 and h≈0.349961, or an interval of approximately [0.150039, 0.849961].

This wide interval quantifies the weakness of four positives. Wilson is an approximate interval under specified sampling assumptions. These eight records are constructed fixed data, so the calculation demonstrates a method; it is not a measured 95% physical-calibration confidence interval. Unknown effects and device variation lie outside this Bernoulli model.

If a separate experiment obtained 30 independent positive trials with no FN, Lesson 14’s formula would give the FN-probability one-sided 95% upper bound 1−0.05^(1/30) ≈ 9.5034%, with 3/n approximately 10%. Zero misses do not imply impossible misses. Here n counts positive trials, not negatives or repeated copies of cases. This lesson obtained no such thirty-trial dataset.

Calculation exercise: Change cost to 2×FN + FP. Calculate all six costs, then explain why selecting the minimum still cannot relabel unknowns as covered.

Worked answer: Costs are 4, 5, 6, 5, 7, and 8, still minimized at threshold 1. Only the eight defined labeled records enter this calculation. Unknown effect definitions and observations remain outside it; tuning cannot generate missing evidence. Fix model and cost before independent sampling, and separately plan measurement and classification of out-of-model effects.

Replay and compare

Download the program and result JSON into one folder. Run with Python 3.8 or newer:

python rtl-university-workbook-v1.py --output replay.json

Compare replay.json with the supplied result, starting with this lesson’s lesson15 field. sourceSha256 identifies the program’s bytes, separately from mathematical correctness. Editing content or resaving LF as CRLF changes that value. Keep the downloaded original and save student changes separately to distinguish method changes from file changes.

Download the classroom replay program · Inspect full scan and interval JSON

Offline interactive lab

RTL / SVA review direction

Physical-injection calibration compares measured outcomes with model predictions. An RTL assertion cannot replace that physical evidence.

Check your reasoning

  1. Recognition — What does a false negative mean during model calibration? Reasoning: Within the defined label set, a positive effect has a negative model prediction: an in-matrix miss. Undefined or unobservable effects are separate unknowns, outside that denominator.
  2. Contrast — As a score threshold rises, which predictions can change? Reasoning: Predicted positives can stay the same or decrease; they cannot increase. True positives or false positives may fall, while false negatives or true negatives may rise.
  3. Scenario — The chip shows a multi-bit upset absent from the model. How should it be recorded? Reasoning: Record an out-of-model effect and its physical context. Do not count it as a model negative or silently omit it from the unknowns.
  4. Failure diagnosis — A report shows zero unknown effects after its unknown list was hidden. What is wrong? Reasoning: Hiding a list does not remove the unknowns. Keep their count and status visible; do not present unobserved or omitted as absent.
  5. Design risk / transfer — You tune a model on one board and test the same records. What does this establish? Reasoning: It measures fit to that calibration set, not generalization. Hold out physical samples and state the device, setup, conditions, and limits.

References

Analysis of laser-induced errors: RTL fault models versus layout locality characteristics · SYNFI pre-silicon fault analysis

MY ACADEMY · LESSON FILM

Lesson video

The film explains this lesson’s data path. After a section, return to the interactive exercise and change the input or fault conditions. The animation presents a teaching model; it does not replace RTL simulation.

Diagram scope
Teaching model · Not RTL simulation or silicon testing
Concept / synthetic teaching diagram; not measurement, a certain bit flip or generalization proof

Download MP4 · Captions VTT

Narration uses a synthetic voice. Both the interaction and animation have model boundaries; interpret results using this lesson’s sources and validation scope.

Wrap-up: take this lesson into a design review

Threat model and assumptions

A physical campaign records traceable stimulus and chip response; digital targets/effects are calibration hypotheses.

Why the design fails

One hit is treated as a deterministic bit flip, or an internal register change is inferred without observing it.

Defenses

Map effects by layer, retain misses and unknowns, validate predictions on separate data, and report intervals.

Validation and checks to perform

Report sample/location/timing/environment/revision/instrument settings, confusion matrix, and model hash; conclusions cover the calibrated domain only.

Limits and unverified claims

Small samples, hidden internal nodes, other dies/packages/tools, analog coupling, and unmodeled faults limit extrapolation.

Try a changed assumption

Take one out-of-model effect. Define a new test stratum and the sensing/samples needed before adding it.

This wrap-up summarizes the lesson’s teaching cases, references and experiment scope. Checks not reported as completed remain future work.

Thanks for reading.

Take the concept with you, not just the terminology.

#RTL#Fault Injection