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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [doc/] [man/] [man1/] [asm-11_expect.1] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 22 wfjm
.\"  -*- nroff -*-
2
.\"  $Id: asm-11_expect.1 550 2014-02-03 08:16:57Z mueller $
3
.\"
4
.\" Copyright 2014- by Walter F.J. Mueller 
5
.\"
6
.\" ------------------------------------------------------------------
7
.
8
.TH ASM-11_EXPECT 1 2013-03-30 "Retro Project" "Retro Project Manual"
9
.\" ------------------------------------------------------------------
10
.SH NAME
11
asm-11_expect \- expect checker for asm-11 test bench
12
.\" ------------------------------------------------------------------
13
.SH SYNOPSIS
14
.
15
.SY asm-11_expect
16
.RI [ OPTION ]...
17
.I FILE...
18
.
19
.SY asm-11_expect
20
.B \-\-help
21
.YS
22
.
23
.\" ------------------------------------------------------------------
24
.SH DESCRIPTION
25
Reads one of more \fBasm-11\fP(1) listing files and checks for unexpected
26
assembly errors and tests for expected address and generated data values.
27
What is expected is specified by comments, described in section EXPECT COMMENTS,
28
which are added to the asm-11 source code.
29
asm-11 will copy these comments to the listing file and asm-11_expect extracts
30
them and checks whether the actual assembly results match the expected ones.
31
.PP
32
asm-11_expect produces at least a one line summary per file like
33
.PP
34
.EX
35
   asm-11_expect: test_0010_alloc.lst OK
36
   asm-11_expect: test_0020_expr.lst OK
37
.EE
38
.PP
39
where each file is marked either \fBOK\fR or \fBFAILED\fR.
40
In case of detected errors additional output follows which gives a description
41
of each error and the affected listing line, like
42
.PP
43
.EX
44
   asm-11_expect: test_0110_op_gg.lst FAILED
45
     FAIL: data 1 mismatch: found=177736, expect=177734
46
       in:  1 27 001042 067700 177736   add  @pa,r0  ;;!! 067700 177734
47
.EE
48
.PP
49
Main application for asm-11_expect is to build self-checking test benches
50
for \fBasm-11\fP(1).
51
.
52
.
53
.\" ------------------------------------------------------------------
54
.SH EXPECT COMMENTS
55
The special comments which describe what to expect for an assembly line
56
have the format
57
.PP
58
.EX
59
   ;;!! [\fIetags\fP] [\fIaddr\fP:] [\fIdata\fP]...
60
.EE
61
.PP
62
with
63
.PP
64
.PD 0
65
.IP "\fBetags\fP"
66
list of expected assembly error flags, given as sequence of uppercase letters
67
without white space between letters.
68
.IP "\fBaddr\fP"
69
expected location counter (value of '.'), given as 6 digit octal number.
70
Note that all 6 digits must be specified, even leading zeros.
71
.IP "\fBdata\fP"
72
expected generated assembly output data, given as blank separated list
73
of either 3 (for byte output) or 6 (for word output) digit octal numbers.
74
Again, all 3 or 6 digits must be specified, even leading zeros.
75
This is checked against the data section of the assembly listing.
76
.br
77
In general this is used to check data emitted into the binary output.
78
However, some assembler statements, e.g. assignments or directives like .end,
79
indicate some result value in data section, and this can of course be
80
checked as well.
81
.PD
82
.PP
83
All three components are optional. Error flags are always tested, if no
84
\fIetags\fP are specified it is checked that no assembly error flag has
85
been generated for the line. Address and data tests are only done in case
86
\fIaddr\fP or \fIdata\fP components have been given.
87
.PP
88
If a line starts with an expect comment it will be applied to the asm-11
89
statement in the following line. Or it is simply appended to a asm-11
90
statement.
91
.SS Comment examples
92
.IP "\fB;;\-\- DM\fR" 4
93
expect a D and a M error flag
94
.IP "\fB;;\-\- 001020:\fR"
95
expect that current location will be 001020, data not checked
96
.IP "\fB;;\-\- 074167 177762\fR"
97
expect that the listing data section shows two words, 074167 and 177762.
98
Address is not checked.
99
.IP "\fB;;\-\- 001004: 000207\fR"
100
expect that current location will be 001004 and that the listing data section
101
shows one word with value 000207.
102
 
103
.SS Some practical cases
104
.EX
105
   .word   65537.          ;;!! T
106
   sob     r4,s4           ;;!! A
107
 
108
   stkbot: .blkw   400     ;;!! 001000:
109
 
110
   .word   100+77          ;;!! 000177
111
   .byte   2+<4*10>        ;;!! 042
112
   spl     5               ;;!! 000235
113
   inc     @1234(r4)       ;;!! 005274 001234
114
   add     @p,@#a          ;;!! 067737 177614 001000
115
 
116
   jsr     pc,sub          ;;!! 001006: 004767 177772
117
 
118
   cmp = 1234              ;;!! 001234
119
   c2 = inc + 67           ;;!! 005267
120
   .end                    ;;!! 000001
121
 
122
.EE
123
 
124
.\" ------------------------------------------------------------------
125
.SH OPTIONS
126
.
127
.\" ----------------------------------------------
128
.IP "\fB\-\-tline\fR"
129
Prints input lines from listing file as they are processed. Helpful to
130
debug expect comments, e.g. in conjunction with the \fB-\-tcheck\fR
131
option.
132
.
133
.\" ----------------------------------------------
134
.IP "\fB\-\-tcheck\fR"
135
Prints for each detected expect comment in the listing file a line reflecting
136
the content of the comment, like
137
.EX
138
   ...line generated by \-\-tcheck ...    | original expect comment
139
   exp:  err=T                          | ;;!! T
140
   exp:  dot=001000                     | ;;!! 001000:
141
   exp:  dat=060037 001000              | ;;!! 060037 001000
142
   exp:  dot=001006 dat=004767          | ;;!! 001006: 004767
143
.EE
144
.
145
.\" ----------------------------------------------
146
.IP "\fB\-help\fR"
147
print full help text and exit.
148
.
149
.\" ------------------------------------------------------------------
150
.SH EXAMPLES
151
.IP "\fBasm-11_expect *.lst\fR" 4
152
Will check all listing files in current directory and produce a listing with
153
at least one summary line per file as described in section DESCRIPTION.
154
 
155
.\" ------------------------------------------------------------------
156
.SH "SEE ALSO"
157
.BR asm-11 (1)
158
 
159
.\" ------------------------------------------------------------------
160
.SH AUTHOR
161
Walter F.J. Mueller 

powered by: WebSVN 2.1.0

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