Introduction
As digital systems grow in complexity, the Hardware Description Languages (HDLs) like VHDL and Verilog used to design them become increasingly difficult to manage. A primary challenge in hardware engineering is formal verification—specifically model checking—which aims to prove a circuit's correctness. However, model checking is plagued by the "state explosion" problem: as the number of variables and components increases, the state space of the circuit grows exponentially, often exceeding the computational limits of modern tools.
This paper presents a solution through program slicing, a technique originally developed for software engineering to isolate the specific parts of a codebase that affect a particular variable or function. By adapting slicing for the concurrent and reactive nature of HDLs, the authors demonstrate a significant reduction in design complexity, facilitating more efficient debugging and formal verification.
The Challenge of Hardware Slicing
While program slicing has been a staple in software maintenance for decades, its application to hardware is non-trivial. Traditional slicing algorithms assume sequential programs with a defined start and end. In contrast, HDLs are:
- Concurrent: Multiple processes execute simultaneously.
- Reactive: They respond continuously to external signal changes.
- Non-halting: They operate in an infinite simulation loop rather than terminating.
Bridging the gap between these paradigms requires a sophisticated mapping of hardware semantics into a framework that standard, language-independent slicers can process.
Methodology: Mapping Hardware to Software
The authors' core innovation lies in translating VHDL semantics into traditional procedural constructs. This allows them to leverage existing, highly optimized inter-procedural slicing algorithms.
Semantic Mapping
The first step involves a direct translation of VHDL elements. For instance, a VHDL process is treated as a procedure, and signals are modeled as global variables. This abstraction simplifies the concurrent environment into a set of interacting procedures.
The Master Process and Signal Dependencies
To handle reactivity, the authors generate an implicit "main" procedure. This master process orchestrates the simulation cycle, initially calling all processes and subsequently re-invoking those sensitive to specific input ports or signal changes.
Communication via signals is modeled by inserting implicit procedure calls. Whenever a signal is assigned a value, the slicer interprets this as a call to every process sensitive to that signal, effectively capturing the data flow across the hardware design.
System Dependence Graphs (SDG)
The backbone of the slicing process is the System Dependence Graph (SDG). In this graph, nodes represent individual statements, while edges represent data or control dependencies. Slicing is then reduced to a graph reachability problem: identifying all nodes that can reach (or be reached by) a specific "slicing criterion."
To maintain precision, the authors employ a matched-parenthesis reachability algorithm. This ensures that the paths followed through the graph respect the call-and-return structure of the modeled procedures, preventing the inclusion of logically impossible execution paths.
Evaluation and Results
The methodology was implemented in a VHDL slicing tool and evaluated using the controller logic of a RISC processor—a complex, real-world benchmark. The tool was tasked with slicing the design based on specific formal properties (CTL specifications).
The quantitative impact on the state space was profound:
- Original Design: Approximately $1.8 \times 10^{47}$ total states.
- Safety Property Slice: Reduced to $2.0 \times 10^{31}$ states.
- Liveness Property Slice: Reduced further to $3.1 \times 10^{29}$ states.
These results indicate that slicing can remove vast amounts of irrelevant logic, potentially turning an intractable verification task into one that completes in minutes.
Key Insights
- Leveraging Existing Tools: The "trick" of mapping hardware behavior to software behavior allows for the use of mature slicing technology without reinventing the wheel.
- Scalability: Interestingly, the benefits of slicing often increase with the size of the design. Larger systems typically contain more "dead weight" relative to any single property being verified.
- Front-end Integration: Slicing serves as a powerful pre-processor for model checkers, directly addressing the state explosion problem at its source.
Future Directions
Despite its success, the authors identify several areas for refinement. Current SDGs are "conservative," meaning they may include more code than strictly necessary to ensure no relevant logic is missed. Future work will focus on optimizing the handling of multiple wait statements within processes and automating the generation of slicing criteria directly from formal specifications. Additionally, the authors plan to extend the tool's support to other concurrent languages like Verilog.
Summary updated