feat: 集成 waveform_trace 波形调试工具

新增功能:
- waveformTracer.ts: 调用 waveform_trace.exe 的工具实现
- toolExecutor.ts: 添加 waveform_trace 工具分发
- types/api.ts: 添加 WaveformTraceArgs 类型定义

工具源码 (tools/waveform_trace/src/):
- AST 解析 + BFS 信号追踪
- VCD 波形解析
- 修复通用 testbench 支持

配置文件:
- .gitignore: 排除 exe 和打包产物
- .vscodeignore: 发布时排除源码
- build.bat/build.sh: 打包脚本
This commit is contained in:
XiaoFeng
2026-01-05 18:18:57 +08:00
parent e48e822d07
commit ada4806493
173 changed files with 57092 additions and 4 deletions

View File

@ -0,0 +1,8 @@
.PHONY: clean
clean:
make clean -C ./utils
make clean -C ./vparser
make clean -C ./dataflow
make clean -C ./controlflow
make clean -C ./ast_code_generator
rm -rf *.pyc __pycache__ *.out parsetab.py *.html

View File

@ -0,0 +1 @@
1.3.0

View File

@ -0,0 +1,7 @@
from __future__ import absolute_import
from __future__ import print_function
import os
with open(os.path.join(os.path.dirname(__file__), "VERSION")) as f:
__version__ = f.read().splitlines()[0]

View File

@ -0,0 +1,3 @@
.PHONY: clean
clean:
rm -rf *.pyc __pycache__ parsetab.py *.out

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,104 @@
Source
Description
ModuleDef
Paramlist
Portlist
Port
Width
Length
Dimensions
Identifier
Value
Constant
IntConst
FloatConst
StringConst
Variable
Input
Output
Inout
Tri
Wire
Reg
Integer
Real
Genvar
Ioport
Parameter
Localparam
Decl
Concat
LConcat
Repeat
Partselect
Pointer
Lvalue
Rvalue
Operator
UnaryOperator
Uminus
Ulnot
Unot
Uand
Unand
Uor
Unor
Uxor
Uxnor
Power
Times
Divide
Mod
Plus
Minus
Sll
Srl
Sra
LessThan
GreaterThan
LessEq
GreaterEq
Eq
NotEq
Eql
NotEql
And
Xor
Xnor
Or
Land
Lor
Cond
Assign
Always
SensList
Sens
Substitution
BlockingSubstitution
NonblockingSubstitution
IfStatement
ForStatement
WhileStatement
CaseStatement
Case
Block
Initial
WaitStatement
ForeverStatement
DelayStatement
InstanceList
Instance
ParamArg
PortArg
Function
FunctionCall
Task
GenerateStatement
SystemCall
IdentifierScopeLabel
IdentifierScope
Pragma
PragmaEntry
Disable
ParallelBlock
SingleStatement

View File

@ -0,0 +1,3 @@
always @({{ sens_list }}) {{ statement }}

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
assign {{ left }} = {{ right }};

View File

@ -0,0 +1,5 @@
begin{% if scope != '' %} : {{ scope }}{% endif %}
{%- for statement in statements %}
{{ statement }}
{%- endfor %}
end

View File

@ -0,0 +1 @@
{% if ldelay != '' %}{{ ldelay }} {% endif %}{{ left }} = {% if rdelay != '' %}{{ rdelay }} {% endif %}{{ right }};

View File

@ -0,0 +1 @@
{{ cond }}: {{ statement }}

View File

@ -0,0 +1,5 @@
case({{ comp }})
{%- for case in caselist %}
{{ case }}
{%- endfor %}
endcase

View File

@ -0,0 +1,5 @@
casex({{ comp }})
{%- for case in caselist %}
{{ case }}
{%- endfor %}
endcase

View File

@ -0,0 +1 @@
{ {% for item in items %}{{ item }}{% if loop.index < len_items %}, {% endif %}{% endfor %} }

View File

