Home > Articles > Hardware

This chapter is from the book

1.3 Verification Methodology

A sound verification methodology starts with a test plan that details the specific functionality to verify so that the specifications are satisfied. A test plan consists of features, operations, corner cases, transactions, and so forth, such that the completion of verifying them constitutes verifying the specifications. To track progress against a test plan, a "scoreboarding" scheme is used. During scoreboarding, the items in the test plan are checked off when they are completely verified. In reality, it is infeasible to verify a set of specifications completely, in the sense that all bugs are uncovered. Thus, a measure of verification quality is desirable. Some commonly used coverage metrics are functional coverage and code coverage. Functional coverage approximates the percentage of functionality verified, whereas code coverage measures the percentage of code simulated. Neither functional coverage nor code coverage directly corresponds to how thoroughly bugs are eliminated. To compensate this shortcoming, bug rate and simulation cycles are widely used to gauge bug absence.

Besides a test plan, a verification methodology has to decide what language or languages should be used during verification. Verilog or VHDL are common design languages. Verification code often demands a language of its own, because the code is usually of a higher level and does not have to conform to strict coding style guidelines like design code. For example, arithmetic operators occur often in verification code but seldom in design code. On the contrary, design code usually has to be able to be synthesized, but verification code does not. Hence, an ideal verification language resembles a software language more than a hardware language. Popular verification languages include Vera, e, C/C++, and Java.

To study verification methodologies further, let's group verification methodologies into two categories: simulation-based and formal method-based verification. The distinguishing factor between the two categories is the existence or absence of vectors. Simulation-based verification methodologies rely on vectors, whereas formal method-based verification methodologies do not. Another way to distinguish simulation-based and formal method based verification is that simulation is input oriented (for example, the designer supplies input tests) and formal method verification is output oriented (for example, the designer supplies the output properties to be verified). There is a hybrid category called semiformal verification that takes in input vectors and verifies formally around the neighborhood of the vectors. Because the semiformal methodology is a combination of simulation-based and formal technology, it is not described separately here.

1.3.1 Simulation-Based Verification

The most commonly used verification approach is simulation-based verification. As mentioned earlier, simulation-based verification is a form of verification by redundancy. The variant or the alternative design manifests in the reference output. During simulation-based verification, the design is placed under a test bench, input stimuli are applied to the test bench, and output from the design is compared with reference output. A test bench consists of code that supports operations of the design, and sometimes generates input stimuli and compares the output with the reference output as well. The input stimuli can be generated prior to simulation and can be read into the design from a database during simulation, or it can be generated during a simulation run. Similarly, the reference output can be either generated in advance or on the fly. In the latter case, a reference model is simulated in lock step with the design, and results from both models are compared.

Before a design is simulated, it runs through a linter program that checks static errors or potential errors and coding style guideline violations. A linter takes the design as input and finds design errors and coding style violations. It is also used to glean easy-to-find bugs. A linter does not require input vectors; hence, it checks errors that can be found independent of input stimuli. Errors that require input vectors to be stimulated will escape linting. Errors are static if they can be uncovered without input stimuli. Examples of static errors include a bus without a driver, or when the width of a port in a module instantiation does not match the port in the module definition. Results from a linter can be just alerts to potential errors. A potential error, for example, is a dangling input of a gate, which may or may not be what the designer intended. A project has its own coding style guidelines enforced to minimize design errors, improve simulation performance, or for other purposes. A linter checks for violations of these guidelines.

Next, input vectors of the items in the test plan are generated. Input vectors targeting specific functionality and features are called directed tests. Because directed tests are biased toward the areas in the input space where the designers are aware, bugs often happen in areas where designers are unaware; therefore, to steer away from these biased regions and to explore other areas, pseudorandom tests are used in conjunction with directed tests. To produce pseudorandom tests, a software program takes in seeds, and creates tests and expected outputs. These pseudorandomly generated tests can be vectors in the neighborhood of the directed tests. So, if directed tests are points in input space, random tests expand around these points.

After the tests are created, simulators are chosen to carry out simulation. A simulator can be an event-driven or cycle-based software or hardware simulator. An event simulator evaluates a gate or a block of statements whenever an input of the gate or the variables to which the block is sensitive change values. A change in value is called an event. A cycle-based simulator partitions a circuit according to clock domains and evaluates the subcircuit in a clock domain once at each triggering edge of the clock. Therefore, event count affects the speed a simulator runs. A circuit with low event counts runs faster on event-driven simulators, whereas a circuit with high event counts runs faster on cycle-based simulators. In practice, most circuits have enough events that cycle-based simulators out-perform their event-driven counterparts. However, cycle-based simulators have their own shortcomings. For a circuit to be simulated in a cycle-based simulator, clock domains in the circuit must be well defined. For example, an asynchronous circuit does not have a clear clock domain definition because no clock is involved. Therefore, it cannot be simulated in a cycle-based simulator.

