簡易檢索 / 詳目顯示

研究生: 吳燈進
Wu, Deng-Jing
論文名稱: NCKU RISC32 指令集編碼與編譯器移植
NCKU RISC32 Instruction Set Encoding and Compiler Porting
指導教授: 陳中和
Chen, Chung-Ho
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 電機工程學系
Department of Electrical Engineering
論文出版年: 2007
畢業學年度: 95
語文別: 中文
論文頁數: 90
中文關鍵詞: 可重定目標編譯器特殊應用指令處理器指令集
外文關鍵詞: retargetable, compiler, ISA, ASIP
相關次數: 點閱:146下載:7
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 現今資訊產品已融入我們的生活之中,其應用的領域也十分多樣化。這些資訊產品為了處理大量的媒體資訊,製造商通常會利用嵌入式處理器來負責所需的運算。這些處理器,在面對不同的資訊產品應用時,若可提供所屬的特定指令,將可大幅地提升資訊產品的效能。有鑑於此,本文改良NCKU RISC32[1]處理器之指令編碼及預留特定應用指令加入的編碼空間,並規劃硬體及軟體開發工具修改的步驟,以逐步達成此目標。初步地,我們在NCKU RISC32處理器上移植LCC編譯器,其可對符合ANSI C規範的C程式碼進行編譯。所輸出的組合語言除了利用GNU Debugger驗證指令順序與功能正確外,並透過GNU Binutils實際的進行組譯與連結以產生可執行檔。這些執行檔在作業環境為Linux kernel 2.4.18 +RISC32 FPGA硬體平台上,可成功順利地執行。未來我們將持續進行組譯器、硬體解碼器及相關二元檔案工具的修改。另外,我們也規劃提供EDA工具,讓新指令加入時,自動地完成軟/硬體修改,縮短設計時程,使NCKU RISC32成為可應用於多種領域的處理器。

    Many information appliance (IA) products have come into our lives in a variety of fields. In order to process a large amount of multimedia information, these IA product manufactures usually use an embedded processor to handle the necessary operations. With specified instructions in the embedded processor, these IA products will increase the efficiency substantially. In view of this, the instruction encoding format is ameliorated to provide the encoding space of the new specified instructions for NCKU RISC32 [1]. We also plan the revising steps for the hardware and software tools to achieve this goal. Currently, we have successfully ported the LCC compiler on the NCKU RISC32 and use it to compile the ANSI C compatible codes. Besides using the GNU Debugger to validate the sequence and function of the generated assembly codes, we also use the GNU Binutils to assemble and link these codes to generate the execution files, which can run on the Linux kernel 2.4.18+RISC32 FPGA platform successfully. Besides, we suggest the required EDA tools, which can modify the HW/SW automatically for the new instructions, to shorten the design cycle time for an application specific instruction processor.

    Chapter 1簡介 1 1.1動機 1 1.2研究貢獻 1 1.3內容編排 2 Chapter 2背景知識 3 2.1 背景 3 2.1.1 ARMv4指令集 3 2.1.2 ARMv4指令集編碼格式 6 2.2指令功能的使用狀況分析與編碼策略 11 2.2.1指令功能的使用狀況分析 12 2.2.2 NCKU RISC32指令編碼策略 14 2.3指令編碼對軟硬體的影響 19 2.4編譯器簡介 21 2.4.1傳統編譯器處理階段 21 2.4.1.1 Compiler Front End 22 2.4.1.2 Compiler Back End 25 2.4.2可重定目標的編譯器 25 2.4.3 GCC 27 2.4.4 LCC 30 2.4.4.1 LCC 簡介 30 2.4.4.2 Machine description 31 2.4.4.3 Specifications 32 2.4.4.4介面結構 34 2.4.4.5 Node Operator 36 2.4.4.6 Intermediate Representation 38 2.4.4.7 Instruction Emitting 40 2.4.5編組譯工具 42 Chapter 3編譯器移植之實作 43 3.1簡介 43 3.2編譯器移植前的基本要件 43 3.2.1暫存器命名 44 3.2.2 Stack Frame Layout 45 3.2.3 Calling convention 47 3.3 LCC 硬體描述檔 47 3.3.1 變數與函數原型宣告 48 3.3.2 Terminal Definitions 49 3.3.3 Rule Pattern of Node Operators 50 3.3.3.1 LOAD 53 3.3.3.2 Constants 54 3.3.3.3 Addressing Mode 55 3.3.3.4 Assignment 57 3.3.3.5 Arguments 58 3.3.3.6 Function Call 58 3.3.3.7 Type Conversion 60 3.3.3.8 Arithmetic 60 3.3.3.9 Branch 65 3.3.4介面參數設定 66 3.3.5介面函數實作 67 3.3.6總結 74 Chapter 4驗證 75 4.1驗證環境簡介 75 4.2驗證程式碼 79 4.2.1 Level I 驗證程式碼 79 4.2.2 Level II 驗證程式碼 81 4.3驗證結果 83 Chapter 5結論與未來發展 84 5.1結論 84 5.2未來發展 85 參考文獻 87 Appendix - NCKU RISC32 Backend I 89 Appendix - NCKU RISC32 Backend II 90

    [1] 國立成功大學 計算機架構與系統研究室, http://caslab.ee.ncku.edu.tw/ .
    [2] ARM Ltd., "ARM Architecture Reference Manual," http://www.arm.com, 2000.
    [3] ARM Ltd., "ARM1136JF-S and ARM1136J-S Technical Reference Manual," http://www.arm.com, 2005.
    [4] X. W. Gao, "Embedded Processor Verification using Particular Characteristics of Linux Operating System," Master thesis, Institute of Computer and Communication Engineering, NCKU, June 2006.
    [5] M. R. Guthaus, et al., "MiBench: A free, commercially representative embedded benchmark suite," Proc. IEEE 4th Annual Workshop on Workload Characterization, December 2001.
    [6] ARM Ltd., "ARM ELF File Format," http://www.arm.com, 1997.
    [7] GNU Binutils, http://www.gnu.org/software/binutils/, 2006.
    [8] A. V. Aho, et al., "Compilers: Principles, Techniques, and Tools," Addison-Wesley, 1986.
    [9] C. Liem, "Retargetable Compilers for Embedded Core Processor," Kluwer Academic Publisher, 1997.
    [10] R. Leupers & P. Marwedel, "Retargetable Compiler Technology for Embedded Systems - Tools and Applications," Kluwer Academic, Boston, 2001.
    [11] G. Araujo, et al., "Challenges in Code Generation for Embedded Processors," Kluwer Academic Publishers, 1995.
    [12] GNU Compiler Collection, http://gcc.gnu.org/, 2006.
    [13] Using and Porting the GNU Compiler Collection, http://gcc.gnu.org/, 2001.
    [14] C. W. Fraser & D. R. Hanson, "lcc, A retargetable compiler for ANSI C," Addison Wesley, 1995.
    [15] C. W. Fraser & D. R. Hanson, "A Code Generation Interface for ANSI C," Software—Practice and Experience, vol. 21, no. 9, pp. 963–988, Sept. 1991.
    [16] Procedure Call Standard for the ARM Architecture, ARM Ltd., 2006.
    [17] A. Kossatchev & M. Posypkin, "Survey of compiler testing methods," Programming and Computer Software 31, 2005.
    [18] A. Kalinov, et al., "Coverage-Driven Automated Compiler Test Suite Generation," Proc. of LDTA'2003, 2003.
    [19] A. Cheng & G. Tyson, "An Energy Efficient Instruction Set Synthesis Framework for Low Power Embedded System Designs," IEEE Transactions on Computers, 2005.
    [20] C. K. Shene, "100 Selected Well-Known Problems," revised edition, Scholars Book Co., 2002.
    [21] M. A. Weiss, "Data Structures and Algorithm Analysis in C," Addison-Wesley, 1997.

    下載圖示
    2008-02-05公開
    QR CODE