Skip to content

Commit b32201c

Browse files
committed
[wip] vcs/defs: Added options for fsdb
Signed-off-by: Jan Bylicki <[email protected]>
1 parent e4b5044 commit b32201c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

common/providers.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ WaveformInfo = provider(
1818
doc = "Waveform collected during a simulation run",
1919
fields = {
2020
"vcd_files": "VCD waveform files",
21+
"fsdb_files": "FSDB waveform files",
2122
"vpd_files": "VPD waveform files",
2223
},
2324
)

vcs/defs.bzl

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ def _vcs_binary(ctx):
143143
command += " -top " + ctx.attr.module_top
144144
command += " -debug_access -debug_region=cell+encrypt +v2k"
145145
command += " +vcs+vcdpluson"
146+
command += " -kdb"
147+
146148

147149
for opt in ctx.attr.opts:
148150
command += " " + opt
@@ -319,10 +321,23 @@ def _vcs_run(ctx):
319321
args.append("+vcs+dumpon+0+0")
320322
args.append("+vcs+dumparrays")
321323

322-
outputs += trace_vcd + trace_vpd
324+
trace_fsdb = []
325+
if ctx.attr.trace_fsdb:
326+
file = ctx.actions.declare_file("{}.fsdb".format(ctx.label.name))
327+
trace_fsdb.append(file)
328+
args.append("+fsdb=" + file.path)
329+
args.append("+vcs+dumparrays")
330+
args.append("+vcs+dumparrays")
331+
args.append("-kdb")
332+
args.append("-error=noTLVRZ")
333+
args.append("-suppress=SVA-UB")
334+
335+
336+
outputs += trace_vcd + trace_vpd + trace_fsdb
323337
result.append(WaveformInfo(
324338
vpd_files = depset(trace_vpd),
325339
vcd_files = depset(trace_vcd),
340+
fsdb_files = depset(trace_fsdb),
326341
))
327342

328343
# Binary runfiles
@@ -434,6 +449,10 @@ vcs_run = rule(
434449
doc = "Enable trace output in VCD format",
435450
default = False,
436451
),
452+
"trace_fsdb": attr.bool(
453+
doc = "Enable trace output in FSDB format",
454+
default = False,
455+
),
437456
"trace_vpd": attr.bool(
438457
doc = "Enable trace output in VPD format",
439458
default = False,

0 commit comments

Comments
 (0)