本小節(jié)通過使用XPS中的定制IP向導(ipwiz),為已經(jīng)存在的ARM PS 系統(tǒng)添加用戶自定IP(Custom IP ),了解AXI Lite IP基本結構,并掌握AXI Lite IP的定制方法,為后續(xù)編寫復雜AXI IP打下基礎。同時本小節(jié)IP定制方法同樣適用于MicroBlaze處理系統(tǒng)。
本小節(jié)定制的是簡單LED的IP,只有一個數(shù)據(jù)寄存器,向其寫值就可以控制8個LED相應亮滅。
硬件平臺:Digilent ZedBoard
開發(fā)環(huán)境:Windows XP 32 bit
軟件: XPS 14.2 +SDK 14.2
一、創(chuàng)建ARM PS系統(tǒng)
同前面幾節(jié)一樣,首先使用XPS創(chuàng)建ARM PS系統(tǒng)。需要注意的是,在選擇外設時,同樣不要添加任何外設

二、定制AXI IP
ARM PS系統(tǒng)創(chuàng)建結束后,就可以開始定制用戶自定義IP。XPS提供了Create or Import Peripheral Wizward 向導,使得用戶自定義IP的創(chuàng)建變得非常簡單。當然在熟悉了AXI IP核結構和代碼編寫規(guī)則后,可以直接編寫自己的IP核而不使用向導。這里采用向導方式。
1、產(chǎn)生AXI IP外設模版
Hardware->Create or Import Peripheral Wizward ,啟動向導

歡迎界面

選擇從模板創(chuàng)建新外設

默認是將外設直接包含到當前XPS工程中

填入外設名。注意必須都是小寫。這里我們建立的是my_axi_ip。下面是版本控制,可以根據(jù)需要修改。同時面板的最下方還提示了將創(chuàng)建名為my_axi_ip_v1_00_a的庫(其實就是一個目錄),所有實現(xiàn)這個IP的HDL文件都在這個庫中。

接下來要選擇外設總線的類型。AXI4_Lite為最基本的AXI 總線,用于簡單處理,所有空間訪問都是通過地址/寄存器方式訪問,不支持突發(fā);AXI4是標準AXI4總線標準,支持突然,支持高速;AXI4_Stream專門為數(shù)據(jù)流而設計。

在IPIF (IP 接口) 配置,這里配置接口的一些屬性,如是否是AXI 主/從設備等。我們所定制的IP是一個從設備,因而不需要使用主設備接口。

選擇需啊喲的寄存器數(shù)量。因為我們只需要一個數(shù)據(jù)寄存器,這里選1。

接下來就是IPIC(IP 互聯(lián)),也就是IP的接口信號。以BUS2開頭的信號,意味對IP來說,這些信號是輸入信號;同樣IP2BUS意味著輸出信號。
這里一些信號做一些說明。

BUS2IP_WrCE(Write Chip Enable,寫使能)
Active high chip enable bus to the user logic. These chip enables are asserted only during active write transaction requests with the target address space and in conjunction with the corresponding sub-address within the space. Typically used for user logic writable registers selection.
BUS2IP_Data(Write Data,寫數(shù)據(jù))
Write data bus to the user logic. Write data is accepted by the user logic during a write operation by assertion of the write acknowledgement signal and the rising edge of the Bus2IP_Clk.
BUS2IP_BE(Byte Enable,字節(jié)使能)
Byte Enable qualifiers for the requested read or write operation to the user logic. A bit in the Bus2IP_BE set to '1' indicates that the associated byte lane contains valid data. For example, if Bus2IP_BE = 0011, this indicates that byte lanes 2 and 3 contain valid data.
IPBUS2_RdAck(Read Acknowledgement,讀反饋)
Active high read data qualifier providing the read acknowledgement from the user logic. Read data on the IP2Bus_Data bus is deemed valid at the rising edge of the Bus2IP_Clk and IP2Bus_RdAck asserted high by the user logic.
接下來需要使用需要使用BFM (Bus Functional Models, 總線功能模型)對外設進行仿真。本例IP很簡單,不要使用。

電子發(fā)燒友App













評論