File tree Expand file tree Collapse file tree 4 files changed +45
-4
lines changed Expand file tree Collapse file tree 4 files changed +45
-4
lines changed Original file line number Diff line number Diff line change 15
15
"""File encapsulating the open road command"""
16
16
17
17
load ("//pdk:open_road_configuration.bzl" , "get_open_road_configuration" )
18
- load ("//synthesis:defs.bzl" , "SynthesisInfo" )
18
+ load ("//synthesis:defs.bzl" , "SynthesisInfo" , "SdcInfo" )
19
19
20
20
OpenRoadInfo = provider (
21
21
"Provider to support running openroad outside of bazel" ,
@@ -100,7 +100,9 @@ def clock_commands(ctx):
100
100
Returns:
101
101
Struct with params inputs and commands. Both return values are lists.
102
102
"""
103
- sdc = ctx .file .sdc
103
+ sdc = None
104
+ if SdcInfo in ctx .attr .sdc :
105
+ sdc = ctx .attr .sdc [SdcInfo ].sdc .files .to_list ()[0 ]
104
106
105
107
if sdc :
106
108
return struct (inputs = [sdc ], commands = ["read_sdc {}" .format (sdc .path )])
Original file line number Diff line number Diff line change @@ -443,3 +443,32 @@ Example:
443
443
attrs = benchmark_synth_attrs ,
444
444
executable = True ,
445
445
)
446
+
447
+ SdcInfo = provider (
448
+ doc = "sdc" ,
449
+ fields = {
450
+ "sdc" : "Path to the SDC file" ,
451
+ }
452
+ )
453
+
454
+ def _sdc_library_impl (ctx ):
455
+ return [
456
+ DefaultInfo (
457
+ files = depset (transitive = [t .files for t in ctx .attr .srcs ])
458
+ ),
459
+ SdcInfo (
460
+ sdc = ctx .attr .srcs [0 ]
461
+ )
462
+ ]
463
+
464
+ sdc_library = rule (
465
+ doc = "Define an SDC library." ,
466
+ implementation = _sdc_library_impl ,
467
+ attrs = {
468
+ "srcs" : attr .label_list (
469
+ doc = "SDC sources." ,
470
+ allow_files = [".sdc" ],
471
+ ),
472
+ },
473
+ )
474
+
Original file line number Diff line number Diff line change 8
8
_benchmark_synth = "benchmark_synth" ,
9
9
_synthesis_binary = "synthesis_binary" ,
10
10
_synthesize_rtl = "synthesize_rtl" ,
11
+ _sdc_library = "sdc_library" ,
12
+ _SdcInfo = "SdcInfo"
11
13
)
12
14
13
15
benchmark_synth = _benchmark_synth
@@ -16,3 +18,6 @@ synthesis_binary = _synthesis_binary
16
18
SynthesisInfo = _SynthesisInfo
17
19
synthesize_rtl = _synthesize_rtl
18
20
UhdmInfo = _UhdmInfo
21
+ SdcInfo = _SdcInfo
22
+ sdc_library = _sdc_library
23
+
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ load("//flows:basic_asic.bzl", "basic_asic_flow")
19
19
load ("//gds_write:build_defs.bzl" , "gds_write" )
20
20
load ("//place_and_route:build_defs.bzl" , "place_and_route" )
21
21
load ("//static_timing:build_defs.bzl" , "run_opensta" )
22
- load ("//synthesis:defs.bzl" , "synthesize_rtl" )
22
+ load ("//synthesis:defs.bzl" , "synthesize_rtl" , "sdc_library" )
23
23
load ("//verilog:defs.bzl" , "verilog_library" )
24
24
25
25
package (
@@ -78,14 +78,19 @@ place_and_route(
78
78
synthesized_rtl = ":verilog_adder-synth" ,
79
79
)
80
80
81
+ sdc_library (
82
+ name = "constraint" ,
83
+ srcs = ["constraint.sdc" ]
84
+ )
85
+
81
86
place_and_route (
82
87
name = "verilog_counter-place_and_route" ,
83
88
clock_period = "10" ,
84
89
core_padding_microns = 20 ,
85
90
die_height_microns = 200 ,
86
91
die_width_microns = 200 ,
87
92
placement_density = "0.7" ,
88
- sdc = "constraint.sdc " ,
93
+ sdc = ": constraint" ,
89
94
synthesized_rtl = ":verilog_counter-synth" ,
90
95
)
91
96
You can’t perform that action at this time.
0 commit comments