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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_0_6_beta/] [README] - Blame information for rev 115

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 114 arniml
 
2
README for the T48 uController project
3
======================================
4 115 arniml
Version: $Date: 2004-05-31 16:28:26 $
5 114 arniml
 
6
 
7
Introduction
8
------------
9
 
10
The T48 µController core an is implementation of the MCS-48 microcontroller
11
family architecture. While being a controller core for SoC, it also aims for
12
code-compatability and cycle-accuracy so that it can be used as a drop-in
13
replacement for any MCS-48 controller.
14
It can be configured to better suit the requirements and characteristics of
15
the integrating system. On the other hand, nearly the full functionality of a
16
stock 8048/8049 is available.
17
 
18
 
19
Download
20
--------
21
 
22
Download the latest stable release from the project homepage at OpenCores.org:
23
 
24
  http://www.opencores.org/projects.cgi/web/t48/overview/
25
 
26
You can get the latest version of the design files from CVS:
27
 
28
  http://www.opencores.org/pdownloads.cgi/list/t48
29
 
30
Please keep in mind that this is work in progress and might contain smaller or
31
bigger problems.
32
You should also check the Tracker for known bugs and see if they affect your
33
work.
34
 
35
 
36
Installation
37
------------
38
 
39
Once the directory structure is generated either by check-out from CVS or by
40
unpacking the tar-archive, the central project initialization file should be
41
set up. A template called init_project.template.sh is located in the sw
42
directory where a copy can be edited. Normally, only the definition for the
43
variable PROJECT_DIR has to be adjusted to the path where the directory
44
structure is located.
45
The commands for setting the necessary variables assume a bash/sh-like
46
shell. In case you run a different shell like csh or ksh, you should adjust
47
these commands as well.
48
 
49
The meaning of the variables is as follows:
50
 
51
  * PROJECT_DIR
52
    Points to the root of the project installation. All further references are
53
    derived from its setting.
54
 
55
  * VERIF_DIR
56
    Location of the verification suite.
57
 
58
  * SIM_DIR
59
    Directory for running simulations.
60
 
61
These variables must be properly set whenever scripts or makefiles of the T48
62
project are executed. Otherwise, you will most likely encounter error
63
messages.
64
 
65
NOTE: The concepts of the mentioned shells require that the init_project.sh is
66
      run in the context of the shell. I.e. you should 'source' the script
67
      instead of executing it like a command. This will make sure that the
68
      variable settings are really effective in the calling shell instance.
69
 
70
 
71
Directory Structure
72
-------------------
73
 
74
The project's directory structure follows the proposal of OpenCores.org.
75
 
76
t48
77
 |
78
 \--+-- rtl
79
    |    |
80
    |    \-- vhdl           : VHDL code containing the RTL description
81
    |         |               of the core.
82
    |         \-- system    : RTL VHDL code of sample systems.
83
    |
84
    +-- bench
85
    |    |
86
    |    \-- vhdl           : VHDL testbench code.
87
    |
88
    +-- sim
89
    |    |
90
    |    \-- rtl_sim        : Directory for running simulations.
91
    |
92
    \-- sw                  : General purpose scripts and files.
93
         |
94
         +-- i8039emu       : An MCS-48 emulator written in C.
95
         |
96
         \-- verif          : The verification suite.
97
              |
98
              +-- include   : Global includes and makefiles.
99
              |
100
              +-- black_box : Black-box verification tests.
101
              |
102
              +-- white_box : White-box verification tests.
103
              |
104
              \-- gp_sw     : General purpose software.
105 115 arniml
 
106
 
107
Compiling the VHDL Code
108
-----------------------
109
 
110
VHDL compilation and simulation tasks take place inside in sim/rtl_sim
111
directory. The project setup supports only the batch mode of certain
112
simulators. However, there should be no problems to integrate the testbench
113
and RTL code into arbitrary simulation environments.
114
 
115
The main file for compilation is Makefile.hier which contains all information
116
regarding the dependencies of the source files and their compilation
117
order. There is a dedicated file for each supported simulator that maps the
118
generic information of Makefile.hier to object files specific to the given
119
simulator.
120
 
121
Compilation is based on the make-utility, thus invocation looks like this:
122
 
