第五章 FPGA 設計
5.4 FPGA 實現
我們將以上所設計架構,用 VHDL 語言寫成行為模式(behavior mode)的硬體 架構,並先以 Modelsim 軟體模擬驗證此行為模式是否正確,再經由和所撰寫的 MATLAB 做比較來驗證,當然前提為 MATLAB 程式是正確的,行為模式正確後 就可將此 VHDL 程式輸入 Xilinx 的 Foundation 4.1 軟體(此處我們所採用 synplicity 作為合成工具)就可得到合成後的 RTL 巢狀(netlist)架構檔,此是根據所撰寫行為 模式下 VHDL 程式所做合成後的輸出檔案,當然此也要做模擬驗證合成後結果 是否和我們所設計要求一致,如果模擬結果和行為模式是不相同的,則就必須從 新撰寫行為模式下的 VHDL 程式,但是如果驗證結果正確,則可再做進一步動 作,將合成後結果對應(mapping)到所選定的 FPGA chip,並加入元件延遲(gate delay)的時間再做模擬,此處模擬重點放在 timing 上模擬,模擬驗證此所設計 chip 所跑的時脈速度是否合於所需,當然如果元件延遲時間大於系統所要求時脈,可 對 Foundation 下一些限制,使能夠符合所需,但是如果還是沒能達成所要求的速
度,就必須重頭設計 VHDL 程式。圖 5.30 為所設計晶片輸出及輸入接腳示意圖,
左邊為輸入接腳,clk 為晶片的工作時脈,reset 為將整個晶片初始化,enable 為 控制處理哪個使用者的工作,R_I 跟 R_Q 為基頻接收取樣且經 A/D 轉換後的實 部及虛部,initial_state 為輸入各使用者的初始參數,Acq_ok 為判斷是否是完成 碼擷取,’1’表已完成碼擷取,反之為’0’,address 為碼擷取後估測出的傳輸延遲。
Freq_en 為指示是否完成頻率估測,最後 Angle_phase 為估測出之頻率偏移值。
圖 5. 30 Input and output port for design chip
在 DS/CDMA 系統的接收端,碼擷取只是抓取傳輸延遲在與正確的時間相差 小於 0.5 切片時間,後級還必須做碼追蹤(code tracking)及決策(detection)動作,
所以需定義好各元件間的接線介面,如圖 5.31 所示,首先基頻類比訊號經由 A/D 轉換器成數位訊號後輸入碼擷取、頻率估測元件,並且當達成碼擷取後,碼擷取 元件會輸出一 enable 腳位告知碼追蹤元件,可開始運作,決策回覆傳送端所送 出訊號。圖 5.32 為硬體設計狀態圖,首先為碼擷取開始狀態,告知系統要做碼 擷取,並進入初始設定狀態,設定一些初始參數值,再進入碼擷取狀態,在此狀 態會計算關聯值,並與臨界值比較,如大於臨界值則進入驗證模式狀態,但是如 果搜尋完一最大可能延遲區間還是沒有任何位置所輸出值大於臨界值就會進入 重新設定狀態,如過驗證模式也過了,則進入頻率偏移估測狀態。圖 5.33 為傳
送端的 RTL 元件連接圖,圖 5.34 為碼結取與頻偏估測架構經合成軟體所和出來 的元件連接圖。圖 5.35 為碼結取與頻偏估測整個架構所使用硬體需求量的分析 報告。而圖 5.36 為此架構下所合成的 timing report。
Acquisition &
Frequency estimator chip
receive_r
receive_i
Acq_ok Delay timing
Compute_freq enable
Total_phase
A/D A/D
base-band signal
I phase Q phase
Code Tracking Chip Control process &
Ram
圖5. 31 Overall architecture
Count
Initial state
Acquisition mode
Check mode
Frequency estimator
Timing and frequency acquisition ok Acquisition
enable
圖5. 32 State diagram of overall hardware design
圖 5.33 RTL structure of transmitter for Synplicity tool
圖 5.34 RTL structure of code acquisition and frequency offset estimation for Synplicity tool
圖 5.35 Mapping report for overall architecture
圖 5.36 Timing report for overall architecture
表 5.1 列出各主要元件所使用的等效邏輯閘數目,其中以記憶單元與其控制 信號所使用的等效邏輯閘最多,其次為頻率估測單元(包含計算相關值函數部 分 ),而 CORDIC 是使用管線化的架構來快速的計算角度。一般接收信號在經 過降頻器而成基頻信號後,會再取樣並做 A/D 轉換,而用 N 位元的的二進位表 示。當使用越多的位元數來對接收的基頻信號取樣後作量化,則碼擷取及頻率偏 移估測的效能就會越好,但是硬體架構也會跟著變大,也就是所使用的等效邏輯 閘數會越多。表 5.2 列出了使用不同位元數對基頻信號作量化時,整個碼擷取及 頻率偏移估測架構的等效邏輯閘數目,由表中可看出每增加一個位元時所增加的 邏輯雜數目會越來越多,因考慮到整個硬體架構的大小,所以採用每一取樣量化 值用 4 位元來表示。
元件 等效邏輯閘數目 所占比例 切片匹配濾波器 11,427 2.7%
記憶單元及控制信號 178,674 42.1%
快速哈達碼轉換 37,513 8.9%
搜尋控制器 14,386 3.4%
頻率估測單元 91,173 21.5%
其它 90,661 21.4%
表 5.1 The equivalent gate count for each module
量化所使用之位元數 等效邏輯閘數目
4 位元 423,834
5 位元 467,153
6 位元 558,746
表 5.2 The equivalent gate count of overall system for using different number of bits to quantize the received baseband signal
如果先前所敘述的所有驗證的結果都正確,就可以將所設計的電路下載到 FPGA 晶片中做實際的測試,我們測試的方法是用 matlab 軟體產生基頻的接收信 號,轉成 Pattern Generator(PG)的文字向量檔(PGV),再將輸入信號用 PG 送入 FPGA 中,而輸出則由 Logic Analyzer 來擷取信號,觀察其波形並轉成文字檔由 matlab 來比較結果,圖 5.37 為浮點數運算與 4 位元定點數運算碼擷取錯誤率和 切片 SNR 的關係圖。圖 5.38 為 4 位元定點數運算及浮點數運算所估測出頻率偏 移的結果。圖 5.37 與圖 5.38 中的浮點數運算為使用 matlab 模擬的結果,定點數 運算為經 FPGA 處理的結果。
-18 -17 -16 -15 -14 -13 -12 10-2
10-1 100
SNR ( dB)
acquisition error rate
fixed point floating point
圖 5. 37 Acquisition error rate v.s chip SNR for fixed and floating point simulation frequency offset = 18 kHz
0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4
x 104 0
0.5 1 1.5 2 2.5x 104
frequency offset ( Hz )
Average of frequency estimation (Hz)
fixed point floating point
圖 5. 38 frequency offset estimation for fixed and floating point simulation SNR = 12 dB
第六章 結論
本論文中,吾人對寬頻分碼多重存取系統基頻碼擷取技術提出全數位化電路 設計方法,首先介紹 3GPP 規範中上下鏈傳輸的資料格式與調變方法,接下來討 論介紹一般傳統碼擷取的技術,但是傳統匹配濾波器的架構需要大的硬體複雜 度。由於前序碼的特殊結構,故吾人提出結合碼擷取與頻率偏移估測的架構,主 要的概念是運用快速哈達馬轉換的演算法來解決這個問題,在設計中並同時考慮 系統效能及硬體複雜度。利用此新的架構我們分析比較不同參數對碼擷取及頻率 估測的性能,其在高頻率偏移下還可達成不錯碼擷取及頻率估測效能。
FPGA 是一種可程式規劃邏輯陣列 IC,使用者可以隨意規劃任意的邏輯電路,並 且可直接在 FPGA 晶片上驗證所設計電路,不需再經過光罩,晶圓製造及封裝等 許多繁雜過程,在此論文中我們採用 FPGA 設計流程做硬體設計實現,本論文中 吾人所設計的 W-CDMA 結合碼擷取架構,只考慮當有大震盪器所造成頻率偏移 下的影響並克服,但是還未考慮多重使用者干擾(MAI)的影響,未來可繼續研究 找出可同時克服頻率偏移及 MAI 影響下的碼擷取,並可研究更好的硬體設計架 構,以更進一步降低硬體的複雜度及所需消耗的功率。
參考文獻
[1] R. L. Peterson, R. E. Ziemer, and D. E. Borth, “Introduction to spread spectrum communication,” Prentice-Hall, 1995.
[2] R. L. Pickholtz, D. L. Schilling, and L. B. Milstein, “Theory of Spread-Spectrum Communications-A Tutorial,” IEEE Trans. Commun., vol. COM-30, no. 5, pp.
855~883, May. 1982.
[3] RAYMOND L. PICKHOLTZ DONALD L. SCHILING “Theory of Spread-Spectrum Communications – A Tutorial” IEEE transactions on communications, no.5, 1982 [4] Rick, R.R.; Milstein, L.B. ”Noncoherent parallel acquisition in CDMA spread
spectrum systems” ICC '94, SUPERCOMM/ICC '94, IEEE International Conference
on, pp: 1422 -1426 vol.3 1994
[5] Briima B.Ibrahim and A. Hamid Aghami “Direct sequence spread spectrum matched filter acquisition in frequency selective Rayleigh fading channels” IEEE Journal on
selected areas in communications vol.12 no.5, 1994
[6] Mohamed G. El-Tarhuni, and Asrar U. Sheikh, “An adaptive filtering PN code acquisition acquisition scheme with improved acquisition based capacity in DS/CDMA”Personal, Indoor and Mobile Radio Communications, 1998. The Ninth
IEEEInternational Symposium on, pp. 1486-1490,1998
[7] Hichan Moon, ”Performance of double dwell acquisition with continuous integration detector in a Rician fading channel” Spread Spectrum Techniques and Applications,
1998 IEEE 5th International Symposium on, Vol. 1, 1998
[8] Bensley, S.E.; Aazhang, B.” Subspace-based channel estimation for code division multiple access communication systems” Communications, IEEE Transactions, Volume: 44 Issue: 8,1996
[9] Stirling-Gallacher, R.A.; Hulbert, A.P.; Povey, G.J.R ”A fast acquisition technique for a direct sequence spread spectrum signal in the presence of a large Doppler shift”
IEEE 4th International Symposium on, Vol. 1, 1996
[10] Okuda, S.; Katayama, M.; Yamazato, T ”A new block demodulator for DS/SS signal with carrier frequency offset”, Sixth IEEE International Symposium on,
Vol. 1, 1995
[11] Eric, M.; Obradovic, M. “Subspace-based joint time -delay and frequency-shift estimation in asynchronous DS-CDMA systems” Electronics Letters , Vol. 33 Issue:
14, 3 July 1997
[12] Wongyi Fu; Abed-Meraim, K. ”Joint channel and frequency offset estimation in CDMA systems” The 11th IEEE International Symposium on, Volume: 2 , 2000 [13] A. Amira, A. Bouridane, P. Milligan, M. Roula “Novel FPGA implementations of
Walsh-Hadamard transforms for signal processing” Vision, Image and Signal
Processing, IEE Proceedings- , Volume: 148 Issue: 6 , Dec. 2001 Page(s): 377 -383
[14] Umberto Mengali and M.Morelli, ”Data-Aided Frequency Estimation for BurstDigital Transmission” IEEE transactions on communication vol. 45 1997
[15] Athanasios Papoulis, ”Probability, Random Variables, and Stochastic Process” Third Edition McGraw-Hill 1991
[16] The Web site for 3GPP: http://www.3gpp.org
[17] Harri Holma and Antti Toskala, ”WCDMA for UMTS”, wiley 2000
[18] F.Adachi,M.Sawahashi and K. Okawa, ”Tree-structured generation of orthogonal spreading codes with different lengths for forward link of DS-CDMA mobile radio”
Electronics Letters, Vol. 33 Issue: 1 , 2 Jan. 1997
[19] Biqi Long; Hichan Moon “Detection and false alarm probability of PN code acquisition in DS-CDMA system” Electronics Letters , Vol. 33 Issue: 11, 22 May 1997
[20] Andrew J. Viterbi., ”CDMA Principles of Spread Spectrum Communication.”
Reading, Massachusetts: Addison-Wesley, March 1995
[21] P. Chaudhury, W. Mohr, and S. Once, “The 3GPP Proposal for IMT-2000,” IEEE
Commun. Mag. , vol. 37, pp. 72-81, Dec. 1999.
[22] Technical Specification 3Gpp TS 25.211 V4.1.0 (2001-06)
[23] Ray Andraka, ”A survey of CORDIC algorithms for FPGA based computes”,
Andraka Consulting Group 1998
[24] Tero Ojanpera, Nokia Research Center and Ramjee Prasad, Delft University of Technology, “An Overview of Air Interface Multiple Access for IMT-2000/UMTS,”
IEEE Commun. pp. 82~95, Sept. 1998.
[25]蕭詩駿/吳文榕 “Fast Code Acquisition for W-CDMA systems and Its FPGA Implementation” 國立教通大學電信工程所,2002
[26] Wang, Y. -P.E.; Ottosson, T., ”Cell search in W-CDMA” Selected Areas in
Communications, IEEE Journal on, Volume: 18 Issue: 8, Aug. 2000
[27] Ray Andraka, ”A survey of CORDIC algorithms for FPGA based computes”,