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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_1_4/] [README] - Blame information for rev 344

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 342 2023-01-27 17:47:04Z 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 342 arniml
the integrating system. On the other hand, nearly the full functionality of
16
stock 8048/8049 and 8021/8022 is available.
17 114 arniml
 
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 342 arniml
  * tb_t8021_behav_c0
179
    Testbench containing the t8021 sample system.
180
 
181
  * tb_t8022_behav_c0
182
    Testbench containing the t8022 sample system.
183
 
184 137 arniml
Each Makefile has a 'clean' target to delete all intermediate data:
185 115 arniml
 
186
$ make -f Makefile. clean
187
 
188 137 arniml
The basic simple sequence list can be found in COMPILE_LIST. This can be
189
useful to quickly set up the analyze stage of any compiler or
190
synthesizer. Especially when synthesizing the code, you want to skip the VHDL
191
configurations in *-c.vhd and everything below the bench/ directory.
192 115 arniml
 
193
Preparation of the ROM Files
194
----------------------------
195
 
196
All testbenches listed above need two files in hex-format. They contain the
197
program for the T48 core and are loaded into internal and external ROM at
198
simulation startup. Their existance is mandatory as they are referenced in the
199
VHDL code of the ROM model lpm_rom.vhd. In case they are missing, the
200
simulation will stop immediately after elaborating the design.
201
 
202
These files are:
203
 
204 263 arniml
  * rom_t49.hex
205 316 arniml
    Internal ROM contents for t8x49 and t8042ah derivatives,
206 263 arniml
    address range 000H to 7FFH.
207 115 arniml
    Intel hex format, starting at address 000H.
208
 
209 263 arniml
  * rom_t49_ext.hex
210
    External ROM contents for t8x49 derivatives,
211
    address range 800H to FFFH.
212
    Intel hex format, starting at address 800H.
213
 
214
  * rom_t48.hex
215 316 arniml
    Internal ROM contents for t8x48 and t8041x derivatives,
216 263 arniml
    address range 000H to 3FFH.
217 115 arniml
    Intel hex format, starting at address 000H.
218
 
219 263 arniml
  * rom_t48_ext.hex
220
    External ROM contents for t8x48 derivatives,
221
    address range 400H to FFFH.
222
    Intel hex format, starting at address 000H.
223
 
224
  * rom_t3x.hex
225
    Internal ROM contents for t803x derivatives,
226
    empty.
227
 
228
  * rom_t3x_ext.hex
229
    External ROM contents for t803x derivatives,
230
    address range 000H to FFFH.
231
    Intel hex format, starting at address 000H.
232
 
233
The verification flow for the T48 project generates these files
234 115 arniml
automatically from the assembler source files.
235
 
236
All regression tests and the general purpose software is organized in a cell
237
structure. Currently, this means that the software for a cell is contained in
238
a dedicated directory where the assembler run takes place. In the future,
239
there will be more aspects to a cell.
240
 
241
Assembling, linking and putting the hex-files in place is under the control of
242
the make-mechanism. E.g. to assemble the source code of a cell, issue the
243
following command:
244
 
245
$ make -f $VERIF_DIR/include/Makefile.cell
246
 
247
This generates the linker file (test.p) and distributes its contents to the
248
required ROM files for internal and external program ROM. The target 'simu'
249
copies these files automatically to the simulation directory. So most likely,
250
for running a test case or any other software, you will want to issue:
251
 
252 281 arniml
$ make -f VERIF_DIR/include/Makefile.cell all clean
253 115 arniml
 
254 281 arniml
The 'all' target generates hex files for all supported testbenches.
255
 
256 115 arniml
The only supported assembler is Alfred Arnold's macroassembler AS. See
257
 
258
  http://john.ccac.rwth-aachen.de:8000/as/
259
 
260
 
261
Verification Environment
262
------------------------
263
 
264
The verification environment consists of a number of test programs. They are
265
all self-checking. I.e. after testing the targeted functionality, they emit a
266
pass/fail information. This information is detected by the testbench which
267
stops the simulation and prints out the simulation result. This is the default
268
mechanism for stopping the VHDL simulation.
269
 
270
Pass/fail is signalled by a certain sequence of the accumulator contents:
271
 
272
  1) Accumulator contains AAH
273
  2) Accumulator contains 55H
274
  3) Accumulator contains 01H   -> Pass
275
     Accumulator contains 00H   -> Fail
276
 
277
The detection is modelled like a state machine and in case the sequence is of
278
bytes inside the accumulator does not match, the detection process restarts
279
from the beginning. This mechanism is part of all verification tests.
280
 
281
The complete regression suite can be executed with the run_regression.pl
282
script. For each test cell, it steps through the sequence
283
 
284
  1) Assemble the source code
285
  2) Run the compiled VHDL design (currently only GHDL)
286
  3) Optionally perform a dump compare against the C-model
287
 
288
It is highly recommended to redirect the output of run_regression.pl into a
289
file. Otherwise, analyzing the messages related to each test cell is almost
290
impossible.
291 287 arniml
 
292
 
293
FPGA Implementation
294
-------------------
295
 
296
All of the design files contain pure RTL code. Also the RAM for the data
297
memory is described by generic RTL code. It should be translated automatically
298
by the tool chain to a technology specific RAM macro.
299
 
300
There is a generic method for the program memory ROM as well, although this
301
project uses a flow where hex-files are loaded by lpm_rom.vhd as the default
302
method. Convert the ROM image to an RTL VHDL file with one of the two
303
following commands (either from hex or bin format):
304
 
305
  $ hex2rom -b [rom image file] rom_t48 10l8s > rom_t48.vhd
306
  $ hex2rom -b [rom image file] rom_t49 11l8s > rom_t49.vhd
307
 
308
The option -b specifies that [rom image file] contains binary data. Skip this
309
option to process a file in hex format.
310
 
311
These resulting RTL representations are instantiated by t48_rom-struct-a.vhd
312
and t49_rom-struct-a.vhd. Altera and Xilinx design tools will detect and
313
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.