Commit Graph

142 Commits

Author SHA1 Message Date
Anzooooo 9a6e67e038 ci(perf): add performance tests for the simfrontend 2025-09-23 10:55:00 +08:00
SFangYy d49925f440 feat(pdb): Add XSPdb, a GDB-like interactive debugger for XiangShan (#4906)
### 1. Purpose of this Pull Request 
XSPdb is a specialized Python pdb-based debugging tool for RISC-V IP
cores, customized for Xiangshan's difftest interface. It provides
GDB-like interactive debugging capabilities, integrating: Terminal
command-line interface, RTL-level waveform toggling, Automated script
replay, System snapshot save/restore, Register initialization
configuration

### 2. Changes Made

* **New Tool (`XSPdb`)**: The core Python scripts for XSPdb have been
added under `scripts/xspdb/`. This tool provides an interactive
debugging console with standard pdb commands (e.g., breakpoints, step,
continue, register inspection).
* **Build System Integration**: A new Makefile, `pdb.mk`, has been
created to define the build targets and logic required for XSPdb.
* **Makefile Modification**: The root Makefile has been updated to
include `pdb.mk`, integrating the new `pdb` target into the main build
system.

### 3. Usage 

The new tool can be built and used via a new `make` target.
1. **Build the XSPdb package**: 
```bash
    make pdb NOOP_HOME=$(pwd)
 ```
2.  **Run a simulation with the XSPdb**:
```bash
   make pdb-run NOOP_HOME=$(pwd)
 ```

---------

Co-authored-by: Zhicheng Yao <yaozhicheng@ict.ac.cn>
2025-09-17 14:46:58 +08:00
xu_zh abc4c5059a
chore(xiangshan.py): add make-threads arg for `make -j` (#4837) 2025-06-27 18:51:37 +08:00
Jiuyue Ma 9e614723ac fix(docker): Fix docker "-e" param when MAKEOVERRIDES contains space
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
2025-05-22 15:12:45 +08:00
Jiuyue Ma f47ebf519e
fix(docker): Forward variables in the make command line to docker (#4686)
EMU Test / Changes Detection (push) Has been cancelled Details
Release Jobs / build-xsdev-image (push) Has been cancelled Details
EMU Test / Generate Verilog (push) Has been cancelled Details
EMU Test / EMU - Basics (push) Has been cancelled Details
EMU Test / EMU - CHI (push) Has been cancelled Details
EMU Test / Docker Build (push) Has been cancelled Details
EMU Test / EMU - Performance (push) Has been cancelled Details
EMU Test / EMU - MC (push) Has been cancelled Details
EMU Test / SIMV - Basics (push) Has been cancelled Details
EMU Test / Upload Artifacts (push) Has been cancelled Details
EMU Test / Check Submodules (push) Has been cancelled Details
EMU Test / Check Format (push) Has been cancelled Details
Many variables in XiangShan Makefile can be overridden from command
line. Without forwarding these to docker, commands executed in the
container may produce unexpected results due to variable mismatches.

Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
2025-05-14 12:40:02 +02:00
Jiuyue Ma 0c97e1df83
fix(docker): fix docker image build by moving MILL_OUTPUT_DIR to tmpfs (#4679)
EMU Test / Changes Detection (push) Has been cancelled Details
Release Jobs / build-xsdev-image (push) Has been cancelled Details
EMU Test / Generate Verilog (push) Has been cancelled Details
EMU Test / EMU - Basics (push) Has been cancelled Details
EMU Test / EMU - CHI (push) Has been cancelled Details
EMU Test / Docker Build (push) Has been cancelled Details
EMU Test / EMU - Performance (push) Has been cancelled Details
EMU Test / EMU - MC (push) Has been cancelled Details
EMU Test / SIMV - Basics (push) Has been cancelled Details
EMU Test / Upload Artifacts (push) Has been cancelled Details
EMU Test / Check Submodules (push) Has been cancelled Details
EMU Test / Check Format (push) Has been cancelled Details
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
2025-05-10 14:22:26 +08:00
Jiuyue Ma cf1c45b612 feat(build): Support build verilog/sim-verilog in docker envrionment
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
2025-05-09 21:02:02 +08:00
Jiuyue Ma ff1c5144ae feat(build): Add `pull-image` target to pull docker image from ghcr.io
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
2025-05-09 21:02:02 +08:00
Jiuyue Ma c00d376c98 feat(build): Build docker image for XiangShan development
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
2025-05-09 21:02:02 +08:00
Yan Xu 1592abd11e
feat: support inst lifetime trace (#4007)
PerfCCT(performance counter commit trace) is a Instruction-level
granularity perfCounter like GEM5
How to use this:
1. Make with "WITH_CHISELDB=1" argument
2. Run with "--dump-db --dump-select-db lifetime", then get the database
3. Instruction lifetime visualize run "python3 scripts/perfcct.py
"the-db-file-path" -p 1 -v | less"
4. Analysis script now is in XS-GEM5 repo, see
https://github.com/OpenXiangShan/GEM5/blob/xs-dev/util/ClockAnalysis.py

How it works:
1. Allocate one unique tag "seqNum" like GEM5 for each instruction at
fetch stage
2. Passing the "seqNum" in each pipeline
3. Recording perf data through the DPIC interface
2025-04-08 11:21:04 +08:00
Tang Haojin f9277093a6
ci: use fst instead of vcd (#4503)
EMU Test / Changes Detection (push) Has been cancelled Details
EMU Test / Generate Verilog (push) Has been cancelled Details
EMU Test / EMU - Basics (push) Has been cancelled Details
EMU Test / EMU - CHI (push) Has been cancelled Details
EMU Test / EMU - Performance (push) Has been cancelled Details
EMU Test / EMU - MC (push) Has been cancelled Details
EMU Test / SIMV - Basics (push) Has been cancelled Details
EMU Test / Upload Artifacts (push) Has been cancelled Details
EMU Test / Check Submodules (push) Has been cancelled Details
EMU Test / Check Format (push) Has been cancelled Details
2025-04-05 05:36:14 +08:00
Zakilim 37626c8b1a feat(topdown): add vector freelist stalls 2025-03-17 14:26:24 +08:00
Zakilim 03a1a638e5 fix(topdown): fix bad speculation instruction calculation 2025-03-17 14:26:24 +08:00
Yanqin Li f242101420
chore(scripts): update to a working state by tutorial (#4415) 2025-03-14 11:21:19 +08:00
xiaofeibao-xjtu 914bbc865a
chore(dispatch): remove useless code and files (#4288) 2025-02-20 15:01:59 +08:00
Tang Haojin 6520f4f4e1
feat(Zawrs): support Zawrs extension (#4211)
This commit implements a basic nop-based Zawrs extension.

- `wrs.sto` in this commit acts as a nop instruction.
- `wrs.nto` in this commit acts as a nop instruction, except it:
- raises illegal instruction exception when !isModeM && mstatus.TW=1, or
- raises virtual instruction exception when privState.V && mstatus.TW=0
&& hstatus.VTW=1

Seems that completely raises no exception is also a valid
implementation,
but raises an exception can help OS to do scheduling during waiting.

Also, like WFI, interrupts cannot take on wrs instructions.
2025-01-22 11:35:09 +08:00
Anzo 517c737eed
ci(perf): add vector hmmer performance test (#4177) 2025-01-16 19:57:32 +08:00
Tang Haojin 5bd65c5635
feat(Config): add yaml parser for complicated parametrization (#4147)
This commit enables complicated parameterization by yaml parsing. We use
circe to do this.

In this commit, we implement 6 configurations:

- PmemRanges: physical memory ranges
- PMAConfigs
- CHIAsyncBridge: set depth to 0 to disable it
- L2CacheConfig
- L3CacheConfig
- DebugModuleBaseAddr

For better human-readability, this commit changes `WithNKBL2/3` to
`L2/3CacheConfig`, changing to case classes, and making the first
parameter only accept human-readable size configuration like `0.5 MB` or
`256kB`.

This commit also changes PMAConfigs and PmemRanges into List of case
classes.
2025-01-15 00:31:49 +08:00
Tang Haojin 28bf033072
ci: archive and update issue B CHI verilog with difftest and test-jar (#4159) 2025-01-14 11:18:46 +08:00
Haoyuan Feng 718a93f52f
feat(Svnapot): support Svnapot extension (#4107) 2025-01-03 18:23:27 +08:00
Tang Haojin 75ed9f4b75
submodule(difftest): set fork-interval default to 10 seconds (#4095) 2024-12-27 09:26:35 +08:00
Yanqin Li f346d72749
ci: add ci tests for Svpbmt (#4016) 2024-12-12 17:17:33 +08:00
linzhida 4293ded2e7 ci: add ci tests for Zacas extension. 2024-12-10 08:49:06 +08:00
NewPaulWalker ad15bdb298
fix(Smstateen): fix access check when Smstateen extension enable. (#3978)
* fix the access check for custom CSR and remove the illegal instruction
check when accessing S-mode custom CSR from VS mode. This is because we
can now use the Smstateen extension to control access to custom content
at different privilege levels.

* fix the misjudgment of the U-mode custom CSR.

* fix the missing access check for the stopi CSR in AIA.
2024-12-09 18:38:48 +08:00
Haoyuan Feng 189833a16f
feat(pointer masking): support Ssnpm & Smnpm & Smmpm (#3921)
feat(pointer masking): support Ssnpm & Smnpm & Smmpm
2024-12-05 14:21:35 +08:00
Haojin Tang fcefab3267 ci(nightly): add more ckpts and refactor gcpt loading method 2024-12-01 23:11:48 +08:00
Tang Haojin 01efe338ce ci(nightly): change checkpoint directory 2024-12-01 23:11:48 +08:00
HuSipeng 393755c794
ci(Zcb): add zcb extension test (#3853) 2024-11-12 15:31:57 +08:00
HeiHuDie dd16cea72b ci(zvfh,zfh): add f16_test 2024-11-09 17:12:35 +08:00
Tang Haojin e76e9e542a
ci(enable-fork): set fork interval to 10 seconds (#3694)
This change can help us to capture the waveform of problem caused by
hardware stuck. Besides, since we enlarged mmap memory, it may take much
more time on `fork()` syscall. Enlarging the fork interval here also
results better simulation speed in some circumstances.
2024-10-19 19:57:14 +08:00
chengguanghui c08f49a0db fix(Trigger): remove tcontrol in trigger module.
* remove tcontrol.
 * use xIE to control trigger's breakpoint exception.
 * modify medelege: bit(EX_BP) is writable.
 * fix emu.yml to make medelege.EX_BP writable in SMP Linux jobs.
2024-10-05 09:30:14 +08:00
Tang Haojin 20156f7747
ci(vcs): use coremark-1-iteration instead of microbench (#3605) 2024-09-19 18:02:18 +08:00
xiaofeibao-xjtu 556c96d6b6
fix(scripts): parser.py support submodule endWiths '();' (#3598) 2024-09-19 10:18:10 +08:00
xiaofeibao 623032efa4 feat(scripts): remove replace of negedge for regFile 2024-09-18 10:17:38 +08:00
Tang Haojin 43f087429a
ci: randomly delay a few seconds between two `get_free_cores` (#3591)
To reduce the possibility of conflicts.
2024-09-16 16:50:52 +08:00
Xu, Zefan 0d7009bf31
ci: update nexus-am base ci workload bins (#3491)
The previous riscv64-xs config for nexus-am includes VGA and AUDIO
devices, which do not exist in XiangShan simulation environment. This
patch modifies the workloads used by xiangshan.py to solve the above
problem.

Signed-off-by: "Xu, Zefan" <ceba_robot@outlook.com>
2024-09-10 11:27:57 +08:00
xiaofeibao-xjtu 20dd904fd3
fix(scripts): fix bug of parser.py (#3500) 2024-09-06 11:02:47 +08:00
Tang Haojin 71f0f4cc1f
ci: use `num_logical_core` to get numa node (#3489) 2024-09-04 15:31:50 +08:00
xiaofeibao-xjtu 9341e7e39c
feat(scripts): add parser.py generate_all.sh from branch kunminghu (#3483) 2024-09-04 13:39:14 +08:00
Chen Xi 0b62a2fb7c
script: fix xiangshan.py `with_chiseldb` permanently disabled (#3411)
previous line
```scala
self.with_chiseldb = 0 if args.no_db else None
```
will cause with_chiseldb permanently disabled
2024-08-21 21:22:08 +08:00
happy-lx 41d8d23915
RVA23: Support Zicclsm & Zama16b (Handling Unaligned Load Store by Hardware) (#3320)
This PR supports handling load store unaligned exceptions by hardware
and provides CSR-controlled switches

---------

Co-authored-by: xiaofeibao <1441675923@qq.com>
2024-08-21 13:22:48 +08:00
Xu, Zefan afdeb3827f
ci: enable riscv-hyp-tests (#3369)
Because of bugs, riscv-hyp-tests was not added to ci. Now XiangShan
master could pass it, so this patch added it back.
2024-08-13 18:18:08 +08:00
Tang Haojin dd720cae57
ci: do not consider procname with ssh (#3335) 2024-08-03 00:32:10 +08:00
Tang Haojin a941bfc4c5
ci: search numactl process to avoid conflicts (#3276) 2024-07-25 10:23:08 +08:00
Xu, Zefan 1f903014cf
ci: add basic ci for Hypervisor extension (#3273)
This patch add xvisor_wboxtest to ci, which tests the nested mmu system.
riscv-hyp-tests are still on the way.
2024-07-24 15:45:54 +08:00
lwd 6ebd27e9f0
ci: add ci for V extension (#3268)
This commit add simple ci tests for V extension.
2024-07-23 19:56:50 +08:00
Tang Haojin e3da8bad33
build: purge chisel 3 and add deprecation check (#3250) 2024-07-22 11:09:11 +08:00
Xuan Hu bc247239b2 script: add `gcpt-restore-bin` arg to specify the gcpt restore bin 2024-07-17 10:45:00 +08:00
chengguanghui 609a6cf050 CI: modify bbl-based SMP linux `bbl.bin`
* exp[breakpoint] can't be delegated when trigger enable
2024-07-17 10:42:27 +08:00
Tang Haojin ae0295f432
chore: bump chisel 6.5.0 (#3210) 2024-07-16 22:52:21 +08:00