Go to file
Haoyuan Feng 57a8ca5e38
EMU Test / Changes Detection (push) Waiting to run Details
EMU Test / Generate Verilog (push) Blocked by required conditions Details
EMU Test / EMU - Basics (push) Blocked by required conditions Details
EMU Test / EMU - CHI (push) Blocked by required conditions Details
EMU Test / EMU - Performance (push) Blocked by required conditions Details
EMU Test / EMU - MC (push) Blocked by required conditions Details
EMU Test / SIMV - Basics (push) Blocked by required conditions Details
EMU Test / Upload Artifacts (push) Blocked by required conditions Details
EMU Test / Check Submodules (push) Blocked by required conditions Details
EMU Test / Check Format (push) Blocked by required conditions Details
fix(LLPTW): dup_wait_resp should not send last_hptw_req when excp (#4596)
In the original design, the condition for `to_last_hptw_req` was:
`dup_wait_resp && entries(io.mem.resp.bits.id).req_info.s2xlate ===
allStage`. As a result, when a newly entered LLPTW request dups with an
entry currently returning from memory, and the new request is marked as
allStage, the `to_last_hptw_req` signal would be true. This causes the
state machine to transition to the `state_last_hptw_req` state and send
a request to HPTW.

However, if the page table returned from memory contains a `vsStagePf`
or `gStagePf`, it should directly go to `mem_out` or `bitmap_check`
without performing a final HPTW translation. Therefore, this commit
fixes the bug by adding a restriction to the original `to_last_hptw_req`
condition to ensure that no exceptions are present; otherwise, the state
machine will transition to either `mem_out` or `bitmap_check`.

Additionally, this PR also fixes a bug where `last_hptw_req_ppn` did not
account for the napot case.
2025-04-21 00:47:49 +08:00
.github ci(perf): fix changed wave file and summary format (#4559) 2025-04-15 13:01:10 +08:00
ChiselAIA@6608dc16ec submodule(chiselAIA): bump chiselAIA to fix `imsic.toCSR.illegal` (#4546) 2025-04-12 12:34:15 +08:00
coupledL2@b2b3ae7d6a fix(DFT): fix `DFT` cgen connection (#4565) 2025-04-15 23:59:16 +08:00
debug bump difftest & mkdir for wave/perf for local-ci script's run-mode (#1927) 2023-02-21 12:49:41 +08:00
difftest@9d5e8eb361 submodule(difftest): add ram_size for setting ref (#4564) 2025-04-15 20:52:56 +08:00
fudian@e1bd4695ca chore: bump chisel 6.0.0 (#2654) 2024-01-19 15:05:34 +08:00
huancun@c5e02bd616 refactor(DFT): refactor `DFT` IO (#4530) 2025-04-14 11:09:03 +08:00
images docs(readme): update kunminghu architecture graph (#3910) 2024-11-21 16:24:27 +08:00
macros/src/main/scala NewCSR: fix unprivileged CSRs and permission check 2024-07-17 10:42:14 +08:00
openLLC@614ceb4c5d fix(SoC, OpenNCB): add support for CHI issue C (#4281) 2025-02-17 23:06:42 +08:00
project
ready-to-run@c22a4b2e81 submodule(ready-to-run): bump nemu ref in ready-to-run (#4566) 2025-04-17 23:49:54 +08:00
rocket-chip@bea0af5d85 submodule(rocket-chip): bump rocket-chip (#4356) 2025-03-05 14:38:54 +08:00
scripts feat: support inst lifetime trace (#4007) 2025-04-08 11:21:04 +08:00
src fix(LLPTW): dup_wait_resp should not send last_hptw_req when excp (#4596) 2025-04-21 00:47:49 +08:00
tools/readmemh
utility@baacebea4b refactor(DFT): refactor `DFT` IO (#4530) 2025-04-14 11:09:03 +08:00
yunsuan@cadd3c2f43 submodule(yunsuan): bump yunsuan 2025-01-17 17:13:18 +08:00
.gitignore chore(gitignore): ignore log file like *.err and *.log (#3915) 2024-11-22 15:27:26 +08:00
.gitmodules misc(submodule): correct case seneitivity in url (#4585) 2025-04-18 10:34:02 +08:00
.mill-version build: bump mill to 0.12.3 (#3933) 2024-11-26 16:12:10 +08:00
.scalafmt.conf style(Frontend): use scalafmt formatting frontend (#3370) 2024-10-25 23:08:56 +08:00
LICENSE
Makefile fix(Makefile): sync from yaml prefix if provided (#4560) 2025-04-15 13:01:43 +08:00
Makefile.test
README.md docs(README): update copyright and license 2025-01-16 19:46:05 +08:00
build.sbt
build.sc feat: move frontend SRAM read-write conflict handling to SRAMTemplate (#4445) 2025-04-10 10:44:14 +08:00
readme.zh-cn.md docs(README): update copyright and license 2025-01-16 19:46:05 +08:00
scalastyle-config.xml chore(scalastyle): allow newline after operators (#4437) 2025-03-21 10:57:44 +08:00
scalastyle-test-config.xml chore(scalastyle): allow sx_lowerCamelCase naming for pipeline signals 2025-03-07 16:35:04 +08:00

README.md

XiangShan

XiangShan (香山) is an open-source high-performance RISC-V processor project.

中文说明在此

Documentation

XiangShan's documentation is available at docs.xiangshan.cc.

The microarchitecture documentation on docs.xiangshan.cc is currently outdated for the latest version (Kunminghu). An updated version is in progress.

XiangShan User Guide has been published separately. You can find it at XiangShan-User-Guide/releases.

Publications

MICRO 2022: Towards Developing High Performance RISC-V Processors Using Agile Methodology

Our paper introduces XiangShan and the practice of agile development methodology on high performance RISC-V processors. It covers some representative tools we have developed and used to accelerate the chip development process, including design, functional verification, debugging, performance validation, etc. This paper is awarded all three available badges for artifact evaluation (Available, Functional, and Reproduced).

Artifacts Available Artifacts Evaluated — Functional Results Reproduced

Paper PDF | IEEE Xplore | BibTeX | Presentation Slides | Presentation Video

Follow us

Wechat/微信:香山开源处理器

Zhihu/知乎:香山开源处理器

Weibo/微博:香山开源处理器

You can contact us through our mailing list. All mails from this list will be archived here.

Architecture

The first stable micro-architecture of XiangShan is called Yanqihu (雁栖湖) and is on the yanqihu branch, which has been developed since June 2020.

The second stable micro-architecture of XiangShan is called Nanhu (南湖) and is on the nanhu branch.

The current version of XiangShan, also known as Kunminghu (昆明湖), is still under development on the master branch.

The micro-architecture overview of Kunminghu (昆明湖) is shown below.

xs-arch-kunminghu

Sub-directories Overview

Some of the key directories are shown below.

.
├── src
│   └── main/scala         # design files
│       ├── device         # virtual device for simulation
│       ├── system         # SoC wrapper
│       ├── top            # top module
│       ├── utils          # utilization code
│       └── xiangshan      # main design code
│           └── transforms # some useful firrtl transforms
├── scripts                # scripts for agile development
├── fudian                 # floating unit submodule of XiangShan
├── huancun                # L2/L3 cache submodule of XiangShan
├── difftest               # difftest co-simulation framework
└── ready-to-run           # pre-built simulation images

IDE Support

bsp

make bsp

IDEA

make idea

Generate Verilog

  • Run make verilog to generate verilog code. The output file is build/XSTop.v.
  • Refer to Makefile for more information.

Run Programs by Simulation

Prepare environment

  • Set environment variable NEMU_HOME to the absolute path of the NEMU project.
  • Set environment variable NOOP_HOME to the absolute path of the XiangShan project.
  • Set environment variable AM_HOME to the absolute path of the AM project.
  • Install mill. Refer to the Manual section in this guide.
  • Clone this project and run make init to initialize submodules.

Run with simulator

  • Install Verilator, the open-source Verilog simulator.
  • Run make emu to build the C++ simulator ./build/emu with Verilator.
  • Refer to ./build/emu --help for run-time arguments of the simulator.
  • Refer to Makefile and verilator.mk for more information.

Example:

make emu CONFIG=MinimalConfig EMU_THREADS=2 -j10
./build/emu -b 0 -e 0 -i ./ready-to-run/coremark-2-iteration.bin --diff ./ready-to-run/riscv64-nemu-interpreter-so

Troubleshooting Guide

Troubleshooting Guide

Acknowledgement

The implementation of XiangShan is inspired by several key papers. We list these papers in XiangShan document, see: Acknowledgements. We very much encourage and expect that more academic innovations can be realised based on XiangShan in the future.

LICENSE

Copyright © 2020-2025 Institute of Computing Technology, Chinese Academy of Sciences.

Copyright © 2021-2025 Beijing Institute of Open Source Chip

Copyright © 2020-2022 by Peng Cheng Laboratory.

XiangShan is licensed under Mulan PSL v2.