簡易檢索 / 詳目顯示

研究生: 張家瑋
Chia-Wei Chang
論文名稱: LLVM TDBlock : 支援RISC-V 64-位元整數指令集後端描述之圖形工具
LLVM TDBlock : A GUI Tool to Generate RISC-V 64-Bit Integer Instruction Set
指導教授: 黃元欣
Yuan-Shin Hwang
口試委員: 謝仁偉
Jen-Wei Hsieh
賴祐吉
Yu-Chi Lai
學位類別: 碩士
Master
系所名稱: 電資學院 - 資訊工程系
Department of Computer Science and Information Engineering
論文出版年: 2018
畢業學年度: 107
語文別: 中文
論文頁數: 49
中文關鍵詞: compilerLLVMRISC-VOpenBlock
外文關鍵詞: compiler, LLVM, RISC-V, OpenBlock
相關次數: 點閱:279下載:0
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 隨著時代與技術的進步,在各種指令集架構 (ISA,instruction set architecture) 下,不同的處理器的架構往往會不停的更新,或是為其新增擴展指令集。而處理器中也有像RISC-V,基於RISC自身的原則開發出的開源指令集架構。而近期來說,不管是開發全新架構或者是嵌入式系統的編譯器後端移植,大多以LLVM來做處理。對於這種趨勢,使用LLVM開發編譯器後端的效率與通用性是個值得我們去探討的議題。

    本篇論文提出利用 OpenBlock為基礎之圖形介面工具,將LLVM 後端開發架構中之檔案Tablegen 所描述的目標暫存器,與目標指令集文件檔 .td (target description),轉換成可視覺化的介面,並在原有之指令集上增加 64位元整數的擴展指令集。其機制在於讓使用者能夠透過拉動、排列程式方塊,透過圖形化的方式來描述目標暫存器與目標指令集。由於在各個目標架構中,暫存器與指令集的描述方式皆是使用TableGen的語法與結構,透過經過本論文整理過之圖形化介面後,達到快速開發、移植相似的架構,並在既有架構下新增擴展指令集。

    最後本論文會以此圖型介面工具實作RISC-V架構,描述其暫存器與指令資訊,並新增擴充指令集;並進行各種實測來保證程式的正確性。


    隨著時代與技術的進步,在各種指令集架構 (ISA,instruction set architecture) 下,不同的處理器的架構往往會不停的更新,或是為其新增擴展指令集。而處理器中也有像RISC-V,基於RISC自身的原則開發出的開源指令集架構。而近期來說,不管是開發全新架構或者是嵌入式系統的編譯器後端移植,大多以LLVM來做處理。對於這種趨勢,使用LLVM開發編譯器後端的效率與通用性是個值得我們去探討的議題。

    本篇論文提出利用 OpenBlock為基礎之圖形介面工具,將LLVM 後端開發架構中之檔案Tablegen 所描述的目標暫存器,與目標指令集文件檔 .td (target description),轉換成可視覺化的介面,並在原有之指令集上增加 64位元整數的擴展指令集。其機制在於讓使用者能夠透過拉動、排列程式方塊,透過圖形化的方式來描述目標暫存器與目標指令集。由於在各個目標架構中,暫存器與指令集的描述方式皆是使用TableGen的語法與結構,透過經過本論文整理過之圖形化介面後,達到快速開發、移植相似的架構,並在既有架構下新增擴展指令集。

    最後本論文會以此圖型介面工具實作RISC-V架構,描述其暫存器與指令資訊,並新增擴充指令集;並進行各種實測來保證程式的正確性。

    論文摘要 i 致謝 iii 目錄 iv 圖目錄 1 表目錄 3 第一章 序論 4 1.1研究背景 4 1.2 研究動機 4 1.3 研究目的 5 1.4 研究方法 6 1.5 論文架構 6 第二章 文獻回顧 7 2.1 LLVM 7 2.2 LLVM Backend 9 2.2.1 LLVM backend流程 9 2.2.2 TableGen 11 2.3 OpenBlocks 14 2.4 RISC-V 17 第三章 實驗方法 18 3.1 概念 18 3.2 Target Description 的 Block之實作 19 3.2.1 RegisterInfo Block 21 3.2.2 InstrFormats Block 26 3.2.3 InstrInfo Block 29 3.2.4 CallingConv Block 32 第四章 實驗結果 36 4.1 實驗環境 36 4.2 數據比對 36 4.3 執行測試 37 第五章 結論與未來展望 39 5.1 結論 39 5.2未來展望 39 參考文獻 40

    [1] TableGen - LLVM documentation.
    http://llvm.org/docs/TableGen/.

    [2] Eric Klopfer, Daniel Wendel, Ricarose Roque, Corey McCaffrey, Lunduo Ye, Aidan Ho, Brett Warne, Xudan Liu, Hout Nga, “MIT OpenBlocks,” https://github.com/mikaelhg/openblocks.

    [3] A. Waterman, “Design of the RISC-V Instruction Set Architecture,” Technical Report No. UCB/EECS-2016-1, EECS Department, University of California, Berkeley, January 2016.

    [4] SPEC: Standard Performance Evaluation Corporation. http://www.spec.org, September 2000.

    [5] C. Lattner and V. Adve, “LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation,” in Proceedings of the international symposium on Code generation and optimization: feedback-directed and runtime optimization, ser. CGO ’04.Washington, DC,USA: IEEE Computer Society, 2004, pp. 75.

    [6] StarLogo TNG. http://education.mit.edu/portfolio_page/starlogo-tng/.

    [7] David Li, He Qichen, “ArduBlock,” https://github.com/taweili/ardublock, 2011.

    [8] D. Kanter, “ RISC-V Offers Simple, Modular ISA,” The Linley Group MICROPROCESSOR report, March 2016.

    [9] Andrew Waterman, Yunsup Lee, David Patterson, Krste Asanovic, “The RISC-V Instruction Set Manual, Volume I: User-Level ISA Version 2.0,” Technical Report UCB/EECS-2014-52, EECS Department, University of California, Berkeley, May 2014.

    [10] Y. Lee, A. Waterman, H. Cook, B. Zimmer, B. Keller, A. Puggelli, J. Kwak, J. Bachrach, D. Patterson, E. Alon, B. Nikolic, K. Asanovic, “An Agile Approach to Building RISC-V Microprocessors,” IEEE Micro, March 2016.

    [11]  TableGen Language Reference. http://llvm.org/docs/TableGen/LangRef.html.

    [12] Writing an LLVM Backend. http://llvm.org/docs/WritingAnLLVMBackend.html#instruction-op erand-name-mapping.

    [13] Chen Chung-Shu, “Tutorial: Creating an LLVM Backend for the Cpu0 Architecture,” Nov 03, 2016.

    [14] Fraser Cormack, Pierre-Andre Saulais, Building an LLVM Backend.
    Apr, 2014.

    [15] riscv-llvm. https://github.com/riscv/riscv-llvm.

    [16] LLVM Cookbook

    [17] 任勝兵, 盧念, 張萬利, 潘震宇. 基於 LLVM 架構的 Nios II 後端快速移植. Computer Applications and Software, Vol. 28 No. 12, Dec. 2011.

    [18] riscv-llvm-toolchain
    https://github.com/andestech/riscv-llvm-toolchain

    [19] riscv-isa-sim
    https://github.com/riscv/riscv-isa-sim

    QR CODE