performed by:gidi getter , shir borenstein supervised by:ina rivkin final presentation

40
Performed by: Gidi Getter, Shir Borenstein Supervised by: Ina Rivkin Final Presentation 21/07/2008 ×Ŗ×Ŗ×Ŗ×Ŗ ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗspeed digital systems laboratory ×Ŗ×Ŗ×Ŗ×Ŗ- ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ×Ŗ ×Ŗ×Ŗ×Ŗ×ŖTechnion - Israel institute of technology department of Electrical Engineering Space Wire Core for LEON3 System

Upload: nowles

Post on 04-Feb-2016

35 views

Category:

Documents


0 download

DESCRIPTION

Technion - Israel institute of technology department of Electrical Engineering. הטכניון - מכון טכנולוגי ליש×Øאל הפקולטה להנדה×Ŗ חשמל. High speed digital systems laboratory. המעבדה למע×Øכו×Ŗ הפ×Ø×Ŗיו×Ŗ מהי×Øו×Ŗ. Space Wire Core for LEON3 System. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Performed by: Gidi Getter,Shir Borenstein

Supervised by: Ina Rivkin

Final Presentation21/07/2008

High speed digital systems laboratoryהמעבדה למע×Øכו×Ŗ הפ×Ø×Ŗיו×Ŗ מהי×Øו×Ŗ

הטכניון - מכון טכנולוגי ליש×Øאל

הפקולטה להנדה×Ŗ חשמל

Technion - Israel institute of technologydepartment of Electrical Engineering

Space Wire Core for LEON3 System

Page 2: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Project Definition

ā€¢ Design a Space Wire core for LEON3 system.

ā€¢ Load Leon3 system with our own IP core to GR-RASTA board.

Page 3: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

What is Space Wire?

ā€¢ Space Wire is a spacecraft communication network. It is coordinated by the European Space Agency (ESA).

ā€¢ Components are connected through low-cost, low-latency, full-duplex, point-to-point serial links.

ā€¢ Uses data strobe encoding - differential ended signaling (DS-DE).

ā€¢ Space Wire utilizes asynchronous communication and allows speeds between 2Mb/s and 400Mb/s.

ā€¢ The protocol describes routing, flow control and error detection in hardware, with little need for software.

Page 4: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

The Protocol

ā€¢ Consists of Data characters and Control characters.

ā€¢ Data characters are 10 bits long ā€“ 1 parity bit,1 flag bit set to ā€˜0ā€™ and 8 data bits.

Page 5: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

The Protocol

ā€¢ Control characters are 4 bits long ā€“ 1 parity bit,1 flag bit set to ā€˜1ā€™ and 2 control characters.

ā€¢ Control codes is built with the ESC character following a FCT character / Data character.

Page 7: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

LEON3 System

LEON3 Processor

AMBA AHB Bus

AHBController

JTAG Dbg Link

MemoryController

SERIAL Dbg Link

JTAG RS232

Space Wire Link

LVDS

RAM

SRAM, DRAM etc.

Page 8: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

SIGNAL gotFCT : std_logic

S_out

d_out : std_logic

S_out : std_logic

SIGNAL gotNull : std_logic

clk : std_logic

SIGNAL sendFCTs : std_logicSIGNAL sendNchars : std_logic

SIGNAL sendTimeCodes : std_logicSIGNAL sendNulls : std_logic

SIGNAL rec_rst : std_logic

SIGNAL tr_rst : std_logic

SIGNAL gotNChar : std_logic

SIGNAL GotEOP : std_logicSIGNAL GotEEP : std_logic

SIGNAL empty : std_logic

U_1S_out

send

Nch

ars

send

Tim

eCod

es

gotF

CT

_ac

kgo

tFC

T_r

eq

sent

FC

T_a

ck

sent

FC

T_r

eq

SIGNAL wr_data_count : std_logic_VECTOR(5 downto 0)

SIGNAL gotFCT_ack : std_logic

my_project_libController

rst : std_logic

SIGNAL gotFCT_req : std_logic

SIGNAL control_flags_out : std_logic_vector(1 DOWNTO 0)

SIGNAL time_out : std_logic_vector(5 DOWNTO 0)

SIGNAL control_flags_in : std_logic_vector(1 DOWNTO 0)

SIGNAL time_in : std_logic_vector(5 DOWNTO 0)

SIGNAL tick_out : std_logicSIGNAL tick_in : std_logic

