|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
#技术风云榜#play with OpenRISC based atlys board(3)# V9 j9 F, S- R" \/ z' Z
- u# j, K* f" z/ V0 i( d1 c
#技术风云榜#play with OpenRISC based atlys board(1):https://www.eda365.com/forum.php?mod=viewthread&tid=469239&page=1&extra=#pid21315739 z3 v$ n- ?: S2 s8 O7 D# G
; Y3 h5 @' F' E1 B& `
#技术风云榜#play with OpenRISC based atlys board(2):https://www.eda365.com/forum.php?mod=viewthread&tid=469267&page=1&extra=#pid2131619
: }1 C9 X! v4 a+ O; W/ n+ F8 f9 m+ I, M, W
( s3 B1 A$ ]7 a* e3 x# j/ \+ h. f/ E3.Using ORPSoC
; M* \* G9 O, \4 H9 d2 ~# J, Z; `
Introduction# t- {! G/ _ c; K) C' I
7 p3 y+ b' V8 _! L" z% Z; |* l
, l5 Z4 w+ ?" I3 @ORPSoC is intended to be a reference implementation of processors in the OpenRISC family. It provides a smallest-possible reference system, primarily for testing of the processors. It also provides systems intended to be synthesized and programmed on physical hardware. The reference system is the least complex implementation and consists of just enough to test the processor’s functionality. The board-targeted builds typically include many additional peripherals. For more information read the ORPSoC User Guide found in the doc directory of the ORPSoC installation.
/ M) {7 @2 A8 N3 s: Q. k
, s8 o9 h& ^# i3 i) D6 I e8 e% MProject organization+ c, V0 S5 E5 g! ^/ x. [
8 S' \- l% s2 f3 I* _' b" X; [
: ~& z v8 I8 D# B* u- rThe ORPSoC project is intended to serve dual purposes. One is to act as a development platform for OpenRISC processors, and as a development platform of OpenRISC-based SoCs targeted at specific hardware. Organising a single project to satisfy these requirements can lead to some overlap and redundancy. The reference implementation based in the root (base directory) of the project contains enough components to create a simple OpenRISC-based SoC. Each board build is intended to implement as fully-featured a system as possible, depending on the targeted hardware. The project is organised in such a way that each board build can use both the reference implementation’s RTL modules and software, as well as its own set of RTL and software. The reference implementation is limited to what is available in the RTL and software directories in the root of the project, and is not technology dependent. 4 L3 H; j7 W2 F$ j8 {+ @
& A3 U/ J) ^$ T+ x) n7 s1 w& b0 ]The Atlys board6 m: ^$ x2 S) T5 ^: O) l4 v
3 i: J) o, s2 ?3 J- @
We will start by finding the Atlys board setup. % Z4 {; k/ `- `4 f5 d1 E! M
9 n8 h) o1 ~3 t K* O3 v" _; Y
1 ]: A2 a& f7 I; n
0 H% t: f {7 j" @# o( ]1 x0 _4 s1 r3 b* x. x( M: ]; F4 I2 |
& j* r/ B3 T* w7 }+ Z) J2 e5 _1 B 5 A1 H) m- x. B
Before we start
. B( K$ [3 y+ v1 v$ Q# a
1 f% @' i# }8 DBefore we start the design phase we have to make sure the Xilinx Design Suite is installed and that the environment variable XILINX is set.
0 I [- [* s1 ?. p6 |5 q! Q- i* P- N: u# V' r
- d" [% J G/ n
2 q3 n# {1 K0 t4 j* X
5 `: W( f7 m2 b B7 k: s" `
6 {9 M6 O) j! k4 ~/ f8 L- HDesign
/ z$ ~# |5 w4 Q0 f% P) c8 Q2 C$ L" n% c/ Y) V1 T2 N$ |
The design is made up of a number of Verilog HDL files. They reside in two different directory. One directory that holds all the code that is common to all board designs found here:& ]: M( u6 G- p# d
9 X3 x. z. x/ e, ^2 ~- m2 k0 M
- E% z: j# E. ]* p, N* \0 f
; k" k. l9 W. [- F1 E! S4 W( V0 b4 U) f
- n( t( i% k+ {% O( ^" w+ y
& _- x: Q9 A. HAnd one board specific design directory as shown in the screenplot of the atlys board directory structure. The syntesis script will pick up all the Verilog design files to build the complete system.
8 S/ R2 _4 a6 [
# m- O+ g- g! P U$ z B/ t% l) U& f# u$ O- ]
5 m% ^' k5 T' ^; @( y- w
Synthesis & \1 y f& V9 q8 B8 m& {
3 j( A% s y7 d- X
Synthesis of the board port for the Xilinx technology with the XST synthesis tool can be run in the board’s <syn/xst/run> path with the following command: <make all> 2 X6 O$ J$ _+ z6 [
This will create an NGC file in <syn/xst/run> named <orpsoc.ngc>. Hopefully it’s all automated enough so that, as long as the design is simulating as desired, the correct set of RTL will be picked up and synthesized without any need for customising scripts for the tool.
' Q: ]0 X2 y @% }9 V. `; D) P3 `/ G- ~6 j; C% d6 }2 r
7 _5 f% K4 i( v! ]4 l9 V) L. T5 |
4 m/ @- Y. d0 q. o V/ o" X
* N9 B7 Y/ ` L$ A1 d8 y, b3 ~7 EUser constraints file5 q/ Z" S2 W+ } T# m' ? E
& |. c" K' ?' j7 \# I; w
$ V# G3 G8 p1 N
A Xilinx User Constraints File (UCF) is in the board’s <backend/par/bin> path. It is named <atlys.ucf>. It should be edited if any extra I/O or constraints are required.
5 V) N- i4 w/ G& v
+ M/ Y& j4 v8 r/ U/ @
- b; s; s- n1 m) u% h3 l9 m, q
/ U* {1 E Q- Y0 XMappping and place & route
# B1 A$ H* r$ `( b; @7 x, g; I9 n/ f6 C2 T* A1 ^5 b/ D0 B1 }
' l+ [8 ~1 y+ m& JMapping and place & route of the design can be run from the board’s <backend/par/run> path with the following command: <make orpsoc.ncd>. The makefile used can be found in the <......./boards/xilinx/atlys/backend/par/bin> directory. Here is an excerpt from the makefile showing the backend design flow:
* [* B! }" t( O/ |% c
3 F0 s9 y2 o9 W& @: H3 |8 J
3 _0 g! X0 L8 Y" W( P. V) N
7 q d* p6 d( v1 x$ R3 T8 }5 \! e1 f' l3 n, u6 j: V
: B/ w5 f" C" k; g- Y* A ' U, {' P/ A1 y& `, e; O
2 ~# n( T' B( _2 [
4 D- v6 h6 |$ d1 r: j& l0 p5 [
7 j+ ?/ I8 |. \! t$ s( _. a. ? 6 K* i* F- U" T! i8 c
Place & route results4 {" Y5 G" j& y9 H- x
L( T" O. p N B- d+ e d+ G- W1 c
; h6 s3 b# [+ J6 X2 i& J! L* qThe results from the place & route tool can be found in the logfile <orpsoc.par>: ( Q/ z6 w9 P: Z7 l+ w
6 T/ t5 {! J" Q' M5 b
$ w$ @- ^' [. M0 O+ q/ j 5 e+ b) R/ Q- R4 g6 |1 o
" u. i' g( ~! k: h% C" c - @3 h- l8 u( a# {' q
Options( d( W0 `" Q8 |: F
* [# k9 N. D) D# m+ F# [/ ^* y
3 L [6 I4 `. b# ~To get a list of options that can be set when running the backend flow, run the following command:
' x3 |$ n, X: Y$ f
% \# [2 I E. P; m1 G8 `% W; \ P" z
make print-config7 d* S; t. Y6 w' Z: ~ z) O
' b7 ]* y2 S7 Q# q' w8 D# b0 t# Q/ K# y, Z
) }% U" @" P& ]- D: O2 x8 M
/ Z' Y% ~) B6 h( y( x
2 {0 z5 b! t% W( w/ `
0 I6 r6 H& e2 u5 ?' |8 W. n6 D6 Y
Generate timing report$ Y! g, u& G6 [3 S* O
; e/ }7 e3 }4 m* O- r5 h- T" [
9 V; C9 U1 _1 B) |2 W
The trace tool can be used to generate a timing report of the post-place and route design: ( A8 \* n7 ` Q* ?& W+ A" R9 l- U
. f1 J# O$ X' H0 U: r' @/ Z! ]make timingreport 3 ~8 d& ?3 V5 V; `+ O6 w+ {- V
2 C& V+ n* S8 q) j1 @: Y7 ^4 J 9 A5 C% X L" j" x$ S
3 X, v1 E& Y4 m: a& C 3 [1 x# n" e" M
# ]% P2 `& @( @( \( P) N1 _Here is the result: 0 n6 G9 A+ i. N+ W7 C8 j) u
" Y1 a2 K4 l# I* \& p7 Y8 X
! Z# m/ }- X$ j1 a
7 U7 v- Y$ p3 P
4 r; g0 ?. z" N& e: _4 m( `: V8 `/ W- G. c/ U8 w
% Q+ ]" S4 h: S! S( ]5 ]
We have 1338 timing errors. Before we continue we have to investigate these errors. The timing report result file is called <orpsoc.twr>. Analyzing the this we find the following timing errors.
9 F% F5 a7 @) W: a5 k$ k
2 {, l- W$ W. Z6 J6 K3 H: b2 C, W S& g G/ u5 E/ t
) N* |& z: j$ l1 r1 K. m$ L2 R& `; P: i( U [# o, b" }/ }
9 P9 V! b- G2 o' C9 C C
+ h% x/ U0 N1 w+ ]/ N# t4 U! y$ m* x9 j0 I/ G
+ t! k: R8 {- Q8 l4 S FWithout knowing to much about the design it is hard to figure out what is wrong. Let's setup a simulation environment and analyze what's going on (see next chapter). $ Y" V, h7 f! T- B) D6 r
1 R4 ]; W. a! n0 \1 P
Generating the bitstream file2 \' K7 _" J' K2 n# E( |
( ]' f) k. ?/ r0 H' t. b3 u
The bitstream file is used to configure the FPGA device. The configuration file generation is run from the .../atlys/backend/par/run directory using the command: make orpsoc.bit . k9 z0 Z% _* r2 S. ^1 S# p
: _+ {& ?! @, { M& W
' s+ t; C( t9 F , P& ~" G( ~1 }: U' p: A- {2 _
, \* H" I4 I/ f1 I: v
3 k6 y+ P7 I2 V2 ^# e" p9 v ) N4 Y# H# R% h0 [, \
Downloading the bitstream
" h6 F+ e+ F$ H" u
/ [. [" }# g3 z p. ]( n! L! nWe are going to use the Xilinx configuration tool called iMPACT to configure the SPARTAN-6 FPGA on the Atlys board. The first thing we have to do is connecting our board to the computer we use for our development work using a USB cable.
1 v' m! }* k: m3 Z. g
2 c$ w: L. `) D' v1 y% T" g
& X6 b! K* O! j3 k% R1 |1 x
$ [2 A, s( X0 Z( R4 I: q( ?( w9 m( l. A2 l7 `9 M+ T6 k
Then start iMPACT. 0 W9 Z+ i* j; @; v- `0 ]" ]" U0 _( e; g
+ j: C; P! H/ @! B, P6 c, N( j* L$ a- g8 x
l
$ n8 ^2 }/ ?' R! d$ P0 |1 `% H+ w# G5 z( |9 M- C
4 D# C6 ]; f/ z1 y. q2 h' ?3 L* ~: h6 f: |) P, W" e3 B3 U i
We will create a new iMPACT project.
7 w& f2 W( D! h4 `% O3 m& w B7 i
- c P) _: m. \; X 8 W6 g: [ f7 m _) ~
$ r+ j# d8 U- X2 i9 i( Y/ H* P' A
5 i1 {: {% ^$ \+ u9 y! i B
6 U- j" t6 R" C
We are going to use JTAG to configure the device.* f7 }7 H0 E3 Z" i# n! W
9 B' @' S! P5 H* ` K' y$ H! ?, @" X: P5 k9 @. ^
; f- s$ ?" f" \+ z" w8 Y# I
6 }! t4 v0 F9 k
$ L6 m2 P0 P9 G6 z3 G# N9 E
( k, R- K4 j* Y1 h4 n; n2 d4 d: sThe iMPACT tool will connect to the boundary scan chain on the board and identify the FPGA.
: E7 I2 p, x3 b
( n' d2 ] g6 i% l# k$ K
0 Y, N1 ]4 [0 w, h& V
! j+ T) Q; A& y* y/ Z5 E1 y( P0 G4 L! q
! m" a" i3 w, l ?$ ^/ U
# L3 Z$ {+ i$ C0 [* f3 o/ G/ P- kTo add a configuration file we right-click the FPGA icon and select <Assign New Configuration File> and find the configuration file <orpsoc.bit>.! U4 U! H3 D4 w8 ~$ P. d& F! h
1 V) B8 Z! X q' `$ }: t/ L
8 D, b; L$ O! M' ] ; [' }8 X) q/ `. v) c7 S+ v
6 J$ G$ b9 n( x- l! F3 \
: O4 L$ X7 o3 x7 b3 E1 SWhen double-clicking the Program operation entry the configuration will start. After a few seconds the configuration has finished.
( v# C$ C& P. o- { |
|