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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_1_2/] [README] - Blame information for rev 306

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 295 arniml
Version: $Id: README 295 2009-04-01 19:32:48Z arniml $
5 114 arniml
 
6
 
7
Introduction
8
------------
9
 
10 181 arniml
The T48 µController core is an implementation of the MCS-48 microcontroller
11 114 arniml
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 263 arniml
    |         +-- system    : RTL VHDL code of sample systems.
83
    |         |
84
    |         \-- t8243     : RTL VHDL code of 8243 core.
85 114 arniml
    |
86
    +-- bench
87
    |    |
88
    |    \-- vhdl           : VHDL testbench code.
89
    |
90
    +-- sim
91
    |    |
92
    |    \-- rtl_sim        : Directory for running simulations.
93
    |
94 280 arniml
    +-- syn
95
    |    |
96
    |    \-- t8048          : T8048 toplevel example synthesis.
97
    |         |
98
    |         +-- b5x300    : for SpartanIIe 300.
99
    |         |
100
    |         \-- jopcyc    : for Cyclone EP1C12.
101
    |
102 114 arniml
    \-- sw                  : General purpose scripts and files.
103
         |
104
         +-- i8039emu       : An MCS-48 emulator written in C.
105
         |
106
         \-- verif          : The verification suite.
107
              |
108
              +-- include   : Global includes and makefiles.
109
              |
110
              +-- black_box : Black-box verification tests.
111
              |
112
              +-- white_box : White-box verification tests.
113
              |
114
              \-- gp_sw     : General purpose software.
115 115 arniml
 
116
 
117
Compiling the VHDL Code
118
-----------------------
119
 
120
VHDL compilation and simulation tasks take place inside in sim/rtl_sim
121
directory. The project setup supports only the batch mode of certain
122
simulators. However, there should be no problems to integrate the testbench
123
and RTL code into arbitrary simulation environments.
124
 
125
The main file for compilation is Makefile.hier which contains all information
126
regarding the dependencies of the source files and their compilation
127
order. There is a dedicated file for each supported simulator that maps the
128
generic information of Makefile.hier to object files specific to the given
129
simulator.
130
 
131
Compilation is based on the make-utility, thus invocation looks like this:
132
 
133
$ make -f Makefile.
134
 
135
where  denotes one of the supported simulators:
136
 
137
  * Makefile.ghdl
138
    Tristan Gingold's GHDL simulator/compiler, a VHDL front-end for gcc.
139
    http://ghdl.free.fr/
140
 
141
  * Makefile.simili
142 244 arniml
    DISCONTINUED
143 115 arniml
    VHDL Simili, a VHDL simulator by Symphony EDA
144
    http://www.symphonyeda.com/
145
 
146
Make will analyze all VHDL files (RTL and testbench code) and elaborate all
147
three testbench top-levels if appropriate for the chosen simulator:
148
 
149
  * tb_behav_c0
150
    The main testbench for regression testing.
151
    Instantiates the plain t48_core and provides internal RAM (256 bytes) and
152
    ROM (2k bytes) plus 2k bytes of external ROM.
153
 
154
  * tb_t8048_behav_c0
155
    The testbench for the t8048 sample system.
156
 
157
  * tb_t8039_behav_c0
158
    The testbench for the 8039 sample system.
159
 
160 263 arniml
  * tb_t8243_behav_c0
161
    Testbench containing the t48_core and the synchronous t8243 flavour.
162
 
163
  * tb_t8048_t8243_behav_c0
164
    Testbench containing the t8048 and the asynchronous t8243 toplevel.
165
 
166 137 arniml
Each Makefile has a 'clean' target to delete all intermediate data:
167 115 arniml
 
168
$ make -f Makefile. clean
169
 
170 137 arniml
The basic simple sequence list can be found in COMPILE_LIST. This can be
171
useful to quickly set up the analyze stage of any compiler or
172
synthesizer. Especially when synthesizing the code, you want to skip the VHDL
173
configurations in *-c.vhd and everything below the bench/ directory.
174 115 arniml
 
175
Preparation of the ROM Files
176
----------------------------
177
 
178
All testbenches listed above need two files in hex-format. They contain the
179
program for the T48 core and are loaded into internal and external ROM at
180
simulation startup. Their existance is mandatory as they are referenced in the
181
VHDL code of the ROM model lpm_rom.vhd. In case they are missing, the
182
simulation will stop immediately after elaborating the design.
183
 
184
These files are:
185
 
186 263 arniml
  * rom_t49.hex
187
    Internal ROM contents for 8x49 derivatives,
