티스토리 툴바



2012/05/08 00:45

AMBA AXI PROTOCOL v1.0 (PART-IV)

OVERLAPPING READ BURST와 WRITE BURST를 정리하도록 하겠습니다.

 

 

1.3.2 Overlapping read burst example


 Figure 1-5 shows how a master can drive another burst address after the slave accepts the first address. This enables a slave to begin processing data for the second burst in parallel with the completion of the first burst.

위의 그림에서 보시는 것과 같이 마스터는 슬레이브에게 BURST ADDRESS를 ISSUE하고(CONTROL INFORMATION도 함께) 슬레이브가 그 ADDRESS를 ACCEPT한 한 직후, 마스터는 다른 BURST ADDRESS를 ISSUE합니다. 그리고 T4 사이클에서 보면 마스터가 슬레이브에게 두 번째(B) BURST에 대한 ADDRESS를 ISSUE하는 중에 슬레이브는 마스터에게 첫 번째(A) 데이터를 전송하는 것을 볼 수 있는데, 이와 같이 병렬적인 처리가 가능한 이유가 BURST TRANSACTION을 완료하기전에 다음 BURST의 ADDRESS를 ISSUE할 수 있는 MULTIPLE OUTSTANDING ADDRESS 스킴과 함께 ADDRESS CHANNEL과 DATA CHANNEL이 분리되어 있기 때문입니다. 이것은 이전 시간에도 이미 언급했던 SKIM들입니다. 그 이후에는 "READ BURST" 예제와 동일하게 두 번째 트랜잭션을 마지막 DATA TRANSFER의 전송과 함께 RLAST 시그널을 마스터에게 보내고 트랜잭션을 마무리합니다.

 

 

1.3.3 Write burst example

 

Figure 1-6 shows a write transaction. The process starts when the master sends an address and control information on the write address channel. The master then sends each item of write data over the write data channel. When the master sends the last data item, the WLAST signal goes HIGH. When the slave has accepted all the data items, it drives a write response back to the master to indicate that the write transaction is complete.

WRITE BURST의 경우에는 READ BURST에 비해서 조금 복잡해 보일 수도 있지만, 동작 흐름은 크게 다르지 않습니다. 마스터는 WRITE 대상의 슬레이브에게 보낼 준비가 된 CONTROL INFORMATION과 WRITE ADDRESS를 ISSUE합니다. 슬레이브는 T2 사이클에서 해당 BURST ADDRESS를 수락함과 동시에 마스터가 바로 DATA TRANSFER를 전송하게 되는데 이것은 WVALID 시그널이 HIGH 상태 즉, 보낼 DATA TRANSFER가 바로 유효한 상태로 샘플링되었기 때문에 그렇습니다. T4 사이클에서 보면 슬레이브가 마스터로부터 DATA TRANSFER를 수락할 준비가 되면 하나의 DATA TRANSFER 전송이 완료되고 이후의 흐름도 동일하게 이어지다가 T9 사이클에서 마찬가지로 마스터가 슬레이브에게 마지막 DATA TRANSFER와 마지막 DATA임을 알리는 WLAST 시그널을 전송하게 되고 슬레이브는 WRITE 트랜잭션을 정상적으로 완료했다는 BRESP 시그널을 마스터에게 보냅니다. 마스터는 BREADY 시그널로 BRESP 시그널을 수락한 준비가 된 상태(HIGH)에서 슬레이브에서 보낸 BRESP 시그널을 수신함과 동시에 BREADY 시그널은 LOW 상태로 트랜지션합니다. 이로써 하나의 WRITE TRANSACTION이 완전히 마무리됩니다.

 

 

1.3.4 Transaction ordering

 

AXI Protocol은 OUT-OF-ORDER TRANSACTION 완료가 가능하다고 하였습니다. 모든 트랜잭션에 ID 태그가 주어지는데, 동일한 ID 태그를 가진 트랜잭션들은 순차적으로 완료해야 하지만 다른 ID 태그를 가진 트랜잭션은 비순차적으로 완료할 수 있다는 의미입니다.

 

첫 번째 강좌에서 이미 언급해 드렸지만 OUT-OF-ORDER 트랜잭션은 두가지 방법을 통해 성능을 향상시킬 수 있습니다


1) The interconnect can enable transactions with fast-responding slaves to complete

   in advance of earlier transactions with slower slaves.

 

