Table of Contents Author Guidelines Submit a Manuscript
Research Letters in Electronics
Volume 2009, Article ID 480740, 5 pages
http://dx.doi.org/10.1155/2009/480740
Research Letter

Token-Aware Completion Functions for Elastic Processor Verification

Department of Electrical & Computer Engineering, North Dakota State University, Fargo, ND 58105, USA

Received 2 June 2009; Accepted 31 July 2009

Academic Editor: Massimo Poncino

Copyright © 2009 Sudarshan K. Srinivasan et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Abstract

We develop a formal verification procedure to check that elastic pipelined processor designs correctly implement their instruction set architecture (ISA) specifications. The notion of correctness we use is based on refinement. Refinement proofs are based on refinement maps, which—in the context of this problem—are functions that map elastic processor states to states of the ISA specification model. Data flow in elastic architectures is complicated by the insertion of any number of buffers in any place in the design, making it hard to construct refinement maps for elastic systems in a systematic manner. We introduce token-aware completion functions, which incorporate a mechanism to track the flow of data in elastic pipelines, as a highly automated and systematic approach to construct refinement maps. We demonstrate the efficiency of the overall verification procedure based on token-aware completion functions using six elastic pipelined processor models based on the DLX architecture.

1. Introduction

The impact of persistent technology scaling results in a previously ignored set of design challenges such as manufacturing and process variability and increasing significance of wire delays. These challenges threaten to invalidate the effectiveness of synchronous design paradigms at the system level. Several alternate design paradigms to deal with these challenges are being proposed. One popular trend is latency-insensitive designs, which allows for variability in data propagation delays [1]. Synchronous Elastic Networks (SENs) [2, 3] hav been proposed as an effective approach to design latency-insensitive systems.

One of the critical challenges for any design approach to succeed is verification. We present a novel highly automated formal verification solution for latency-insensitive pipelined microprocessors developed using the SEN approach (here on referred to as elastic processors). Note that correctness proofs for methods to synthesize elastic designs from synchronous designs have been provided [2], but this is not a substitute for verification. The idea with the verification approach is to show that the elastic processor correctly implements all behaviors of its instruction set architecture (ISA) model, which is used as the high-level specification for the processor. The notion of correctness that we use is Well-Founded Equivalence Bisimulation (WEB) refinement, a detailed description of which can be found in [4]. It is sufficient to prove that the elastic processor (implementation) and its ISA (specification) satisfy the following core WEB refinement correctness formula to establish that the elastic processor refines (correctly implements) its ISA.

Definition 1.1 (Core WEB Refinement Correctness Formula). One has 𝑤𝐼𝑀𝑃𝐿𝑠=𝑟(𝑤)𝑢=𝑆𝑠𝑡𝑒𝑝(𝑠)𝑣=𝐼𝑠𝑡𝑒𝑝(𝑤)𝑢𝑟(𝑣)𝑠=𝑟(𝑣)𝑟𝑎𝑛𝑘(𝑣)<𝑟𝑎𝑛𝑘(𝑤).(1)

In the formula above, IMPL denotes the set of implementation states, Istep is a step of the implementation machine, and Sstep is a step of the specification machine. The refinement map 𝑟 is a function that maps implementation states to specification states. In fact, the refinement map can be thought of as an instrument to view the behaviors of the implementation machine at the specification level, thereby allowing verification tools to easily compare the behaviors of the two systems. 𝑟𝑎𝑛𝑘 is used for deadlock detection. Our focus in this work is to check safety, that is, to show that if the implementation makes progress, then, the result of that progress is correct as specified by the high-level specification. We plan to address deadlock detection in future work, and we therefore ignore 𝑟𝑎𝑛𝑘 for the present.

The specific steps involved in a refinement-based verification methodology are (a) construct models of the specification and implementation, (b) compute the states of the implementation model that are reachable from reset (known as reachable states), (c) construct a refinement map, and (d) the models and the refinement map can now be used to state the refinement-based correctness formula (excluding deadlock detection) for the implementation model, which can then be automatically checked for the set of all reachable states using a decision procedure. Modeling and verification are performed using ACL2-SMT [5], a system developed by combining the ACL2 theorem prover (version 3.3) with the Yices decision procedure (version 1.0.10) [6].

