OpenCores
URL https://opencores.org/ocsvn/pavr/pavr/trunk

Subversion Repositories pavr

[/] [pavr/] [trunk/] [doc/] [html/] [group__pavr__test.html] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 doru
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3
<title>Testing</title>
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
5
</head><body>
6
<!-- Generated by Doxygen 1.2.16 -->
7
<center>
8
<a class="qindex" href="main.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
9
<hr><h1>Testing</h1><table border=0 cellpadding=0 cellspacing=0>
10
<tr><td colspan=2><br><h2>Modules</h2></td></tr>
11
<tr><td nowrap align=right valign=top><a class="el" href="group__pavr__test__bugs.html">Bugs</a></td></tr>
12
<tr><td nowrap align=right valign=top><a class="el" href="group__pavr__fpga.html">FPGA prototyping</a></td></tr>
13
</table>
14
<hr><a name="_details"></a><h2>Detailed Description</h2>
15
<dl compact><dt><b>
16
Testing strategy</b><dd>
17
When testing a certain entity, the following <b>testing</b> <b>strategy</b> was adopted: <ul>
18
<li> embed that entity into a larger one that also includes all other ingredients needed for a real-life simulation of the tested entity. Typical such `other ingredients' are RAMs and multiplexers. <li> run custom VHDL tests that test as much as possible of the functionality of the device under test. Extreme cases are the first situations to be tested. </ul>
19
<br>
20
 Two kinds of tests were conducted on pAVR: <ul>
21
<li> every module of pAVR was separately tested as described in the testing strategy above. <li> pAVR as whole was tested as described in the testing strategy above. </ul>
22
<br>
23
</dl><dl compact><dt><b>
24
Testing pAVR modules</b><dd>
25
Each pAVR module was separately tested. <br>
26
 The particular tests carried out are presented below, grouped by the entities under test: <ul>
27
<li> <b>utilities</b> defined in `std_util.vhd' <br>
28
 The associated test file is `test_std_util.vhd'. <br>
29
 The utilities defined in `std_util.vhd' here are: <ul>
30
<li> type conversion routines often used throughout the other source files in this project <li> basic arithmetic functions <li> sign and zero-extend functions <br>
31
 Both are tested in `test_std_util.vhd'. <br>
32
 Extreme cases and typical cases are considered. <br>
33
 <li> vector comparision function <br>
34
 Tested in `test_std_util.vhd'. <br>
35
 Extreme cases and typical cases are considered. <br>
36
 </ul>
37
<li> <b>ALU</b> <br>
38
 The associated tests are defined in `test_pavr_alu.vhd'. They consist of checking the ALU output and flags output for all ALU opcodes, one by one, for all of these situations: <ul>
39
<li> carry in = 0 <li> carry in = 1 <li> additions generate overflow <li> substractions generate overflow </ul>
40
There are 26 ALU opcodes to be checked for each situation. <li> <b>Register</b> <b>File</b> <br>
41
 The associated tests are defined in `test_pavr_register_file.vhd'. <br>
42
 The following tests are done: <ul>
43
<li> read all ports, one at a time <ul>
44
<li> read port 1 (RFRD1) <li> read port 2 (RFRD2) <li> write port (RFWR) <li> write pointer register X (RFXWR) <li> write pointer register Y (RFYWR) <li> write pointer register Z (RFZWR) </ul>
45
<li> combined RFRD1, RFRD2, RFWR <br>
46
 They should work simultaneousely. <li> combined RFXWR, RFYWR, RFZWR <br>
47
 They should work simultaneousely. <li> combined RFRD1, RFRD2, RFWR, RFXWR, RFYWR, RFZWR <br>
48
 That is, all RF ports are accessed simultaneousely. They should do their job. <br>
49
 However, note that the pointer registers are accessible for writting by their own ports but also by the RF write port. Writing them via pointer register write ports overwrites writing via general write port. Even though concurrent writing could happen in a perfectly legal AVR implementation, AVR's behavior is unpredictible (what write port has priority). We have chosen for pAVR the priority as mentioned above. </ul>
50
<li> <b>IO</b> <b>File</b> <br>
51
 The associated tests are defined in `test_pavr_io_file.vhd'. <br>
52
 The following tests are performed on the IOF: <ul>
53
<li> test the IOF general write/read/bit processing port. <br>
54
 Test all opcodes that this port is capable of: <ul>
55
<li> wrbyte <li> rdbyte <li> clrbit <li> setbit <li> stbit <li> ldbit </ul>
56
<li> test the IOF port A. <br>
57
 Port A is intended to offer to pAVR pin-level IO connectivity with the outside world. <br>
58
 Test reading from and writing to Port A. <br>
59
 Test that Port A pins correctly take the appropriate logic values (high, low, high Z or weak high). <li> test Timer 0. <ul>
60
<li> test Timer 0 prescaler. <li> test Timer 0 overflow. <li> test Timer 0 interrupt. </ul>
61
<li> test External Interrupt 0. <br>
62
 Test if each possible configuration (activation on low level, rising edge or falling edge) correctly triggers External Interrupt 0 flag. </ul>
63
<li> <b>Data</b> <b>Memory</b> <br>
64
 The tests defined in `test_pavr_dm.vhd' are simple read-write confirmations that the Data Memory does its job. </ul>
65
</dl><dl compact><dt><b>
66
Testing the pAVR entity</b><dd>
67
pAVR as a whole was tested by building an upper entity that embedds a pAVR, its Program Memory and some multiplexers. Those multiplexers are meant to give Program Memory control to the test entity (for properly setting up Program Memory contents) or to pAVR (while pAVR is actually being monitored as it executes intructions from the Program Memory). <br>
68
 <br>