SIGNAL wr_en_tf : std_logic

SIGNAL rd_en_rf : std_logic

SIGNAL wr_clk_rf : std_logic

SIGNAL rd_en_tf : std_logic

SIGNAL rd_clk_tf : std_logic

SIGNAL Link_Disabled : std_logic

SIGNAL has_places : std_logic

SIGNAL sentFCT_req : std_logicSIGNAL sentFCT_ack : std_logic

SIGNAL CreditError : std_logic

SIGNAL tr_fifo_dout : std_logic_VECTOR(8 downto 0)SIGNAL tr_fifo_din : std_logic_VECTOR(8 DOWNTO 0)

SIGNAL RxError : std_logic

fifo_9bit

rd_clk

rd_en

rst

dout : (8:0)

empty

rd_data_count : (5:0)

SIGNAL rec_fifo_din : std_logic_vector( 8 DOWNTO 0 )

SIGNAL wr_en_rf : std_logic

SIGNAL rd_data_count : std_logic_VECTOR(5 downto 0)

d_in : std_logic

S_in : std_logic

SIGNAL rec_fifo_dout : std_logic_VECTOR(7 downto 0)

wr_clk

wr_en

SIGNAL got_EEP : std_logicSIGNAL got_EOP : std_logic

ahbo : std_logic --AHB_slv_out_type;

ahbi : std_logic --AHB_slv_in_type;

SIGNAL tick_out_req : std_logicSIGNAL tick_out_ack : std_logic

rd_en_tf

tr_

fifo_

din

: (8:

0)

wr_

data

_co

unt

: (5:

0)

cont

rol_

flags

_in

has_

pla

ces

Package ListLIBRARY ieee;USE ieee.std_logic_1164.all;USE ieee.std_logic_arith.all;USE IEEE.std_logic_unsigned.all;USE ieee.numeric_std.all;

DeclarationsPorts:

Diagram Signals:

d_outmy_project_libTransmitter

clk

D_outfifo_empty

tick

_in

time

_in

cont

rol_

flags

_in

has_

pla

ces

tr_fifo_dout

rst_dcm

tr_fifo_dout : (8:0)

empty

rst

my_project_lib

din : (8:0)

wr_en

rst

my_project_lib

control_flags_out : (1:0)

Cre

ditE

rro

r

gotE

EP

gotE

OP

gotF

CT

gotF

CT

_ac

kgo

tFC

T_r

eq

gotN

Cha

r

gotN

ull

gotT

ime

Cod

e

rst

Rx

Err

or

sent

FC

T_a

ck

sent

FC

T_r

eq

rec_rst

Cre

ditE

rro

r

sen

dNul

ls

gotN

ull

gotF

CT

Go

tEO

PG

otE

EP

gotF

CT

_ac

kgo

tFC

T_r

eq

sent

FC

T_a

ck

sent

FC

T_r

eq

Rx

Err

or

rstse

ndF

CT

str_clk

rd_en

U_2

gotEEPgotEOP

gotFCT

gotNChar

gotNull

gotTimeCoderec_

rst

sendFCTssendNchars

sendNullssendTimeCodes

tr_r

st

CreditErrorRxError

sendFCTssendNchars

sendTimeCodes

rec_

rst

tr_r

stsendNulls

rd_clk_tftr_rst

gotN

Cha

rtic

k_o

ut

d_in

S_in

RecieverU_0

D_in

S_in

sys_clkclk

din

rec_clk

rec_fifo_din : (8:0)

tick_out_acktick_out_reqtime_out : (5:0)

wr_en_rf

wr_clk_rf

rec_fifo_dinwr_en_rf

tick_out_reqtick_out_ack

by shirg idi on 10 2008 ל אפ×Øי

<enter diagram title here>

<company name>

my_project_lib/SW/struct

rd_

clk

got_EEP

rd_e

n_rf

cont

rol_

flag

s_o

ut

time_

out

rec_fifo_dout : (7:0)

rd_data_count : (5:0)got_EEPgot_EOP

clk

rst

Link_Disabled

clk

rst

U_4

wr_

clk

full

wr_data_count : (5:0)

got_EOP

clk

Link_Disabled

clk

clk

clk

rst

my_project_libahbsw_ctrlU_3

add

_cre

dit

clk

cont

rol_

flags

_in

cont

rol_

flag

s_o

ut

d_in

d_o

ut

disable_link

Go

tEE

PG

