研究生: |
朱陳緯 WEI CHU-CHEN |
---|---|
論文名稱: |
AGCC:自動生成支持客製指令編譯器之IDE AGCC: An IDE to Automatically Generate Compilers that Support Custom Instructions |
指導教授: |
黃元欣
Yuan-Shin Hwang |
口試委員: |
戴文凱
Wen-Kai Tai 謝仁偉 Jen-Wei Hsieh |
學位類別: |
碩士 Master |
系所名稱: |
電資學院 - 資訊工程系 Department of Computer Science and Information Engineering |
論文出版年: | 2022 |
畢業學年度: | 110 |
語文別: | 中文 |
論文頁數: | 44 |
中文關鍵詞: | 協處理器 、客製指令 、編譯器 |
外文關鍵詞: | LLVM, RISC-V, IDE |
相關次數: | 點閱:369 下載:0 |
分享至: |
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
隨著 RISC-V 架構的技術日益進步,在許多應用方面的 RISC-V 協處理器與加速器都被設計出來,如果要能使 CPU 驅動協處理器就需要含有客製化指令的二進制檔。為了獲得對應的二進制檔,目前最普遍的方式是手動在原始程式(source code)插入相對應的 Inline Aassembly,但這對於大部份的人都非常的困難且複雜。
本論文提出利用 GUI 圖形化介面為基礎的 IDE 工具 AGCC,使用者能利用 AGCC 自動產生客製化 LLVM 後端並產生客製化編譯器最終再生成含有客製指令的二進制檔。而另一個工具 AGRVCC 會自動產生含有協處理器的 bitstream 並將他燒入至 FPGA,最終將 AGCC 產生的二進制檔交給 FPGA 執行並比較含有協處理器與沒有協處理器的執行結果。
使用者只須要將原始程式輸入至 AGCC 並將想要交給協處理器處理的部分選取出來,AGCC 會將產生協處理器 bitstream 的必要檔案傳給 AGRVCC,並且產生客製化編譯器以及生成對應二進制檔,不需要自行修改原始程式也不需要自行改動編譯器相關的檔案等複雜的工作。另外 AGRVCC 也會透過傳入的檔案自行生成含有協處理器的 FPGA 硬體,因此使用者也不需要自行撰寫 verilog 等硬體描述語言即可獲得執行結果。
最後本論文以此圖形化 IDE 工具基於 RISC-V 架構上實作從原始程式(source code)到產生客製二進制檔以及協處理器硬體,並進行各種實測來驗證正確性。
With the popularity of RISC-V, coprocessors for various applications have also been designed. Such as cloud computing, mobile phones, AI computing, etc., In addition, the concept of heterogeneous computing has also been implemented in many products in recent years.
How to design a coprocessor and design instructions and drive it is a hard issue. In addition to writing the verilog of the hardware, it must also be able to generate the corresponding binary file.
Implementing coprocessors manually and generating custom compilers is complex.This article provides a GUI tool that can automatically generate compilers and binaries that support custom instructions, execute and verify correctness on the coprocessor, and then show users the advantages of coprocessor acceleration. Provide more convenient methods in research and development.
[1] Colin Schmidt, Albert Ou, Krste Asanović (2018). Hwacha V4: Decoupled Data Parallel Custom Extension.
[2] Hara, Y., Tomiyama, H., Honda, S., Takada, H., & Ishii, K. (2008). CHStone: A benchmark program suite for practical C-based high-level synthesis. 2008 IEEE International Symposium on Circuits and Systems (ISCAS).
[3] Andrew Waterman, K. A. c., SiFive Inc. (2017). The RISC-V Instruction Set Manual Volume I: User-Level ISA. EECS Department, University of California, Berkeley.
[4] 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.
[5] Writing an LLVM Backend. http://llvm.org/docs/WritingAnLLVMBackend.html#instruction-operand-name-mapping.
[6] Extending LLVM: Adding instructions, intrinsics, types, etc.
https://llvm.org/docs/ExtendingLLVM.html
[7] TableGen Language Reference. http://llvm.org/docs/TableGen/LangRef.html.
[8] Chen Chung-Shu, “Tutorial: Creating an LLVM Backend for the Cpu0 Architecture,” Nov 03, 2016.
[9] Fraser Cormack, Pierre-Andre Saulais, Building an LLVM Backend. Apr, 2014.
[10] riscv-llvm. https://github.com/riscv/riscv-llvm.
[11] Mayur Pandey, Suyog Sarda, LLVM Cookbook, May, 2015.
[12] 任勝兵, 盧念, 張萬利, 潘震宇. 基於LLVM架構的Nios II後端快速移植. Computer Applications and Software, Vol. 28 No. 12, Dec. 2011.
[13] Jozef Kolek, Zoran Jovanović, Nenad Šljivić, Dragan Narančić, “Adding microMIPS Backend to the LLVM Compiler Infrastructure,” IEEE, 2013.
[14] Fraser Cormack, Pierre-André Saulais, Building an LLVM Backend, European LLVM Conference, 2014.