69
 The binary file that will be executed by pAVR during the test is automatically loaded into the Program Memory using an ANSI C utility, TagScan. The test entity has a number of tags spread over the source code, as comments. The TagScan utility reads the binary file to be loaded, scans the test file, and inserts VHDL statements into the properly tagged places. These statements load the Program Memory using its own write port. This way of initializing the Program Memory seems more general (and surely more interesting) than using file IO VHDL functions. <br>
70
 The TagScan utility is also used for other purposes. For example, for inserting a certain header in all source files. It is heavily used as a general preprocessor. <br>
71
 <br>
72
 Testing pAVR as a whole actually means designing and running binaries that put pAVR on extreme situations. <br>
73
 The following tests are done:
74
<ul>
75
   <li> <strong> Interrupts </strong> <br>
76
      This exercises pAVR interrupt handling. <br>
77
      All interrupts are tested. <br>
78
      The associated peripherals (Port A, Timer 0 and External Interrupt 0) are
79
      put in a variety of conditions. <br>
80
      Results: <br>
81
      tbd
82
   <li> <strong> General test </strong> <br>
83
      This is a hand-written assembler source that is meant to be assembled and
84
         run on pAVR. <br>
85
      It exercises each of pAVR instructions, one by one. <br>
86
      It tries to put pAVR in most difficult situations, for each instruction. For
87
      example, it exercises:
88
      <ul>
89
         <li> concurrent stalls
90
         <li> stalls combined with 32 bit instructions
91
         <li> stalls combined with intructions that change the instruction flow
92
         <li> control hazard candidates (stress the Program Memory Manager and
93
            the Stall and Flush Unit)
94
         <li> data hazard candidates (stress the Bypass Unit)
95
      </ul>
96
      Results: <br>
97
         Passed OK. The verification consisted of checking each instruction, each
98
         intermediate result and each relevant intermediate internal state.
99
         <table border="1" cellspacing="0" cellpadding="4">
100
            <tr>
101
               <th> Assembler
102
               <th> Clocks
103
               <th> Instructions
104
               <th> CPI
105
            <tr>
106
               <td> avrasm32, by Atmel
107
               <td> 667
108
               <td> 361
109
               <td> 1.85
110
         </table>
111
   <li> <strong> Sieve </strong> <br>
112
      Sieve of Eratosthenes; finds the the first 100 prime numbers. <br>
113
      Written in ANSI C. <br>
114
      Results:
115
      <table border="1" cellspacing="0" cellpadding="4">
116
         <tr>
117
            <th> Compiler
118
            <th> Clocks
119
            <th> Instructions
120
            <th> CPI
121
         <tr>
122
            <td> avr-gcc, O0
123
            <td> 12170
124
            <td> 8851
125
            <td> 1.37
126
         <tr>
127
            <td> avr-gcc, O3
128
            <td> 11946
129
            <td> 8824
130
            <td> 1.35
131
      </table>
132
   <li> <strong> TagScan </strong> <br>
133
      Exercises string manipulating routines. <br>
134
      Written in ANSI C. <br>
135
      Results:
136
      <table border="1" cellspacing="0" cellpadding="4">
137
         <tr>
138
            <th> Compiler
139
            <th> Clocks
140
            <th> Instructions
141
            <th> CPI
142
         <tr>
143
            <td> tbd
144
            <td> tbd
145
            <td> tbd
146
            <td> tbd
147
      </table>
148
   <li> <strong> C compiler </strong> <br>
149
      Written in ANSI C. <br>
150
      Results:
151
      <table border="1" cellspacing="0" cellpadding="4">
152
         <tr>
153
            <th> Compiler
154
            <th> Clocks
155
            <th> Instructions
156
            <th> CPI
157
         <tr>
158
            <td> tbd
159
            <td> tbd
160
            <td> tbd
161
            <td> tbd
162
      </table>
163
   <li> <strong> Waves </strong> <br>
164
      Simulates waves on the surface of a liquid. <br>
165
      Written in ANSI C. <br>
166
      Uses floating point numbers (observation: the avr-gcc compiler seems to
167
      take about 200 pAVR clocks per floating point operation). <br>
168
      A mesh of only 5x5 points is considered, and only 5 iterations
169
      are done. Bigger values make the simulation unacceptably long on
170
      the available computer. <br>
171
 
172
      Checking the result is done by converting the array of 25 floats
173
      into a scaled array of 25 chars, copying these chars from Data
174
      Memory (by hand), constructing a 3D image of the result, and
175
      comparing it to a reference 3D image. <br>
176
 
177
      Results: <br>
178
      Passed OK. As expected, the chars array to be tested exactly matches
179
      the reference array.
180
      <table border="1" cellspacing="0" cellpadding="4">
181
         <tr>
182
            <th> Compiler
183
            <th> Clocks
184
            <th> Instructions
185
            <th> CPI
186
         <tr>
187
            <td> avr-gcc
188
            <td> 209,175
189
            <td> 122,236
190
            <td> 1.71
191
      </table>
192
</ul>
193
 <br>
194
 </dl><hr><address align="right"><small>Generated on Tue Dec 31 20:26:31 2002 for Pipelined AVR microcontroller by
195
<a href="http://www.doxygen.org/index.html">
196
<img src="doxygen.png" alt="doxygen" align="middle" border=0
197
width=110 height=53></a>1.2.16 </small></address>
198
</body>
199
</html>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.