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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_1_0/] [README] - Blame information for rev 292

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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