研究生: |
張家瑋 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 |
中文關鍵詞: | compiler 、LLVM 、RISC-V 、OpenBlock |
外文關鍵詞: | compiler, LLVM, RISC-V, OpenBlock |
相關次數: | 點閱:300 下載: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架構,描述其暫存器與指令資訊,並新增擴充指令集;並進行各種實測來保證程式的正確性。
[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