File: README

package info (click to toggle)
gpsim 0.32.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,644 kB
  • sloc: cpp: 121,258; asm: 54,223; ansic: 13,576; python: 9,708; sh: 4,695; makefile: 1,575; lex: 1,139; yacc: 854; pascal: 511; perl: 93; awk: 44; xml: 41
file content (89 lines) | stat: -rw-r--r-- 3,363 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Regression tests for gpsim

Introduction
------------

The purpose of the regression tests is to ensure that gpsim works.
Basic elements like instruction simulation and breakpoints are 
verified. In addition when new bugs are found and fixed, specific
tests are created to ensure that future versions of gpsim are not
infected.

Each regression test or a collection of similar regression tests
occupies a subdirectory that is child of this README's directory.
The item(s) to be tested are placed into their own .asm file. This
file is assembled by gpasm and simulated by gpsim and then the results
are "analyzed" by a script. Once the .asm file is created, the whole
process becomes automatic. However, the regression files need to 
adhere to a format that is understood by the scripts.

Running
-------

If you want to perform a regression test with the default set up then
run:

On *nix:
  ./run_regression.sh

On WIN32 + Cygwin from the shell:
  ./run_regression.sh '/cygdrive/c/Program Files/gpsim/bin'

(You may need to change the file to an executable [chmod +x]).
This should step through each test and print PASS or FAIL results.

The 'run_regression.sh' script consists of a list of regression tests
that are to be tested. Each of these is a single line that invokes the
secondary script 'rt.sh'. This script takes two parameters: the
directory containing the regression test and the name of the Makefile
target the test should invoke. Typically there is a 'sim' target. So
an example of rt.sh action would be:

   cd node_test
   make sim


Files needed for a regression test
----------------------------------

Each test requires a .asm file and a .stc file. The .asm file contains
the assembly code (of course) and the .stc file contains startup 
commands that allow you to configure your simulation environment for
your test. For example, if your test involves measuring the width
of a pulse then you'll want to create an asynchronous stimulus to
generate the pulse. If there are no special startup conditions, then
the .stc file can be really simple. For example, 14-bit core
instruction test .stc file contains only:

  # simple script to load the simulation 
  load s instructions_14bit.cod

It's also possible to embed gpsim scripts directly in the assembly
source files. See the logic_test/ regression test for an example.


Assembly file format
--------------------

The assembly file must be in the relocatable code format. The reason
is because gpsim makes use of gpasm directives that are only available
in this format. The assembly file can contain anything you
want. However, to simplify the parsing of the results there must be an
assertion that contains the string "*** PASSED". For example,
something like this:

  .assert  ",\"*** PASSED MidRange core interrupt test\""

This assertion should be placed in the assembly file at an instruction
that executes only after all of the tests have completed. (Note, this
type of assertion has no break condition expression - so therefore it
will always assert and gpsim will halt the simulation when this is
encountered. The message will be printed to stdout.)


Makefiles
---------

In addition to the Assembly File format, there must also be a Makefile
in each regression directory. This Makefile can be anything you want,
but at some point there must be a make target that can invoke gpsim.