Commit Graph

133 Commits

Author SHA1 Message Date
Makiras 382d0578fa perf: optimize XData/XPort hot paths
- Short-circuit shadow updates when no callbacks; baseline on first OnChange

- Use memcmp/memcpy for write-compare shadowing

- Add XPort hot iteration vector for write/read paths

- Move XClock callback assert to registration

- Fix XData ReInit memory cleanup and validate bval across words

- Document optimization rationale and correctness fixes
2026-01-26 07:17:09 +00:00
Makiras aaa29408ac optimize(cond/expr/fsm): cut per-cycle overhead
- CondCheck uses unordered index + vector scan and pre-bound compare fns
- Expr eval reuses buffers and uses list+index for faster lookup/trigger bookkeeping
- FSM actions keep DSL order with pre-bound exec callbacks to avoid switch
- Add fast-path returns and avoid aborts on expr/fsm parse failures
2026-01-25 06:58:43 +00:00
Makiras 43d1b2f428 feat(test): Add comprehensive test suite and fix bugs
This commit introduces the Catch2 testing framework and adds a suite of
unit tests for core components, significantly improving code quality and
verifying correctness.

- Add tests for , covering step callbacks, condition
  checking, and data array manipulation.
- Add tests for , validating arithmetic, logical operations,
  and temporal functions like  and .
- Add tests for  to verify state transitions and triggers.
- Integrate tests into the build system with CMake and CTest.

