Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions vivado/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ def _vivado_synthesis_optimize_impl(ctx):
timing_summary_report = ctx.actions.declare_file("{}_timing.rpt".format(ctx.label.name))
util_report = ctx.actions.declare_file("{}_util.rpt".format(ctx.label.name))
drc_report = ctx.actions.declare_file("{}_drc.rpt".format(ctx.label.name))
if ctx.attr.with_probes:
probes_file = ctx.actions.declare_file("{}.ltx".format(ctx.label.name))
probes_file_path = probes_file.path
else:
probes_file = None
probes_file_path = ""

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

Expand All @@ -330,12 +336,15 @@ def _vivado_synthesis_optimize_impl(ctx):
"{{CHECKPOINT_OUT}}": synth_checkpoint.path,
"{{DRC_REPORT}}": drc_report.path,
"{{OPT_DIRECTIVE}}": ctx.attr.opt_directive,
"{{PROBES_FILE}}": probes_file_path,
"{{THREADS}}": "{}".format(ctx.attr.threads),
"{{TIMING_REPORT}}": timing_summary_report.path,
"{{UTIL_REPORT}}": util_report.path,
}

outputs = [synth_checkpoint, timing_summary_report, util_report, drc_report]
if ctx.attr.with_probes:
outputs.append(probes_file)

default_info = run_tcl_template(
ctx,
Expand Down Expand Up @@ -372,6 +381,10 @@ vivado_synthesis_optimize = rule(
doc = "Threads to pass to vivado which defines the amount of parallelism.",
default = 8,
),
"with_probes": attr.bool(
doc = "Create debug probes.",
default = False,
),
"xilinx_env": attr.label(
doc = "A shell script to source the vivado environment and " +
"point to license server",
Expand Down
3 changes: 3 additions & 0 deletions vivado/synth_optimize.tcl.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ opt_design -directive {{OPT_DIRECTIVE}}
report_timing_summary -file {{TIMING_REPORT}}
report_utilization -file {{UTIL_REPORT}}
report_drc -file {{DRC_REPORT}}
if {"{{PROBES_FILE}}" != ""} {
write_debug_probes {{PROBES_FILE}}
}
write_checkpoint -force {{CHECKPOINT_OUT}}