|
|||||
OpenVera 2.0 assertions empower verification
OpenVera 2.0 assertions empower verification Assertion-based verification has become important because current verification techniques are inadequate at catching errors and eliminating them. Consider the case where you have embedded a core in a system-on-a-chip (SoC) design. If you are just checking signals at the chip level, then you may not catch a bug that is caused by an improper protocol to the embedded core. If the protocols were constantly being monitored, then when the violation occurs, the simulation would immediately respond with an assertion failure -- and the real cause of the problem can be investigated. Assertions are created to describe design specifications. Assertions can describe undesirable behaviors or specific behaviors that are required to complete a test plan. These assertions can then be checked in either dynamic simulation or formal verification. OpenVera Assertions (OVAs) are part of the OpenVera hardware verification language, which is available under an open sou rce license. The open source model has proven to provide a path for fast time-to-market with innovation and contribution from multiple sources. SoC design teams, verification teams and EDA developers can access OpenVera by downloading the Language Reference Manual (LRM) from the OpenVera web site. Assertions in OpenVera 2.0 provide a clear mechanism to describe sequences of events and to test for their occurrence. This method is more concise and intuitive than the procedural descriptions provided by hardware description languages (HDLs) such as Verilog. In addition, OVAs have built-in functions to minimize the amount of code that you need to write. With the expressive power of OVAs, complex protocol assertions can be described in much fewer lines of code than with HDL-based assertions. With clear definitions and less code, verification is more productive. OVAs can be checked dynamically during simulation, and they can be targeted for proofs by formal verificat ion tools. With this unified support, designers can specify once and use in multiple verification environments. Additionally, OVAs can be used to specify functionality to simulate and measure functional coverage. OVAs provide language capabilities to build and reuse libraries of pre-built assertions. This macro capability provides a mechanism to build a reusable library of assertions, which can be shared within groups or among the OpenVera community. With a library of assertions, designers will be able to reuse the prior specifications and raise the level of abstraction of the specification. Features of OpenVera assertions OVAs are implicitly and concurrently evaluated during all of verification. In dyna mic verification, the assertions would be evaluated continuously. Each assertion is evaluated at every time step, and its status is updated by the state of simulation. If an assertion completes, then its result can be logged and displayed in a GUI environment. With this implicit evaluation, any overhead of starting, processing and evaluating assertions is a natural feature and does not require any action by the user. The language includes features to express the following: The OVA language provides capabilities to refer to data values in the past, present or future. This enables checks of data values at specific time points. An example of this usage is to check that FIFO output corresponds to input after several operations. In addition, the language provides capabilities to have a non-deterministic variable called a free variable specification, which enables formal verification tools to verify for all possible variable assignments. This provides a shorthand method of asserting all possible values. Language hierarchy Context I t is usually necessary to define a sampling clock to determine when to sample the design signals. OVA provides the clock keyword in order to specify when to sample the design signals. Directives Boolean expressions Event expressions "If ready is True intermittently or continuously for 3 clock cycles, then after that transmit must be True within 4 clock cycles, unless reset happened in the meantime." Figure 1 - OVA code for protocol The OVA code shown in Figure 1 starts with a module specification "module protocol". This specification implies that all of the statements in this definition should apply to all instances of module protocol. The next line is "clock posedge clk". This specification implies that all events within this grouping should sample their design signals at the rising edge of clk. The initial sequence that we want to check for is "ready is True intermittently or continuously for 3 clock cycles." Let's first look at: ready #[1..] ready #[1..] ready This sequence will succeed whenever ready is high in three clock cycles, which do not need to be consecutive. Figure 2 shows two valid sequences. In the first waveform, ready is high for three consecutive clock cycles. The start and end time of the event is shown. In the second waveform, ready is high in every other cycle that is also a valid sequence. This condition is necessary but not sufficient. We must also constrain the reset from triggering as well as transmit from going h igh. In order to constrain these signals the istrue construct is used: istrue (!transmit && !reset) in (ready #[1..] ready #[1..ready); if (matched ready3) then #[1..4] (transmit || reset); Whenever event ready3 succeeds, then between one and four clock cycles later either transmit goes high or reset goes high. If ready3 never matches, then we do not check the then condition. Only if ready matches do we perform this check. Finally, we use the assert directive to enforce this check during design verification. Formula expressions
Consider the example of an arbiter. The OVA code is shown in Figure 3.
Figure 3 - OVA code for arbiter A possible waveform for the arbiter is shown in Figure 4: We want to check for the condition that can occur whenever a grant signal and lock are asserted. If this condition happens, then grant should stay asserted until lock is de-asserted. First we need to check if grant and lock are asserted simultaneously: if (grant && lock This condition is true whenever both grant and lock are true at the same falling clock edge. At clock cycle 2 this condition holds. The then clause "grant until !lock" specifies that grant should stay high until lock is de-asserted. At cycle 5 lock is de-asserted, and thus the sequence terminates. The value of grant is immaterial when "!lock" is sampled. Finally, an assert directive is required to ensure the sequence holds for the entire simulation: assert a_grant : globally f_grant; Consider another example of a protocol using the triggers construct. Figure 5 shows an example of an assertion for a data transf er protocol. Figure 6 shows the waveform for the protocol.
Figure 5 - OVA code for data transfer Figure 6 -- Waveform for data transfer protocol The signal "burst_start" signals the start of a burst mode protocol, "burst_end" signals the end of a burst mode, and transfer is asserted when there is a transfer of data. If reset occurs during data transfer, this should not cause an assertion failure and the sequence is accepted. All signals within the assertion are relative to the arbiter module because of the module definition module "data_transfer." All signals are sampled on the negative edge of the clock because of the clock definition clock "negedge clk." "Formula f_burst" specifies that whenever there is a start of a burst mode, then transfer should be asserted until the end of the burst mo de transfer. Now, if during this sequence, reset is asserted, although the property would fail, we should not report a failure because it is caused by an external reset. The formula formula f_burst_r : accept (reset) in f_burst; specifies that reset is a condition that will cause "f_burst_r" to succeed if reset occurs during the sequence "f_burst." The construct "accept reset in" specifies that the formula is true whenever reset is asserted in the sequence. Finally an assert directive is required to ensure the sequence holds for the entire simulation: assert a_burst_r : globally f_burst_r; Consider a third example using the eventually construct. Figure 7 shows the OVA code and Figure 8 shows the waveform diagram.
Figure 7 - OVA code for eventuality construct Figure 8 -- Waveform using eventually construct The temporal sequence description request #[1..3] request succeeds whenever there are 2 requests separated by 1 through 3 clock cycles. In Figure 8 there is a request at cycle1, and at cycle 3, which is a valid sequence. The construct "triggers" implies that whenever the above sequence holds, then the second formula must also hold one cycle later. The second expression eventually[3..5] grant implies that grant must be true 3 to 5 cycles from that time. Finally the formula must be asserted to be true: assert a_grant : globally f_grant; The construct globally is used to assert that this formula must always be true. Summary OpenVera Assertions provide a language platform on which an assertion-based methodology can be constructed. Libraries of assertion intellectual property (IP) can be developed and exchanged to increase verification abstraction and productivity. Bruce Greene is a technical marketing manager in Synopsys' Verification Technology group. Previously, Greene worked as a Field application engineer at C Level Design selling and supporting the synthesis and simulation products. Prior to that, he worked as a corporate application engineer in the Nanometer Analysis and Test group at Synopsys, Inc.
|
Home | Feedback | Register | Site Map |
All material on this site Copyright © 2017 Design And Reuse S.A. All rights reserved. |