摘 要: 隨著WLAN(無線局域網)的普及,各種接口的WLAN網卡層出不窮,像UART,SPI,USB等。為了驗證接口的功能、性能和兼容性是否符合需求,在此提出了一種支持UARTSPI接口的驗證工具。傳統的接口驗證采用手動驗證的方法,即手動修改UART接口的波特率或SPI接口的大小端等來達到遍歷所有用例的目的,傳統方法存在效率低,容易漏測測試用例等缺陷。而該工具通過命令通道完成上位機和下位機的協商,保持接口參數同步;數據通道驗證在該接口參數下的功能和性能,實現了接口的功能和性能驗證的自動化,大大提高了測試效率,保證測試用例的覆蓋率。該工具適用于多種平臺下的UART和SPI接口驗證。
關鍵詞: UART; SPI; 接口驗證; 自動化
中圖分類號: TN919?34; TP273.5 文獻標識碼: A 文章編號: 1004?373X(2013)24?0094?05
Design and Implementation of verification tool for UART SPI interfaces
LI Xin?wei
(Beijing CEC Huada Electronic Design Co., Ltd., Beijing 100102, China)
Abstract: As the WLAN (wireless local area network) service grows popular, WLAN cards of all kinds of interfaces come forth, such as UART, SPI, USB and so on. In order to verify the functionality, performance, compatibility of the interfaces, an interface verification tool for UART SPI is developed. The traditional way of verifying interface is manual, that is, all the baud rates of UART interface are tested one by one manually. So the traditional way has the disadvantage of low efficiency and unstable test coverage. The consultation between PC and slave computer is finished by the tool through command channel to maintain synchronization of interface parameters. The functionality and performance verification are completed by data channel. The tool can not only improve the efficiency of the test, but also ensure the test coverage. This tool can be applicable to the verification of UART and SPI interfaces in many platforms.
Keywords: UART; SPI; interface verification; automation
0 引 言
隨著WLAN的廣泛應用,越來越多的芯片廠商投入到WLAN芯片開發上。因此各種接口的WLAN芯片成為了各大廠商發展的主要方向。目前主流的接口有:USB,SDIO,UART,SPI等[1]。
本公司設計了一款支持多接口、多協議的無線局域網802.11n(1T1R)的SoC芯片。該SoC芯片集成了SDIO,SPI,UART等接口。為了驗證各個接口是否能夠達到設計需求,需要對各個接口進行功能、性能和兼容性的測試。所謂接口驗證,是指以接口為測試對象,詳細測試接口功能和性能。本文中是指UART接口和SPI接口。對于UART接口,需要對接口的波特率、數據長度、奇偶校驗位、停止位、流控、異常錯誤等進行驗證[2]。對于SPI接口,需要對接口的大小端、工作模式、工作速率等進行驗證[3]。
1 接口單元驗證的必要性
1.1 接口單元驗證簡介……p>