• 沒有找到結果。

Transition definitions:

3.5 Stimulus Biasing

Biasing techniques can help verification engineers generate stimuli to hit desirable corner cases more easily. BDD-based approaches can generally support the stimulus biasing.

However, due to the BDD’s inherent topology, only bit-level signals can be biased in these approaches. Instead, our stimulus generator is capable of achieving an even higher flexibility, shown later, to bias the generated stimuli. This feature is extremely useful to exercise those uncovered scenarios to get a better simulation quality.

Table 3.1: Biasing information I

Biasing type Weight Transition-level Wt3 = 20

Wt4 = 40

3.5.1 Transition-level Biasing / Transaction-level Biasing

Since each transition indicates certain interface behavior, we use the transition-level bi-asing to guide the state transition. Due to the non-determinism, there may exist multiple valid transitions after the Evaluation phase. A strategy is needed to pick one from these candidates. One method is to give each transition t an individual weight wt. Then, the probability that a candidate transition ti is selected is defined as:

Pti = wti P

tj∈N T CSwtj

, ti ∈NTCS

For example, in Case 1 of the previous example, t3 and t7 are both transition candidates.

If the biasing information is given as Table 3.1, t7 has a higher probability (80%) to be chosen than t3(20%) does. Furthermore, if preliminary simulation results do not exercise certain states or transitions, the related transition weights can be increased accordingly.

Another similar approach is the transaction-level biasing. We can define a meaningful transaction in terms of a sequence of transitions and then bias all these transitions at the

d[1]

Figure 3.9: An example of bit-level biasing.

same time.

3.5.2 Bit-level biasing / Word-level biasing

As mentioned before, bit-level biasing is available while BDD-based approaches are adopted. The basic idea of these approaches is to traverse BDDs to obtain a valid so-lution. Fig. 3.9 is an example to demonstrate the bit-level biasing scheme. In Fig. 3.9(a), there are two BDD nodes representing distinct bit signals, d[0] and d[1]. Each node has two outgoing branches “Then” and “Else” to indicate that the signal is assigned to 1 or 0.

General bit-level biasing schemes set a probability value along with each branch to affect the BDD traversal outcomes. For example, p and q are bit-level biasing parameters for

“d[1]=1” and “d[0]=1” in Fig. 3.9, respectively.

In typical protocols, many signals are defined in a group of bits, i.e., a word, instead of a single bit only. Therefore, the capability of the word-level biasing becomes critical

and essential. As shown in Fig. 3.9(b), bit-level biasing settings can result in different word-level biasing. However, bit-level biasing has limitations in many situations. For example, in our approach, we allow the weight settings for different word values of d as shown in Table 3.1 to apply direct word-level biasing. This biasing setting simultaneously increases the appearance probabilities of “d=01” and “d=10”. Note that, under bit-level biasing, the positive biasing of “d=01” implies the negative biasing of “d=10”. Obviously, there is no way for bit-level biasing to achieve the distribution of word-level biasing given in Table 3.1.

In our approach, the word-level biasing settings can affect the generated stimuli in two manners. On the one hand, while the biased signal is in the unconstrained part of the Update phase, the signal’s value can be directly produced via a weighted random number generator with the distribution specified by the word-level biasing. On the other hand, if the biased signal appears in the constrained part, i.e., the signal value relates to which transition is selected, the biasing effect could be reflected by changing the transition weights. Assume the word-level biasing list for an n-bit signal s is “Ws=0, Ws=1, ..., Ws=2n−1” and Cs=it is a binary variable indicating if “s = i” is feasible while selecting t as the next transition, for 0 ≤ i ≤ 2n− 1. While the original transition weight of the transition t is wt, the modified transition weight according to the word-level biasing is:

w0t= wt

P2n−1

i=0 Cs=it ∗ Ws=i P2n−1

i=0 Ws=i

Table 3.2 shows an example of this mechanism. When the word-level weights of the signal b are given, the original transition weights, as shown in Table 3.1, can be modified according to the update transformation functions of those transitions. While t3and t7 con-strain the value of Ib to 1 and 0, respectively, the modification ratio, Wt03/Wt3:Wt07/Wt7, is 3:1, which is the same as the word-level biasing setting of Ib (WIb=1:WIb=0). After this adjustment, the transitions tending to generate signal values with higher word-level weights should appear more frequently.

3.5.3 Feedback for Biasing Refinements

By understanding the design intent and desired scenarios, engineers can manually change those biasing settings to improve simulation quality in later simulation runs. Besides, we could also build a weight tuner which can collect current simulation information and adjust the biasing settings automatically.

In general, a weight tuner should follow certain formulae or strategies to bias the simulation to unverified corners. In other words, the new weight settings should raise the appearance probability of those stimuli which are seldom or even not produced in the previous stimulus set. For example, here is a simple strategy for increasing the transition coverage of GEFSM and balancing every transition’s appearance count as far as possible.

Assume current outgoing transitions are {t1, t2, ..., tn} and the corresponding weight set is W={wt1, wt2, ..., wtn}. If ti is selected as the next transition and wti is greater than n,

Table 3.2: Biasing information II

we can apply the following weight tuning formula to every wtj ∈ W:

wtj =

By decreasing the weight of frequently appeared transition and increasing weights of others, this kind of feedback mechanism can dynamically modify biasing settings during simulation. Hence, more varied stimulus sequences can be obtained using an automatic weight tuner.

相關文件