Commit Graph

16 Commits

Author SHA1 Message Date
Jiuyue Ma 428551504a
palladium: Build DPILIB_EMU shared library as separated targets (#468)
To support difftest for projects that use their own palladium flow,
the build of DPILIB_EMU shared library should be moved to separated
target.

Signed-off-by: Liu Shan <liushan@bosc.ac.cn>
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
Co-authored-by: Liu Shan <liushan@bosc.ac.cn>
2024-09-14 11:33:15 +08:00
Kunlin You 2766390a14
Fix extra space of Palladium CFLAGS for path parsing (#318)
Previous change #312 has an extra space, which cause error in path parsing, this change fixs it.
The usage of subst is $(subst <from>,<to>,<text>), redundant space is not allowed.
2024-03-19 14:52:47 +08:00
Kamimiao 965fcd3e00
vcs: fix the support for DRAMsim3 (#302) 2024-03-13 21:02:35 +08:00
Kunlin You 0a21549d75
Fix Palladium CFLAGS for path parse (#312)
Previou for Verilator/VCS, SIM_CXXFLAGS will be passed twice, so
we use \\\" for path, make it visible as " inside the code.
For Palladium, we pass these CXX_FLAGS directly to gcc, so we should
replace \\\" with \", to make it treat correctly in compilation.
2024-03-13 21:01:12 +08:00
Kunlin You cb97c84e92
palladium: fix scripts (#307)
We add exit at the end of run/debug scripts to make simualation exit automatically.
And we disable gui windows for debug by default.
2024-03-11 09:40:52 +08:00
Kunlin You f4ddea6041
flash: support synthesizable flash without SYNTHESIS (#303)
Previously we use synthesizable flash only when SYNTHESIS=1, now we support configuring synthesizable flash just like memory, so we can use it to run workload based on flash.
2024-03-11 09:23:07 +08:00
Kunlin You 260b9cdd24
Add TB_NO_DPIC/SYNTHESIS macros around all DPIC funcs (#298)
We add SYNTHESIS macros around generated DPIC funcs, and TB_NO_DPIC macros around DPIC funcs in fixed vsrc of TB.

With this change, difftest with non-default GatewayConfig can run in both SYNTHESIS or not.
2024-03-05 14:59:58 +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 74613abf27
palladium: add scripts (#286)
Now we release related palladium scripts and user should set PLDM_HOST
for internal information.

We use wildcard for boards occupation in compilerOptions.qel, it can
automatically choose approprate boards count. User can also set it
manully like {boards 0+1.1+1.2}, which means occupy 1 board and 2 extra
domains. It can be estimated by gate count in xe.msg.
2024-02-08 16:30:59 +08:00
Kunlin You f63f678641
palladium.mk: rename RELEASE_WITH_ASSERT to SYNTHESIS (#263)
We will generate same verilog code for both SYNTHESIS/no-SYNTHESIS
version. It should be more simple and clear.
2024-01-22 11:57:30 +08:00
Kunlin You 8673c659f5
Add macros to disable Mem and SimJTAG DPI-C functions (#259)
We add Macros to turn off DPIC on MemRWHelper and SimJTAG without
SYNTHESIS. That means we can reduce number of synchronizations if
needed. The new Macros is defined in palladium.mk by default.

To add build-in decleration of system task for Palladium, we need
to add $.

We declare fwrite in tb_top as Gfifo to reduce synchronizations and
speed up simulation.
2024-01-18 11:24:33 +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
Kunlin You 1e94c8c5d8
Fix palladium.mk (#256)
We remove RANDOMIZE_GARBAGE_ASSIGN and RANDOMIZE_INVALID_ASSIGN
because it will cause many DPIC function to get $random, which slow
the simulation speed.

Move some display and delay declaration inside module, because some
module may sometimes not be used by DUT, declaration in command-line
will cause conflict.
2024-01-17 11:56:45 +08:00
Kunlin You 86b2069c82
Fix PLDM_CXXFLAGS and XMSIM_FLAGS in palladium.mk (#249)
PLDM_CXXFLAGS: add missing + to avoid param overriden
XMSIM_FLAGS: add -PROFTHREAD to support profile for multithread
Ident spaces: modify ident to align
2024-01-16 14:51:58 +08:00
Kunlin You 7c8d499fe9
Rename Async to Deferred, add related macros in Makefile. (#246)
Add non-block DPIC macros to Makefile, enabled by default.

Rename Async to Deferred, because when using only non-block DPIC,
we still need to synchronize at regular intervals. Hardware need to
pause until comparision is done.
It only means synchronization interal is extended, and result may be
deferred. But not turely async. We will try to add related implementation
later. So Hardware no need to wait for Comparison done.

Now we add macros to command line and each vfiles. We will try to gen it
at seperate macros.v later to make it configurable.
2024-01-15 14:44:30 +08:00
Kunlin You 1f6dd8d295
Makefile: support Palladium simulation (#245)
* Makefile,Scripts: support Palladium simulation

To add extra Macros when pldm-build, use PLDM_EXTRA_MACRO="..."
To add extra Args when make pldm-run/pldm-debug, use PLDM_EXTRA_ARGS="..."
Use RELEASE_WITH_ASSERT to specify Palladium simulation without Software.

We will provide default path of PLDM_SCRIPTS_DIR in internal env.sh.
User can copy dir and specify path for its own arguments.
2024-01-13 11:08:31 +08:00