香山是一款开源的高性能 RISC-V 处理器,基于 Chisel 硬件设计语言实现,支持 RV64GC 指令集。

Yinan Xu 5986560e7d Update Artifact Evaluation badges to README.md (#1789) 1 day ago
.github 580075cfbe ci: disable vcs ci temporarily (#1682) 2 months ago
debug a58e335197 Integer SRT16 Divider (#1019) 1 year ago
difftest @ bafef94dde fa9d712c89 dp2: add a pipeline for load/store (#1597) 2 months ago
fudian @ 3dd05b0881 12e221b129 Bump rocket-chip (#1502) 6 months ago
huancun @ a47ce2c287 a0938898e1 Added chisel-db to dump hw data into a database automatically 3 months ago
images 7a2fc509e2 misc: fix typo in nanhu arch figure (#1552) 4 months ago
project 5a7b942b03 update sbt version 3 years ago
ready-to-run @ ec61625c16 25ac26c6cf Fix vcs simulation support, support manually set ram_size (#1551) 4 months ago
rocket-chip @ 254ebf7150 361e6d5146 fix for chipsalliance/rocket-chip#2967 (#1562) 3 months ago
scripts e559722632 CI: support basic VCS simulation (#1575) 3 months ago
src 9bb2ac0fcd lq: fix load load violation check logic (#1764) 1 week ago
tools f320e0f01b misc: update PCL information (#899) 1 year ago
.gitignore 46f74b57fb feat: parameterize load store (#1527) 4 months ago
.gitmodules 72060888ce Clean up project dependencies (#1282) 9 months ago
.mill-version b32ad70d6b build.sc: remove `testOnly` (#843) 1 year ago
LICENSE c6d439803a Add MulanPSL-2.0 License (#824) 1 year ago
Makefile 1c746d3a7a fix some typos (#1537) 5 months ago
README.md 5986560e7d Update Artifact Evaluation badges to README.md (#1789) 1 day ago
build.sbt 5e414fe2a1 Add sbt build support (#857) 1 year ago
build.sc 7861bfd695 Update build.sc (#1622) 2 months ago
readme.zh-cn.md 5986560e7d Update Artifact Evaluation badges to README.md (#1789) 1 day ago
scalastyle-config.xml 945710d1cb first commit 3 years ago
scalastyle-test-config.xml 945710d1cb first commit 3 years ago

README.md

XiangShan

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

中文说明在此

Copyright 2020-2022 by Institute of Computing Technology, Chinese Academy of Sciences.

Copyright 2020-2022 by Peng Cheng Laboratory.

Docs and slides

XiangShan-doc is our official documentation repository. It contains design spec., technical slides, tutorial and more.

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 Results Reproduced

Paper PDF | IEEE Xplore (TBD) | ACM DL (TBD) | BibTeX (TBD)

Follow us

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

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

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

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

Architecture

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

The second stable micro-architecture of XiangShan is called Nanhu (南湖) 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 Nanhu (南湖) is shown below.

xs-arch-nanhu

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
│       └── xstransforms   # 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

In the development of XiangShan, some sub-modules from the open-source community are employed. All relevant usage is listed below.

Sub-module Source Detail
L2 Cache/LLC Sifive block-inclusivecache Our new L2/L3 design are inspired by Sifive's block-inclusivecache.
Diplomacy/TileLink Rocket-chip We reused the Diplomacy framework and TileLink utility that exist in rocket-chip to negotiate bus.

We are grateful for the support of the open-source community and encourage other open-source projects to reuse our code within the scope of the license.