188
    address range 000H to 7FFH.
189 115 arniml
    Intel hex format, starting at address 000H.
190
 
191 263 arniml
  * rom_t49_ext.hex
192
    External ROM contents for t8x49 derivatives,
193
    address range 800H to FFFH.
194
    Intel hex format, starting at address 800H.
195
 
196
  * rom_t48.hex
197
    Internal ROM contents for t8x48 derivatives,
198
    address range 000H to 3FFH.
199 115 arniml
    Intel hex format, starting at address 000H.
200
 
201 263 arniml
  * rom_t48_ext.hex
202
    External ROM contents for t8x48 derivatives,
203
    address range 400H to FFFH.
204
    Intel hex format, starting at address 000H.
205
 
206
  * rom_t3x.hex
207
    Internal ROM contents for t803x derivatives,
208
    empty.
209
 
210
  * rom_t3x_ext.hex
211
    External ROM contents for t803x derivatives,
212
    address range 000H to FFFH.
213
    Intel hex format, starting at address 000H.
214
 
215
The verification flow for the T48 project generates these files
216 115 arniml
automatically from the assembler source files.
217
 
218
All regression tests and the general purpose software is organized in a cell
219
structure. Currently, this means that the software for a cell is contained in
220
a dedicated directory where the assembler run takes place. In the future,
221
there will be more aspects to a cell.
222
 
223
Assembling, linking and putting the hex-files in place is under the control of
224
the make-mechanism. E.g. to assemble the source code of a cell, issue the
225
following command:
226
 
227
$ make -f $VERIF_DIR/include/Makefile.cell
228
 
229
This generates the linker file (test.p) and distributes its contents to the
230
required ROM files for internal and external program ROM. The target 'simu'
231
copies these files automatically to the simulation directory. So most likely,
232
for running a test case or any other software, you will want to issue:
233
 
234 281 arniml
$ make -f VERIF_DIR/include/Makefile.cell all clean
235 115 arniml
 
236 281 arniml
The 'all' target generates hex files for all supported testbenches.
237
 
238 115 arniml
The only supported assembler is Alfred Arnold's macroassembler AS. See
239
 
240
  http://john.ccac.rwth-aachen.de:8000/as/
241
 
242
 
243
Verification Environment
244
------------------------
245
 
246
The verification environment consists of a number of test programs. They are
247
all self-checking. I.e. after testing the targeted functionality, they emit a
248
pass/fail information. This information is detected by the testbench which
249
stops the simulation and prints out the simulation result. This is the default
250
mechanism for stopping the VHDL simulation.
251
 
252
Pass/fail is signalled by a certain sequence of the accumulator contents:
253
 
254
  1) Accumulator contains AAH
255
  2) Accumulator contains 55H
256
  3) Accumulator contains 01H   -> Pass
257
     Accumulator contains 00H   -> Fail
258
 
259
The detection is modelled like a state machine and in case the sequence is of
260
bytes inside the accumulator does not match, the detection process restarts
261
from the beginning. This mechanism is part of all verification tests.
262
 
263
The complete regression suite can be executed with the run_regression.pl
264
script. For each test cell, it steps through the sequence
265
 
266
  1) Assemble the source code
267
  2) Run the compiled VHDL design (currently only GHDL)
268
  3) Optionally perform a dump compare against the C-model
269
 
270
It is highly recommended to redirect the output of run_regression.pl into a
271
file. Otherwise, analyzing the messages related to each test cell is almost
272
impossible.
273 287 arniml
 
274
 
275
FPGA Implementation
276
-------------------
277
 
278
All of the design files contain pure RTL code. Also the RAM for the data
279
memory is described by generic RTL code. It should be translated automatically
280
by the tool chain to a technology specific RAM macro.
281
 
282
There is a generic method for the program memory ROM as well, although this
283
project uses a flow where hex-files are loaded by lpm_rom.vhd as the default
284
method. Convert the ROM image to an RTL VHDL file with one of the two
285
following commands (either from hex or bin format):
286
 
287
  $ hex2rom -b [rom image file] rom_t48 10l8s > rom_t48.vhd
288
  $ hex2rom -b [rom image file] rom_t49 11l8s > rom_t49.vhd
289
 
290
The option -b specifies that [rom image file] contains binary data. Skip this
291
option to process a file in hex format.
292
 
293
These resulting RTL representations are instantiated by t48_rom-struct-a.vhd
294
and t49_rom-struct-a.vhd. Altera and Xilinx design tools will detect and
295
extract the ROM and turn it into a memory macro.

powered by: WebSVN 2.1.0

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