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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_1_3/] [README] - Blame information for rev 345

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