on chip bus

39
SOC Consortium Course Material On Chip Bus On Chip Bus Speaker: 沈沈沈 National Taiwan University Adopted from National Taiwan University SOC Course Material

Upload: temple

Post on 05-Feb-2016

55 views

Category:

Documents


1 download

DESCRIPTION

On Chip Bus. Speaker: 沈文中. National Taiwan University Adopted from National Taiwan University SOC Course Material. Outline. AMBA Bus Advanced System Bus Advanced High-performance Bus Advanced Peripheral Bus IP Design flow FPGA design flow. Bus Architecture. Outline. AMBA Bus - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: On Chip Bus

SOC Consortium Course Material

On Chip BusOn Chip Bus

Speaker: 沈文中National Taiwan University

Adopted from National Taiwan University

SOC Course Material

Page 2: On Chip Bus

2SOC Consortium Course Material

OutlineAMBA Bus

– Advanced System Bus– Advanced High-performance Bus– Advanced Peripheral Bus

IP Design flowFPGA design flow

Page 3: On Chip Bus

3SOC Consortium Course Material

Bus Architecture

Page 4: On Chip Bus

4SOC Consortium Course Material

OutlineAMBA Bus

– Advanced System Bus• High performance• Pipelined operation• Multiple bus master

– Advanced High-performance Bus– Advanced Peripheral Bus

FPGA design flow

Page 5: On Chip Bus

5SOC Consortium Course Material

ASB charactersNegative edge triggerTri-state bus

– Drawback: More effort used to control timing– Advantage: cost less area

Page 6: On Chip Bus

6SOC Consortium Course Material

OutlineAMBA Bus

– Advanced System Bus– Advanced High-performance Bus

• High performance• Pipelined operation• Multiple bus master• Burst transfers• Split transactions

– Advanced Peripheral BusIP Design flowFPGA design flow

Page 7: On Chip Bus

7SOC Consortium Course Material

AHB simple Arch.

Page 8: On Chip Bus

8SOC Consortium Course Material

AHB ComponentsAHB Components

– AHB master is able to initiate read and write operations by providing an address and control information. Only one bus master is allowed to actively use the bus at any one time.(max. 16)

– AHB slave responds to a read or write operation within a given address-space range. The bus slave signals back to the active master the success, failure or waiting of the data transfer.

Page 9: On Chip Bus

9SOC Consortium Course Material

AHB Components(ii)AHB Components

– AHB arbiter ensures that only one bus master at a time is allowed to initiate data transfers.

– AHB decoder is used to decode the address of each transfer and provide a select signal for the slave that is involved in the transfer. A single centralized decoder is required in all AHB implementations.

Page 10: On Chip Bus

10SOC Consortium Course Material

AHB Signals(i)AHB Signals can be classified as

– Clock (HCLK)– Address and read/write data (HADDR, HRDATA,

HWDATA)– Arbitration (HGRANTx, HMASTER, HMASTLOCK,…)– Control signal (HRESETn,…)– Response signal(HREADY, HRESP)

Page 11: On Chip Bus

11SOC Consortium Course Material

AHB Signals(ii)

Transfer signals– HCLK

• bus clock. All signal timings are related to the rising edge.– HADDR[31:0]

• 32 bits system bus– HWDATA/HRDATA [31:0]

• 32 bits write/read data bus– HWRITE

• High: write data• Low: read data

– HREADY• Transfer done

Page 12: On Chip Bus

12SOC Consortium Course Material

AHB Signals(ii)Basic Transfer

Each transfer consists of– An address and control cycle– One or more cycles for the data

Page 13: On Chip Bus

13SOC Consortium Course Material

AHB Arch.

Page 14: On Chip Bus

14SOC Consortium Course Material

AHB Signals(iii)Control signals

– HTRANS[1:0]• Current transfer type

– HBURST[2:0]• When sequential transfer, control transfer relation

– HSIZE[2:0]• Control transfer size=2^HSIZE bytes(max=1024bits)

– HPROT[3:0]• Protection data

Page 15: On Chip Bus

15SOC Consortium Course Material

AHB Signals(iii)-HTRANSHTRANS[1:0]

– IDLE: master don’t need data to be transfered– BUSY: allows bus masters to insert IDLE cycles in the

middle of bursts of transfers.– NONSEQ: The address and control signals are unrelated

to the previous transfer.– SEQ: the address is related to the previous transfer.

Page 16: On Chip Bus

16SOC Consortium Course Material

AHB Signals(iii)-HBURST

Page 17: On Chip Bus

17SOC Consortium Course Material

AHB Signals(iii)-HBURST

Page 18: On Chip Bus

18SOC Consortium Course Material

AHB Signals(iv)Response signals

– HREADY• Transfer done, ready for next transfer