This commit also includes the following fixes and enhancements:
- Fix a bug in .
- Add  correctness to .
- Expose , , and  to SWIG bindings.
2026-01-23 11:08:14 +08:00
Makiras a391e6db63 feat: Split xcomm trigger logic into base/expr/fsm, add FSM/expr parsing, and fix XData static constants linker issue 2026-01-22 11:05:04 +08:00
FrankOu 2b6818522b fix(nullptr_t): Fix bug of compile error in clang20 2025-11-02 12:08:14 +08:00
yaozhicheng 1a30ce5319 fix GSIM xclock step 2025-08-03 00:00:12 +08:00
yaozhicheng 78a7de66b1 feat: support only step ris/fail in fast mode 11/12 2025-07-31 11:10:42 +08:00
yaozhicheng fe4e0628f1 add assert in XPort get 2025-06-27 09:10:48 +08:00
yaozhicheng 208f41deb6 fix picker#39: use shared_ptr<XData> to relpace XData* 2025-05-23 14:38:00 +08:00
yaozhicheng fbe9ad80d8 new feat(comuse): add As uint64 to xfunc 2025-04-30 11:06:17 +08:00
yaozhicheng b807ba87d0 new feat(comuse): add CString 2025-04-30 11:06:17 +08:00
yaozhicheng a86e1a0568 refine(comuse): add _valcmp(bigint cmp) to reaplace memcmp 2025-04-30 11:06:17 +08:00
yaozhicheng 7e06251980 feat(comuse): add SetValidCmpMode/GetValidCmpMode for ComUseCondCmp 2025-04-30 11:06:17 +08:00
yaozhicheng 11118c297a comuse(fix): fix CbCount useage 2025-04-02 15:30:01 +08:00
yaozhicheng 24b5cfcc4d comuse: add ComUseRangeCheck 2025-04-02 15:30:01 +08:00
yaozhicheng 1f5615f3c9 comuse(feat): add cmp func arg for ComUseCondCheck 2025-04-02 15:30:01 +08:00
yaozhicheng 576bb09c0d ComUseStepCb(feat): add Reset 2025-04-02 15:30:01 +08:00
yaozhicheng a5f89bbe0a comuse(add): add SetUxArray functions 2025-03-26 14:08:41 +08:00
yaozhicheng a0fb1faba8 XSignalCFG(feat): support map-structed yaml (spend less space) 2025-03-24 14:34:13 +08:00
yaozhicheng d6ee255349 ComUseCondCheck: add valid_bytes to SetCondition 2025-03-24 14:34:13 +08:00
yaozhicheng 4303fb649b comuse: refine ComUseDataArray 2025-03-24 14:34:13 +08:00
yaozhicheng 6f3f1ae6b2 comuse: add ComUseDataArray 2025-03-24 14:34:13 +08:00
yaozhicheng 9acacd88d0 xclock: add RemoveStepXCbsX 2025-03-24 14:34:13 +08:00
yaozhicheng 64a2541136 ComUseCondCheck: add func ListCondition 2025-03-24 14:34:13 +08:00
yaozhicheng 35a0767c54 comuse: add ComUseCondCheck and test 2025-03-24 14:34:13 +08:00
yaozhicheng 82ab9df0b3 xdata: add cmp and test 2025-03-24 14:34:13 +08:00
yaozhicheng 0b6cd48af1 xclock: add disable/enable step 2025-03-24 14:34:13 +08:00
yaozhicheng ff44977c14 GetFromUxArray/UxPtrAsU64: use raw type ptr 2025-03-24 14:34:13 +08:00
yaozhicheng bfceca1c8b comuse: add GetFromUxArray && PtrAsU64 2025-03-24 14:34:13 +08:00
yaozhicheng d23f1e1985 refine: use class imp ComUse* functions 2025-03-24 14:34:13 +08:00
yaozhicheng 72035f68d4 new feat: add common use function xdata echo char 2025-03-24 14:34:13 +08:00
yaozhicheng 7a0db43e23 new feat: add xname to xsignal_cfg 2025-03-24 14:34:13 +08:00
yaozhicheng 6ac5905eb7 XSignalCFG: fix typo 2025-03-24 14:34:13 +08:00
yaozhicheng 126e217d56 s_xsignal_cfg: add is_empty attr 2025-03-24 14:34:13 +08:00
yaozhicheng b767ff8d39 new XSignalCFG: support internal cfg signales 2025-03-24 14:34:13 +08:00
yaozhicheng 3d8139201a feature: adder yaml header 2025-03-24 14:34:13 +08:00
yaozhicheng d012103d46 refine: set default log level to info 2025-03-24 14:34:13 +08:00
yaozhicheng 9d36d4690f xdata: new func BindNativeData 2025-03-24 14:34:13 +08:00
yaozhicheng 01f4199a7d xdata: add OnchangeCbs check 2025-03-24 14:34:13 +08:00
yaozhicheng be770ccfcb xclock: extend fast_mode_level to 3 (support 0, 1, 2, 3) 2025-01-09 16:39:48 +08:00
yaozhicheng 006f387089 xport: add AsImm/Rise/FalWrite() 2025-01-09 16:28:34 +08:00
yaozhicheng 48e35cd7af xclock: change FastMode -> SetFastMode 2025-01-09 15:29:56 +08:00
yaozhicheng c558323afd xclock: add func FastMode/IsFastMode 2025-01-08 23:46:25 +08:00
yaozhicheng 9ecf547427 xclock: add TEST_get_u64* 2025-01-08 12:00:14 +08:00
yaozhicheng 20326f3df3 Add new func: CSelf, return uint64 value of this 2025-01-07 16:26:37 +08:00
yaozhicheng aadeef7349 xclock: add uint64 prt Ris/Fal cbs 2025-01-07 16:21:07 +08:00
yaozhicheng 861c302c4a xclock: add uint64 stepfunc ptr support 2025-01-07 15:58:07 +08:00
yaozhicheng 37f5a937b2 vpi: add VPI_TIME and VPI_VECVAL check 2024-12-27 17:55:26 +08:00
yaozhicheng a9295da414 xdata: add func SetVPIWriteFlag 2024-12-27 11:00:50 +08:00
yaozhicheng e48bd85bfd vpi: add force & release statement 2024-12-27 11:00:23 +08:00