2) Complex slaves can return read data out of order. For example, a data item for a later

  access might be available from an internal buffer before the data for an earlier access is 

  available.

 

첫 번째 방법은 마스터A가 슬레이브B에게 ADDRESS ISSUE를 먼저하고 다음에 슬레이브C에게ADDRESS ISSUE를 한 상황으로 가정합시다. AHB 프로토콜의 경우에는 순차적으로 트랜잭션을 마무리할 수 있는데, 만약 슬레이브B가 슬레이브C보다 응답이 느린 디바이스라고 해도 슬레이브B의 트랜잭션 동작이 먼저 처리가 되어야만 슬레이브C의 동작을 처리할 수 있습니다. 반면에 AXI 프로토콜에서는 응답속도가 더 빠른 슬레이브의 트랜잭션을 먼저 처리할 수 있기 때문에 성능에 이점이 있습니다.

 

두 번째 방법은 내부 버퍼에 1, 2, 3, 4 이렇게 순서대로 데이터 쌓여 있고 1이 먼저 처리되어야 할 순서라고 가정하겠습니다. 슬레이브 입장에서는 1보다 4부터 먼저 처리하기를 원하는 경우가 있다면 그럴 경우에 4, 3, 2, 1과 같이 비순차적으로 사용 가능하기 때문에 성능적인 측면에서 더욱 좋습니다.

 

If a master requires that transactions are completed in the same order that they are
issued, then they must all have the same ID tag. If, however, a master does not require
in-order transaction completion, it can supply the transactions with different ID tags,
enabling them to be completed in any order.
In a multimaster system, the interconnect is responsible for appending additional
information to the ID tag to ensure that ID tags from all masters are unique. The ID tag
is similar to a master number, but with the extension that each master can implement
multiple virtual masters within the same port by supplying an ID tag to indicate the
virtual master number.
Although complex devices can make use of the out-of-order facility, simple devices are
not required to use it. Simple masters can issue every transaction with the same ID tag,
and simple slaves can respond to every transaction in order, irrespective of the ID tag.

 

위의 스펙을 보시면 ID 태그에 대한 많은 설명이 나오는데요. ID 태그가 동일한 트랜잭션들은 반드시 순서대로 처리가 완료되어야 하지만 다른 ID 태그를 가진 트랜잭션은 비순차적으로 완료할 수 있다는 내용이 핵심인 것만 알아두시면 됩니다. 시간이 늦어 이만 강좌를 마치도록 하겠습니다. 궁금한 내용은 블로그에 얼마든지 질문해 주시면 아는데까지 성심껏 답변을 드리겠습니다. 편안한 밤 보내세요.

 

 

Written by Simhyeon, Choe

 

 

 

저작자 표시
Trackback 0 Comment 0
2012/04/16 22:30

AMBA AXI PROTOCOL v1.0 (PART-III)

오늘은 READ BURST, OVERLAPPING READ BURST, WRITE BURST 트랜잭션의 타이밍 다이어그램을 살펴보도록 합시다.

 

1.3 Basic transactions
This section gives examples of basic AXI protocol transactions. Each example shows
the VALID and READY handshake mechanism. Transfer of either address information
or data occurs when both the VALID and READY signals are HIGH. The examples are
provided in:
• Read burst example
• Overlapping read burst example
• Write burst example

 
1.3.1 Read burst example
Figure 1-4 shows a read burst of four transfers. In this example, the master drives the
address, and the slave accepts it one cycle later.

- Note -

 The master also drives a set of control signals showing the length and type of the burst, but these signals are omitted from the figure for clarity.

After the address appears on the address bus, the data transfer occurs on the read data
channel. The slave keeps the VALID signal LOW until the read data is available. For
the final data transfer of the burst, the slave asserts the RLAST signal to show that the
last data item is being transferred.

 

AXI BUS PROTOCOL은 AHB BUS PROTOCOL과 마찬가지로 모든 시그널은 RIGING EDGE에서 샘플링됩니다. 그리고 각 시그널에 대한 레퍼런스는 AMBA AXI PROTOCOL v1.0 SPEC P.31의 SIGNAL DESCRIPTION에 설명되어 있습니다.

위의 타이밍 다이어그램을 살펴보면, 모든 시그널의 샘플링을 전역으로 참조할 수 있도록 ACLK이 있고 녹색으로 표시된 부분은 마스터가 슬레이브에게 보내는 시그널이며 파란색으로 표시된 부분은 슬레이브가 마스터에게 보내는 시그널을 의미합니다(혼돈하기 쉽기 때문에 표시하였습니다). 그리고 각 시그널에는 AR, AW, R, W와 같이 시그널 앞에 PREFIX가 붙어 있는데요. AR은 "Read Address"를 뜻하고 AW는 "WRITE ADDRESS"를 의미합니다. 그냥 R과 W는 DATA에 대한 R/W를 말합니다. 몇 가지 예를 들어보도록 하겠습니다.

ARADDR = READ ADDRESS (FROM MASTER TO SLAVE)

RDATA   = READ DATA (FROM MASTER TO SLAVE)

RREADY = READ DATA READY (FROM SLAVE TO MASTER)

위와 같이 해석합니다. 전혀 어렵지 않죠? READ BRUST 동작은 간단합니다. 버스의 모든 동작은 항상 마스터가 아비터로부터 버스 사용 권한을 획득하여 컨트롤 시그널과 어드레스 시그널을 슬레이브에게 보냄으로써 시작됩니다. 컨트롤 시그널은 버스트 타입, 크기, 길이와 같은 정보들을 포함하고 있으며 어드레스 시그널은 특정 SLAVE의 주소 공간을 의미합니다. 그렇다면 MASTER가 여러 개의 SLAVE가 존재하는 버스에서 R/W할 대상 SLAVE는 어떻게 선택할까요?

그 해답은 아래와 같이 AXI PROTOCOL 특징에 설명되어 있습니다.

 

In memory mapped AXI (AXI3, AXI4, and AXI4-Lite), all transactions involve the concept
of a target address within a system memory space and data to be transferred.
Memory mapped systems often provide a more homogeneous way to view the system,
because the IPs operate around a defined memory map.

(AXI REFERENCE GUIDE P.11 - MEMORY MAPPED PROTOCOLS)

 

따라서, AMBA BUS를 사용하는 모든 IP들은 하나의 메모리 레이아웃으로 맵핑되어 있기 때문에 어떤 SLAVE인지는 관심가질 필요가 없으며 단지 SLAVE 영역에 해당하는 어드레스에 접근하기만 하면 됩니다.

 

첫 번째 T0에서 T1 사이클을 보면, 마스터가 슬레이브로 읽는 동작이 유효할 경우 ARVALID 시그널을 HIGH로 트랜지션합니다. 그 직후 바로 해당 슬레이브의 ADDRESS로 ISSUE(ISSUE는 보낸다는 의미)합니다. 언제까지 ISSUE할까요? 물론 SLAVE가 ARREADY 시그널이 HIGH로 트랜지션할 때까지 말이죠. T2 사이클에 ARREADY의 시그널이 HIGH로 샘플링됨과 동시에 ARVALID와 ARADDR이 LOW로 TRANSTION합니다(첫 번째 빨간 박스). T3에서 T4 사이클을 보면 RREADY 시그널이 HIGH로 되어 있는데 즉, 마스터는 이미 데이터를 받을 준비가 되어 있는 상태임을 알 수 있습니다. T5에서 T6 사이클에서 슬레이브가 마스터에게 보낼 데이터가 유효하다는 RVALID - HIGH 시그널을 보내고 바로 DATA를 전송함으로써 RREADY가 LOW로 트랜지션되는 것을 볼 수 있습니다. 이후 똑같은 과정으로 모든 데이터 전송을 진행하다가 마지막 DATA TRANSFER를 보낼 때 마지막이라는 것을 슬레이브가 마스터에게 알리기 위해 RLAST 시그널을 전송함으로써 하나의 버스트 트랜잭션을 완료합니다(세번 째 빨간 박스). 오늘은 READ BURST까지만 정리하고 다음 시간에는 OVERLAPPING READ BURST, WRITE BURST의 WAVEFORM을 살펴 보도록 하겠습니다.

 

Written by Simhyeon, Choe

 

 

 

저작자 표시
Trackback 0 Comment 2
2012/03/26 23:21

AMBA AXI PROTOCOL v1.0 (PART II)

 



The AXI protocol provides a single interface definition for describing interfaces:
• between a master and the interconnect
• between a slave and the interconnect
• between a master and a slave.


