Skip to content

Commit 544ab6b

Browse files
authored
Merge pull request hdl#307 from hdl/die_shot
Add an option in OpenROAD to export a die shot.
2 parents ab762a3 + 856fa76 commit 544ab6b

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

place_and_route/build_defs.bzl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ place_and_route = rule(
9090
"core_padding_microns": attr.int(
9191
mandatory = True,
9292
),
93+
"create_die_shot": attr.bool(
94+
default = False,
95+
doc = "Exports a die shot image of the design. This requires qt support.",
96+
),
9397
"density_fill_config": attr.label(
9498
allow_single_file = True,
9599
),
@@ -114,6 +118,10 @@ place_and_route = rule(
114118
default = "0.69",
115119
doc = "When performing global placement this is how densely our cells should be packaged on the die parameter is (0-1]",
116120
),
121+
"qt_qpa_platform": attr.string(
122+
default = "minimal",
123+
doc = "The qt platform to use with OpenROAD.",
124+
),
117125
"sdc": attr.label(
118126
allow_single_file = True,
119127
),

place_and_route/open_road.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ def openroad_command(ctx, commands, input_db = None, step_name = None, inputs =
256256
tools = tool_inputs,
257257
input_manifests = input_manifests,
258258
env = {
259+
"QT_QPA_PLATFORM": ctx.attr.qt_qpa_platform,
259260
"TCL_LIBRARY": openroad_runfiles_dir + "/tk_tcl/library",
260261
},
261262
execution_requirements = execution_requirements,

place_and_route/private/benchmark.bzl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,20 @@ def benchmark(ctx, open_road_info):
4242
"report_cell_usage",
4343
]
4444

45+
cmd_outputs = []
46+
47+
if ctx.attr.create_die_shot:
48+
image_file = ctx.actions.declare_file(ctx.label.name + "_die.png")
49+
open_road_commands.append("save_image -width 2048 {out}".format(out = image_file.path))
50+
cmd_outputs.append(image_file)
51+
4552
command_output = openroad_command(
4653
ctx,
4754
commands = open_road_commands,
4855
input_db = open_road_info.output_db,
4956
inputs = inputs,
5057
step_name = "benchmark",
58+
outputs = cmd_outputs,
5159
)
5260

5361
benchmark_file = ctx.actions.declare_file(ctx.label.name + "_report.textproto")
@@ -87,7 +95,7 @@ def benchmark(ctx, open_road_info):
8795
commands = open_road_commands,
8896
input_files = depset(inputs),
8997
output_db = command_output.db,
90-
logs = depset([command_output.log_file, benchmark_file]),
98+
logs = depset([command_output.log_file, benchmark_file] + cmd_outputs),
9199
)
92100

93101
return merge_open_road_info(open_road_info, current_action_open_road_info)

0 commit comments

Comments
 (0)