123
$ make -f Makefile.
124
 
125
where  denotes one of the supported simulators:
126
 
127
  * Makefile.ghdl
128
    Tristan Gingold's GHDL simulator/compiler, a VHDL front-end for gcc.
129
    http://ghdl.free.fr/
130
 
131
  * Makefile.simili
132
    VHDL Simili, a VHDL simulator by Symphony EDA
133
    http://www.symphonyeda.com/
134
 
135
Make will analyze all VHDL files (RTL and testbench code) and elaborate all
136
three testbench top-levels if appropriate for the chosen simulator:
137
 
138
  * tb_behav_c0
139
    The main testbench for regression testing.
140
    Instantiates the plain t48_core and provides internal RAM (256 bytes) and
141
    ROM (2k bytes) plus 2k bytes of external ROM.
142
 
143
  * tb_t8048_behav_c0
144
    The testbench for the t8048 sample system.
145
 
146
  * tb_t8039_behav_c0
147
    The testbench for the 8039 sample system.
148
 
149
To delete all intermediate data, each Makefile has a 'clean' target:
150
 
151
$ make -f Makefile. clean
152
 
153
 
154
Preparation of the ROM Files
155
----------------------------
156
 
157
All testbenches listed above need two files in hex-format. They contain the
158
program for the T48 core and are loaded into internal and external ROM at
159
simulation startup. Their existance is mandatory as they are referenced in the
160
VHDL code of the ROM model lpm_rom.vhd. In case they are missing, the
161
simulation will stop immediately after elaborating the design.
162
 
163
These files are:
164
 
165
  * t48_rom.hex
166
    Internal ROM contents at address range 000H to 7FFH.
167
    Intel hex format, starting at address 000H.
168
 
169
  * t48_ext_rom.hex
170
    External ROM contents at address range 800H to FFFH.
171
    Intel hex format, starting at address 000H.
172
 
173
The verification flow for the T48 project generates these two files
174
automatically from the assembler source files.
175
 
176
All regression tests and the general purpose software is organized in a cell
177
structure. Currently, this means that the software for a cell is contained in
178
a dedicated directory where the assembler run takes place. In the future,
179
there will be more aspects to a cell.
180
 
181
Assembling, linking and putting the hex-files in place is under the control of
182
the make-mechanism. E.g. to assemble the source code of a cell, issue the
183
following command:
184
 
185
$ make -f $VERIF_DIR/include/Makefile.cell
186
 
187
This generates the linker file (test.p) and distributes its contents to the
188
required ROM files for internal and external program ROM. The target 'simu'
189
copies these files automatically to the simulation directory. So most likely,
190
for running a test case or any other software, you will want to issue:
191
 
192
$ make -f VERIF_DIR/include/Makefile.cell simu clean
193
 
194
The only supported assembler is Alfred Arnold's macroassembler AS. See
195
 
196
  http://john.ccac.rwth-aachen.de:8000/as/
197
 
198
 
199
Verification Environment
200
------------------------
201
 
202
The verification environment consists of a number of test programs. They are
203
all self-checking. I.e. after testing the targeted functionality, they emit a
204
pass/fail information. This information is detected by the testbench which
205
stops the simulation and prints out the simulation result. This is the default
206
mechanism for stopping the VHDL simulation.
207
 
208
Pass/fail is signalled by a certain sequence of the accumulator contents:
209
 
210
  1) Accumulator contains AAH
211
  2) Accumulator contains 55H
212
  3) Accumulator contains 01H   -> Pass
213
     Accumulator contains 00H   -> Fail
214
 
215
The detection is modelled like a state machine and in case the sequence is of
216
bytes inside the accumulator does not match, the detection process restarts
217
from the beginning. This mechanism is part of all verification tests.
218
 
219
The complete regression suite can be executed with the run_regression.pl
220
script. For each test cell, it steps through the sequence
221
 
222
  1) Assemble the source code
223
  2) Run the compiled VHDL design (currently only GHDL)
224
  3) Optionally perform a dump compare against the C-model
225
 
226
It is highly recommended to redirect the output of run_regression.pl into a
227
file. Otherwise, analyzing the messages related to each test cell is almost
228
impossible.

powered by: WebSVN 2.1.0

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