The primary challenge in applying the refinement-based approach to elastic pipelines is as follows. The very attractive property of elastic systems is that they allow for the insertion of buffers (known as elastic buffers) in any place in the data path to deal with propagation delays of long wires, without altering the functionality of the system. The insertion of these buffers however can drastically change the data flow patterns of the system, making it hard to compute refinement maps for these systems. Our primary contribution is a procedure—we call token-aware completion functions—that computes refinement maps for elastic pipelined systems (described in Section 3) even after the insertion of elastic buffers in any place in the data path. The procedure allows for highly automated and efficient verification of elastic pipelined systems. The effectiveness of our verification method is demonstrated using 6 DLX-based elastic pipelined processor models. The models are described in Section 2. Verification results are given in Section 4, and we conclude in Section 5. Due to limited space, we request the reader to refer to literature for background on synchronous elastic networks [2, 3] and refinement [4].

Note that this is the first known approach that aims to verify the correctness of elastic pipelined processors against their high-level nonpipelined ISA specifications. In previous work, we have developed an equivalence checking approach that is used to verify elastic pipelines against their synchronous parent pipelines [7].

2. Elastic Processor Models

The elastic processor models are based on the 5-stage DLX pipeline. The elastic processor models and their nonpipelined ISA-level specifications are described using the ACL2 programming language and are defined at the term-level, because term-level abstractions make the verification problem tractable. We use the ACL2-SMT system for verification as it can be used to reason at the term-level. Note that bit-level versions of these models were used in [7]. The models were obtained by first elasticizing a synchronous 5-stage DLX processor using the Synchronous Elastic Flow (SELF) protocol approach [2]. The main idea is to replace all flip flops with elastic buffers (EBs) that are constructed from two elastic half buffers (EHBs), namely, a master EHB and a slave EHB. The clock network is replaced by a network of elastic controllers, where each controller is used to control the elastic buffers in a pipeline stage and synchronized with the controllers of adjacent pipeline stages. The controllers are synchronized with the clock and are connected in accordance with connections between pipeline stages in the data path. Each controller has three possible states, 𝑒𝑚𝑝𝑡𝑦, 𝑎𝑙𝑓, and 𝑓𝑢𝑙𝑙, which indicate that the corresponding elastic buffer has 0, 1, and 2 valid data tokens, respectively.

We call the processor model obtained by elasticizing the synchronous DLX 𝑀0. The main advantage of the elastic processor is that it permits the insertion of additional elastic buffers at any place in the data path to break long wires. We therefore inserted additional elastic buffers 𝑙1,,𝑙5 at various places in the model. We inserted 𝑙1 in model 𝑀0 to get model 𝑀1. We then inserted 𝑙2 in model 𝑀1 to get 𝑀2. We derived models 𝑀3, 𝑀4, and 𝑀5 in a similar manner. The model M5 is shown in Figure 1. The figure also shows the positions of the additional elastic buffers and how they are connected with the elastic buffers corresponding to the pipeline latches (namely 𝑝𝑐,𝑓𝑑,𝑑𝑒,𝑒𝑚, and 𝑚𝑚). The network of elastic controllers for the DLX processor with five additional elastic buffers in the data path is shown in Figure 2. These models are used to demonstrate the effectiveness of our verification approach.

480740.fig.001
Figure 1: High-level organization of elastic 5-stage DLX processor with five additional elastic buffers 𝑙1,𝑙2,,𝑙5.
480740.fig.002
Figure 2: Network of elastic controllers for the elastic 5-stage DLX processor shown in Figure 1. The J and F blocks denote the join and fork circuits. Valid is used to indicate valid data in the datapath. Stop is used to indicate that EB cannot accept data at this time.

3. Token-Aware Completion Functions

