Overview
Constraint solving for instruction generation is a technique for automatically producing instruction sequences from a formal architectural model. In the evidence, the technique is described as generating instruction sequences that reach a desired state while avoiding undefined behavior. This was used in prior CHERI work and is discussed as a future direction for TestRIG-style generation of templates targeting deep states in architectural models.
Use in CHERI-MIPS testing
Previous CHERI work generated tests from a formal model of the CHERI-MIPS ISA. That model was written in the L3 Specification Language, compiled from L3 to HOL4, and then used with constraint solving to automatically generate instruction sequences. The goal of those generated sequences was to reach a desired state without triggering undefined behavior.
Use with Sail models
The same approach is reported as having been applied to the CHERI ARM Morello instruction set starting from a Sail Language model. The evidence also describes ongoing work on a Sail-OCaml VEngine with direct access to the data structures of a Sail RISC-V model. This is intended to eliminate independent encodings in the VEngine and support further automation of templates that target specific deep states in an architectural model using constraint solving.
Relationship to template-based generation
The evidence also references IBM’s Genesys-Pro in the context of templates that can intelligently solve for desired deep states. In the TestRIG discussion, constraint solving is presented as a way to automate generation of templates aimed at specific deep states in an architectural model.
Role in verification workflows
Within the provided TestRIG evidence, constraint solving is positioned alongside randomized and model-based testing techniques. The surrounding workflow includes reduced counterexamples, smart shrinking, non-shrinkable initialization sequences, and assertions, but the constraint-solving-specific contribution is the automatic construction of instruction sequences or templates that drive the implementation toward targeted architectural states.