Algorithm for Compiled Event-Driven VHDL Simulation
WU Qing · Chinese Journal of Computers · 2002
VHDL Simulator plays a key role in the verification of VLSI high\|level design, and the fast and efficient check of the design validity speeds up the design flow significantly. The simulation algorithm determinate the efficiency of a simulator, and it is the key factor in constructing an efficient simulator. This paper discusses the classification of VHDL simulation algorithms first. The simulation algorithm consists of two parts: schedule algorithm and implementation algorithm. Schedule algorithm is either oblivious or event\|driven. In oblivious algorithm, each component is evaluated at each time point, producing a new design state for the next time point. In event\|driven algorithm, changes in design state are recorded, only those components that might cause a change in design state during a given time point are simulated. Implementation algorithm is either interpretive or compiled. In interpretive algorithm, a data structure that represents the design is constructed, and a central scheduler iterates over simulation time, calling procedures that evaluate the design component. Compiled algorithm produces a straight\|line program with all data addressed directly by the code. Compiled algorithm works more efficiently because of reducing the overhead of traversing the design structures. Most published implementations of compiled simulation used the oblivious schedule algorithm. This paper presents an algorithm for compiled event\|driven VHDL simulation. To implement this algorithm, a simulation schedule kernel is programmed and compiled into a C++ library first, which can be used to manage and schedule the events occuring during the simulation. Then we translate VHDL sources of design into C++ codes, which finally can be compiled into an executable simulation file. To make the precompiled simulation kernel and the codes translated from VHDL source, we smartly apply the encapsulation, inheritance and polymorphism characteristic of Object\|Oriented technique into the algorithm, which make this algorithm more graceful and efficient. Also, we put forward a method of translating VHDL codes into C++ codes that is also Object\|Oriented, and it works well with the VHDL simulation algorithm. The algorithm presented in this paper combines the merit of compiled implementation algorithm and event\|driven algorithm, and has characteristics of high performance and easy expansion. This algorithm has been used in the author's compiled VHDL simulator. In the last part of this paper, we verify the performance and efficiency of the algorithm by some experiment data derived from author's prototype simulator.