A hardware simulator or emulator models the circuit using hardware components such as processor arrays and field programmable gate arrays (FPGAs). First, the components in a hardware simulator are configured to model the design. In a processor array hardware simulator, the design is compiled into instructions of the processors so that executing the processors is tantamount to simulating the design. In an FPGA-based hardware acceleration, the FPGAs are programmed to mimic the gates in the design. In this way, the results from running the hardware are simulation results of the design. A hardware simulator can be either event driven or cycle based, just like a software simulator. Thus, each type of simulator has its own coding style guidelines, and these guidelines are more strict than those of software simulators. A design can be run on a simulator only if it meets all coding requirements of the simulator. For instance, statements with delays are not permitted on a hardware simulator. Again, checking coding style guidelines is done through a linter.

The quality of simulating a test on a design is measured by the coverage the test provides. The coverage measures how much the design is stimulated and verified. A coverage tool reports code or functional coverage. Code coverage is a percentage of code that has been exercised by the test. It can be the percentage of statements executed or the percentage of branches taken. Functional coverage is a percentage of the exercised functionality. Using a coverage metric, the designer can see the parts of a design that have not been exercised, and can create tests for those parts. On the other hand, the user could trim tests that duplicate covered parts of a circuit.

When an unexpected output is observed, the root cause has to be determined. To determine the root cause, waveforms of circuit nodes are dumped from a simulation and are viewed through a waveform viewer. The waveform viewer displays node and variable values over time, and allows the user to trace the driver or loads of a node to determine the root cause of the anomaly.

When a bug is found, it has to be communicated to the designer and fixed. This is usually done by logging the bug into a bug tracking system, which sends a notification to the owner of the design. When the bug is logged into the system, its progress can be tracked. In a bug tracking system, the bug goes through several stages: from opened to verified, fixed, and closed. It enters the opened stage when it is filed. When the designer confirms that it is a bug, he moves the bug to the verified stage. After the bug is eradicated, it goes to the fixed stage. Finally, if everything works with the fix, the bug is resolved during the closed stage. A bug tracking system allows the project manager to prioritize bugs and estimate project progress better.

Design codes with newly added features and bug fixes must be made available to the team. Furthermore, when multiple users are accessing the same data, data loss may result (for example, two users trying to write to the same file). Therefore, design codes are maintained using revision control software that arbitrates file access to multiple users and provides a mechanism for making visible the latest design code to all.

The typical flow of simulation-based verification is summarized in Figure 1.4. The components inside the dashed enclosure represent the components specific to the simulation-based methodology. With the formal verification method, these components are replaced by those found in the formal verification counterparts.

01fig04.gif

Figure 1.4 Flow of simulation-based verification

1.3.2 Formal Method-Based Verification

The formal method-based verification methodology differs from the simulation-based methodology in that it does not require the generation of test vectors; otherwise, it is similar. Formal verification can be classified further into two categories: equivalence checking and property verification.

Equivalence checking determines whether two implementations are functionally equivalent. Checking equivalence is infeasible using a simulation-based methodology because there are practically an infinite number of vectors in the input space. During formal verification, the decision from a equivalence checker is clear-cut. However, industrial equivalence checkers have not yet reached the stage of turnkey solution and often require the user to identify equivalent nodes in the two circuits to limit the input search space for the checkers. These user-identified equivalent nodes are called cut points. At times, a checker can infer equivalent nodes from the node names.

Two basic approaches are behind equivalence checking. The first approach searches the input space in a systematic way for an input vector or vectors that would distinguish the two circuits. This approach, called SAT (satisfiability), is akin to automatic test pattern generation algorithms. The other approach converts the two circuits into canonical representations, and compare them. A canonical representation has the characteristic property that two logical functions are equivalent if and only if their respective representations are isomorphic—in other words, the two representations are identical except for naming. A reduced ordered binary decision diagram is a canonical representation. Binary decision diagrams of two equivalent functions are graphically isomorphic.

Equivalence checking is most widely used in the following circumstances:

  1. Compare circuits before and after scan insertion to make sure that adding scan chains does not alter the core functionality of the circuit.
  2. Ensure the integrity of a layout versus its RTL version. This is accomplished by first extracting from the layout a transistor netlist and comparing the transistor netlist with the RTL version.
  3. Prove that changes in an engineering change order (ECO) check-in are restricted to the scope intended. This is done by identifying the changed regions in the circuits.