Flushing [8] is one standard approach used to compute refinement maps for pipelined processors. In this approach, partially executed instructions in the pipeline latches are forced to complete, without allowing the machine to fetch any new instructions. Projecting out the programmer visible components—which include the program counter, register file, instruction memory, and data memory for the models we consider—in the resulting state will give the corresponding ISA state.

Completion functions [9] were proposed as a computationally efficient approach to construct flushing refinement maps. One completion function for each pipeline latch in the machine is used to compute the effect on the programmer visible components of completing any partially executed instruction in that latch. The completion functions are composed to form the flushing refinement map. Note that older instructions in the pipeline are completed before younger instructions. For the DLX example, let 𝑓𝑑𝑐, 𝑑𝑒𝑐, 𝑒𝑚𝑐, and 𝑚𝑚𝑐 be the completion functions for the latches 𝑓𝑑, 𝑑𝑒, 𝑒𝑚, and 𝑚𝑚, respectively. Let 𝑟𝑓, 𝑖𝑚, and 𝑑𝑚 be the register file, instruction memory, and the data memory of the processor model. The ISA state 𝑠 corresponding to a synchronous DLX processor state 𝑤 (𝑝𝑐𝑤,𝑓𝑑𝑤,𝑑𝑒𝑤,𝑒𝑚𝑤,𝑚𝑚𝑤,𝑟𝑓𝑤,𝑖𝑚𝑤,𝑑𝑚𝑤) is 𝑝𝑐𝑠,𝑟𝑓𝑠,𝑖𝑚𝑠,𝑑𝑚𝑠= fdc(dec(emc(mmc (𝑝𝑐𝑤,𝑟𝑓𝑤,𝑖𝑚𝑠,𝑑𝑚𝑤, 𝑚𝑚𝑤),𝑒𝑚𝑤),𝑑𝑒𝑤),𝑓𝑑𝑤).

When we try to apply the completion functions approach to elastic pipelined processors, two issues arise. First, in some states of the elastic processor, instructions can be duplicated in the data path; that is, an instruction can reside in two pipeline latches. Such a situation can occur at a fork when the instruction in a buffer before the fork has proceeded along one path of the fork, but the other path is blocked. The latch before the fork has to retain the instruction until both paths are cleared. A direct application of the completion functions-based map to such a state will result in completing the same instruction twice leading to an erroneous refinement map. Second, Elastic Half Buffers (EHBs) need not have valid tokens. The contents of such EHBs should be ignored and should not be used to update the programmer visible components.

We introduce token-aware completion functions as a method to compute flushing-based refinement maps for elastic pipelined processors. The idea being that EHBs which are either holding duplicate instructions or are in an empty state should not be completed. This is achieved by first computing the reachable states of the elastic controller network. We use token-flow diagrams proposed in [7] to compute the reachable states of the system. The reachability analysis is performed by simulating how tokens flow in the elastic architecture using a form of symbolic simulation. The output of the token-flow diagrams is a set of token-states, one token-state for each reachable state. In a token-state, each EHB is assigned a numbered token, which is essentially a natural number. A value of “0” indicates a bubble; that is, the EHB is empty. Also, EHBs with the same instruction will be assigned the same token numbers. Thus, using the token-state, duplicate instructions and empty EHBs can be identified.

The token-aware completion functions approach works by first computing a two-dimensional array; we call token-array. Each row in the array corresponds to a reachable state of the elastic controller network. Each element in a row is a binary value. The number of elements in a row is 2𝑛, where 𝑛 is the number of pipeline latches in the elastic system. If token-array (𝑖,𝑗)=1, then the contents of EHB 𝐻𝑗 in the reachable state 𝑆𝑖 should be completed. If token-array (𝑖,𝑗)=0, then the contents of EHB 𝐻𝑗 in the reachable state 𝑆𝑖 should be ignored when computing the refinement map. Given the set of token-states (which are the reachable states represented using numbered tokens) of the elastic controller network of an elastic system, Procedure 1 computes the token-array for the elastic system.

