HDL Simulation Runtime Stack for Wait Statement Suspension
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
VHDL simulators face complexity and increased simulation runtime costs due to the need for extensive bookkeeping code when handling procedures with wait statements, as they require managing resumption points and preserving declarations across suspended procedures, which complicates the compilation and execution process.
Innovation Solution
Implementing a method that uses a secondary runtime stack for procedures with wait statements, allowing for context switching to save and restore the simulation state, thereby simplifying the management of suspended procedures and reducing the need for complex bookkeeping code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If procedures with wait statements are simulated using traditional VHDL simulator methods, then the simulation can handle complex circuit designs, but the simulation runtime increases and compiler complexity increases due to extensive bookkeeping code
Solution Approach 1:
The patent segments the simulation runtime into distinct phases: a main runtime stack for executing processes and a secondary runtime stack for executing procedures with wait statements. This segmentation allows the simulator to handle procedure suspension and resumption separately from the main simulation flow, eliminating the need for complex bookkeeping code in the compiler while maintaining accurate simulation of procedures containing wait statements.
Solution Approach 2:
The patent introduces a secondary runtime stack as an intermediary data structure to manage the state of procedures with wait statements. This intermediary stack stores suspension points and local variables, acting as a buffer between the main simulation runtime and the suspended procedures. By using this intermediary, the compiler can generate simpler code that relies on the runtime stack management mechanism rather than requiring complex bookkeeping logic.
2Reliability
If procedures with wait statements are simulated using traditional methods, then the simulation can maintain process state, but extensive bookkeeping code is required to manage resumption points and preserve declarations
Solution Approach 1:
The patent implements a self-service mechanism where the secondary runtime stack automatically manages the preservation and restoration of procedure state. When a procedure with a wait statement is suspended, its local variables and execution state are automatically pushed onto the secondary stack. Upon resumption, the state is automatically popped and restored. This self-managing approach eliminates the need for manual bookkeeping code to track suspension points and preserve declarations, reducing compiler complexity while maintaining reliable state preservation.
3Productivity
If a secondary runtime stack is implemented for procedures with wait statements, then simulation runtime costs are reduced and compilation is simplified, but additional memory structure is required
Solution Approach 1:
The patent merges the secondary runtime stack for procedures with the main runtime stack for processes into a unified stack-based execution model. Both processes and procedures utilize the same stack mechanism for state management, allowing the simulator to handle different execution contexts (processes without wait statements, procedures with wait statements, and nested procedure calls) through a single, consistent data structure. This merging approach minimizes the total memory overhead compared to implementing completely separate management structures for each execution context.
Data Source
AI summary
When a wait statement is encountered in an HDL simulation, the simulation kernel executes functions corresponding to other processes while waiting for the wait to mature. However, the preservation of variables and states of each process and procedure in the call chain can be complex and inefficient. An embodiment of the present invention provides a method to suspend procedures in simulation of an HDL circuit design such that processes that call procedures containing wait statements are executed on a secondary runtime stack and can be suspended by saving the state of simulation and switching simulation execution to the primary runtime stack.