– HRESP[1:0]• OKAY transfer complete• ERROR transfer failure(ex: write ROM)• RETRY higher priority master can access bus• SPLIT other master can access bus

Page 19: On Chip Bus

19SOC Consortium Course Material

AHB Signals(v)Arbiter signals

– HGRANTx• Select active bus master

– HMASTER[3:0]• Multiplex signals that sent from master to slave

– HMASTLOCK• Locked sequence

Page 20: On Chip Bus

20SOC Consortium Course Material

Master signal

Page 21: On Chip Bus

21SOC Consortium Course Material

Arbiter signal

Page 22: On Chip Bus

22SOC Consortium Course Material

Slave signal

Page 23: On Chip Bus

23SOC Consortium Course Material

OutlineAMBA Bus

– Advanced System Bus– Advanced High-performance Bus– Advanced Peripheral Bus

• Low power• Latched address and control• Simple interface• Suitable for many peripherals

IP Design flowFPGA design flow

Page 24: On Chip Bus

24SOC Consortium Course Material

APB state diagram

Page 25: On Chip Bus

25SOC Consortium Course Material

APB signalsAPB character

– Always two cycle transfer– No wait cycle and response signal

APB signals– PCLK Bus clock , rising edge is used to time all

transfers.– PRESETn APB reset 。 active Low.

Page 26: On Chip Bus

26SOC Consortium Course Material

APB signalsPADDR[31:0] APB address bus.PSELx Indicates that the slave device is selected.

There is a PSELx signal for each slave.PENABLE Indicates the second cycle of an APB

transfer.PWRITE Transfer direction. High for write access,

Low for read access.PRDATA Read data busPWDATA Write data bus

Page 27: On Chip Bus

27SOC Consortium Course Material

OutlineAMBA Bus

– Advanced System Bus– Advanced High-performance Bus– Advanced Peripheral Bus

IP Design flow– Memory definition– IP design-SW– IP design-HW

FPGA design flow

Page 28: On Chip Bus

28SOC Consortium Course Material

Memory definition

•Self-designed IP can be located in the Bus error response area

•Defined in AHBDecoder.v

Page 29: On Chip Bus

29SOC Consortium Course Material

AMBA IP designSoftware part

– Write a function to control hardware– Delay number of clocks by NOOP (asm) instruction

Hardware part– Add MYIP.v into top module– Change ahbdecoder.v– Change AHBMuxS2M.v– Change ahbahbtop.v

Page 30: On Chip Bus

30SOC Consortium Course Material

IP design-HWAdd MYIP.v into top module

– Write your own module in AMBA interface

Core SDRAM OtherModules

AHB

AHBAHBTop

AHBDecoder

AHBMuxS2M

AHBZBTRAMZBTSRAM

MYIPAHBAHB2APB

APBlntconAPB

AHBAPBSys

APBRegs

Page 31: On Chip Bus

31SOC Consortium Course Material

IP design-HWChange ahbdecoder.v

– Add HSELMYIP signal to select your own slave IP to response

– Address are defined in decoder

Page 32: On Chip Bus

32SOC Consortium Course Material

IP design-HWChange AHBMuxS2M.v

– Use mux to select slave which can use HRDATA

master

slave1

slave2

HREADY-xHRESP-xHRDATA-x

HSEL-x

Page 33: On Chip Bus

33SOC Consortium Course Material

IP design-HWChange ahbahbtop.v

– Add your module in AMBA Bus– Connect the above net connection

Page 34: On Chip Bus

34SOC Consortium Course Material

Architecture

AHBDecoder AHBMuxS2M

AHBZBTRAM MYIP

ZBTSRAM

AHBAHBTop

AHB2APB

sel

APBIntCon

APBregs

AHBAPBsys

addr

Page 35: On Chip Bus

35SOC Consortium Course Material

OutlineAMBA Bus

– Advanced System Bus– Advanced High-performance Bus– Advanced Peripheral Bus

IP Design flow FPGA design flow

– Compile flow– Download flow

Page 36: On Chip Bus

36SOC Consortium Course Material

Compile flow(i)All verilog module must be synthesized by Xilinx

Software

Page 37: On Chip Bus

37SOC Consortium Course Material

Compile flow(ii)Add example2.ucf (define the pin assignment) into

projectDouble click generate programming file to generate *.bit

(which can be downloaded into FPGA)

Page 38: On Chip Bus

38SOC Consortium Course Material

OutlineAMBA Bus

– Advanced System Bus– Advanced High-performance Bus– Advanced Peripheral Bus

IP Design flow FPGA design flow

– Compile flow– Download flow

Page 39: On Chip Bus

39SOC Consortium Course Material

Download flowConnect config link Connect Multi-ICE to Logic ModulePower onUse progcrd.exe to download example2.bit fileRemove config linkPower off