1 |
7 |
idiolatrie |
+------------------------------------------------------------------------------+
|
2 |
|
|
| |
|
3 |
2 |
idiolatrie |
| layer[2] SoC for Spartan-3E Starter Kit |
|
4 |
7 |
idiolatrie |
| |
|
5 |
2 |
idiolatrie |
+------------------------------------------------------------------------------+
|
6 |
7 |
idiolatrie |
|
7 |
|
|
The layer[2] system-on-a-chip combines to the greatest possible extent a
|
8 |
|
|
MIPS I(tm) compatible CPU with various memories and I/O-controllers.
|
9 |
|
|
The spectrum of supported memories includes (inter alia) adjacent to an
|
10 |
|
|
internal 16 kB memory, a flash-memory of 16 MB.
|
11 |
|
|
The input/output capabilities of the system are realized by a PS/2 keyboard
|
12 |
|
|
controller for handling the input and a VGA-textmode-controller responsible
|
13 |
|
|
for output purposes.
|
14 |
|
|
For the communication with other computer systems a RS-232 interface is used.
|
15 |
|
|
|
16 |
|
|
The implementation of the hardware components was accomplished by the usage
|
17 |
|
|
of the VHDL hardware description language and furthermore these components
|
18 |
|
|
were synthesised for the Spartan-3E Starter Kit.
|
19 |
|
|
Because of the compatibility with the MIPS I(tm) ISA, it is additionally
|
20 |
|
|
possible to compile software with the GCC for layer[2].
|
21 |
|
|
|
22 |
|
|
+------------------------------------------------------------------------------+
|
23 |
|
|
| Toolchain Setup |
|
24 |
|
|
+------------------------------------------------------------------------------+
|
25 |
|
|
This Section helps you with setting up the toolchain appropriatly.
|
26 |
|
|
|
27 |
|
|
+---------------------------------------------------------------------------+
|
28 |
|
|
| cygwin |
|
29 |
|
|
+---------------------------------------------------------------------------+
|
30 |
|
|
Installing cygwin is pretty easy. Just download the Installer from the
|
31 |
|
|
cygwin homepage.
|
32 |
|
|
|
33 |
|
|
After you have selected a download mirror, you will be prompted a
|
34 |
|
|
"Select Packages" Window. We need Python for the upload script
|
35 |
|
|
and the memory file generator script
|
36 |
|
|
, so check if its node is set to Default
|
37 |
|
|
(This should suffice).
|
38 |
|
|
|
39 |
|
|
The Devel node contains 'make', 'subversion', 'binutils' and the 'gcc'.
|
40 |
|
|
These packages should be selected by default.
|
41 |
|
|
|
42 |
|
|
+---------------------------------------------------------------------------+
|
43 |
|
|
| ISE WebPack |
|
44 |
|
|
+---------------------------------------------------------------------------+
|
45 |
|
|
You can download the WebPack here if you haven't already installed it.
|
46 |
|
|
|
47 |
|
|
The hardware build script xilinx/Makefile assumes that you have installed
|
48 |
|
|
the WebPack at "C:\Xilinx". If your installation is located somewhere
|
49 |
|
|
else, don't forget to adjust the build script.
|
50 |
|
|
|
51 |
|
|
+---------------------------------------------------------------------------+
|
52 |
|
|
| pySerial |
|
53 |
|
|
+---------------------------------------------------------------------------+
|
54 |
|
|
Download and extract pySerial. Open cygwin and navigate into the pySerial
|
55 |
|
|
directory. Type
|
56 |
|
|
|
57 |
|
|
python setup.py install
|
58 |
|
|
|
59 |
|
|
If you still get some error when using the upload script, you probably
|
60 |
|
|
need to install pyWin as well.
|
61 |
|
|
|
62 |
|
|
+---------------------------------------------------------------------------+
|
63 |
|
|
| GCC Cross Compiler |
|
64 |
|
|
+---------------------------------------------------------------------------+
|
65 |
|
|
Go to Cygwin Mirror Sites and download the newest source packages
|
66 |
|
|
'binutils-*-src.tar.bz', 'gcc-core-*-src.tar.bz' as well as
|
67 |
|
|
'mpfr-*-src.tar.bz'. First we define some global variables. In cygwin type
|
68 |
|
|
line-by-line:
|
69 |
|
|
|
70 |
|
|
export TARGET=mips-elf
|
71 |
|
|
export PREFIX=/usr/local/$TARGET
|
72 |
|
|
export PATH=$PATH:$PREFIX/bin
|
73 |
|
|
|
74 |
|
|
Extract the archives into the directories 'binutils', 'gcc' and 'mpfr'
|
75 |
|
|
respectively. In cygwin go to your directory that contains the extracted
|
76 |
|
|
directories and type line-by-line:
|
77 |
|
|
|
78 |
|
|
mkdir build-binutils
|
79 |
|
|
cd build-binutils
|
80 |
|
|
../binutils/configure --target=$TARGET --prefix=$PREFIX
|
81 |
|
|
make
|
82 |
|
|
make install
|
83 |
|
|
cd ..
|
84 |
|
|
|
85 |
|
|
Next, we compile MPFR which is a prerequisite for GCC:
|
86 |
|
|
|
87 |
|
|
mkdir build-mpfr
|
88 |
|
|
cd build-mpfr
|
89 |
|
|
../mpfr/configure -–target=$TARGET -–prefix=$PREFIX
|
90 |
|
|
make
|
91 |
|
|
make install
|
92 |
|
|
cd ..
|
93 |
|
|
|
94 |
|
|
And finally, GCC:
|
95 |
|
|
|
96 |
|
|
mkdir build-gcc
|
97 |
|
|
cd build-gcc
|
98 |
|
|
../gcc/configure --with-newlib --without-headers \
|
99 |
|
|
--enable-languages="c" --target=$TARGET --prefix=$PREFIX \
|
100 |
|
|
--with-gnu-ld --with-gnu-as --disable-libssp --with-mpfr=$PREFIX
|
101 |
|
|
make
|
102 |
|
|
make install
|
103 |
|
|
cd ..
|
104 |
|
|
|
105 |
|
|
If the compilation ends with an error, search 'build-gcc' for the binaries
|
106 |
|
|
'mips-elf-cc1.exe' and 'mips-elf-gcc.exe' and copy them manually into the
|
107 |
|
|
directory
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
+------------------------------------------------------------------------------+
|
111 |
|
|
| User Guide |
|
112 |
|
|
+------------------------------------------------------------------------------+
|
113 |
|
|
The following section describes how to build and upload the hardware, the
|
114 |
|
|
bootloader and the demo software.
|
115 |
|
|
|
116 |
|
|
+---------------------------------------------------------------------------+
|
117 |
|
|
| Hardware |
|
118 |
|
|
+---------------------------------------------------------------------------+
|
119 |
|
|
To build the hardware just navigate to and enter
|
120 |
|
|
|
121 |
|
|
make build
|
122 |
|
|
|
123 |
|
|
Once completed, you can upload it onto your Starter Kit with
|
124 |
|
|
|
125 |
|
|
make upload
|
126 |
|
|
|
127 |
|
|
This just loads it directly onto your Spartan-3E. If you wish to load the
|
128 |
|
|
design to the Plattform Flash type
|
129 |
|
|
|
130 |
|
|
make prom
|
131 |
|
|
|
132 |
|
|
If nothing shows up on the display, you might accidetally erased the CPLD.
|
133 |
|
|
Start the iMPACT GUI and upload to the
|
134 |
|
|
CPLD.
|
135 |
|
|
|
136 |
|
|
+---------------------------------------------------------------------------+
|
137 |
|
|
| Building the Bootloader |
|
138 |
|
|
+---------------------------------------------------------------------------+
|
139 |
|
|
The source for the 'void Bootloader' is located at . You can
|
140 |
|
|
build it with
|
141 |
|
|
|
142 |
|
|
make standalone
|
143 |
|
|
|
144 |
|
|
This will create the binary and translates it into the VHDL memory file
|
145 |
|
|
. You need to rebuild the hardware subsequently.
|
146 |
|
|
|
147 |
|
|
+---------------------------------------------------------------------------+
|
148 |
|
|
| Configuring 'upload.py' |
|
149 |
|
|
+---------------------------------------------------------------------------+
|
150 |
|
|
The serial port number of the upload script needs to
|
151 |
|
|
be adjusted.
|
152 |
|
|
|
153 |
|
|
34] port = 4, # 'COM5',
|
154 |
|
|
|
155 |
|
|
+---------------------------------------------------------------------------+
|
156 |
|
|
| Uploading images |
|
157 |
|
|
+---------------------------------------------------------------------------+
|
158 |
|
|
Start layer[2] and select 'Upload image ...'. You can navigate with the
|
159 |
|
|
'ARROW UP' and 'ARROW DOWN' keys. The system now waits for some incomming
|
160 |
|
|
serial transmission.
|
161 |
|
|
In cygwin switch to the directory where resides and type
|
162 |
|
|
|
163 |
|
|
make upload
|
164 |
|
|
|
165 |
|
|
This will build and upload the application. If everything went well,
|
166 |
|
|
you'll see the 'void Bootloader' start-up screen again.
|
167 |
|
|
|
168 |
|
|
If you select 'View memory contents ...', you can monitor the contents of
|
169 |
|
|
the StrataFlash and the DDR. 'ARROW UP' and 'ARROW DOWN' increases or
|
170 |
|
|
decreases the starting address of the displayed memory contents
|
171 |
|
|
respectively. Press 'ESC' to return.
|
172 |
|
|
|
173 |
|
|
With 'Start ...' the contents of the StrataFlash will be loaded to the DDR
|
174 |
|
|
and the system starts the execution of the uploaded program.
|