Skip to content

Fault injection and switching coverage #5

Description

@isenbek

From the 27C3 talk's list of things worth doing next, and the only item on it
that nothing in either repository does.

The idea: disable a transistor, re-run a test program, and see whether it still
passes. Most of the time it does. That is not a statement about the chip being
robust, it is a statement about the program not exercising that transistor.
Run it over the whole die and you get a coverage map of a piece of software
against the silicon it runs on, which is not a measurement any behavioural
emulator can produce.

Why this belongs in halfphi rather than in a chip crate

It needs no die data and names no chip. It is a property of the solver: a
transistor that is forced permanently off, and a counter for whether a
transistor ever conducted.

There is already a precedent in the model. 17 of the 6502's transistors are
gated by ground and so are permanently off, which is physically correct, and the
netlist builder already reasons about that case. Forcing a transistor off on
demand is the same state reached deliberately.

Rough shape

// Fault injection: force a switch permanently open.
eng.disable_transistor(t);
eng.enable_transistor(t);

// Coverage: has this switch ever changed state since the counter was reset?
eng.switching_coverage() -> &BitSet

Both are cheap. disable is a flag consulted where the gate level is read;
coverage is a bit set touched in the same place. Neither adds a branch to the
group-building inner loop, which is where the time goes.

What it would immediately answer for the 6502 site

  • Which transistors does each of the seven shipped programs actually exercise?
  • The 1060 static-logic transistors are identified by signature rather than by
    name. Fault injection is an independent way to ask what any of them do.
  • the_residue_is_two_inert_structures currently argues from topology that two
    transistors cannot affect anything. Disabling them and finding the golden trace
    bit-identical over 3000 half-cycles would be a second, independent proof of the
    same claim.

That last one is the strongest argument for building it: it turns a structural
argument into a measurement, which is the move this project keeps making.

Care needed

Coverage counted as "ever conducted" is the weak version, since 1503 of 3510
transistors conduct at any instant and most are pulldowns inside gates. "Ever
changed state" is the useful one, and the two should not be conflated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions