Definition
Stream generation is one of the two levels of test program generation described for Genesys-Pro. It determines which instructions appear in a test and the order in which they appear, while instruction-level generation creates the specific instruction instances. [C1]
Role in Genesys-Pro
Genesys-Pro's generation engine takes a test template and a declarative architecture model as input and produces a test program matching the scenario requested by the template. The generator is pseudorandom and uses generic biasing constraints so that repeated invocations can exercise the requested scenario in different contexts. [C2]
Within this process, stream generation handles the sequencing of the test. The evidence describes test program generation as occurring at two levels: stream and single instruction. [C1]
Drivers and solver structure
Sequencing-control statements in the user's test template are the primary drivers of stream generation. For each control statement, Genesys-Pro associates a separate stream solver. That solver recursively invokes solvers for its substatements, and each recursive path terminates by invoking the single-instruction solver. [C3]
For example, for a select statement, the associated stream solver randomly chooses one of the statement's substatements, such as an Add instruction, and invokes that substatement's solver. [C3]
Dependencies across instructions
The user can express dependencies between different instructions in the stream through shared variables and generic biases. The evidence gives examples such as a shared variable reg and a resource dependency bias. [C4]
When generating a particular statement, the engine considers previously generated instructions, but it does not consider requests that follow the current statement in the template. This can increase the chance that later statements fail to generate. [C5]
Failure handling
Genesys-Pro uses two strategies to reduce failures caused by the forward-generation approach. First, it can detect failures before they occur and inject special instructions into the test. One example is register reloading, where load instructions are injected into the stream to set registers to desired values when bounded resources such as floating-point registers can no longer be set directly to a requested value. [C6]
Second, each stream solver has rollback capabilities. If generation of a substatement fails, the solver can roll back to the state before the failed attempt and select another substatement. The evidence gives an example in which a failed Add generation attempt in a select statement is rolled back and another substatement such as Sub is selected. [C7]
Reentrant and concurrent streams
The stream solver supports controlled generation of reentrant instructions that execute more than once in a single test run, including procedure calls, recurring interrupts, user-defined loops, and self-modifying code. Randomly generated loops can be prohibited to avoid generating infinite loops. [C8]
For multiprocessor or multithreaded designs, the stream solver creates separate instruction sequences for each processor or thread. The evidence notes that this can involve additional synchronization mechanisms. [C9]
Relationship to instruction-level generation
Stream generation and instruction-level generation use different techniques. Stream generation decides instruction presence and ordering; instruction-level generation handles the construction of individual instruction instances. In the described Genesys-Pro flow, a stream-generation path eventually invokes the single-instruction solver, which formulates an instruction request as a constraint satisfaction problem and solves it to produce an instruction instance satisfying the constraints. [C1] [C10]