TECHNOLOGY
TrekSoC is built on top of the Trek graph-based constrain solver. Analogous to the SystemVerilog Constraint Satisfaction Problem (CSP)constraintsolver, the Trek graph-based constraint solver uses graph paths instead of variables as the foundation of constraint solving.
A CSP constraint solver accepts a set of variables (e.g. a, b and c), the legal values for each variable (e.g. each of a, b and c must be between 1 and 10), and a set of constraints that must be satisfied between those variables (e.g. a + b = c ). The constraint solver then finds a random solution (e.g. a=2, b=5, c=7) that satisfies those constraints.
This variable based approach is useful for randomizing individual transactions, but it is difficult to formulate the randomization of an entire scenario using a CSP constraint solver. CSP constraint solving is NP complete and can consume a lot of compute power to solve complex constraints.
A graph-based constraint solver accepts as input a graph of decision points where each decision may be randomized to result in alarge number of possible paths. The solver also accepts a set of constraints (e.g. traversing path segment a implies that path segment b may not be visited) that must be satisfied. The solver then finds a path through the graph that satisfies the set of constraints
By associating actions with each path elementin the graph, it is possible to intuitively formulate randomization of entire scenarios using a graph-based constrain solver. Graph-based constraint solving is O(log N) making is possible to rapidly solve complex scenario constraints.
TrekSoC Services
TrekSoC provides a framework of scenario models that are used to generate C test cases. Each test takes the form of a randomized micro-kernel running applications that drive individual hardware devices to test possible system interactions.

Scenario models may request system services that are provided by TrekSoC. This section describes some of the key services available to scenario models.
Memory Management
This service allows memory buffers to be allocated and freed on demand. Allocated addresses are randomized. Address randomization is biased towards creating cache line collisions to test cache coherency. Allocation is biased towards partial reuse of recently freed buffers to test data ordering. Virtual page tables are handled within this service.
This service also supports memory connectivity testing.
Register Access
This service allows scenario models to request randomization, writing and checking of register values.
This service also supports register connectivity testing.
Scheduler
Tasks may be flexibly scheduled sequentially within a thread or across threads to create producer/consumer scenarios. Threads may be on the same processor or distributed across multiple processors. .
Interrupts and Polls
A scenario model may ask to wait for an interrupt or until a status bit is set. Interrupt handlers and non-blocking poll loops are automatically generated.
System Management
This service will randomly switch clocking and power modes. Scenario models may ask for a specific device to be powered up for the duration of an operation, possibly allowing for intermittent power downs during the operation to test state retention.
Testbench Actions
This service allows scenario models to request arbitrary testbench activity to drive and check I/O interfaces or other testbench events.
GPIO
This service allows scenario models to request specific system GPIO routings.
Debug Facilities
This service allows scenario models to log various levels of diagnostic messages. Diagnostics on thread progress and memory state are automatically generated.
Data Checking
This service allows scenario models to request checking of memory data buffers against an array of expected data. Data checking may be implemented by offloadingmemory contents using backdoor memory access or by comparing checksum signatures, which consumes embedded CPU cycles.
Timing Checks
This service allows scenario models to request checking that the elapsed time between two events falls within a specified range. Timing checks may be implemented using either elapsed simulation time or using an onboard timer if available