If an equivalence check fails, the checker generates an input sequence of vectors that, when simulated, demonstrates the differences between the two circuits. From the waveforms, the user debugs the differences. A failure can result from a true error or an unintended boundary condition. An unintended boundary condition arises when the scan circuitry is not disabled. Then a checker will generate a sequence of vectors that runs the postscan circuit in test mode while running the prescan circuit in normal operating mode. Surely these two circuits are not equivalent under this input sequence. Therefore, when comparing a prescan circuit and a postscan circuit, the postscan circuit must be configured in normal operating mode.

The other type of formal verification is property checking. Property checking takes in a design and a property which is a partial specification of the design, and proves or disproves that the design has the property. A property is essentially a duplicate description of the design, and it acts to confirm the design through redundancy. A program that checks a property is also called a model checker, referring the design as a computational model of a real circuit. Model checking cast in the light of the basic verification principle is visualized in Figure 1.3 (B).

The idea behind property checking is to search the entire state space for points that fail the property. If a such point is found, the property fails and the point is a counterexample. Next, a waveform derived from the counterexample is generated, and the user debugs the failure. Otherwise, the property is satisfied. What makes property checking a success in industry are symbolic traversal algorithms that enumerate the state space implicitly. That is, it visits not one, but a group of points at a time, and thus is highly efficient.

Even though symbolic computation has taken a major stride in conquering design complexity, at the time of this writing only the part of the design relevant to the property should be given to a property verifier, because almost all tools are incapable of automatically carving out the relevant part of the design and thus almost certainly will run into memory and runtime problems if the entire design is processed.

Furthermore, the power and efficiency of a property verifier is highly sensitive to the property being verified. Some properties can be decided readily whereas others will never finish or may not even be accepted by the tool. For example, some property verifiers will not accept properties that are unbound in time (for example, an acknowledgment signal will eventually be active). A bound property is specified within a fixed time interval (for example, an acknowledgment signal will be active within ten cycles).

A failure can result from a true design bug, a bug in the property or unintended input, or state configurations. Because a property is an alternative way of expressing the design, it is as equally prone to errors as the design. A failure can be caused by unintended input or state configurations. If the circuit under verification is carved out from the design, the input waveforms to the circuit must be configured to be identical to them when the circuit is embedded in the design. Failure to do so sends unexpected inputs (for example, inputs that would not occur when the circuit is a part of the design) to the circuit, and the circuit may fail over these unexpected inputs because the circuit has not been designed to handle them. To remove unintended configurations from interfering with property verification, the inputs or states are constrained to produce only the permissible input waveforms. Underconstraining means that input constraining has not eliminated all unexpected inputs, and this can trigger false failures. Overconstraining, which eliminates some legal inputs, is much more dangerous because it causes false successes and the verifier will not alert the user.

Some practical issues with property verifiers include long iteration times in determining the correct constraining parameters, and debugging failures in the properties and in the design. Because only a portion of the design is given to the property verifier, the environment surrounding that portion has to be modeled correctly. Practical experience shows that a large percentage of time (around 70 percent) in verification is spent getting the correct constraints. Second, debugging a property can be difficult when the property is written in a language other than that of the design (for instance, the properties are in SystemVerilog whereas the design is in Verilog). This is because many property verifiers internally translate the properties into finite-state machines in Verilog, and verify them against the design. Therefore, the properties are shown as the generated machine code, which is extremely hard to relate to signals in the design or is hard to interpret its meaning. Finally, debugging failures in a property has the same difficulty as any other debugging.

As an alternative to a state space search in verifying a property, the theorem-proving approach uses deductive methods. During theorem proving, a property is specified as a mathematical proposition and the design, also expressed as mathematical entities, is treated as a number of axioms. The objective is to determine whether the proposition can be deduced from the axioms. If it can, the property is proved; otherwise, the property fails. A theorem prover is less automatic than a model checker and is more of an assistance to the user. The user drives the tool to arrive at the proposition by assembling relevant information and by setting up intermediate goals (in other words, lemmas), whereas the tool attempts to achieve the intermediate goals based on the input data.

Effective use of a theorem prover requires a solid understanding of the internal operations of the tool and a familiarity with the mathematical proof process. Although less automatic, efficient usage of a theorem prover can handle much larger designs than model checkers and requires less memory. Furthermore, a theorem prover accepts more complex properties. For example, a theorem prover can allow the properties written in higher order logic (HOL) whereas almost all model checkers only accept first-order logic and computation tree logic or their variants. HOL is more expressive than first-order logic and enables a concise description of complex properties.

A typical flow of formal verification is shown in Figure 1.5. Remember that the components in this diagram replace the components inside the dashed box of Figure 1.4. Although formal verification does not require test vectors, it does require a test bench that configures the circuit in the correct operational mode, such as input constraining.

01fig05.gif

Figure 1.5 A typical flow of formal verification

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020