@ -0,0 +1 @@
(({{ cond }})? {{ true_value }} : {{ false_value }})

View File

@ -0,0 +1 @@
{{ value }}

View File

@ -0,0 +1,2 @@
{%- for item in items %}{{ item }}
{%- endfor %}

View File

@ -0,0 +1,3 @@
{% for definition in definitions %}
{{ definition }}
{% endfor %}

View File

@ -0,0 +1 @@
diable {{ name }}

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
@({{ senslist }});

View File

@ -0,0 +1 @@
{{ value }}

View File

@ -0,0 +1 @@
forever {{ statement }}

View File

@ -0,0 +1 @@
for({{ pre }} {{ cond }}; {{ post }}) {{ statement }}

View File

@ -0,0 +1,7 @@
function {{ retwidth }} {{ name }};
{%- for s in statement %}
{{ s }}
{%- endfor %}
endfunction

View File

@ -0,0 +1 @@
{{ name }}({% for arg in args %}{{ arg }}{% if loop.index < len_args %}, {% endif %}{% endfor %})

View File

@ -0,0 +1,4 @@
generate {% for item in items %}{{ item }}{% endfor %}
endgenerate

View File

@ -0,0 +1 @@
genvar {{ name }};

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
{{ scope }}{{ name }}

View File

@ -0,0 +1 @@
{% for scope in scopes %}{{ scope }}{% endfor %}

View File

@ -0,0 +1 @@
{{ name }}{%- if loop != '' %}[{{ loop }}]{%- endif %}.

View File

@ -0,0 +1,5 @@
if({{ cond }}) {{ true_statement }}
{%- if true_statement[-1] != ' ' and true_statement[-1] != '\n' %} {% endif -%}
{%- if true_statement.count('\n') == 0 and false_statement != '' %}
{% endif -%}
{%- if false_statement != '' %}else {{ false_statement }}{% endif -%}

View File

@ -0,0 +1,3 @@
initial {{ statement }}

View File

@ -0,0 +1 @@
inout {% if signed %}signed {% endif %}{% if width != '' %}{{ width }} {% endif %}{{ name }}{% if dimensions != '' %} {{ dimensions }}{% endif %};

View File

@ -0,0 +1 @@
input {% if signed %}signed {% endif %}{% if width != '' %}{{ width }} {% endif %}{{ name }}{% if dimensions != '' %} {{ dimensions }}{% endif %};

View File

@ -0,0 +1,5 @@
{{ name }}{{ array }}
({% for port in portlist %}
{{ port }}{%- if loop.index < len_portlist -%}, {%- endif -%}
{% endfor %}
)

View File

@ -0,0 +1,12 @@
{{ module }}
{%- if len_parameterlist > 0 %}
#({% for param in parameterlist %}
{{ param }}{%- if loop.index < len_parameterlist -%},
{%- endif -%}{% endfor %}
)
{%- endif %}
{%- for instance in instances %}
{{ instance }}{%- if loop.index < len_instances -%},
{%- endif -%}{%- endfor -%};

View File

@ -0,0 +1 @@
{{ value }}

View File

@ -0,0 +1 @@
integer {{ name }};

View File

@ -0,0 +1 @@
{{ first }} {% if second != '' %}{{ second }} {% endif %}{% if signed %}signed {% endif %}{% if width != '' %}{{ width }} {% endif %}{{ name }}{% if dimensions != '' %} {{ dimensions }}{% endif %}

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
{ {% for item in items %}{{ item }}{% if loop.index < len_items %}, {% endif %}{% endfor %} }

View File

@ -0,0 +1 @@
[{{ msb }}:{{ lsb }}]

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
localparam {% if signed %}signed {% endif %}{% if width != '' %}{{ width }} {% endif %}{{ name }} = {{ value }};

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
{{ var }}

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1,14 @@
module {{ modulename }}{% if paramlist != '' %} #
(
{{ paramlist }}
)
{%- endif %}
(
{{ portlist }}
);
{% for item in items %}{{ item }}
{% endfor %}
endmodule