otE

OP

Go

tTim

e

r_d

ata_

cou

nt

read

_en

rst

Tim

eCod

e

w_

data

_cou

nt

wr_

en

time_

out

ahbi

ahbo

tick_

out_

ack

tick_

out_

req

wr_

en_

tf

time

_in

tick

_in

Title:Path:Edited:

my_project_libReceiveFifoU_5

rd_data_count

dout

rd_en

Project:

<enter comments here>

my_project

ahbo

ahbi

hindex = 11 ( integer ) haddr = 16#B00# ( integer ) hmask = 16#fff# ( integer )

Space Wire Core ā€“ Top Level

Page 9: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Space Wire Core ā€“ Controller

gotFCT

ā€˜1ā€™ Q

ctrl_rst

clk

D Q

ctrl_rst

D Q

ctrl_rst

D

Page 10: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Space Wire Core ā€“ Transmitter

Data serialization unit ā€“ translate the character into data-strobe logic

values

clk

tick

tr_clk

tick_tr

FCT synchronizer

req

ack

Early data fetch from FIFO

Transmitter control unit ā€“ decides which character to transmit and manages FCT

balance

Page 11: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Space Wire Core ā€“ Receiver

0 1 0 0 10 00

clk

D

Serial to parallel character decoder

Initialization Null decoder

DCM & reset generator

State controller and timer

State controller and timer

Time code synchronizer

FCT synchronizer

Clock restore

Page 12: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

ā€¢ Leon3 reads data one packet at a time.ā€¢ All NChars are forwarded from FIFO1 to FIFO2 until

EOP/EEP is detected.ā€¢ No further data is written into FIFO2 until is the packet

was read by Leon3 and FIFO2 is empty again.

Receiver FIFO

Page 13: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

ā€¢ Handles all requests from processor.ā€¢ Reads and writes data from FIFOs to transfer between

core and processor.ā€¢ Add bit for data/EOP.ā€¢ Updates Status Register.ā€¢ Informs available room in receive FIFO for FCT handling

by transmitter.

State Machine

StatusRegister

clk

reset

AHB_slave_in

AHB_slave_out

wr_enData

9

rd_enData

8

Tick_out

Time_in

AMBA AHB Controller

Tick_in

Time_out

Page 14: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

ā€¢ The Space Wire core with Leon3 system was checked in logic simulation only.

ā€¢ The Leon3 system with a custom IP core was loaded into GR-RASTA board.

ā€¢ Coming up next: Simulation results.

Logic Simulation

Page 15: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Logic Simulation ā€“ Transmit

The value of the status register is sent back to the processor.

The processor initiate a read cycle on the bus, to the write status register address.

volatile int *check_status = 0xB0000ABC;free_space = 64 - *check_status;

Page 16: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

volatile int *send_addr4 = 0xB0000000;*send_addr4 = *nchar;

Logic Simulation ā€“ Transmit

Data is written into transmit FIFO.4 write cycles to transfer 4 nchars.Transmitter reads the nchars from the

FIFO

Transmitter sends the nchars across the linkTransmitter sends the nchars across the link

Page 17: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Logic Simulation ā€“ Receive

Receiver detectes arrival of nchar on link.

The nchars are written into FIFO 1.

Data is transferred from FIFO1 to FIFO2 as long as EOP was not recieved

Status register in AHB controller is updated by the number of nchars stored in FIFO2.

Page 18: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Logic Simulation ā€“ Receive

Receiver detectes arrival of EOP

A character marking arrival of EOP is written to

reciever FIFO1

FIFO controller reports arrival of EOP to AHB controller. No more nchar will be tranfered to FIFO2.

AHB status register is updated, to report arrival of EOP to processor.

Page 19: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Logic Simulation ā€“ Receive

The rest of the computation is done in software

The value of the status register is sent back to the processor.

The processor initiate a read cycle on the bus, to the status register address.

volatile int *check_status = 0xB0100AB0 ;status = *check_status;

Page 20: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Logic Simulation ā€“ Receive

The processor requests to read 4 nchars

The AHB controller reads 4 lines from receiver FIFO and collects them

The data is sent back to the processor, 4 nchars in parallel (32 bit data bus)

Page 21: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

ā€¢ LEON3 design configuration.ā€¢ Add instantiation of the core to leon3mp.vhd (top

module).ā€¢ Add VHDL file list of the core to Makefile. This will add

