Commit Graph

59 Commits

Author SHA1 Message Date
Song Fangyuan 8d8e9beb1d
feat: improve VCS waveform, coverage, and modern Verdi support (#94)
* (fix): artifacts patch

* (fix) vcs waveform: support fsdb rename and flush

* (update) yaml-cpp: move to dependence and bump to 0.9.0

* (remove) third: drop unused type_safe

* (update) slang: bump default tag to v11.0

* (update) yaml-cpp: fetch dependency during init

* (fix) vcs coverage: add runtime save control

* fix: update VCS coverage control flow

* fix: make VCS finish safe for host process

* fix: stabilize VCS coverage export

* fix: support modern Verdi integration for VCS

* example: unify output paths and add per-example test targets

* fix: resolve xspcomm from picker path in mem_direct template

---------

Co-authored-by: Makiras <22570332+Makiras@users.noreply.github.com>
2026-07-07 17:48:32 +08:00
Tim Sandner 7d336d5367 Fixed portability by making import linux only
Fixed variable might be undefined causing warning
2026-06-04 10:28:09 +08:00
Tim Sandner 76114708ff fix: disable ASLR when loading VCS simulator library 2026-06-04 10:28:09 +08:00
yichun 301c403754 UVS support in picker (phase 1) 2026-05-12 14:06:51 +08:00
Makiras e3eab27451 feat(lib): add atClone hook for post-fork state re-initialization
Add a new `atClone()` method to the simulation core and expose it through all language bindings.

This method is intended to be called in a child process after a fork() to re-initialize the state of the Verilated model. This is crucial for supporting robust multi-process simulation environments, such as Python's `multiprocessing`, where forking can lead to an inconsistent state in the simulator's child instances.

Additionally, this commit includes several stability and memory management improvements:
- Fix memory leaks in `DutUnifiedBase` and the C++ wrapper by ensuring allocated resources are properly deallocated.
- Add a null-pointer check in `FlushWaveform` to prevent crashes when a waveform dumper is not present.
- Expose the `atClone` functionality to C++, Go, Java, Lua, Python, and Scala wrappers.
2026-01-29 17:07:30 +08:00
Makiras 4ffb85b2ee Defer Verilator waveform pause until dumper exists 2026-01-29 17:07:30 +08:00
FrankOu 94a5dbcd61 fix(dut_base): Add missing `cstring` for dut_base.cpp 2025-12-04 18:04:53 +08:00
J. Wang 4b5842336d
Add support for macOS (#64)
Add support for macOS:

* bugfix(exprtk): Upgrade verison of exprtk to fix compile error in clang.

* refact: Remove `bits/stdc++.h` and move `src/codegen/cpp.cpp::replace_all` to `include/picker.hpp::str_replace_all`

* feat: Use `dlopen` for non-linux platform.

* fix: Add missing headers

* fix(nproc): Fix bug of missing `nproc` in MacOS

* refactor(python): Adapt python template to macOS

* refactor(mem_direct): Adapt mem_direct template to macOS

* refactor(lib_suffix): Add shared library suffix in code generator

* refactor(dut_base.cpp): Use code generator to set library suffix

* add(cpp): Add cpp support for macOS

* add(java): Add java support for macOS

* refactor(nproc): Set $NPROC to support macOS

* fix(parser/sv): Add missing header file `unordered_set`

* fix(python_macos): fix the wrong suffix of module-type library

* refactor(codegen/lib): generator template use absolute path

* fix(mem_direct): fix link error in macOS

* feat: Use LLVM Clang to compile instead of AppleClang

* feat(golang): Add golang support for macOS

* fix(rpath): fix CMAKE_BUILD_RPATH for macOS

* feat(lua): Add lua support for macOS

* fix(scala): Fix wrong use of static method in scala

* feat(scala): Add scala support for macOS

* refactor(cmake): Upgrade cmake version to 3.15

* feat(doc): Add doc about installing picker on macOS
2025-11-03 10:38:10 +08:00
FrankOu2001 bc3570eaaa refactor: Enhance waveform export and rename APIs
- Store waveform and coverage export settings in the DUT class.
- **BREAKING CHANGE**: Renamed waveform control APIs to clarify pause/resume semantics:
  - `OpenWaveform` -> `ResumeWaveformDump`
  - `CloseWaveform` -> `PauseWaveformDump`
  - `WaveformClosed` -> `WaveformPaused`
- Fix syntax error in `template/mem_direct/Makefile`.
2025-09-04 15:38:35 +08:00
Zhicheng 0063b63f58
Add backend simulator GSIM support (#50)
New features:

- add firrtl parser
- add gsim example
- support gsim complete
- support internal signal parse for gsim
- test gsim Nutshell success
- readme: update gsim info

---------
Co-authored-by: Makiras <xieyunlonglong@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-13 15:16:15 +08:00
Makiras b3da72f4d4 fix typo for \; 2025-06-12 16:08:18 +08:00
Makiras 09bd083451
Fix ptr (#41)
* [fix] quick fix for GetInternalSignal raw ptr to shared_ptr

* [fix] DutUnifiedBase::DutUnifiedBase args initialization for allocate memory
2025-06-10 18:44:25 +08:00
yaozhicheng 7cef2ee866 feat: add Open/CloseWaveform support 2025-04-30 11:23:00 +08:00
yaozhicheng 7e72f73ee4 memdirect: add tag __RW_TYPE__ check 2025-04-30 11:23:00 +08:00
Makiras eb9e31d262 fix: remove in_out render for flat-rw 2025-04-30 11:23:00 +08:00
Makiras 870d8f648b fix: relative path emtpy cause use /
verilator root hardcode, emem_direct rerun logic
2025-04-30 11:23:00 +08:00
Makiras ddce03de56 add CacheSignalCFG example 2025-04-30 11:23:00 +08:00
Makiras 4a7efd9701 feat: verilator direct memory access for internal 2025-04-30 11:23:00 +08:00
yaozhicheng 959e732824 dut_base: include V{module}_root.h directly in verilartor mode 2025-04-30 11:23:00 +08:00
yaozhicheng 2fd3ad19db native signal: fix typo & refine native_signal_t 2025-04-30 11:23:00 +08:00
yaozhicheng bac81768d5 native: support native signal for python 2025-04-30 11:23:00 +08:00
Makiras cf35240762 refact: passthrough C pointer Step() to xcomm XClock() instead of python wrapper 2025-04-30 11:23:00 +08:00
Makiras 7dc100a6c0 refact: combine WaveformOn/Off to WaveformEnable(bool)
add -O3 for verilator simulation
2025-01-08 11:35:10 +08:00
yaozhicheng 47f8e6faec dut: add WaveformOn/Off support for verilator 2025-01-08 11:35:10 +08:00
yaozhicheng 6345d3057c vpi: ignore error prefix 2025-01-08 11:35:10 +08:00
Makiras 8e130d9c26 fix: vcs methods and vpi access control 2025-01-08 11:35:10 +08:00
Makiras 20fc335844 fix: missing vpi callback for RefreshComb 2025-01-08 11:35:10 +08:00
Makiras 7b70577b45 feat: add FlushWaveForm() to write wave immediately, for debugger
add doc: API statement
2025-01-08 11:35:10 +08:00
Makiras c2ac1e2bf3 bug fix: missing verilator vpi::callValueCbs, update README.md 2025-01-08 11:35:10 +08:00
Makiras 6071bbb72b feat: add new options --vpi, --checkpoints for features control
--vpi: enable internal signal access
--checkpoints: using simulator capabilities for save/restore module status
2025-01-08 11:35:10 +08:00
Makiras 69f2b59bd0 fix: compiling warning for constant string to char* 2025-01-08 11:35:10 +08:00
Makiras 3aa0b3ccae feat: add vpi functions export and internal signal iteration list 2025-01-08 11:35:10 +08:00
yaozhicheng 8042ce019d dut args: extend more space for VCS 2024-11-21 13:35:26 +08:00
yaozhicheng ef0b75ba13 VCS: call in dut.Finish 2024-11-19 16:49:41 +08:00
yaozhicheng b8f448cb57 add env ENABLE_XINFO=1/0 to turn on/off XInfo 2024-10-23 13:11:46 +08:00
Makiras 4dfe6e2b05 bug fix: VecString processing 2024-08-13 10:35:24 +08:00
Makiras d8ef598539 fix missing contexp pointer in DutVerilatorBase::Finish while VL_COVERAGE NOT defined 2024-07-31 16:41:33 +08:00
Makiras 8bc476c364 bug fix: memory and threads leak on DutVerilatorBase, forget to delete the VerilatedContext* 2024-07-30 13:57:16 +08:00
yaozhicheng e8df27a2be refine: add PK_/X prefix to info/message/error/fatal 2024-07-29 07:24:59 +00:00
Makiras 98d467d317 optimize argc and argv passage, auto detect whether the argv[0] is filename or args 2024-07-25 06:58:51 +00:00
Makiras 35898bdf59 bug fix: string need c_str in strcpy 2024-07-25 03:05:39 +00:00
Makiras 71fbafff83 add vector<string> for DUT initialize 2024-07-24 09:04:18 +00:00
Makiras b905acf43e fix VCS for cpp 2024-07-17 10:34:01 +08:00
yaozhicheng 772cd9efe8 uniform mk 2024-07-17 10:34:01 +08:00
yaozhicheng 3f857c4dbb refine user APIs 2024-07-17 10:34:01 +08:00
Makiras 9020e0cce0 add string for SetWaveform/Coverage 2024-07-17 10:34:01 +08:00
Makiras b032392421 add std::String for GetDPIHandle 2024-07-17 10:34:01 +08:00
Makiras 33e7314c73 refactor libDUT init function 2024-07-17 10:34:01 +08:00
Makiras a777499620 optimize multi-instance with hash DPI func name
also add dlclose to release namespace and flag to reuse main namespace
2024-07-17 10:34:01 +08:00
Makiras 7cdd8d576c refacted DutUnifiedBase without inhert and change dlmopen abstract level
due to dlmopen DPI library is simulator-related, we choose to dlmopen whole libUT.so without simulator-related code
2024-07-17 10:34:01 +08:00