| 研究生: |
孫慶儒 Sun, Ching-Ju |
|---|---|
| 論文名稱: |
以FPGA實現一支援高階語言的RISC-V電腦系統 FPGA Implementation of a RISC-V Computer System with High-Level Language Support |
| 指導教授: |
陳進興
Chen, Chin-Hsing 張名先 Chang, Ming-Xian |
| 學位類別: |
碩士 Master |
| 系所名稱: |
電機資訊學院 - 電腦與通信工程研究所 Institute of Computer & Communication Engineering |
| 論文出版年: | 2024 |
| 畢業學年度: | 112 |
| 語文別: | 英文 |
| 論文頁數: | 80 |
| 中文關鍵詞: | 現場可規劃邏輯電路 、RISC-V 、編譯器 、組譯器 、記憶體階層 、RS232 |
| 外文關鍵詞: | field programmable logic gate array (FPGA), RISC-V, Compiler, Assembler, Memory Hierarchy, RS232 |
| 相關次數: | 點閱:57 下載:11 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
隨著科技的發展,人工智慧所需的運算能力越來越龐大,為了因應這要求,高效能處理器想必是非常重要。那在現今這麼多處理器中,其中以RISC-V架構處理器較為突出。它的優點在於開放和靈活性的設計,可依使用者自訂,滿足特別的需求。因其簡潔有效的指令和設計,這也使得實現低功耗且高效能的處理器成為可能。本論文以RV32IM指令集去設計帶有快取記憶體的RISC-V五級流水線架構處理器實現於FPGA系統。
本論文將以C語言編寫的程式,經過RISC-V編譯器及組譯器轉換成機器語言,將它從電腦端透過RS232串接口輸入FPGA中,經過RISC-V處理器的運算,將得出的結果從記憶體中讀出,透過RS232串接口輸出到電腦端,並在螢幕上顯示。
使用快取記憶體與沒有使用快取記憶體之RISC-V架構處理器相比較,因為記憶體階層的特性,前者具有讀寫速度快的優點,其得出結果的速度較沒有使用快取記憶體之RISC-V架構處理器快了4倍,驗證了記憶體階層的特性。我們還實現了區塊版本的矩陣乘法。我們發現區塊版本的資料快取命中率高於原始版本。這可以在資料被替換之前,最大化對已載入快取中的資料的存取,即改善時間局部性以減少快取未命中。
With the advancement of technology, artificial intelligence requires powerful computing capabilities. In response to this demand, efficient processors are undoubtedly crucial. Among the multitude of processors available today, RISC-V architecture processors stand out prominently. Their advantages lie in their open and flexible design, allowing customization to meet specific needs. Additionally, their concise and effective instruction set design enables the realization of low-power and high-performance processors. This thesis designs a RISC-V five-stage pipelined architecture processor with cache memory implemented on an FPGA system, using the RV32IM instruction set.
This thesis wrote program in C language, which was compiled and assembled into machine code using a RISC-V compiler and assembler. The program then was inputted into the FPGA through the RS232 serial interface from the computer. After undergoing computation by the RISC-V processor, the resulting output was read from the memory and outputted back to the computer via the RS232 serial interface, displaying the results on the screen.
Comparing a RISC-V architecture processor with cache memory to one without cache memory, the former exhibits the advantage of faster read and write speeds due to the characteristics of memory hierarchy. As a result, the processor with cache memory achieves a speedup of 4 times compared to the one without cache memory in obtaining results. It verify the characteristics of memory hierarchy. We also implemented the blocking version of matrix multiplication. We found that blocking version data cache hit rate is higher than the original version. It maximize accesses to the data loaded into the cache before the data are replaced; that is, improve temporal locality to reduce cache misses.
[1] D. G. Bailey and C. T. Johnston, “Algorithm transformation for fpga implementation”, 2010 Fifth IEEE International Symposium on Electronic Design, Test & Applications, pages 77–81, 2010.
[2] E. Cui, T. Li and Q. Wei, “Risc-v instruction set architecture extensions: a survey”. IEEE Access, pages 24696–24711, 2023.
[3] A. Dörflinger, M. Albers, B. Kleinbeck, Y. Guan, H. Michalik, R. Klink, C. Blochwitz, A. Nechi and M. Berekovic, “A comparative survey of open-source application-class risc-v processor implementations”, Proceedings of the 18th ACM International Conference on Computing Frontiers, pages 12–20, 2021.
[4] X. Han and X. Kong, “The designing of serial communication based on rs232”, 2010 First ACIS International Symposium on Cryptography, and Network Security, Data Mining and Knowledge Discovery, E-Commerce and Its Applications, and Embedded Systems, pages 382–384, 2010.
[5] S. Harris and D. Harris, Digital Design and Computer Architecture, RISC-V Edition, Morgan Kaufmann, 2021.
[6] S. L. Harris, D. Chaver, L. Piñuel, JI. Gomez-Perez, M. H. Liaqat, Z. L. Kakakhel, O. Kindgren and R. Owen, “Rvfpga: Using a risc-v core targeted to an fpga in computer architecture education”, 2021 31st International Conference on Field-Programmable Logic and Applications (FPL), pages 145–150, 2021.
[7] I. Kuon, R. Tessier and J. Rose, “Fpga architecture: Survey and challenges”, Foundations and Trends® in Electronic Design Automation, pages 135–253, 2008.
[8] J. R. Levine, T. Mason and D. Brown, Lex & Yacc, O’Reilly Media, Inc, 1992.
[9] T. Æ. Mogensen, Introduction to Compiler Design, Springer Nature, 2024.
[10] A. M. Mohamed, N. Mubark and S. Zagloul, “Performance aware shared memory hierarchy model for multicore processors”, Scientific Reports, pages 2045-2322, 2023.
[11] S. A. Przybylski, Cache and Memory Hierarchy Design: A Performance Directed Approach, Morgan Kaufmann, 1990.
[12] N. Simson, A. Tahigara and W. Ecker, “A comparative analysis of arm and risc-v isas for deeply embedded systems”, MBMV 2024; 27. Workshop, pages 110–119, 2024.
[13] A. Waterman, Y. Lee, D. A. Patterson and K. Asanovic, “The risc-v instruction set manual, volume i: Base user-level isa”, EECS Department, UC Berkeley, Tech. Rep. UCB/EECS-2011-62, pages 1–32, 2011.