# Coverage Fulfillment Automation in Hardware Functional Verification Using Genetic Algorithms
## 4 Results
### Coverage Collection for ALUI Operating as an Accumulator  
The design represents an arithmetic logic unit (ALU) operating as an accumulator (the first operand is fed with the value of the previous operation result), which performs the four basic mathematical operations. The operands (called operand A and operand B) and the result are 8 bits wide, and there is an error bit that signals both overflow and underflow situations. The range of the resulting values was split into 10, 15, and 20 ranges during the many trials performed. All coverage ranges contained the same number of values, except for the last group which accommodated only the remaining values, as depicted in (5). The coverage target consists in obtaining results from the DUT, the values of which fit each of the intervals computed in (5) after 20 consecutive operations were performed. \[ULs=\bigg{\{}c\in\mathbb{N},\ c=\max\bigg{(}bottom+i+\frac{top-bottom}{n},top \bigg{)}|i\in(0,n-1)\bigg{\}}, \tag{5}\]  
where \(ULs\) (upper limits) represents the list of the upper limits of the ranges of values corresponding to the intervals of values which must be covered (the list of lower limits can be easily deduced as the coverage intervals are arranged back-to-back); _top_ and _bottom_ represent a maximum and minimum value which can be reached by the signal to be covered (e.g., if the signal is 8 bits wide, and there are no other constraints imposed by functional specification, the top value is 255 and the bottom value is 0). The approaches used to generate sequences of stimuli are labeled and their characteristics described in Table 1. \begin{table}
\begin{tabular}{c c} \hline \hline
**Version of GA** & **Characteristics of Genetic Algorithms-Based Approach** \\ \hline \multirow{7}{*}{**Version 1**} & \multirow{7}{*}{\(\bullet\)} & the data contained by each individual which commands the accumulator to perform a sequence of 20 operations are stored in this order: the first value of operand A, the first value of operand B, the first code of operator, the second value of operand B, the second code of operator, \(\ldots\) the 20 th value of operand B, the 20 th code of operator; \\  & \multirow{7}{*}{\(\bullet\)} & the crossover is done using a random position in the data stream that represents an individual; \\  & \multirow{7}{*}{\(\bullet\)} & two parents generate exactly two children; \\  & \multirow{7}{*}{\(\bullet\)} & only the best parents (the first half of the total number of parents which are extracted after ordering the individuals) are used to generate children in the next population (parent 1 is combined with parent 2, parent 2 is combined with parent 3, \(\ldots\), parent n_pop/2-1 is combined with parent n_pop/2); \\  & \multirow{7}{*}{\(\bullet\)} & 20\% of the parents (randomly selected) are transferred unaltered to the next generation; \\  & \multirow{7}{*}{\(\bullet\)} & mutation probability is 2\%. \\ \hline \multirow{2}{*}{**Version 1.1** (compared with v1.1)} & \multirow{7}{*}{\(\bullet\)} & all parents are used to generate the next population (parent 1 is combined with parent 2, parent 3 is compared with parent 4, \(\ldots\), parent n\_pop-1 is combined with parent n\_pop). \\ \hline \multirow{2}{*}{**Version 1.2** (compared with v1.1)} & \multirow{7}{*}{\(\bullet\)} & the best 20\% of parents are copied as children; the parents copied as children are not randomly selected as in previous versions. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The characteristics of genetic algorithm-based approaches developed in the present work. The described approaches were tested over multiple coverage targets to check their performance. The obtained results can be seen in Tables 2-4, and are grouped by the number of ranges into which the result was split. To emphasize the performance of genetic algorithm approaches over the classical verification technique (known as \"constrained-random verification\"), the team ran several sets of simulations using randomly generated stimuli. They used multiple metrics to compare the performance of employed approaches: