Introduction
앞서 BLOG에서 JTAG to AXI Master (PG174 - February 4, 2021) 라는 IP를 사용하면,
Vivado Hardware Debug Manager의 TCL console을 통하여 JTAG을 지나서, FPGA 내부에 Design된 JTAG-to-AXI Master IP를 지나서, AXI Interconect( or Smart Connect)를 지나서 연결되어 있는 Peripherals( BRAM, GPIO, etc... )에 Write/Read를 할 수 있음을 확인하였습니다.
여기서는 AXI BRAM Controller IP와 Block Memory Generator IP 사이의 Address, data 간의 관계를 살펴 보겠습니다.
Table of Contents
Step 1 : Example Design with JTAG to AXI Master IP
Step 2 : Problems with Write Operations
Step 3 : Difference in the Memory map between the two IPs
Step 1 : Example Design with JTAG-to-AXI Master IP
1.
테스트 환경은 다음과 같습니다.
OS | Windows 10 pro (version 20H2) |
Vivado | Version 2020.2.2 |
Board | Avnet Artix-7 50T Evaluation Board |
Target Device | XC7A50T-1FTG256C |
Vivado의 간단한 Block Design과 mark_debug, Set Up Debug을 사용한 경험이 있는 User를 대상으로 합니다.
2.
아래의 링크를 클릭하면 JTAG-to-AXI Master IP를 사용한 Example Design을 download 받을 수 있습니다.
Download Link : Example Design with JTAG-to-AXI Master IP
아래의 링크를 클릭하면 현재 보고있는 BLOG에서 사용된 TCL command가 기입된 TXT file을 download 받을 수 있습니다.
3.
Download 받은 Example Design Vivado Project에서 Block Design을 Open 합니다.
Block Design의 "Address Editor" tap을 클릭합니다. 그리고 BRAM의 Base Address를 확인합니다.
BRAM의 Base Address는 "0xC000_0000" 입니다.
BRAM의 High Address는 "0xC000_0FFF" 입니다.
Step 2 : Problems with Write Operations
1.
앞서 BLOG에서 테스트하였던 부분으로 아래의 TCL command로 Address "0xC0000_0000"에 data "0x1122_3344"을 Write한 후, Read하면 read data가 "0x1122_3344"임을 확인할 수 있습니다.
TCL command (Write Operation) |
create_hw_axi_txn -force wr_txn0 [get_hw_axis hw_axi_1] -address C0000000 -data {11223344} -len 1 -type write run_hw_axi wr_txn0 |
TCL command (Read Operation) |
create_hw_axi_txn -force rd_txn0 [get_hw_axis hw_axi_1] -address C0000000 -len 1 -type read run_hw_axi rd_txn0 |
2.
이 후, 아래의 TCL command로 Address "0xC0000_0001"에 data "0x5566_7788"을 Write한 후, Address "0xC0000_0000"에 Read하면 read data는 "0x1122_3344"가 아닌 "0x5566_7788"로 확인됩니다.
TCL command (Write Operation) |
create_hw_axi_txn -force wr_txn0 [get_hw_axis hw_axi_1] -address C0000001 -data {55667788} -len 1 -type write run_hw_axi wr_txn0 |
TCL command (Read Operation) |
create_hw_axi_txn -force rd_txn0 [get_hw_axis hw_axi_1] -address C0000000 -len 1 -type read run_hw_axi rd_txn0 |
3.
정리하면 다음과 같습니다.
Vivado TCL console을 통하여 Write operation 시, Data 32bits 기준으로 Address value를 순차적으로 증가(+1)하여 변경하면 정상적으로 Write 되지 않습니다.
TCL command (Write Operation) |
create_hw_axi_txn -force wr_txn0 [get_hw_axis hw_axi_1] -address C0000000 -data {11223344} -len 1 -type write run_hw_axi wr_txn0 create_hw_axi_txn -force wr_txn0 [get_hw_axis hw_axi_1] -address C0000001 -data {55667788} -len 1 -type write run_hw_axi wr_txn0 create_hw_axi_txn -force wr_txn0 [get_hw_axis hw_axi_1] -address C0000002 -data {99AABBCC} -len 1 -type write run_hw_axi wr_txn0 create_hw_axi_txn -force wr_txn0 [get_hw_axis hw_axi_1] -address C0000003 -data {DDEEFF11} -len 1 -type write run_hw_axi wr_txn0 |
Vivado TCL console을 통하여 Write operation 시, Data 32bits 기준으로 Address value를 다음과 같은 방법으로 변경하여야 정상적으로 Write 됩니다.
TCL command (Write Operation) |
create_hw_axi_txn -force wr_txn0 [get_hw_axis hw_axi_1] -address C0000000 -data {11223344} -len 1 -type write run_hw_axi wr_txn0 create_hw_axi_txn -force wr_txn0 [get_hw_axis hw_axi_1] -address C0000004 -data {55667788} -len 1 -type write run_hw_axi wr_txn0 create_hw_axi_txn -force wr_txn0 [get_hw_axis hw_axi_1] -address C0000008 -data {99AABBCC} -len 1 -type write run_hw_axi wr_txn0 create_hw_axi_txn -force wr_txn0 [get_hw_axis hw_axi_1] -address C000000C -data {DDEEFF11} -len 1 -type write run_hw_axi wr_txn0 |
이러한 테스트 결과는 AXI BRAM Controller IP의 Memory map과 Block Memory Generator IP의 Memory map에 차이가 있기 떄문입니다.
Step 3 : Difference in Memory map between two IPs
1.
아래의 그림은 AXI BRAM Controller IP가 바라보는 Memory map 입니다.
2.
아래의 그림은 JTAG-to-AXI Master IP IP를 사용하여 Write Operation 시, AXI BRAM Controller IP와 Block Memory Generator IP의 Memory map 입니다.
위와 같은 구조로 동작되기 때문에 실제 Block Memory(BRAM)에는 일부 Address가 사용되지 않는 문제가 있습니다.
3.
이 문제를 해결하려면 AXI BRAM Controller IP의 출력 Address와 Block Memory Generator IP의 입력 Address 사이의 연결을 살펴보아야 합니다. 아래 그림에서 AXI BRAM Controller IP의 출력 Address[11:0]과 Block Memory Generator IP의 입력 Address[31:0]의 range를 보아야 합니다.
AXI BRAM Controller IP의 출력 Address와 Block Memory Generator IP의 입력 Address 사이에 다음과 같은 Logic Design을 넣어주면 Block Memory의 모든 Address를 사용할 수 있게 됩니다.
User Logic |
Block Memory Generator의 Address [0] <= AXI BRAM Controller의 Address [2] Block Memory Generator의 Address [1] <= AXI BRAM Controller의 Address [3] Block Memory Generator의 Address [2] <= AXI BRAM Controller의 Address [4] Block Memory Generator의 Address [3] <= AXI BRAM Controller의 Address [5] Block Memory Generator의 Address [4] <= AXI BRAM Controller의 Address [6] Block Memory Generator의 Address [5] <= AXI BRAM Controller의 Address [7] Block Memory Generator의 Address [6] <= AXI BRAM Controller의 Address [8] Block Memory Generator의 Address [7] <= AXI BRAM Controller의 Address [9] Block Memory Generator의 Address [8] <= AXI BRAM Controller의 Address [10] Block Memory Generator의 Address [9] <= AXI BRAM Controller의 Address [11] Block Memory Generator의 Address [31:10] <= All '0' |
지금까지 JTAG-to-AXI Master IP의 사용에 있어 AXI BRAM Controller IP와 Block Memory Generator IP 사이의 Address, data 간의 관계에 대하여 알아보았습니다.
여러분의 FPGA 설계에 조금이라도 도움이 되었으면 합니다.
오늘도 좋은 하루 되세요.
(공감, 구독, 댓글은 저에게 힘이 됩니다!)
Create Date: Jun 16, 2021
Posted By: Mouessee
Xilinx 본사는 한국 내에 Corporate and Sales Distributor로 MAKUS를 두고 있습니다.
Xilinx 국내 Corporate and Sales Distributor인 MAKUS는 XIlinx FPGA Device를 기술영업을 통해 판매하며 기술지원이 가능합니다.
MAKUS www.makus.co.kr
관련 BLOG
------------------------------
------------------------------
Using the JTAG-to-AXI to test Peripherals on Artix-7 board (1/2)
Using the JTAG-to-AXI to test Peripherals on Artix-7 board (2/2)
How to monitor XADC with "JTAG to AXI Master" IP
'Xilinx > Vivado' 카테고리의 다른 글
Warning message occurred when installing Vivado 2022.1 (0) | 2022.09.06 |
---|---|
How to monitor XADC with "JTAG to AXI Master" IP (0) | 2022.08.31 |
Using the JTAG-to-AXI to test Peripherals on Artix-7 board (1/2) (1) | 2022.08.31 |
How to install a Board Definition file (0) | 2022.08.16 |
My recommended book for "VHDL" or "Verilog" users (0) | 2022.08.11 |