| 研究生: |
蕭珮珊 Hsiao, Pei-Shan |
|---|---|
| 論文名稱: |
支援作業系統執行且具備前端與記憶體子系統優化之六級RV64IMA模組化CPU實作 Implementation of an OS-compatible 6-stage RV64IMA Modular CPU with Frontend and Memory Optimizations |
| 指導教授: |
陳中和
Chen, Chung-Ho |
| 學位類別: |
碩士 Master |
| 系所名稱: |
電機資訊學院 - 電機工程學系 Department of Electrical Engineering |
| 論文出版年: | 2026 |
| 畢業學年度: | 114 |
| 語文別: | 中文 |
| 論文頁數: | 99 |
| 中文關鍵詞: | RISC-V 、作業系統相容處理器 、RV64IMA 、Linux 、記憶體子系統 |
| 外文關鍵詞: | RISC-V, OS-compatible processor, RV64IMA, Linux, memory subsystem |
| 相關次數: | 點閱:63 下載:0 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
隨著嵌入式系統與邊緣運算應用日益複雜,處理器平台已不再僅需執行bare-metal 程式,也必須支援即時作業系統與通用作業系統。對RISC-V處理器而言,作業系 統相容性不僅包含基本指令集正確性,也涉及特權模式、例外與中斷處理、原子操 作、虛擬記憶體、計時器中斷與基本SoC周邊等系統機制。本論文提出並實作一個 可支援作業系統執行的六級RV64IMA模組化CPU,稱為Lunacore,目標是在維持 in-order execution 與 in-order commit 之硬體複雜度與可驗證性的同時,建立可啟動 FreeRTOS 與 Linux 的RISC-V 處理器平台。
在微架構設計方面,Luna採用六級single-issuein-order pipeline,並透過明確的提交 流程支援precise exception、CSR 存取與特權模式執行。為改善指令供應,本研究設 計decoupled frontend,將 next-PC generation、branch prediction 與 instruction fetch 解 耦,降低branchredirect 與取指延遲對管線的影響。在記憶體子系統方面,Luna整合 pipelined VIPT L1 cache、Sv39 MMU、ITLB/DTLB、page table walker、store-to-load forwarding 與 atomic memory operation 支援,使核心能處理 Linux 所需的位址轉譯、 page fault、同步操作與特權模式下的記憶體存取行為。本研究亦建立SoC模擬平台, 整合CLINT、PLIC、UART、AXI-basedinterconnect與主記憶體模型,完成處理器核 心、系統周邊與Linux軟體環境之整合。
為驗證設計正確性,本研究建立多層次validationinfrastructure,包含RISC-V指令測 試、LunaISS、commit-level co-simulation、Konata pipeline viewer 與 fast Linux booting mode。實驗結果顯示,Luna可通過RV64IMA指令層級測試,成功執行FreeRTOS, 並可啟動Linux kernel v5.15,完成由 M-mode OpenSBI、S-mode Linux kernel 到 U mode console 的完整開機流程。此結果證明Luna具備支援實際作業系統所需之特權 模式切換、中斷、計時器、MMU、UARTconsole與使用者空間執行能力。
效能評估方面,本研究以CVA6作為主要in-orderbaseline,並使用CoreMark、Dhry stone、MiBench、PolyBench 與 EmBench 分析不同 workload 下的表現。結果顯示, Luna 在 CoreMark/MHz 與 Dhrystone 中相較 CVA6 分別提升約 5.1% 與 7.3%,在 MiBench 與 PolyBench 中分別達到 1.107× 與 1.065× 的 geometric mean speedup,整 體benchmark 類型之overall geometric mean speedup 為 1.063×。此外,Luna 於 16nm FinFET 製程下可達到1GHz 目標頻率,合成後總cellarea 為363,438.1µm2,post synthesis average power estimate 為 197.8mW。綜合而言,本論文完成一個具備作業 系統相容性的RV64IMAin-order CPU 與 SoC 平台,可作為後續RISC-VOS-capable processor 與 Linux workload 分析之研究基礎。
This thesis presents Luna core, an OS-compatible six-stage RV64IMA modular CPU and SoC simulation platform. The work targets a RISC-V processor capable of exe-cuting FreeRTOS and Linux while retaining the simplicity and verifiability of in-order execution and in-order commit. Luna integrates a decoupled frontend, a pipelined VIPT L1 cache, Sv39 virtual memory support, TLBs, a page table walker, store-to-load for-warding, atomic memory operations, and basic SoC peripherals including CLINT, PLIC, UART, an AXI-based interconnect, and main memory. A multi-level validation infras-tructure, including RISC-V instruction tests, LunaISS, commit-level co-simulation, a Konata pipeline viewer, and a fast Linux booting mode, is used to verify functionality and support long-running system workloads. Experimental results show that Luna passes RV64IMA instruction-level tests, executes FreeRTOS, and boots Linux kernel v5.15 from OpenSBI to a user-mode console. Compared with CVA6, Luna improves Core-Mark/MHz and Dhrystone by about 5.1% and 7.3%, achieves geometric mean speedups of 1.107×on MiBench and 1.065×on PolyBench, and obtains an overall speedup of 1.063×across benchmark categories. Post-synthesis evaluation in a 16nm FinFET process shows that Luna reaches 1GHz with a cell area of 363,438.1μm2 and an average power estimate of 197.8mW.
[1]A. W. Services, “Freertos real time operating system,” 2023.[Online]. Available: https://www.freertos.org/
[2]The Linux Kernel community. (2026) The Linux Kernel documentation. Accessed: 2026-05-11. [Online]. Available: https://docs.kernel.org/
[3]F. Zaruba and L. Benini, “The cost of application-class processing: Energy and perfor mance analysis of a linux-ready 1.7-ghz 64-bit risc-v core in 22-nm fdsoi technology,” IEEE Transactions on Very Large Scale Integration (VLSI) Systems, vol. 27, no. 11, pp. 2629–2640, Nov. 2019.
[4]M. R. Guthaus, J. S. Ringenberg, D. Ernst, T. M. Austin, T. Mudge, and R. B. Brown, “Mibench: A free, commercially representative embedded benchmark suite,” in Pro ceedings of the IEEE International Workshop on Workload Characterization, 2001, pp. 3–14.
[5]L.-N. Pouchet and T. Yuki, “Polybench/c: The polyhedral benchmark suite,” https:// www.cs.colostate.edu/~pouchet/software/polybench/, 2012–2016.
[6]D. Patterson, J. Bennett, P. Dabbelt, C. Garlati, G. S. Madhusudan, and T. Mudge, “Embench: An evolving benchmark suite for embedded IoT computers from an academic-industrial cooperative: Towards the long overdue and deserved demise of dhrystone,” in RISC-V Workshop Zurich, 2019. [Online]. Available: https://github.com/embench/embench-iot
[7]R.-V. International and W. D. Corporation, “Opensbi (risc-v open source supervisor binary interface),” 2019-2026, accessed: [Insert Date Here]. [Online]. Available: https://github.com/riscv-software-src/opensbi
[8]R.-V. International, “Risc-v advanced core local interruptor (aclint) specification,” 2025, accessed: 2026-05-11. [Online]. Available: https://github.com/riscv/riscv-aclint
[9]A. Waterman, K. Asanović, and J. Hauser, “The RISC-V Instruction Set Manual, Vol ume II: Privileged Architecture, Document Version 20211203,” RISC-V International, San Francisco, Tech. Rep., dec 2021. [Online]. Available: https://riscv.org
[10]Y.-T. Zhuang, P.-S. Hsiao, and C.-H. Chen, “Lunaiss: A risc-v simulator for branch pre dictor validation and interval-based profiling,” in 2025 22nd International SoC Design Conference (ISOCC). IEEE, 2025, pp. 1–2.
[11]R. Shioya, “shioyadan/konata,” original-date: 2017-04-27T14:09:24Z. [Online]. Available: https://github.com/shioyadan/Konata
[12]The load/store unit (LSU) —RISCV-BOOM documentation. [Online]. Available: https://docs.boom-core.org/en/latest/sections/load-store-unit.html