Commit Graph

31 Commits

Author SHA1 Message Date
Tang Haojin 7fd1a72f7e
vcs: implement optional xprop examination (#398) 2024-06-13 22:13:35 +08:00
Tang Haojin 4fca0b9846
vcs: add target `simv-run` to run simv easily (#397) 2024-06-13 22:13:05 +08:00
Kunlin You 695a71d062
ci: test simv simulation for SYNTHESIS and disable DPIC RAM/FLASH (#314) 2024-03-14 15:47:07 +08:00
Kamimiao 1a0a0a0bd0
vcs: add support for --workload-list option (#293)
Support --workload-list option for vcs simulation framework. By add running args like `--workload-list=<listfile_name>`,user can run several workload in a single launch on VCS or Palladium. This feature will greatly reduce time required to run many short workloads. Each line of list file should `workload-name max-instr-limit`.

To support this feature, we add workload-switch logic. When a workload is done (or exceed max-instr-limit),we will raise workload-switch signal according to simv_result. Then the reset signal will be set to high. Other logic will only rely on reset logic, so we can see each workload independently.

Note: Now DUT memory has two implementation schemes: load memory to Hardware memory when initial, or load memory in software, then read/write by DPIC. Currently the first scheme cannot support reload memory when reset again. So we must ensure using DPIC memory.

The whole progress of handling workload-list is like follows:
1. When initial, user pass workload-list.
2. When `reset` is set to high. User will trigger simv_init, it will get workload and max-instr from workload-list, just like only a workload is run. Software and DUT memory(DPIC) will be inited in this. 
3. When `simv_nstep` is ended successfully. `workload-switch` will set `reset` to high. Software should be free by difftest_finish. Then Back to Point 2.
4. When `simv_init` gets no more workload from list. The whole simulation is ended.
2024-03-01 13:46:26 +08:00
Kunlin You 06622d0a0d
Batch: pack DPIC to reduce sync times (#281)
* Batch: pack DPIC to reduce sync times

We pack DPIC of DifftestBundles on Hardware and unpack it in Software. So tens of DPIC called times will be reduced to one, which reduce sync times in platform such as palladium.

It can speed up full-difftest of XiangShan from 0.23MHz to 0.29MHz with GlobalEnable,Squash and Gfifo(Non-block) in Palladium. Without Gfifo, it can speed up from 0.025 MHz to 0.11MHz.

Difftest cycle delayed for DifftestBundles to collect valid bundles in bundleNum cycles, which cause delayed comparision result.

BatchInterval and BatchFinish are appended to infoVec to seperate DPIC packed for different Cycle. Other elements contains BundleType and BundleLen to help unpack DataVec.

Now we set maximum data byte packed as 3900, and maximum info byte packed as 90, because Palladium limits total bytes of gfifo param should less than 4000.

We add --max-num-width verilator args to increase bit width limits. See related issue verilator/verilator#2082

For misalignment of struct member, we add packed attribute to struct declaration so all member will be aligned by byte, which helps use memcpy for DPIC.

Note: When run full-difftest in XiangShan with Batch mode, it is possible to contains only one cycle DPICs each time for larger possible maximum bytes each cycle. So diffStateSelect should also be open for VCS and Palladium.

We reshape GatewaySink for same control interface and different IO interface corresponding to DufftestBundle(single-pack) and batchIO(Batch). DPIC for different io interface should extend DPICBase for general methods.
2024-02-08 11:10:26 +08:00
Kunlin You 51f5f12d43
vcs: enable search for missing sv files (#285) 2024-02-07 10:25:17 +08:00
Kunlin You be428423ce
vcs: fix including generated vsrc (#282)
In vcs, -y only used for missing modules, +incdir is used for file
include. And +incdir is also support by verilator
2024-02-04 10:14:55 +08:00
Kunlin You afabff248f
Gen C++ and Verilog macros by GatewayConfig (#251)
Currently all macros in Gateway can be decided by GatewayConfig,
we move macros inside Config for better comprehension.

Difftest-related macros in Verilog can be configured in generated
DifftestMacros.v, which should be included by all files use those macros.

Some redundant passing of config and return val of collect is removed.
Some macros are renamed for similar format.

Makefile and mk are changed to include generated/DifftestMacros.v
2024-01-17 11:57:36 +08:00
Yinan Xu 0a1f66607e
CI: switch to ubuntu-22.04 runners (#252) 2024-01-16 15:57:38 +08:00
Yinan Xu 63d1304442
misc: expect rtl to be created at BUILD_DIR/rtl (#231) 2023-12-27 16:07:41 +08:00
Yinan Xu 0b15347558
vcs: build the files sliently (#200) 2023-10-20 20:19:15 -05:00
Yinan Xu 826194688b
Fix the VCS simulation flow and scripts (#172)
* add `VCS` macro to indicate VCS
* add a CI test case for using Verilator to simulate VCS top
2023-09-21 19:23:25 +08:00
Yinan Xu f905bc9fc3
Clean up code (#138) 2023-09-08 15:43:27 +08:00
Yinan Xu e57910562f
Update License comments (#134) 2023-09-06 16:40:04 +08:00
William Wang 540af7a595
vcs: fix incorrect random initialization (X) (#81)
Set RANDOMIZE_DELAY to 0 will cause some random initialized reg be
initialized to X. RANDOMIZE_DELAY should satisfy:

* round(RANDOMIZE_DELAY) > 0
* RANDOMIZE_DELAY < reset delay

See https://github.com/chipsalliance/firrtl/pull/835
2022-06-04 16:47:05 +08:00
ZhangZifei 328ff3f9aa Revert "vcs: disable RANDOMIZE_GARBAGE_ASSIGN"
This reverts commit eb9ed9191e.
2022-05-27 12:37:33 +08:00
ZhangZifei 27db4601ae vcs: set CONSIDER_FSDB default to none 2022-05-27 12:10:29 +08:00
ZhangZifei 3618eb8f8b vcs: could disable fsdb dump at compile stage
usage:
  make simv CONSIDER_FSDB=0
Note:
1. $CONSIDER_FSDB is 1 at default.
2. Verdi is needed if wanna dump fsdb.
2022-05-27 12:00:27 +08:00
William Wang eb9ed9191e vcs: disable RANDOMIZE_GARBAGE_ASSIGN 2022-05-27 12:00:27 +08:00
ZhangZifei de3c28728c vcs: fix vcs flag about dump-wave 2022-05-19 20:48:35 +08:00
ZhangZifei e11bbf34e7 vcs: enrich param dump-wave=[vpd,fsdb] 2022-05-19 19:27:12 +08:00
Yinan Xu d01dc60848 difftest: add DIFFTEST macro
This commit adds DIFFTEST macro to wrap difftest modules. Makefiles
for verilator and vcs are updated as well.
2022-03-24 18:38:34 +08:00
wangkaifan 4a25287bfa vcs: fix vcs workflow
* complement vcs compiling filelist
* fix init sequence
2022-02-18 09:24:23 +08:00
William Wang 8e1a4fb947 runahead: update runahead interface 2021-09-18 18:25:31 +08:00
William Wang 3d265c42f4 misc: fix vcs-clean script 2021-07-27 17:42:46 +08:00
William Wang f044d4767a misc: update PCL information 2021-07-27 17:05:42 +08:00
William Wang f4a4c399e3 misc: clean up code to use difftest in XiangShan 2021-07-27 16:58:54 +08:00
William Wang 01134e2e03 misc: fix scripts 2021-07-05 16:18:53 +08:00
Lemover c6d439803a
Add MulanPSL-2.0 License (#824)
In this commit, we add License for XiangShan project.
2021-06-04 09:06:35 +08:00
Yinan Xu 632fc81b17
test,vcs: call $finish when difftest fails (#808) 2021-05-11 15:49:05 +08:00
Yinan Xu acd0ebb7e5
test: add support for VCS simulation (#803)
This commit adds support for using Synopsys VCS to simulate SimTop.
Difftest is also supported.

For now, we use src/test/vsrc/vcs/top.v as the top-level module.
In the future, we may support VCS slave mode for better scalability.
2021-05-07 09:34:59 +08:00