本小節(jié)通過(guò)使用XPS中的定制IP向?qū)?ipwiz),為已經(jīng)存在的ARM PS 系統(tǒng)添加用戶(hù)自定IP(Custom IP ),了解AXI Lite IP基本結(jié)構(gòu),并掌握AXI Lite IP的定制方法,為后續(xù)編寫(xiě)復(fù)雜AXI IP打下基礎(chǔ)。同時(shí)本小節(jié)IP定制方法同樣適用于MicroBlaze處理系統(tǒng)。
本小節(jié)定制的是簡(jiǎn)單LED的IP,只有一個(gè)數(shù)據(jù)寄存器,向其寫(xiě)值就可以控制8個(gè)LED相應(yīng)亮滅。
硬件平臺(tái):Digilent ZedBoard
開(kāi)發(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)。需要注意的是,在選擇外設(shè)時(shí),同樣不要添加任何外設(shè)
二、定制AXI IP
ARM PS系統(tǒng)創(chuàng)建結(jié)束后,就可以開(kāi)始定制用戶(hù)自定義IP。XPS提供了Create or Import Peripheral Wizward 向?qū)?,使得用?hù)自定義IP的創(chuàng)建變得非常簡(jiǎn)單。當(dāng)然在熟悉了AXI IP核結(jié)構(gòu)和代碼編寫(xiě)規(guī)則后,可以直接編寫(xiě)自己的IP核而不使用向?qū)?。這里采用向?qū)Х绞健?/p>
1、產(chǎn)生AXI IP外設(shè)模版
Hardware->Create or Import Peripheral Wizward ,啟動(dòng)向?qū)?/p>
歡迎界面
選擇從模板創(chuàng)建新外設(shè)
默認(rèn)是將外設(shè)直接包含到當(dāng)前XPS工程中
填入外設(shè)名。注意必須都是小寫(xiě)。這里我們建立的是my_axi_ip。下面是版本控制,可以根據(jù)需要修改。同時(shí)面板的最下方還提示了將創(chuàng)建名為my_axi_ip_v1_00_a的庫(kù)(其實(shí)就是一個(gè)目錄),所有實(shí)現(xiàn)這個(gè)IP的HDL文件都在這個(gè)庫(kù)中。
接下來(lái)要選擇外設(shè)總線(xiàn)的類(lèi)型。AXI4_Lite為最基本的AXI 總線(xiàn),用于簡(jiǎn)單處理,所有空間訪問(wèn)都是通過(guò)地址/寄存器方式訪問(wèn),不支持突發(fā);AXI4是標(biāo)準(zhǔn)AXI4總線(xiàn)標(biāo)準(zhǔn),支持突然,支持高速;AXI4_Stream專(zhuān)門(mén)為數(shù)據(jù)流而設(shè)計(jì)。
在IPIF (IP 接口) 配置,這里配置接口的一些屬性,如是否是AXI 主/從設(shè)備等。我們所定制的IP是一個(gè)從設(shè)備,因而不需要使用主設(shè)備接口。
選擇需啊喲的寄存器數(shù)量。因?yàn)槲覀冎恍枰粋€(gè)數(shù)據(jù)寄存器,這里選1。
接下來(lái)就是IPIC(IP 互聯(lián)),也就是IP的接口信號(hào)。以BUS2開(kāi)頭的信號(hào),意味對(duì)IP來(lái)說(shuō),這些信號(hào)是輸入信號(hào);同樣IP2BUS意味著輸出信號(hào)。
這里一些信號(hào)做一些說(shuō)明。
BUS2IP_WrCE(Write Chip Enable,寫(xiě)使能)
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,寫(xiě)數(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.
接下來(lái)需要使用需要使用BFM (Bus Functional Models, 總線(xiàn)功能模型)對(duì)外設(shè)進(jìn)行仿真。本例IP很簡(jiǎn)單,不要使用。
評(píng)論