Procedure. In:𝑆𝑅, set of token-states of the elastic controller network and 𝑃𝐻, the ordered set of pipeline half buffers. The number of token states (|𝑆𝑅|) is 𝑟. The number of pipeline half buffers (|𝑃𝐻|) is 2𝑛, where 𝑛 is the number of pipeline latches. The order of the pipeline half buffers is determined by the position of the buffer in the pipeline; that is, buffers closer to the end of the pipeline have a higher index.Out:token-array for the elastic system.(1) Initialize 𝑖 to 𝑟.(2) Initialize 𝑉𝑡 (the set of visited tokens) to {0}. The token number “0” represents a bubble. Note that initializing 𝑉𝑡 to {0} causes the procedure to assign a “0” value to the empty EHBs in the token-array.(3) Initialize 𝑗 to 2𝑛.(4) Let 𝑡=token (𝑆𝑖,𝑃𝐻𝑗), where 𝑡𝑜𝑘𝑒𝑛 is a look-up function that gives the token number for EHB 𝑃𝐻𝑗 in token-state 𝑆𝑖.(5)token-array (𝑖,𝑗)=¬(𝑡𝑉𝑡)(6) Assign 𝑉𝑡=𝑉𝑡{𝑡}: add the token number of EHB 𝑃𝐻𝑗 to the visited token set.(7) If 𝑗10, decrement 𝑗 and go to step 4.(8) If 𝑖10, decrement 𝑖 and go to step 2. Procedure 2 takes as input the token-array and computes the flushing refinement map for the elastic system using completion functions.

Procedure. In: Elastic processor state 𝑤: 𝑃1,,𝑃𝑚,𝐻1,,𝐻2𝑛. 𝑃1,,𝑃𝑚 are the programmer visible components, and 𝐻1,,𝐻2𝑛 are the half buffers in the pipeline latches of the elastic machine.Out: ISA state 𝑠 obtained by applying the flushing refinement map to 𝑤.(1) Let 𝑆2𝑛+1=𝑃1,,𝑃𝑚. (2) Initialize 𝑖 to 2𝑛.(3)𝑟=reachable-state (𝑤), gives the number of the reachable elastic controller network state of 𝑤, assuming that the reachable states are numbered.(4)One has 𝑆𝑖=𝑆𝑐𝑜𝑚𝑝𝑙𝑒𝑡𝑖𝑜𝑛𝑖+1,𝐻𝑖𝑆,if𝑡𝑜𝑘𝑒𝑛-𝑎𝑟𝑟𝑎𝑦(𝑟,𝑖)=1,𝑖+1,otherwise.(2)(5) If 𝑖10, decrement 𝑖 and go to step 3.(6)Then, 𝑠=𝑆1.

Example 3.3. The elastic controller network of the 𝑀5 processor model has two reachable states 𝑆1 and 𝑆2. The token-states 𝑇1 and 𝑇2 (given as a vector of token numbers for the EHBs in 𝑀5 in the order 𝑝𝑐𝑓𝑑𝑑𝑒𝑒𝑚𝑚𝑚𝑙1𝑙2𝑙3𝑙4𝑙5) corresponding to these reachable states 𝑆1 and 𝑆2, respectively, are 0,70,60,50,40,00,00,00,30,00,3 and 0,07,60,50,00,40,70,40,30,30,0 [7]. Note that there are two tokens in the token-states for each EB, one corresponding to the master EHB and the other corresponding to the slave EHB. The completion function-based refinement map obtained using Procedures 3.1 and 3.2 for any state 𝑤 of processor model 𝑀5 whose elastic controller network is state 𝑆1 is 𝑝𝑐𝑠,𝑟𝑓𝑠,𝑖𝑚𝑠,𝑑𝑚𝑠=𝑓𝑑𝑐(𝑑𝑒𝑐(𝑒𝑚𝑐(𝑚𝑚𝑐(𝑝𝑐𝑤,𝑟𝑓𝑤,𝑖𝑚𝑠,𝑑𝑚𝑤,𝑙5𝑤𝑠),𝑒𝑚𝑤𝑠),𝑑𝑒𝑤𝑠), 𝑓𝑑𝑤𝑠). The completion function-based refinement map obtained using Procedures 3.1 and 3.2 for any state 𝑤 of processor model 𝑀5 whose elastic controller network is state 𝑆2 is 𝑝𝑐𝑠,𝑟𝑓𝑠,𝑖𝑚𝑠,𝑑𝑚𝑠= fdc(fdc(dec(mmc (𝑝𝑐𝑤,𝑟𝑓𝑤,𝑖𝑚𝑠,𝑑𝑚𝑤,𝑚𝑚𝑤𝑠),𝑑𝑒𝑤𝑠),𝑓𝑑𝑤𝑠), 𝑓𝑑𝑤𝑚).