View File

@ -0,0 +1 @@
{% if ldelay != '' %}{{ ldelay }} {% endif %}{{ left }} <= {% if rdelay != '' %}{{ rdelay }} {% endif %}{{ right }};

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
output {% if signed %}signed {% endif %}{% if width != '' %}{{ width }} {% endif %}{{ name }}{% if dimensions != '' %} {{ dimensions }}{% endif %};

View File

@ -0,0 +1,5 @@
fork{% if scope != '' %} : {{ scope }}{% endif %}
{%- for statement in statements %}
{{ statement }}
{%- endfor %}
join

View File

@ -0,0 +1 @@
{%- if paramname != '' -%}.{{ paramname }}({{ argname }}){%- else -%}{{ argname }}{%- endif -%}

View File

@ -0,0 +1 @@
parameter {% if signed %}signed {% endif %}{% if width != '' %}{{ width }} {% endif %}{{ name }} = {{ value }};

View File

@ -0,0 +1,2 @@
{% for param in params %}{{ param }}{% if loop.index < len_params %},
{% endif %}{% endfor %}

View File

@ -0,0 +1 @@
{{ var }}[{{ msb }}:{{ lsb }}]

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
{{ var }}[{{ ptr }}]

View File

@ -0,0 +1 @@
{{ name }}

View File

@ -0,0 +1 @@
{%- if portname != '' -%}.{{ portname }}({{ argname }}){%- else -%}{{ argname }}{%- endif -%}

View File

@ -0,0 +1,2 @@
{% for port in ports %}{{ port }}{% if loop.index < len_ports %},
{% endif %}{% endfor %}

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
(* {{ entry }} *)

View File

@ -0,0 +1 @@
{{ name }}{% if value != '' %} = {{ value }}{% endif %}

View File

@ -0,0 +1 @@
real {{ name }};

View File

@ -0,0 +1 @@
reg {% if signed %}signed {% endif %}{% if width != '' %}{{ width }} {% endif %}{{ name }}{% if dimensions != '' %} {{ dimensions }}{% endif %};

View File

@ -0,0 +1 @@
{ {{ times }}{{ value }} }

View File

@ -0,0 +1 @@
{{ var }}

View File

@ -0,0 +1 @@
{% if type != '' %}{{ type }} {% endif %}{{ sig }}

View File

@ -0,0 +1 @@
{% for item in items %}{{ item }}{% if loop.index < len_items %} or {% endif %}{% endfor %}

View File

@ -0,0 +1 @@
{{ statement }};

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
{{ description }}

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
"{{ value }}"

View File

@ -0,0 +1 @@
{% if ldelay != '' %}{{ ldelay }} {% endif %}{{ left }} = {% if rdelay != '' %}{{ rdelay }} {% endif %}{{ right }};

View File

@ -0,0 +1 @@
${{ syscall }}{% if len_args > 0 %}({% endif %}{% for arg in args %}{{ arg }}{% if loop.index < len_args %}, {% endif %}{% endfor %}{% if len_args > 0 %}){% endif %}

View File

@ -0,0 +1,7 @@
task {{ name }};
{%- for s in statement %}
{{ s }}
{%- endfor %}
endtask

View File

@ -0,0 +1 @@
({{ left }} {{ op }} {{ right }})

View File

@ -0,0 +1 @@
tri {% if signed %}signed {% endif %}{% if width != '' %}{{ width }} {% endif %}{{ name }}{% if dimensions != '' %} {{ dimensions }}{% endif %};

View File

@ -0,0 +1 @@
({{ op }}{{ right }})

View File

@ -0,0 +1 @@
({{ op }}{{ right }})

View File

@ -0,0 +1 @@
({{ op }}{{ right }})

View File

@ -0,0 +1 @@
({{ op }}{{ right }})

Some files were not shown because too many files have changed in this diff Show More