the files to simulation and synthesis scripts.ā€¢ Write C code of the program. Compile using sparc-elf

cross compiler. Create an exec file to run on board, and a memory snapshot for simulation.

ā€¢ Simulate design using testbench provided by gaisler.ā€¢ Perform synthesis with synplify, using generated script.ā€¢ Perform P&R with ISE tool, and load bit file to board.ā€¢ Load exec file and run program using GRMON.

Configuring LEON3 System

Page 22: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

ā€¢ Add support for UART and DSU.

LEON3 Design Configuration

Page 23: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

ā€¢ Add support for UART and DSU.

LEON3 Design Configuration

Page 24: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

ā€¢ Add support for UART and DSU.

LEON3 Design Configuration

Page 25: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Add IP Core

ā€¢ Add instantiation of the core to leon3mp.vhd (top module).

Page 26: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Add IP Core

AHB slave index number on the bus

12 MSB bits of slave address space

Number of AHB slaves on the bus.Default is 8, change to 16.

Page 27: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

MakefileAdd the VHDL files of the core to ā€œVHDLSYNFILESā€ parameter

Page 28: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Testbench

Change SDRAM file to the same as SRAM file.

Page 29: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Create scripts for Simulation

ā€¢ ā€œmake scriptsā€ command generates tool-specific compile scripts.

ā€¢ ā€œmake vsimā€ compiles all VHDL files and testbench for simulation.

ā€¢ ā€œmake xgrlibā€ ā€“ GUI interface for running these commands and more.

Page 30: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Compile C Program for LEON3

Compile C code using sparc-elf cross compiler:

ā€¢ To create an exec file to run on board:sparc-elf-gcc -O2 -g prog.c -o prog.exe

ā€¢ To create a memory image for simulation:sparc-elf-objcopy -O srec prog.exe sram.srec

Page 31: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Simulation and Synthesis

ā€¢ Simulate design with Modelsim: run ā€œmake vsimā€ will compile all the files.

ā€¢ Run synthesis: ā€œmake synplifyā€ will create a project file (leon3mp_synplify.prj) for Synplify.

ā€¢ These commands can be run from xgrlib GUI.

Page 32: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

P&R with ISE

ā€¢ Can be run directly from synplify after synthesis.

ā€¢ Constrains file to be used in ISE is provided in the LEON3 package in:

ā€œboards\gr-cpci-xc2v\leon3mp.ucfā€

Page 33: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Problems Using GR-CPCI-XC2V

ā€¢ Bit files can be programmed from PROM or Boundary Scan (JTAG).

ā€¢ By default, the board is configured to be loaded from PROM at startup.

ā€¢ To load a new bit file, the system must be reset. If a new bit file is loaded again before reset, the new system will not function.

Page 34: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Problems Using GR-CPCI-XC2V

ā€¢ To configure the board to be loaded only from JTAG, set jumpers to Boundary Scan Programming (Mode='101').

Page 35: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

LEON3 Debug Support Unit

Page 36: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

LEON3 Debug Support Unit

RS232 DSU connection for serial connection to PC

JTAG connection for loading and debugging

Page 37: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

GRMON

ā€¢ GRMON is a general debug monitor for the LEON processor.

ā€¢ Can be used to access all system registers and memory.

ā€¢ Used for downloading and execution of LEON applications.

ā€¢ Can access the DSU via RS232, JTAG, PCI, USB and ethernet.

ā€¢ Can loopback UART in system and print its output on console.

Page 38: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

GRMON

Starting GRMON:ā€¢ With UART loopback via serial: grmon -uā€¢ With UART loopback via JTAG: grmon -u -jtagGRMON command-line interface:ā€¢ Load a program: load <file>ā€¢ To run a program: runā€¢ System information: info sysā€¢ Displaying register content: regā€¢ Displaying memory contents: mem <addr>

Page 39: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

GRMON

Page 40: Performed by:Gidi Getter , Shir Borenstein Supervised by:Ina Rivkin Final Presentation

Achievements & Future Development

Project main steps:ā€¢ Learn and implement Space Wire protocol.ā€¢ Integrate SW core into LEON3 system.ā€¢ Operate GR-CPCI-XC2V board with LEON3

system with our own IP core.Future improvements:ā€¢ Operate the SW core on the board with loopback,

and check compatibility of protocol with SW bridge.

ā€¢ Integrate SW core as master on AHB bus, implement interrupt and DMA for transactions.