4.2. 系統層級功率估計架構
4.2.4 功率估計結果的儲存與呈現
每一個硬體元件的參數傳遞都是分別傳送,功率分開計算,結果也是分開儲 存。可以針對功率變動大的元件設定較密集的資訊採樣頻率,而不會增加其他硬 體元件的參數資料量。圖 4.9 為功率資訊的示意圖。
圖 4.9 功率資訊
各元件的能量與平均功率消耗的公式如下:
IPx,total energy = S( Ti,j * Pi ) IP x,power = IPx,total energy / T total
Ti,j : 從 Ti到 Tj 經過的時間、Pi : 此元件在 Ti到 Tj 之間的平均消耗功率
Ttotal:整個系統的模擬時間
整個系統的能量與平均消耗功率的公式如下:
Systemtotal energy = S( IPx,total energy ) for all IPx
Systempower = Systemtotal energy / Ttotal
本平台能夠針對各個硬體元件,呈現個別的平均消耗功率、總消耗能量,以 及整個系統的平均消耗功率、總消耗能量、總模擬時間,並且提供功率-時間關 系的折線圖。在折線圖中,針對每個硬體元件及整個系統在模擬過程中的功率消 耗情況,畫出各自的圖形。圖形採用 svg 格式,這是一種基於 XML 語言的向量圖 格式。為了讓系統的變動情形更明顯,在繪圖前先搜尋過系統中最低及最高功率 的數值,以此為 y 軸高度繪製圖形,而 x 軸設定採樣 1000 個點來顯示。
4.3. Experimental results
本節說明如何應用依循此功率估計架構實作之功率估計輔助軟體分析 3D 影 像繪圖 SOC 的功率消耗,來檢驗本架構的功能實用度。此 3D 影像處理的架構如
圖 3.10,包含 ARM926-EJS CPU、AHB BUS、記憶體、Geometry Module、Rendering Module 及 IRQ controller。此 SOC 包含一套 OS,在 OS 上面執行支援 OpenGL-es 1.0 的 3D 繪圖程式,程式可透過驅動程式與 GM、RM 溝通,將複雜的運算交由硬體 處理,最後成像在螢幕上。此 SOC 已下線做出成品,但是在目前的設計中僅強調 處理效能,沒有考慮功率消耗的問題,將在下一版的 SOC 中加入低功率設計。由 於目前設計中沒有加入功率偵測電路,無法針對各個硬體元件分析各別的功率消 耗,雖然可以從 gate level 得知各個硬體元件的功率消耗,但模擬時間太久,執行 多個 frame 的測試有困難。所以改由電子系統層級模擬,搭配本平台做功率消耗的 分析,做為加入低功率設計時的考量依據。
圖 4.10 3D 繪圖 SOC 主要架構
SystemC 模擬系統的建立,ARM926EJ-S CPU 與 AHB BUS 使用 CoWare 公司 的 IP library,記憶體與 IRQ controller 為自行撰寫的 SystemC 模組,GM 與 RM 的 SystemC 模組由其他 3D 計劃成員提供,系統模擬使用 CoWare Platform Architecture 運行。由於 CoWare 公司的 CPU 指令集模擬器的模擬效能不夠快,在系統中運行 OS 的效能太差,採用折衷辦法,事先將驅動程式送出的資訊算好,CPU 僅負責模 擬驅動程式的動作。由於此 SOC 系統的運算瓶頸集中在 GM 與 RM 模組上,CPU 佔的運算時間相對較少,而且此系統沒有動態降低 CPU 功率的機制,簡化 CPU 的 模擬動作對功率消耗趨勢的影響尚在能接受的範圍,考量模擬的速度決定簡化之。
另一個嚴重拖慢 CPU 模擬速度的動作為檔案的輸入輸出,所以在模擬時,可 以假裝資料原本就存在記憶體上,將檔案輸入的動作寫在記憶體的 SystemC 模組 內,當成時初始化資料。而 frame 處理完的結果也直接從記憶體模組輸出到檔案,
如此可以進一步節省模擬的時間。簡化後的系統,模擬一個 frame 的時間為 2~10 秒,平均約為 5 秒多,相較 gate- level 模擬時間快數百倍以上。模擬此 SOC 模擬平 台建立在 CoWare Platform Architecture 的結果如圖 4.11。
圖 4.11 3D 繪圖 SOC 實作於 Platform Architecture 平台
目前的 CPU 功率消耗設定為單狀態的估計方法,給予一定值,再根據執行的 指令個數加上額外的能量消耗,其能量消耗參考[24]的數據。Bus 的功率計算方式,
根據一段時間內的 Bus 存取次數,乘上讀取與寫入的額外消耗能量,得到此段時 間因存取而多耗的能量,除以這一段的時間得到此段時間的平均消耗功率。記憶 體的功率計算方式同 Bus。GM 與 RM 的功率消耗由 gate- level 的模擬結果得知,
其最高與最低的功率消耗差距很小,這是由於 GM 與 RM 內部的暫存器數量很多,
暫存器的功率消耗在 GM 與 RM 中佔極大比例,不論 GM 與 RM 的輸入訊號是否 改變,暫存器皆會消耗功率。因此,將 GM 與 RM 的功率估計方式,設定為 2 種 狀態的功率消耗,動作中與待命中,數值取自一般運行中的功率消耗,及不改變 輸入時的功率消耗。在 SystemC 模組中,根據 GM 與 RM 的啟始訊號與結束訊號,
送出狀態參數。
輸入的測試資料為一個 cube 物件,此物件包含 12 個三角形,對此 cube 做放
大縮小的動作,連續輸入 79 個 frame 的資料。圖 4.12 為經過此 3D 繪圖系統處理 後的圖形資料,列出其中數個 frame 的結果與模擬此 frame 所需的執行時間。圖 4.13 為這 79 的 frame 疊加在一起的結果。系統的功率與能量模擬結果如表 4.1 所示,
Svg 格式的時間-功率關係圖如圖 4.14。
圖 4.12 繪圖晶片輸出結果 1
圖 4.13 繪圖晶片輸出結果 2
表 4.1 系統的功率與能量模擬結果
硬體元件名稱 總消耗能量(nJ) 平均消耗功率(W) 消耗功率比例
CPU 3.80618e+07 0.048 23.10%
BUS 161763 0.000203994 0.10%
RAM 2.13485e+06 0.00269219 1.29%
GM 6.28647e+07 0.0792766 38.14%
RM 6.16221e+07 0.0777096 37.38%
System 1.64845e+08 0.207881 -
圖 4.14 功率估計平台 功率-時間折線圖
5 計畫成果自評
本子計畫第一年已經參與子計畫四的 programmable vertex shader 指令集架構 制定與設計,並且針對此 vertex shader 的特性發展出適當的 clock gating 機制,在 增加少數面積(大約 6.7%)的情況下,降低 vertex shader 大約 31.2%的功率消耗。
我們同時完成一套適用於 programmable vertex shader 的指令排程器,可以減少 vertex shader 執行指令時所需要增加的 NOP 數目以及能量消耗。此外,本子計畫 亦使用 SystemC 為三維電腦繪圖系統發展完成一套高階交易層次功率模型架構,
可用於快速分析與評估三維電腦繪圖處理引擎系統架構的功率消耗,作為日後其 他低功率技術(例如 power management 等)效能之模擬與評估平台。本子計畫第 一年進度與預定目標大致相符,目前已經將相關成果整理並投稿至相關會議[25]
及期刊[26]。
6 參考文獻
[1] Ju-Ho Sohn, Jeong-Ho Woo, Min-Wuk Lee, Hye-Jung Kim, Ramchan Woo, and Hoi-Jun Yoo, “A 155-Mw 50-Mvertices/s Graphics Processor with Fixed-Point Programmable Vertex Shader for Mobile Applicatio ns”, IEEE Journal of Solid-state Circuits, Vol. 41, No. 5, pp. 1081-1091, May 2006.
[2] Byeong-Gyu Nam, Jeabin Lee, Kwanho Kim, Seung Jin Lee, Hoi-Jun Yoo, “A 52.4mW 3D Graphics Processor with 141 Mvertices/s Vertex Shader and 3 Power Domains of Dynamic Vo ltage and Frequency Scaling”, ISSCC 2007, pp. 278-279, 2007.
[3] B. Moyer, "Low-power design for embedded processors," Proceedings of the IEEE, Vol. 89, No. 11, pp. 1576-1587, Nov. 2001.
[4] L. Benini and G. De Micheli, "System-Level Power Optimization: Techniques and Tools,” ACM Trans. on Design Automation of Electronic Systems, Vol. 5, No. 2, pp.
115-192, April 2000.
[5] M. Pedram and A. Abdollahi, "Low-power RT-level synthesis techniques: a tutorial," IEE Proc.-Comput. Digit. Tech., Vol. 152, No. 3, pp. 333-343, May 2005.
[6] L. Benini, A. Bogliolo and G. De Micheli, “A Survey of Design Techniques forSystem- Level Dynamic Power Management,” IEEE Trans. on VLSI Systems, Vol. 8, No. 3, pp. 299-316, June 2000.
[7] Richard Atwater Thomson, “The Direct3D Graphics Pipeline”, August 13, 2006.
[8] Erik Lindholm, Mark J Kilgard, and Henry Moreton, “A User-Programmable Vertex Engine ”, NVIDIA Corporation, pp. 149-158.
[9] R. I. Bahar and S. Manne, “Power and energy reduction via pipeline balancing,” in Proc. 28th Int. Symp. Computer Architecture (ISCA), pp. 218-229, July 2001.
[10] Li Hai, S. Bhunia, Yiran Chen, K. Roy, and T.N. Vijaykumar, “DCG: deterministic clock-gating for low-power microprocessor design”; IEEE Transactions on Very Large Scale Integration (VLSI) Systems; Vol. 12, No. 3, pp. 245-254, March 2004.
[11] Xiaotao Chang, Mingming Zhang, Ge Zhang, Zhimin Zhang, and Jim Wang,
“Adaptive Clock Gating Technique for Low Power IP Core in SoC Design”; IEEE International Symposium on Circuits and Systems (ISCAS 2007), pp. 2120-2123, May 2007.
[12] “GPU ShaderAnalyzer 1.40”, ATI.
[13] V. Tiwari, S. Malik, and A. Wolfe, “Power Analysis of Embedded Software: A First Step Towards Software Power Minimization,” IEEE Trans. VLSI Systems, Vol.
2, pp. 437-445, Dec. 1994.
[14] A. Sinha and A. P. Chandrakasan, “JouleTrack - A Web Based Tool for Software Energy Profiling,” in Proc. Design Automation Conf., pp. 220–225, June 2001.
[15] I. Lee, H. Kim, P. Yang, S. Yoo, EY Chung, KM Choi, JT Kong and SK Eo,
“PowerViP: Soc power estimation framework at transaction level”, In ASP-DAC '06, Jan. 2006, pp. 551-558.
[16] D. Brooks, V. Tiwari, and M. Martonosi, “Wattch: A Framework for Architectural- Level Power Analysis and Optimizations,” in Int. Symp. on Computer Architecture, 2000.
[17] W. Ye, N. Vijaykrishnan, M. Kandemir, and M. J. Irwin, “The Design and Use of SimplePower: A Cycle-Accurate Energy Estimation Tool,” in Proc. Design Automation Conf., 2000, pp. 340-345.
[18] P. P. Sotiriadis and A. P. Chandrakasan, “A Bus Energy Model for Deep Sub-Micron Technology,” IEEE Trans. VLSI Systems, Vol. 10, pp. 341-350, June 2002.
[19] N. Bansal, K. Lahiri, A. Raghunathan, and S. T. Chakradhar, “Power Monitors: a framework for system- level power estimation using heterogeneous power models,”
in Proc. Int. Conf. on VLSI Design, 2005, pp. 579-585.
[20] M. Caldari, M. Conti, M. Coppola, P. Crippa, S. Orcioni, L. Pieralisi, C. Turchetti,
“System-Level Power Analysis Methodology Applied to the AMBA AHB Bus”, Design Automation and Test in Europe Conference and Exhibition, 2003.
[21] Neffe, U. Rothbart, K. Steger, C. Weiss, R. Rieger, and E. Muhlberger, “Energy estimation based on hierarchical bus models for power-aware smart cards,” Design, Automation and Test in Europe Conference and Exhibition, 2004.
[22] Micron Technology, “Calculating DDR memory system power”, http://www.micron.com/products/dram/ddr/technotes, “DDR SDRAM memory system power calculations”, http://www.micron.com/support/part_info/powercalc [23] OSCI, http://www.systemc.org/home
[24] Sachin Idgunji, “Case study of a lo w power MTCMOS based ARM926 SoC:
Design, analysis and test challenges,” IEEE International Test Conference, 2007.
[25] Kun-Yi Wu, Jin- Lin Liu and Shiann-Rong Kuang, “Energy-efficient programmable vertex shader for 3D graphics applications,” submitted to International Computer Symposium, 2008.
[26] Jiun-Ping Wang and Shiann-Rong Kuang, “Design of Power Efficient Configurable Booth Multipliers,” submitted to IEEE Transactions on Circuits and Systems I, 2008.