The interface definition enables a variety of different interconnect implementations.
The interconnect between devices is equivalent to another device with symmetrical
master and slave ports to which real master and slave devices can be connected.
Most systems use one of three interconnect approaches:
• shared address and data buses
• shared address buses and multiple data buses
• multilayer, with multiple address and data buses.


In most systems, the address channel bandwidth requirement is significantly less than
the data channel bandwidth requirement. Such systems can achieve a good balance
between system performance and interconnect complexity by using a shared address
bus with multiple data buses to enable parallel data transfers.

위의 인터페이스와 인터커넥트 설명을 보면 마스터와 슬레이브라는 용어가 나오는데, 쉽게 얘기해서 마
스터는 AXI 아비터에게 버스 사용의 권한을 획득하여 R/W 작업을 위해 컨트롤 시그널, 어드레스 그리고 데이터를 슬레이브에게 전달하여 슬레이브와 통신이 가능하도록 해주는 디바이스(ex : CPU, DMA 등)를 의미하고 슬레이브는 마스터에게 받은 컨트롤 시그널, 어드레스와 데이터로 슬레이브 영역에서 처리하도록 해주는 디바이스(ex : SRAM, BUFFER, FIFO 등)를 의미합니다. 인터커넥트는 하나 이상의 마스터와 슬레이브가 통신이 가능하도록 메모리 맵핑된 IP로 정의할 수 있습니다. 인터커넥트도 하나의 IP기 때문에 추상적인 개념이 아니라 논리 회로 블럭을 의미합니다.

레지스터 슬라이스(Register slices)
Each AXI channel transfers information in only one direction, and there is no
requirement for a fixed relationship between the various channels. This is important
because it enables the insertion of a register slice in any channel, at the cost of an
additional cycle of latency. This makes possible a trade-off between cycles of latency
and maximum frequency of operation.
It is also possible to use register slices at almost any point within a given interconnect.
It can be advantageous to use a direct, fast connection between a processor and
high-performance memory, but to use simple register slices to isolate a longer path to
less performance-critical peripherals.

레지스터 슬라이스라는 개념을 설명하기 앞서 아래의 그림을 먼저 살펴 보겠습니다.


위의 그림을 보면 왼쪽에는 여러 개의 마스터가 있고 왼쪽에는 여러 개의 슬레이브가 있으며
인터커넥트에 연결되어 있습니다. 녹색 네모가 바로 레지스터 슬라이스로 보시면 됩니다.
레지스터 슬라이스가 필요한 이유가 무엇일까요? 위와 같이 여러 개의 마스터와 슬레이브가
하나의 버스를 공유하는 구조에서는 인터커넥트가 마스터의 작업 처리에 대한 Bottleneck이
발생할 수 밖에 없습니다. 그러니까 마스터 하나가 어드레스 시그널을 슬레이브로 전달한다고
했을 때, 이를 디코딩하기 위한 작업이 슬레이브가 많을 수록 현저히 떨어지는데 결국
인터커넥트에서 마스터의 어드레싱을 처리하는 응답 속도가 떨어진다는 의미가 되겠지요.
따라서 마스터와 인터커넥트 혹은 슬레이브와 인터커넥트 버스 중간에 레지스터 슬라이스
(비트를 저장할 수 있는 플립플롭으로 보시면 됩니다)를 두어, 인터커넥트까지 거치지 않고
레지스터 슬라이스에서 바로 특정 시그널에 대한 응답을 할 수 있습니다. 이 결과로 Frequency가
높아지겠지만 반대로 Interconnect Path가 많아지게 됨으로써 Latency 지연이 증가하게 되겠지요.
즉, 레지스터 슬라이스를 패스 중간에 얼만큼 설치하느냐에 따라 Frequency와 Latency 간의
TRADE OFF가 있습니다. 하지만 마스터와 슬레이브 간의 버스 패스가 너무 길어 특정 사이클
이내로 응답이 불가능한 경우는 레지스터 슬라이스를 설치해야 합니다.

오늘은 간단히 여기까지만 정리하고 다음 시간에 타이밍 다이어그램에서 READ와 WRITE BURST의
동작을 살펴보도록 하겠습니다. (아래에 AMBA AXI SPEC 첨부하였으니 참고하세요)


Written by Simhyeon, Choe


AMBAaxi[1].pdf


ug761_axi_reference_guide.pdf







저작자 표시
Trackback 0 Comment 0