4. Results

The token-aware completion functions approach was used to verify safety for six elastic pipelined processors 𝑀0,,𝑀5. The results are shown in Table 1. Verification was performed using the ACL2-SMT system. The ACL2-SMT system incorporates a translator that reduces the correctness theorem to a decision problem in the form of a formula in a decidable logic that Yices can handle. The decision problem is then checked by Yices. Column “Bool Vars” gives the number of Boolean variables in the decision problem. The experiments were conducted on a 1.8 GHz Intel (R) Core(TM) Duo CPU, with an L1 cache size of 2048 KB. As can be seen from the table, each of the elastic 5-stage DLX-based processors was verified against the high-level instruction set architecture (ISA) within 25 seconds, thereby demonstrating the high efficiency of our approach.

tab1
Table 1: Verification times and SMT statistics.

5. Conclusions

We have developed a method for checking the correctness of elastic pipelined processors against their high-level instruction set architectures. The approach was demonstrated by verifying 6 DLX-based elastic processor models. For future work, we plan to further explore the scalability of the verification method.

References

  1. L. P. Carloni, K. L. McMillan, and A. L. Sangiovanni-Vincentelli, “Theory of latency-insensitive design,” IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 20, no. 9, pp. 1059–1076, 2001. View at Publisher · View at Google Scholar
  2. J. Cortadella, M. Kishinevsky, and B. Grundmann, “Synthesis of synchronous elastic architectures,” in Proceedings of the 43rd annual Design Automation Conference (DAC '06), E. Sentovich, Ed., pp. 657–662, San Francisco, Calif, USA, July 2006. View at Publisher · View at Google Scholar
  3. S. Krstic, J. Cortadella, M. Kishinevsky, and J. O'Leary, “Synchronous elastic networks,” in Formal Methods in Computer Aided Design (FMCAD '06), pp. 19–30, IEEE Computer Society, San Jose, Calif, USA, November 2006. View at Publisher · View at Google Scholar
  4. P. Manolios, Mechanical Verification of Reactive Systems, Ph.D. thesis, University of Texas, Austin, Tex, USA, August 2001, http://www.ccs.neu.edu/home/pete/research/phd-dissertation.html.
  5. S. K. Srinivasan, Efficient verification of bit-level pipelined machines using refinement, Ph.D. thesis, Georgia Institute of Technology, December 2007, http://etd.gatech.edu/theses/available/etd-08242007-111625/.
  6. Yices, 2007, http://fm.csl.sri.com/yices/.
  7. S. K. Srinivasan, K. Sarker, and R. S. Katti, “Verification of synchronous elastic processors,” to appear in IEEE Embedded Systems Letters.
  8. J. R. Burch and D. L. Dill, “Automatic verification of pipelined microprocessor control,” in Proceedings of the 6th International Conference on Computer Aided Verification (CAV '94), vol. 818 of Lecture Notes in Computer Science, pp. 68–80, Springer, Stanford, Calif, USA, June 1994. View at Publisher · View at Google Scholar
  9. R. Hosabettu, M. Srivas, and G. Gopalakrishnan, “Proof of correctness of a processor with reorder buffer using the completion functions approach,” in Proceedings of the 11th International Conference Computer Aided Verification (CAV '99), N. Halbwachs and D. Peled, Eds., vol. 1633 of Lecture Notes in Computer Science, Springer, Trento, Italy, July 1999. View at Publisher · View at Google Scholar