Professional Documents
Culture Documents
Amber
May 2013
Table of Contents
1 2 Amber Project ............................................................................................................................................................
1.1 1.2 2.1 2.2 2.3 2.4 2.) 2.$ 2.' Project Directory Structure ........................................................................................................... Amber FPGA System .......................................................................................................................... Insta in! t"e Amber #roject ......................................................................................................... Insta in! t"e %om#i er ........................................................................................................................ &unnin! Simu ations ............................................................................................................................. Simu ation out#ut (i es ........................................................................................................................ *ard+are ,ests ........................................................................................................................................... % Pro!rams ...................................................................................................................................................... -inu. ..........................................................................................................................................................................
3
3 4
6
$ $ ' 10 12 14 1$
3 # *
1" 2)
20 21
'icense ....................................................................................................................................................................................
22
Released under the GNU Lesser General Public License (v2.1) terms
2 of 22
Amber
May 2013
Amber Project
The Amber project is a complete processor system implemented on the Xilinx Spartan-6 SP605 FPGA development board The project is hosted on opencores or! The project provides a complete hard"are and so#t"are development system abo$nt the Amber processor core A n$mber o# applications% "ith & so$rce code% are provided as examples o# "hat the systme can be $sed #or The recommended system #or the project is the Xilinx SP605 development board% a P& r$nnin! &ent'S 6 x% the Xilinx (S) *+ 5 tool chain ,#ree -ebpac. version/% and the &ode Sorcery G01 toolchain #or A23 processors All o# these elements are #ree except #or the act$al development board "hich costs aro$nd 4500
1+1
Table 1
"+1isim "+1tests
"+1too s "+15 o! "+15 o!1amber23 "+15 o!1amber2) "+15 o!1et"mac "+15 o!1 ib
"+15 o!1.5$8ddr3
Released under the GNU Lesser General Public License (v2.1) terms
3 of 22
Amber
,irector
May 2013
#roject (or co#yri!"t reasons. ,"ey are needed to im# ement t"e Amber system on a /irte.9$ de5e o#ment board and must be !enerated in 4i in. %ore!en. s+ s+1boot9 oader9seria s+1boot9 oader9et"mac %ontains % source (i es (or a## ications t"at run on t"e Amber system0 as +e as some uti ities t"at aid in debu!!in! t"e system. %0 assemb y sources and a ma2e(i e (or t"e seria 9#ort boot9 oader a## ication. %0 assemb y sources and a ma2e(i e (or t"e et"ernet9#ort boot9 oader a## ication. ,"is a## ication su##orts te net (or contro and status0 and t(t# (or u# oadin! e ( e.ecutab e (i es. %0 assemb y source and a ma2e(i e (or a sim# e stand9a one a## ication e.am# e. %ommon %0 assemb y and ma2e(i e inc ude (i es. %0 assemb y sources and a ma2e(i e to bui d t"e object t"at com#rise a 5ery sma and imited stand9a one re# acement (or t"e ibc ibrary. S"e scri#ts and % source (i es (or com#i e and debu! uti ities. %ontains t"e .mem and .dis (i es (or t"e 5m inu. simu ation.
1+2
Released under the GNU Lesser General Public License (v2.1) terms
4 of 22
Amber
May 2013
+is"bone8arbiter.5
boot&mem.v <2; embedded S&AM = contains boot oader code uart.v UA&, 0 Statica y con(i!urab e sim# e UA&, uart.v UA&, 1 Statica y con(i!urab e sim# e UA&,
U R0 ./!
(b&'s)&ddr3&brid*e.v
U R0 ./!
cloc+s&resets.v
mcb&ddr3.v
All the 8erilo! so$rce code "as speci#ially developed #or this project "ith the exception o# the #ollo"in! mod$les9 ddr3.v The Xilinx Spartan-6 ::2; controller "as !enerated by the Xilinx &ore!en tool The #iles are not incl$ded "ith the project #or copyri!ht reasons (t is $p to the $ser to optain the (S) so#t"are #rom Xilinx and !enerate the correct memory controller 0ote that -ishbone brid!e mod$les are incl$ded that s$pport both the Xilinx Spartan-6 ::2; controller and the 8irtex-6 controller eth_top.v This mod$le is #rom the 'pencores )thernet 3A& *0<*00 3bps project The 8erilo! code is incl$ded #or convenience (t has not been modi#ied% except to provide a memory mod$le #or the Spartan-6 FPGA
Released under the GNU Lesser General Public License (v2.1) terms
$ of 22
Amber
May 2013
2
2+1
Verilog simulations
-nstalling t!e Amber project
(# yo$ have not already done so% yo$ need to do"nload the Amber project #rom 'pencores or! The Amber project incl$des all the 8erilo! so$rce #iles% tests "ritten in assembly% a boot loader application "ritten in & and scripts to compile% sim$late and synthesi=e the code >o$ can either do"nload a tar != #ile #rom the 'pencores "ebsite or better still% connect to the 'pencores S$bversion server to do"nload the project This can be done on a 7in$x P& as #ollo"s9
$ mkdir /<your amber install path>/ $ cd /<your amber install path>/ $ svn --username <your opencores account name> --password <your opencores password> \ co http://opencores.org/ocsvn/amber/amber/trunk
2+2
Released under the GNU Lesser General Public License (v2.1) terms
) of 22
Amber
May 2013
These s"itches speci#y the correct version o# the (SA% and tell the compiler not to create bx instr$ctions ?ere is the s"itch to $se "ith the G01 lin.er% arm-nonelin$x-!n$eabi-ld9
--2i"-v9b"
This s"itch converts any bx instr$ctions ,"hich are not s$pported/ to @mov pc% lr@ ?ere is an example $sa!e #rom the boot-loader ma.e process9
arm-none-linu"-gnueabi-gcc -c -0s -march*armv;a -mno-thumb-interwork -22reestanding -7../include -c -o boot-loader.o boot-loader.c arm-none-linu"-gnueabi-gcc -7../include -c -o start.o start.) arm-none-linu"-gnueabi-gcc -c -0s -march*armv;a -mno-thumb-interwork -22reestanding -7../include -c -o crc8<.o crc8<.c arm-none-linu"-gnueabi-gcc -c -0s -march*armv;a -mno-thumb-interwork -22reestanding -7../include -c -o "modem.o "modem.c arm-none-linu"-gnueabi-gcc -c -0s -march*armv;a -mno-thumb-interwork -22reestanding -7../include -c -o el2splitter.o el2splitter.c arm-none-linu"-gnueabi-ld -%static -$ap boot-loader.map --strip-debug --2i"-v9b" -o bootloader.el2 -, sections.lds boot-loader.o start.o crc8<.o "modem.o el2splitter.o ../mini-libc/print2.o ../mini-libc/libc(asm.o ../mini-libc/memcpy.o arm-none-linu"-gnueabi-ob!copy -' .comment -' .note boot-loader.el2 ../tools/amber-el2splitter boot-loader.el2 > boot-loader.mem ../tools/amber-memparams.sh boot-loader.mem boot-loader(memparams.v arm-none-linu"-gnueabi-ob!dump - -) -&1 boot-loader.el2 > boot-loader.dis
A #$ll list o# compile s"itches #or !cc can be #o$nd here9 "tt#>11!cc.!nu.or!1on inedocs1!cc94.).21!cc1A&M97#tions."tm ?A&M97#tions And #or ld here9 "tt#>11source+are.or!1binuti s1docs92.211 d1A&M."tm ?A&M
2+3
/unning Simulations
>o$ sho$ld be able to $se any 8erilo!-A00* compatible sim$lator to r$n sim$lations The project comes "ith r$n scripts and project #iles #or the #ree Xilinx -ebpac. (Sim *+ 5 sim$lator )xample $sa!eB
$ cd $#$%&'(%#)&/hw/isim $ ./run.sh hello-world ,est hello-world= type 9 make -s - ../mini-libc $74()7>&*8 arm-none-linu"-gnueabi-gcc -c -0s -march*armv;a -mno-thumb-interwork -22reestanding -7../include -c -o boot-loader-serial.o boot-loader-serial.c arm-none-linu"-gnueabi-ld -%static -$ap boot-loader-serial.map --strip-debug --2i"v9b" -o boot-loader-serial.el2 -, sections.lds boot-loader-serial.o start.o crc8<.o "modem.o el2splitter.o ../mini-libc/print2.o ../mini-libc/libc(asm.o ../minilibc/memcpy.o arm-none-linu"-gnueabi-ob!copy -' .comment -' .note boot-loader-serial.el2 ../tools/amber-el2splitter boot-loader-serial.el2 > boot-loader-serial.mem ../tools/amber-memparams?;.sh boot-loader-serial.mem boot-loader-serial(memparams?;.v ../tools/amber-memparams8;@.sh boot-loader-serial.mem boot-loaderserial(memparams8;@.v arm-none-linu"-gnueabi-ob!dump - -) -&1 boot-loader-serial.el2 > boot-loaderserial.dis ../tools/check(mem(siAe.sh boot-loader-serial.mem BCDDDD;DB make -s - ../mini-libc $74()7>&*8 'unning: /tools/6ilin"/89.:/7)&(E)/7)&/bin/lin/unwrapped/2use tb -o amber-test.e"e -pr! amber-isim.pr! -d %00,($&$(F71&*B../../sw/boot-loader-serial/boot-loaderserial.memB -d %00,($&$(+#'#$)(F71&*B../../sw/boot-loader-serial/boot-loaderserial(memparams?;.vB -d $#74($&$(F71&*B../../sw/hello-world/hello-world.memB -d #$%&'(103(F71&*Btests.logB -d #$%&'(,&),(4#$&*Bhello-worldB -d #$%&'()7$( ,'1*9 -d #$%&'(,7$&05,*D -d #$%&'(10#E($#74($&$ -incremental -i ../vlog/lib -i ../vlog/system
Released under the GNU Lesser General Public License (v2.1) terms
2 of 22
Amber
May 2013
-i ../vlog/amber;? -i ../vlog/amber;: -i ../vlog/tb 7)im +.:@2 Gsignature D"2bcDDdaaH 4umber o2 +5s detected in this system: 9 ,urning on mult-threading= number o2 parallel sub-compilation !obs: @ Eetermining compilation order o2 -E1 2iles #nalyAing Ierilog 2ile B../vlog/system/boot(mem?;.vB into library work #nalyAing Ierilog 2ile B../vlog/system/boot(mem8;@.vB into library work #nalyAing Ierilog 2ile B../vlog/system/clocks(resets.vB into library work #nalyAing Ierilog 2ile B../vlog/system/interrupt(controller.vB into library work #nalyAing Ierilog 2ile B../vlog/system/system.vB into library work #nalyAing Ierilog 2ile B../vlog/system/test(module.vB into library work #nalyAing Ierilog 2ile B../vlog/system/timer(module.vB into library work #nalyAing Ierilog 2ile B../vlog/system/uart.vB into library work #nalyAing Ierilog 2ile B../vlog/system/wb("s<(ddr?(bridge.vB into library work #nalyAing Ierilog 2ile B../vlog/system/wishbone(arbiter.vB into library work #nalyAing Ierilog 2ile B../vlog/system/a2i2o.vB into library work #nalyAing Ierilog 2ile B../vlog/system/ddr?(a2i2o.vB into library work #nalyAing Ierilog 2ile B../vlog/system/ethmac(wb.vB into library work #nalyAing Ierilog 2ile B../vlog/system/main(mem.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(clockgen.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(crc.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(2i2o.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(maccontrol.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(macstatus.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(miim.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(outputcontrol.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(random.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(receivecontrol.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(registers.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(register.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(r"addrcheck.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(r"counters.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(r"ethmac.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(r"statem.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(shi2treg.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(spram(;:<"?;.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(top.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(transmitcontrol.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(t"counters.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(t"ethmac.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(t"statem.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/eth(wishbone.vB into library work #nalyAing Ierilog 2ile B../vlog/ethmac/"ilin"(dist(ram(8<"?;.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(alu.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(barrel(shi2t.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(cache.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(coprocessor.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(core.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(decode.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(decompile.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(e"ecute.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(2etch.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(multiply.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(register(bank.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;?/a;?(wishbone.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(alu.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(barrel(shi2t.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(shi2ter.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(coprocessor.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(core.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(dcache.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(decode.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(decompile.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(e"ecute.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(2etch.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(icache.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(mem.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(multiply.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(register(bank.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(wishbone.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(wishbone(bu2.vB into library work #nalyAing Ierilog 2ile B../vlog/amber;:/a;:(write(back.vB into library work #nalyAing Ierilog 2ile B../vlog/lib/generic(iobu2.vB into library work #nalyAing Ierilog 2ile B../vlog/lib/generic(sram(byte(en.vB into library work #nalyAing Ierilog 2ile B../vlog/lib/generic(sram(line(en.vB into library work #nalyAing Ierilog 2ile B../vlog/tb/tb(uart.vB into library work #nalyAing Ierilog 2ile B../vlog/tb/eth(test.vB into library work #nalyAing Ierilog 2ile B../vlog/tb/dumpvcd.vB into library work #nalyAing Ierilog 2ile B../vlog/tb/tb.vB into library work )tarting static elaboration ompleted static elaboration Fuse $emory 5sage: 98<J; K% Fuse +5 5sage: 8;;D ms ompiling module clocks(resets ompiling module generic(sram(line(enGE#,#(L7E,-*...
Released under the GNU Lesser General Public License (v2.1) terms
3 of 22
Amber
May 2013
ompiling module generic(sram(byte(enGE#,#(L7E,-*... ompiling module a;?(cache(de2ault ompiling module a;?(wishbone ompiling module a;?(2etch ompiling module a;?(decompile(; ompiling module a;?(decode ompiling module a;?(barrel(shi2t ompiling module a;?(alu ompiling module a;?(multiply ompiling module a;?(register(bank ompiling module a;?(e"ecute ompiling module a;?(coprocessor ompiling module a;?(core ompiling module eth(clockgen ompiling module eth(shi2treg ompiling module eth(outputcontrol ompiling module eth(miim ompiling module eth(registerG'&)&,(I#15&*@MbDH ompiling module eth(registerG'&)&,(I#15&*@Mb8D8D... ompiling module eth(registerGL7E,-*8='&)&,(I#15&... ompiling module eth(registerGL7E,-*N='&)&,(I#15&... ompiling module eth(registerGL7E,-*N='&)&,(I#15&... ompiling module eth(registerGL7E,-*N='&)&,(I#15&... ompiling module eth(registerG'&)&,(I#15&*@MbD88D... ompiling module eth(registerG'&)&,(I#15&*@MbD8DD... ompiling module eth(registerGL7E,-*<='&)&,(I#15&... ompiling module eth(registerGL7E,-*9='&)&,(I#15&... ompiling module eth(registerGL7E,-*?='&)&,(I#15&... ompiling module eth(registerG'&)&,(I#15&*@MbD88D... ompiling module eth(registerGL7E,-*8H ompiling module eth(registerGL7E,-*:='&)&,(I#15&... ompiling module eth(registerGL7E,-*8<='&)&,(I#15... ompiling module eth(registers ompiling module eth(receivecontrol ompiling module eth(transmitcontrol ompiling module eth(maccontrol ompiling module eth(t"counters ompiling module eth(t"statem ompiling module eth(crc ompiling module eth(random ompiling module eth(t"ethmac ompiling module eth(r"statem ompiling module eth(r"counters ompiling module eth(r"addrcheck ompiling module eth(r"ethmac ompiling module generic(sram(byte(enGE#,#(L7E,-*... ompiling module eth(spram(;:<"?; ompiling module eth(2i2oGE&+,-*8<= 4,(L7E,-*:H ompiling module eth(wishbone ompiling module eth(macstatus ompiling module eth(top ompiling module generic(iobu2 ompiling module generic(sram(byte(enGE#,#(L7E,-*... ompiling module boot(mem?; ompiling module uartGL%(EL7E,-*?;=L%()L7E,-*9H ompiling module test(moduleGL%(EL7E,-*?;=L%()L7E... ompiling module timer(moduleGL%(EL7E,-*?;=L%()L7... ompiling module interrupt(controllerGL%(EL7E,-*?... ompiling module main(memGL%(EL7E,-*?;=L%()L7E,-*... ompiling module wishbone(arbiterGL%(EL7E,-*?;=L%... ompiling module ethmac(wbGL%(EL7E,-*?;=L%()L7E,-... ompiling module system ompiling module eth(test ompiling module tb(uart(de2ault ompiling module dumpvcd ompiling module tb ,ime 'esolution 2or simulation is 8ps. Laiting 2or 8 sub-compilationGsH to 2inish... ompiled <@ Ierilog 5nits %uilt simulation e"ecutable amber-test.e"e Fuse $emory 5sage: @J:@D K% Fuse +5 5sage: ;8;D ms 3 +5 5sage: 8;DD ms 7)im +.:@2 Gsignature D"2bcDDdaaH L#'4743: # L&%+# K license was 2ound. L#'4743: +lease use 6ilin" 1icense on2iguration $anager to check out a 2ull 7)im license. L#'4743: 7)im will run in 1ite mode. +lease re2er to the 7)im documentation 2or more in2ormation on the di22erences between the 1ite and the Full version. ,his is a 1ite version o2 7)im. ,ime resolution is 8 ps )imulator is doing circuit initialiAation process. 1oad boot memory 2rom ../../sw/boot-loader-serial/boot-loader-serial.mem 'ead in ;D:? lines
Released under the GNU Lesser General Public License (v2.1) terms
4 of 22
Amber
May 2013
QQQQQQQQQQQQQQQQQQQQ +assed hello-world 9N<?9 ticks QQQQQQQQQQQQQQQQQQQQ )topped at time : 88J8?;N:DD ps : File B/pro!/amber(trunk(working/hw/vlog/tb/tb.vB 1ine :D?
2+#
r;
Released under the GNU Lesser General Public License (v2.1) terms
15 of 22
Amber
;@; ;@: ;@@ ;J8 ;J9 ;JN ?DD ?D? ?D< ?DJ ?8; ?8: ?8@ ?;8 ?;9 ?;N ??D ??? ??< ??J ?9; ?9: ?9@ ?:8 ?:9 ?:N ?<D ?<? ?<< ?<J ?N; ?NN ?@8 ?@9 ?@N ?JD ?J: ?JJ 9D; 9D: 9D@ 98D 98N 9;; 9;< 9;J 9?;
May 2013
2+#+2
Figure 2 - G067ave (aveform vie(er
This prod$ces the #ollo"in! o$tp$t The le#t col$mn !ives the time o# the event The next col$m !ives the name o# the callin! #$nction The next col$mn !ives the val$e o# the r0 re!ister This re!ister holds the #irst parameter passed in #$nction calls The next col$mn !ives the name o# the #$nction called
;N<D?8 u main -> ;N<8D9 u print2 -> ;N<?88 u print -> G DDDD@dec= H print2 u G DN2222@c= H print u G DDDDDD:?= H (outbyte u
Released under the GNU Lesser General Public License (v2.1) terms
11 of 22
Amber
;N<988 etc.
May 2013
2+*
0ar(1are Tests
The Amber pac.a!e contains a set o# tests "hich are $sed to veri#y the correct operation o# all the instr$ctions% interr$pts% the cache and peripherals The tests are "ritten in assembly Several o# the tests "ere added "hen a speci#ic b$! "as #o$nd "hile deb$!!in! the core To r$n one o# the tests% $se r$n Dtest-nameE% e !
$ cd $#$%&'(%#)&/hw/sim $ run barrel(shi2t
'nce the r$n is complete loo. at the o$tp$t #ile h"-tests lo! in the 4A35)265AS)<h"<sim< directory to chec. the res$lts All tests sho$ld pass The #ollo"in! table describes each test The so$rce #iles #or these tests are in the directory 4A35)265AS)<h"<tests
Table 2
.ame adc addr8e. add
b cac"e1
cac"e2
Released under the GNU Lesser General Public License (v2.1) terms
12 of 22
Amber
.ame cac"e3 cac"eab e8area cac"e8( us" cac"e8s+a#8bu!
May 2013
,ests t"at t"e cac"e can +rite to and read bac2 mu ti# e times (rom 22 +ords in se:uence in memory 9 t"e siDe o( t"e cac"e. ,ests t"e cac"eab e area co9#rocessor (unction. ,ests t"e cac"e ( us" (unction. Does a ( us" in t"e midd e o( a se:uence o( data reads. %"ec2s t"at a t"e data reads are correct. ,ests t"e interaction bet+een a s+a# instruction and t"e cac"e. &uns t"rou!" a main oo# mu ti# e times +it" di((erent numbers o( no# instructions be(ore t"e s+# instruction to test a ran!e o( timin! interactions bet+een t"e cac"e state mac"ine and t"e s+a# instruction. Fi s u# t"e cac"e and t"en does a s+a# access to data in t"e cac"e. ,"at data s"ou d be in5a idated. %"ec2 by readin! it a!ain. ,ests te:0 tst0 cm# and cmn +it" t"e # ( a! set. Starts in su#er5isor mode0 c"an!es to Interru#t mode t"en Fast Interru#t mode0 t"en su#er5isor mode a!ain and (ina y User mode. %"an!e status bits. ,ests mo5s +"ere t"e destination re!ister is r1)0 t"e #c. De#endin! on t"e #rocessor mode and +"et"er t"e s bit is set or not0 some or none o( t"e status bits +i c"an!e. 3ord accesses to random addresses in DD&3 memory. ,"e test creates a ist o( addresses in an area o( boot8mem. It t"en +rites to a addresses +it" data 5a ue e:ua to address. Fina y it reads bac2 a ocations c"ec2in! t"at t"e read 5a ue is correct. ,ests byte read and +rite accesses to DD&3 memory. ,est bac2 to bac2 +rite9read accesses to DD&3 memory. ,ests +is"bone access to t"e interna memory in t"e 6t"ernet MA% modu e. ,ests +is"bone access to re!isters in t"e 6t"ernet MA% modu e. ,ests et"ernet MA% (rame transmit and recei5e (unctions and 6t"mac DMA access to "iboot mem. 6t"mac is #ut in oo#bac2 mode and a #ac2et is transmitted and recei5ed. 6.ecutes 20 FI&Es at random times +"i e e.ecutin! a sma oo# o( code. ,"e interru#ts are tri!!ered usin! a ransom timer. ,est c"ec2s t"e (u set o( FI&E re!isters Br< to r14C and +i on y #ass i( a interru#ts are "and ed correct y. ,"e core +as i e!a y s2i##in! an instruction a(ter a se:uence o( 3 conditiona not9e.ecute instructions and 1 conditiona e.ecute instruction. ,ests instruction and data ( o+. S#eci(ica y tests t"at a stm +ritin! to cac"ed memory a so +rites a data t"rou!" to main memory. ,ests t"at a stream o( str instrutions +ritin! to cac"ed memory +or2s correct y. ,ests dm +"ere t"e #c is oaded +"ic" causes a jum#. At t"e same time t"e mode is c"an!ed. ,"is is re#eated +it" t"e cac"e enab ed. ,ests +is"bone read and +rite access to "i Bnon9cac"ab eC boot S&AM. A oad store se:uence +as (ound to not e.ecute correct y. ,ests runnin! a sim# e a !orit"m to add a bunc" o( numbers and c"ec2 t"at t"e resu t is correct. ,"is a !orit"m runs <0 times. Durin! t"is0 a +"o e bunc" o( I&E interru#ts are tri!!ered usin! t"e random timer. ,ests dm and stm o( sin! e re!isters +it" cac"e enab ed. ,ests dm and stm o( 2 re!isters +it" cac"e enab ed. ,ests t"e standard (orm o( dm. ,ests dm +"ere t"e user mode re!isters are oaded +"i st in a #ri5i e!ed mode. ,ests dm +"ere t"e status bits are a so oaded. ,ests t"e usa!e o( dm in User Mode +"ere t"e status bits are oaded. ,"e s bit s"ou d be i!nored in User Mode. ,ests dr and drb +it" a t"e di((erent addressin! modes. ,ests rd and str o( r1). ,ests t"e m a Bmu ti# y and accumu ateC instruction. ;u! +it" Mu ti# y Accumu ate. ,"e ( a!s +ere !etttin! set 1 cyc e ear y. ,ests a mo5s (o o+ed by a se:uence o( dr and str instructions +it" di((erent condition (ie ds. ,ests t"e mu Bmu ti# yC instruction. ,ests t"e @subtract +it" carry@ instruction by doin! 3 $49bit subtractions. Generates as dense a stream o( +rites as #ossib e to c"ec2 t"at t"e memory subsystem can co#e
dm8stm8onet+o dm1 dm2 dm3 dm4 dr dr8atr8#c ma m as8bu! mo5s8bu! mu sbc stm8stream
Released under the GNU Lesser General Public License (v2.1) terms
13 of 22
Amber
.ame
May 2013
stm1 stm2 strb sub s+i s+#8 oc28bu! s+# uart8re! uart8r.int uart8r. uart8t. unde(ined8ins
,ests t"e norma o#eration o( t"e stm instruction. ,est jum#s into user mode0 oads some 5a ues into re!isters r< 9 r140 t"en jum#s to FI&E and sa5es t"e user mode re!isters to memory. ,ests str and strb +it" di((erent inde.in! modes. ,ests sub and subs. ,ests t"e so(t+are interru#t = s+i. ;u! bro2e an instruction read immediate y a(ter a s+# instruction. ,ests s+# and s+#b. ,ests +is"bone read and +rite access to t"e Amber UA&, re!isters. ,ests t"e UA&, recei5e interru#t (unction. Some te.t is sent (rom t"e test8uart to t"e uart and an interru#t !enerated. ,ests t"e UA&, recei5e (unction. Uses t"e tb8uart in oo#bac2 mode to 5eri(y t"e transmitted data. ,ests Unde(ined Instruction Interru#t. Fires a (e+ unsu##orted ( oatin! #oint unit BFPUC instructions into t"e core. ,"ese cause unde(ined instruction interru#ts +"en e.ecuted.
2+6
C Programs
(n addition to the short assembly lan!$a!e tests% some lon!er pro!rams "ritten in & are incl$ded "ith the Amber system These can be $sed to #$rther test and veri#y the system% or as a basis to develop yo$r o"n applications The so$rce code #or these pro!rams is in 4A35)265AS)<s"
Released under the GNU Lesser General Public License (v2.1) terms
14 of 22
Amber
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # r J r8D r88 r8; r8? sp pc
May 2013
---------------------------------------------------------------------------#mber ore 5ser F7'P 7'P > )I rD D"DDDDDDD8 r8 D"DDDD8c?: r; D"DDDDDDDD r? D"DDDDDDDD r9 D"deadbee2 r: D"deadbee2 r< D"deadbee2 rN D"deadbee2 r@ D"deadbee2 D"deadbee2 rJ D"deadbee2 D"deadbee2 r8D D"DDDDDD88 D"deadbee2 r88 D"2DDDDDDD D"deadbee2 r8; D"DDDDDD9@ D"deadbee2 r8? D"deadbee2 D"deadbee2 D"deadbee2 D"D82222cD r89 GlrH D"deadbee2 D"deadbee2 D"deadbee2 D";DDDDN<? r8: GpcH D"DDDD8;:D )tatus %its: 4*D= >*8= *8= I*D= 7'P $ask D= F7'P $ask D= $ode * )upervisor ---------------------------------------------------------------------------QQQQQQQQQQQQQQQQQQQQ +assed boot-loader QQQQQQQQQQQQQQQQQQQQ
The boot loader is $sed to do"nload lon!er applications onto the FPGA development board via the 1A2T port and $sin! ?yper Terminal on a host -indo"s P&
This is a very simple example o# a stand alone & pro!ram The print# #$nction it $ses is contained in 4A35)265AS)<s"<mini-libc% so that it can r$n on an FPGA "itho$t access to a real libc library #ile
Released under the GNU Lesser General Public License (v2.1) terms
1$ of 22
Amber
May 2013
2+4
'inu5
A memory #ile is provided to r$n a sim$lation o# 7in$x bootin! The main reason #or providin! this #ile is to have a lon! test to #$rther validate the correct operation o# the core This #ile "as created #rom a modi#ied version o# the A + AF .ernel "ith the patch-A + AF-vrs* b=A patch #ile applied and then some modi#ications made to so$rce #iles to s$pport the speci#ic hard"are in the Amber A FPGA The vmlin$x mem memory #ile contains an embedded extA #ormat ramdis. ima!e "hich contains the hello-"orld pro!ram% b$t renamed as <sbin<init The .ernel mo$nts the ramdis. as <dev<root and r$ns init This pro!ram prints G?ello% -orldG and "rites the test pass val$e to the sim$lation control re!ister To r$n this sim$lation9
$ cd $#$%&'(%#)&/hw/isim $ ./run.sh vmlinu"
This sim$lation ta.es abo$t 6 million tic.s to r$n to completion% or bet"een 5 min$tes and an ho$r o# "all time dependin! on yo$r sim$lator and P& The #ollo"in! is the o$tp$t #rom this sim$lation9
# #mber %oot 1oader v;D88D88N;88:8@ # ! D";D@DDDD # # 1inu" version ;.9.;N-vrs8 GconorCserverH Ggcc version 9.:.8 G)ourcery 3QQ 1ite ;D8D.DJ:DH H #?:9 ,ue Feb 8 8N::<:DD 3$, ;D88 # +5: #mber ; revision D # $achine: #mber-F+3#-)ystem # 0n node D totalpages: 8D;9 # AoneGDH: 8D;9 pages. # AoneG8H: D pages. # AoneG;H: D pages. # Kernel command line: console*tty#$D mem*?;$ root*/dev/ram # alibrating delay loop... 8J.J8 %ogo$7+) # $emory: ?;$% * ?;$% total # $emory: ?88?<K% available G9J?K code= 8J:K data= ?;K initH # Eentry cache hash table entries: 9DJ< Gorder: D= ?;N<@ bytesH # 7node cache hash table entries: 9DJ< Gorder: D= ?;N<@ bytesH # $ount cache hash table entries: 9DJ< Gorder: D= ?;N<@ bytesH # %u22er cache hash table entries: @8J; Gorder: D= ?;N<@ bytesH # +age-cache hash table entries: @8J; Gorder: D= ?;N<@ bytesH # +0)76 con2ormance testing by 547F76 # 1inu" 4&,9.D 2or 1inu" ;.9 # %ased upon )wansea 5niversity omputer )ociety 4&,?.D?J # )tarting kswapd # tty#$D at $$70 D"8<DDDDDD GirU * 8H is a L)%4 # pty: ;:< 5ni"J@ ptys con2igured # '#$E7)K driver initialiAed: 8< '#$ disks o2 ;D@K siAe 8D;9 blocksiAe # 4etLinder Floating +oint &mulator ID.JN Gdouble precisionH # '#$E7)K: e"t; 2ilesystem 2ound at block @?@@<D@ # '#$E7)K: 1oading ;DD blocks R8 diskS into ram disk... done. # Freeing initrd memory: ;DDK
Released under the GNU Lesser General Public License (v2.1) terms
1) of 22
Amber
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
May 2013
The pro!ram trace $tility can be $sed to trace the 7in$x exec$tion% as #ollo"s9
$ cd $#$%&'(%#)&/hw/sim $ ln -s ../../sw/tools/amber-!umps.sh !umps $ !umps vmlinu"
Released under the GNU Lesser General Public License (v2.1) terms
12 of 22
Amber
May 2013
FPGA S nt!esis
A ma.e#ile is provided that per#orms synthesis o# the system to a Xilinx Spartan-6 FPGA To $se this ma.e#ile yo$ m$st have Xilinx (S) installed ( have tested it "ith (S) v*+ 5 The ma.e#ile is H$ite #lexible To see all its options% type9
$ cd $#$%&'(%#)&/hw/2pga/bin $ make help
To $se the script to per#orm a complete synthesis r$n #rom start to #inish and !enerate a bit#ile9
$ cd $#$%&'(%#)&/hw/2pga/bin $ chmod Q" V.sh $ make new
The script per#orms the #ollo"in! steps * &ompiles the boot loader pro!ram in 4A35)265AS)<s"<boot-loader% to ens$re the latest version !oes into the boot6mem ram bloc.s 2$ns xst to synthesi=e the top-level 8erilo! #ile 4A35)265AS)<h"<vlo!<system<system v and everythin! inside it 2$ns n!bb$ild to create the initial FPGA netlist 2$ns map to do placement 2$ns par to do ro$tin! 2$ns bit!en to create an FPGA bit#ile in the bit#ile directory 2$ns trce to do timin! analysis on the #inished FPGA
; + 5 6 F
The Spartan-6 FPGA tar!et device is the de#a$lt To compile #or the 8irtex-6 FPGA% set 8(2T)X6I* on the command line% e !
$ cd $#$%&'(%#)&/hw/2pga/bin $ make new I7',&6<*8
The Amber A; core is the de#a$lt To synthesi=e the Amber A5 core instead% set AA5I* on the command line% e !
$ cd $#$%&'(%#)&/hw/2pga/bin $ make new #;:*8
(# the par step #ails ,timin! or area constrains not met/% yo$ can rer$n map and par "ith a di##erent seed Simply call the ma.e#ile a!ain "itho$t the ne" s"itch The ma.e#ile "ill a$tomatically increment the seed% e !
$ cd $#$%&'(%#)&/hw/2pga/bin
Released under the GNU Lesser General Public License (v2.1) terms
13 of 22
Amber
$ make
May 2013
The system cloc. speed is con#i!$red "ithin the FPGA ma.e#ile% 4A35)265AS)<h"<#p!a<bin<3a.e#ile To chan!e it% chan!e the val$e o# A35)26&7J6:(8(:)2 in that #ile The system cloc. #reH$ency is eH$al to the P77@s 8&' cloc. #reH$ency divided by A35)26&7J6:(8(:)2 5y de#a$lt it is set to +03?= #or Spartan-6 and K03?= #or 8irtex-6
Released under the GNU Lesser General Public License (v2.1) terms
14 of 22
Amber
May 2013
$sing %oot&'oa(er
(# yo$ have a development board "ith a 1A2T connection to a P& yo$ can $se bootloader to do"nload and r$n applications on the board ( have tested this "ith the Xilinx SP605 development board (t provides a 1A2T connection via a 1S5 port on the board
#+1
&onnect the SP605 serial port 1S5 to the P& and chec. that the port is visible9
ls -l /dev/tty5)%D crw-rw---- 8 root dialout 8@@= D $ay $ lsusb %us DD8 Eevice DD8: %us DD; Eevice DD8: %us DD? Eevice DD8: %us DD9 Eevice DD8: %us DD: Eevice DD8: %us DD< Eevice DD8: %us DDN Eevice DD8: %us DD@ Eevice DD8: %us DD8 Eevice DD;: %us DD: Eevice DD;: %us DD: Eevice DD?: %us DD; Eevice D8?: Bus 008 Device 006: %y!&" %y'%art 'B 7E 8d<b:DDD; 7E 8d<b:DDD; 7E 8d<b:DDD8 7E 8d<b:DDD8 7E 8d<b:DDD8 7E 8d<b:DDD8 7E 8d<b:DDD8 7E 8d<b:DDD8 7E D:e?:D<D@ 7E D9<e:::a: 7E D92?:D;8; 7E D?2d:DDD@ ID 10c4:ea60 lig(t
9 88:D; /dev/tty5)%D
1inu" Foundation ;.D root hub 1inu" Foundation ;.D root hub 1inu" Foundation 8.8 root hub 1inu" Foundation 8.8 root hub 1inu" Foundation 8.8 root hub 1inu" Foundation 8.8 root hub 1inu" Foundation 8.8 root hub 1inu" Foundation 8.8 root hub 3enesys 1ogic= 7nc. 5)%-;.D 9-+ort -5% %ehavior ,ech. omputer orp. &lan $icroelectronics orp. 1aser $ouse 6ilin"= 7nc. Cygnal Integrated Products, Inc. CP210x
!"# Bridge $
&on#i!$re minicom
sudo minicom -s Q-----------------------------------------------------------------------Q W # )erial Eevice : /dev/tty5)%D W W % - 1ock2ile 1ocation : /var/lock W W allin +rogram : W W E allout +rogram : W W & %ps/+ar/%its : J;8<DD @48 W W F - -ardware Flow ontrol : Xes W W 3 - )o2tware Flow ontrol : 4o W W W W hange which settingY W Q-----------------------------------------------------------------------Q
Released under the GNU Lesser General Public License (v2.1) terms
25 of 22
Amber
May 2013
#+2
Released under the GNU Lesser General Public License (v2.1) terms
21 of 22
Amber
May 2013
'icense
All so$rce code provided in the Amber pac.a!e is release $nder the #ollo"in! license terms9
opyright G H ;D8D #uthors and 0+&4 0'&).0'3 ,his source 2ile may be used and distributed without restriction provided that this copyright statement is not removed 2rom the 2ile and that any derivative work contains the original copyright notice and the associated disclaimer. ,his source 2ile is 2ree so2twareZ you can redistribute it and/or modi2y it under the terms o2 the 345 1esser 3eneral +ublic 1icense as published by the Free )o2tware FoundationZ either version ;.8 o2 the 1icense= or Gat your optionH any later version. ,his source is distributed in the hope that it will be use2ul= but L7,-05, #4X L#''#4,XZ without even the implied warranty o2 $&' -#4,#%717,X or F7,4&)) F0' # +#',7 51#' +5'+0)&. )ee the 345 1esser 3eneral +ublic 1icense 2or more details. Xou should have received a copy o2 the 345 1esser 3eneral +ublic 1icense along with this sourceZ i2 not= download it 2rom http://www.opencores.org/lgpl.shtml #uthorGsH: - onor )anti2ort= csanti2ort.amberCgmail.com
Released under the GNU Lesser General Public License (v2.1) terms
22 of 22