Skip to content

Commit 60bfaf6

Browse files
stridge-cruxmlQuantamHD
authored andcommitted
Change rule attributes from private to allow user customization.
Change a number of the attributes in vivado rules to allow user modification. While the defaults should remain, there are some use cases where modifying these would be desired.
1 parent 5e2ec27 commit 60bfaf6

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

vivado/defs.bzl

+20-20
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def create_and_synth(
188188

189189
return run_tcl_template(
190190
ctx,
191-
ctx.file._create_project_tcl_template,
191+
ctx.file.create_project_tcl_template,
192192
substitutions,
193193
ctx.file.xilinx_env,
194194
all_files + ip_block_dirs,
@@ -230,7 +230,7 @@ vivado_create_project = rule(
230230
doc = "Jobs to pass to vivado which defines the amount of parallelism.",
231231
default = 4,
232232
),
233-
"_create_project_tcl_template": attr.label(
233+
"create_project_tcl_template": attr.label(
234234
doc = "The create project tcl template",
235235
default = "@rules_hdl//vivado:create_project.tcl.template",
236236
allow_single_file = [".template"],
@@ -292,7 +292,7 @@ vivado_synthesize = rule(
292292
doc = "Jobs to pass to vivado which defines the amount of parallelism.",
293293
default = 4,
294294
),
295-
"_create_project_tcl_template": attr.label(
295+
"create_project_tcl_template": attr.label(
296296
doc = "The create project tcl template",
297297
default = "@rules_hdl//vivado:create_project.tcl.template",
298298
allow_single_file = [".template"],
@@ -326,7 +326,7 @@ def _vivado_synthesis_optimize_impl(ctx):
326326

327327
default_info = run_tcl_template(
328328
ctx,
329-
ctx.file._synthesis_optimize_template,
329+
ctx.file.synthesis_optimize_template,
330330
substitutions,
331331
ctx.file.xilinx_env,
332332
[checkpoint_in],
@@ -360,7 +360,7 @@ vivado_synthesis_optimize = rule(
360360
doc = "Threads to pass to vivado which defines the amount of parallelism.",
361361
default = 8,
362362
),
363-
"_synthesis_optimize_template": attr.label(
363+
"synthesis_optimize_template": attr.label(
364364
doc = "The synthesis optimzation tcl template",
365365
default = "@rules_hdl//vivado:synth_optimize.tcl.template",
366366
allow_single_file = [".template"],
@@ -392,7 +392,7 @@ def _vivado_placement_impl(ctx):
392392

393393
default_info = run_tcl_template(
394394
ctx,
395-
ctx.file._placement_template,
395+
ctx.file.placement_template,
396396
substitutions,
397397
ctx.file.xilinx_env,
398398
[checkpoint_in],
@@ -426,7 +426,7 @@ vivado_placement = rule(
426426
doc = "Threads to pass to vivado which defines the amount of parallelism.",
427427
default = 8,
428428
),
429-
"_placement_template": attr.label(
429+
"placement_template": attr.label(
430430
doc = "The placement tcl template",
431431
default = "@rules_hdl//vivado:placement.tcl.template",
432432
allow_single_file = [".template"],
@@ -458,7 +458,7 @@ def _vivado_place_optimize_impl(ctx):
458458

459459
default_info = run_tcl_template(
460460
ctx,
461-
ctx.file._place_optimize_template,
461+
ctx.file.place_optimize_template,
462462
substitutions,
463463
ctx.file.xilinx_env,
464464
[checkpoint_in],
@@ -492,7 +492,7 @@ vivado_place_optimize = rule(
492492
doc = "Threads to pass to vivado which defines the amount of parallelism.",
493493
default = 8,
494494
),
495-
"_place_optimize_template": attr.label(
495+
"place_optimize_template": attr.label(
496496
doc = "The placement tcl template",
497497
default = "@rules_hdl//vivado:place_optimize.tcl.template",
498498
allow_single_file = [".template"],
@@ -540,7 +540,7 @@ def _vivado_routing_impl(ctx):
540540

541541
default_info = run_tcl_template(
542542
ctx,
543-
ctx.file._route_template,
543+
ctx.file.route_template,
544544
substitutions,
545545
ctx.file.xilinx_env,
546546
[checkpoint_in],
@@ -574,7 +574,7 @@ vivado_routing = rule(
574574
doc = "Threads to pass to vivado which defines the amount of parallelism.",
575575
default = 8,
576576
),
577-
"_route_template": attr.label(
577+
"route_template": attr.label(
578578
doc = "The placement tcl template",
579579
default = "@rules_hdl//vivado:route.tcl.template",
580580
allow_single_file = [".template"],
@@ -601,7 +601,7 @@ def _vivado_write_bitstream_impl(ctx):
601601

602602
default_info = run_tcl_template(
603603
ctx,
604-
ctx.file._write_bitstream_template,
604+
ctx.file.write_bitstream_template,
605605
substitutions,
606606
ctx.file.xilinx_env,
607607
[checkpoint_in],
@@ -627,7 +627,7 @@ vivado_write_bitstream = rule(
627627
doc = "Threads to pass to vivado which defines the amount of parallelism.",
628628
default = 8,
629629
),
630-
"_write_bitstream_template": attr.label(
630+
"write_bitstream_template": attr.label(
631631
doc = "The write bitstream tcl template",
632632
default = "@rules_hdl//vivado:write_bitstream.tcl.template",
633633
allow_single_file = [".template"],
@@ -722,7 +722,7 @@ def _xsim_test_impl(ctx):
722722

723723
_, vivado_log, vivado_journal = run_tcl_template(
724724
ctx,
725-
ctx.file._xsim_test_template,
725+
ctx.file.xsim_test_template,
726726
substitutions,
727727
ctx.file.xilinx_env,
728728
all_files,
@@ -781,7 +781,7 @@ xsim_test = rule(
781781
mandatory = True,
782782
allow_single_file = [".sh"],
783783
),
784-
"_xsim_test_template": attr.label(
784+
"xsim_test_template": attr.label(
785785
doc = "The tcl template to run on vivado.",
786786
default = "@rules_hdl//vivado:xsim_test.tcl.template",
787787
allow_single_file = [".template"],
@@ -843,7 +843,7 @@ def _vivado_create_ip_impl(ctx):
843843
encrypt_content, encrypted_files, post_processing_command = generate_encrypt_tcl(
844844
ctx,
845845
all_files,
846-
ctx.file._keyfile.path,
846+
ctx.file.keyfile.path,
847847
ip_src_dir,
848848
)
849849
outputs += encrypted_files
@@ -866,10 +866,10 @@ def _vivado_create_ip_impl(ctx):
866866

867867
ip_block_outputs = run_tcl_template(
868868
ctx,
869-
ctx.file._create_ip_block_template,
869+
ctx.file.create_ip_block_template,
870870
substitutions,
871871
ctx.file.xilinx_env,
872-
all_files + [ctx.file._keyfile],
872+
all_files + [ctx.file.keyfile],
873873
outputs,
874874
post_processing_command,
875875
)
@@ -922,12 +922,12 @@ vivado_create_ip = rule(
922922
mandatory = True,
923923
allow_single_file = [".sh"],
924924
),
925-
"_create_ip_block_template": attr.label(
925+
"create_ip_block_template": attr.label(
926926
doc = "The create project tcl template",
927927
default = "@rules_hdl//vivado:create_ip_block.tcl.template",
928928
allow_single_file = [".template"],
929929
),
930-
"_keyfile": attr.label(
930+
"keyfile": attr.label(
931931
doc = "The keyfile to use when optionally encrypting",
932932
default = "@rules_hdl//vivado:xilinx_keyfile.txt",
933933
allow_single_file = [".txt"],

0 commit comments

Comments
 (0)