Skip to content

Commit d89ca8b

Browse files
authored
Add support for creating the debug probes '.ltx' file (#413)
* Add debug probes * Fix bug. * Fix lint.
1 parent 97e078d commit d89ca8b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

vivado/defs.bzl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,12 @@ def _vivado_synthesis_optimize_impl(ctx):
322322
timing_summary_report = ctx.actions.declare_file("{}_timing.rpt".format(ctx.label.name))
323323
util_report = ctx.actions.declare_file("{}_util.rpt".format(ctx.label.name))
324324
drc_report = ctx.actions.declare_file("{}_drc.rpt".format(ctx.label.name))
325+
if ctx.attr.with_probes:
326+
probes_file = ctx.actions.declare_file("{}.ltx".format(ctx.label.name))
327+
probes_file_path = probes_file.path
328+
else:
329+
probes_file = None
330+
probes_file_path = ""
325331

326332
checkpoint_in = ctx.attr.checkpoint[VivadoSynthCheckpointInfo].checkpoint
327333

@@ -330,12 +336,15 @@ def _vivado_synthesis_optimize_impl(ctx):
330336
"{{CHECKPOINT_OUT}}": synth_checkpoint.path,
331337
"{{DRC_REPORT}}": drc_report.path,
332338
"{{OPT_DIRECTIVE}}": ctx.attr.opt_directive,
339+
"{{PROBES_FILE}}": probes_file_path,
333340
"{{THREADS}}": "{}".format(ctx.attr.threads),
334341
"{{TIMING_REPORT}}": timing_summary_report.path,
335342
"{{UTIL_REPORT}}": util_report.path,
336343
}
337344

338345
outputs = [synth_checkpoint, timing_summary_report, util_report, drc_report]
346+
if ctx.attr.with_probes:
347+
outputs.append(probes_file)
339348

340349
default_info = run_tcl_template(
341350
ctx,
@@ -372,6 +381,10 @@ vivado_synthesis_optimize = rule(
372381
doc = "Threads to pass to vivado which defines the amount of parallelism.",
373382
default = 8,
374383
),
384+
"with_probes": attr.bool(
385+
doc = "Create debug probes.",
386+
default = False,
387+
),
375388
"xilinx_env": attr.label(
376389
doc = "A shell script to source the vivado environment and " +
377390
"point to license server",

vivado/synth_optimize.tcl.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ opt_design -directive {{OPT_DIRECTIVE}}
55
report_timing_summary -file {{TIMING_REPORT}}
66
report_utilization -file {{UTIL_REPORT}}
77
report_drc -file {{DRC_REPORT}}
8+
if {"{{PROBES_FILE}}" != ""} {
9+
write_debug_probes {{PROBES_FILE}}
10+
}
811
write_checkpoint -force {{CHECKPOINT_OUT}}

0 commit comments

Comments
 (0)