Project

General

Profile

C++TESK Getting Started » History » Revision 3

Revision 2 (Mikhail Chupilko, 09/19/2013 02:29 PM) → Revision 3/9 (Mikhail Chupilko, 09/19/2013 02:40 PM)

h1. C++TESK Getting Started 

 h2. Introduction 

 _Hardware verification_ Hardware verification is usually understood as the process of checking _behavior_ behavior of hardware on conformity to its _specification_. specification. Such a process can be done formally by means of, e.g., model checking, automatic theorem proving, etc. Also, verification can be done by means of _simulation of_ simulation of separated hardware modules with the help of _simulator_. simulator. 

 Accounting the complexity of hardware models under verification, the task of automation should have usually been solved before the actual verification. The more processes will be done automatically and the less manual labor will be needed, the more effective check will be made. Without touching upon the formal verification methods, in this course we will focus only on simulation-based verification. Moreover, we will further speak only about one of the existing verification tool, created in the Institute for system programming of RAS. The tool''s capabilities allow speaking about it as a powerful and quite modern solution. So, we will speak about using _C++TESK C++TESK Testing ToolKit_ ToolKit (or C++TESK for short). 

 C++TESK implements simulation based approach to verification. The main element of the tool is its _core library_, core library, implemented in programming languages C and C++. All core components are arranged in one package and are available at http://forge.ispras.ru/projects/cpptesk-toolkit/files. The tool is designed for creating test systems using C++ for different models of synchronous hardware at different levels of abstraction. Test systems are created using any means, provided by C++, basing on the approach, macros and classes defined by C++TESK. 

 When creating test systems for simulation based verification, three main tasks are usually solved. The first one is _test test sequence construction_, construction, the second one is _checking checking of behavior correctness_, correctness, and the third one is test completeness estimation. C++TESK allows construction test sequences of two types: selection _random random stimulus set_ set from the previously described stimuli at each simulation cycle or _selective choice_ selective choice of stimuli based on techniques of _exploration_ exploration of implicitly defined FSMs. Checking of behavior correctness is made at each simulation cycle by means of _executable executable reference model_, model, created by verification engineer at some level of abstraction. External model (e.g., system simulator) can also be used. _Test completeness_ Test completeness is determined either by the number of testing cycles for randomly selected stimuli, or on the basis of the information about _completeness completeness of FSM exploration_. exploration. 

 Common scheme of test system is represented in figure 1. 

 1 ( !figure1.png! ). 
 *Figure1. Generalized structure of test system* 

 Let us shortly describe elements represented at the common scheme. 
 # _Stimulus generator_ is a component making test sequence (stimuli sequence). It is adjusted by test scenarios; 
 # _Test oracle_ is a component receiving data flows from stimulus generator and target component, sending stimulus flow from generator to target component, estimating correctness of target system behavior; 
 # _Target system_ is a hardware model, developed at one of hardware description languages (here, in Verilog), receiving stimulus flow and responding to it by reactions which should be checked; 
 # _Coverage tracker_ is a component grabbing information about reference model functional coverage, which in general affects stimulus generator work (e.g., by information of reached coverage); 
 # _Test report generator_ is a component making reports (test traces) with information of traversed transitions, reached coverage, found errors, etc. 


 The following tasks will be overviewed below. 
 * Analysis of documentation for development of C++TESK test systems; 
 * Development of test oracles including reference models and their adapters; 
 * Definition of test coverage; 
 * Setting up stimulus generator; 
 * Verification itself. 

 h2. Documentation analysis for development of test systems 

 Under _verification_ we mean a process of checking observed behavior against specification. In the other words, verification is an establishing of the correspondence between target system behavior and its specification. Therefore, we should have not only the target system, but its specification too, being a document written at the beginning of target system development, slightly modified during development process, and containing information of target system functionality. 

 In reality specification is often very poor or even absent, and target system developers might have written only lists of _input_ and _output interface_ signals. In this case to conduct verification is difficult as to speak about bug in target system is possible only having information about correct behavior. Verification engineers have to interview target system developers, making list of requirements which are obligatory for target system. When list of requirements (specification) is obtained, verification can be started. 

 Practice shows that specification (especially, cycle accurate) is convenient to represent in the following ways. 
 1. by means of block diagrams (see figure 2). 

 !figure2.png! 
 *Figure 2. Example of block diagram for single operation* 

 Block diagram allows describing reference model behavior with any proximity to cycle accurateness. Figure 2 contains abstract representation of operation IO-WRITE (write via IO channel), starting from one-cycle request by the 20th interface. At the following cycle, device starts to receive data, taking 17, 19, 33 or 37 cycles depending on data length and presence of mask among sent data. This block diagram is insufficient for usage in reference model development and is supplied with _chart of cycle accurate operation description_, which should be described below. Operation finishes after receiving and saving of all data. 

 The following notations are used in block diagrams. 
 * Oval symbols mean points of operation start and stop; start point contains mnemonic designation of operation to be executed in this control flow path; 
 * Rectangle symbols mean blocks taking exactly one cycle for execution at current abstraction level. Process of reference model functioning is always described inside of such blocks. Block is allowed to be supplied with information about real execution time, other auxiliary information facilitating binding the scheme to reference model. 
 * Rhombus symbols mean branches in control flow. The symbol should contain condition of branching inside. There should be only one ingoing path and two outgoing paths; 
 * Forking of control flow is represented by bold point with two or more outgoing paths; 
 * Merging of several control flow paths is made also in bold point, meaning synchronization of control flow paths (waiting for the slowest one) to proceed to the outgoing path. 

 2. by means of _charts of cycle accurate operation description_ (see table 1).