|
| 1 | +load("@bazel-orfs//:openroad.bzl", "orfs_pdk") |
| 2 | + |
| 3 | +# Expose every individual file under platforms/ as a public source-file |
| 4 | +# target, so designs in other packages can refer to e.g. |
| 5 | +# //flow:platforms/asap7/verilog/fakeram7_64x28.sv directly. This is the |
| 6 | +# label form bazel-orfs's config_mk_parser produces for VERILOG_FILES / |
| 7 | +# ADDITIONAL_LEFS / ADDITIONAL_LIBS that point at platform-provided files. |
| 8 | +# Exclude package BUILD files so they aren't claimed as source labels by |
| 9 | +# any future sub-package under platforms/. |
| 10 | +exports_files( |
| 11 | + glob( |
| 12 | + ["platforms/**/*"], |
| 13 | + exclude = [ |
| 14 | + "platforms/**/BUILD", |
| 15 | + "platforms/**/BUILD.bazel", |
| 16 | + ], |
| 17 | + ), |
| 18 | + visibility = ["//visibility:public"], |
| 19 | +) |
| 20 | + |
| 21 | +# Expose synth.tcl as an addressable source label so bazel-orfs can |
| 22 | +# point its `_synth_tcl` attr default at `@orfs//flow:scripts/synth.tcl` |
| 23 | +# instead of vendoring its own (drifting) copy at the bazel-orfs repo |
| 24 | +# root. See bazel-orfs `private/rules.bzl`. |
| 25 | +exports_files( |
| 26 | + ["scripts/synth.tcl"], |
| 27 | + visibility = ["//visibility:public"], |
| 28 | +) |
| 29 | + |
| 30 | +# files shared between scripts/synth.sh and scripts/flow.sh steps |
| 31 | +MAKEFILE_SHARED = [ |
| 32 | + "scripts/variables.json", |
| 33 | + "scripts/*.py", |
| 34 | + "scripts/*.sh", |
| 35 | + "scripts/*.yaml", |
| 36 | + "scripts/*.mk", |
| 37 | +] |
| 38 | + |
| 39 | +# makefile and scripts used by script/synth.sh steps |
| 40 | +filegroup( |
| 41 | + name = "makefile_yosys", |
| 42 | + srcs = ["Makefile"], |
| 43 | + data = glob(MAKEFILE_SHARED + [ |
| 44 | + "scripts/*.script", |
| 45 | + "scripts/*.v", |
| 46 | + "scripts/util.tcl", |
| 47 | + "scripts/synth*.tcl", |
| 48 | + "scripts/synth*.v", |
| 49 | + "platforms/common/**/*.v", |
| 50 | + ]) + [ |
| 51 | + "//flow/util:makefile_yosys", |
| 52 | + ], |
| 53 | + visibility = ["//visibility:public"], |
| 54 | +) |
| 55 | + |
| 56 | +# makefile and scripts used in the scripts/flow.sh steps |
| 57 | +filegroup( |
| 58 | + name = "makefile", |
| 59 | + srcs = ["Makefile"], |
| 60 | + data = glob(MAKEFILE_SHARED + [ |
| 61 | + "scripts/*.tcl", |
| 62 | + "platforms/common/**/*.v", |
| 63 | + ]) + [ |
| 64 | + "//flow/util:makefile", |
| 65 | + ], |
| 66 | + visibility = ["//visibility:public"], |
| 67 | +) |
| 68 | + |
| 69 | +[orfs_pdk( |
| 70 | + name = pdk, |
| 71 | + srcs = glob([ |
| 72 | + "platforms/{pdk}/**/*.{ext}".format( |
| 73 | + ext = ext, |
| 74 | + pdk = pdk, |
| 75 | + ) |
| 76 | + for ext in { |
| 77 | + "asap7": [ |
| 78 | + "cfg", |
| 79 | + "gds", |
| 80 | + "lef", |
| 81 | + "lib", |
| 82 | + "lib.gz", |
| 83 | + "lyt", |
| 84 | + "mk", |
| 85 | + "rules", |
| 86 | + "sdc", |
| 87 | + "sv", |
| 88 | + "tcl", |
| 89 | + "v", |
| 90 | + ], |
| 91 | + "gf180": [ |
| 92 | + "cfg", |
| 93 | + "gds", |
| 94 | + "lef", |
| 95 | + "lib.gz", |
| 96 | + "lyt", |
| 97 | + "mk", |
| 98 | + "rules", |
| 99 | + "tcl", |
| 100 | + "v", |
| 101 | + ], |
| 102 | + "ihp-sg13g2": [ |
| 103 | + "gds", |
| 104 | + "json", |
| 105 | + "lef", |
| 106 | + "lib", |
| 107 | + "lyt", |
| 108 | + "mk", |
| 109 | + "rules", |
| 110 | + "tcl", |
| 111 | + "v", |
| 112 | + ], |
| 113 | + "nangate45": [ |
| 114 | + "cfg", |
| 115 | + "gds", |
| 116 | + "lef", |
| 117 | + "lib", |
| 118 | + "lyt", |
| 119 | + "mk", |
| 120 | + "rules", |
| 121 | + "tcl", |
| 122 | + "v", |
| 123 | + ], |
| 124 | + "sky130hd": [ |
| 125 | + "gds", |
| 126 | + "lef", |
| 127 | + "lib", |
| 128 | + "lyt", |
| 129 | + "mk", |
| 130 | + "rules", |
| 131 | + "tcl", |
| 132 | + "tlef", |
| 133 | + "v", |
| 134 | + ], |
| 135 | + "sky130hs": [ |
| 136 | + "gds", |
| 137 | + "lef", |
| 138 | + "lib", |
| 139 | + "lyt", |
| 140 | + "mk", |
| 141 | + "rules", |
| 142 | + "tcl", |
| 143 | + "tlef", |
| 144 | + "v", |
| 145 | + ], |
| 146 | + }.get(pdk, []) |
| 147 | + ] + [ |
| 148 | + "platforms/common/**/*.v", |
| 149 | + ]), |
| 150 | + config = ":platforms/{pdk}/config.mk".format(pdk = pdk), |
| 151 | + libs = glob([ |
| 152 | + "platforms/{pdk}/**/*.{ext}".format( |
| 153 | + ext = ext, |
| 154 | + pdk = pdk, |
| 155 | + ) |
| 156 | + for ext in { |
| 157 | + "asap7": [ |
| 158 | + "lib", |
| 159 | + "lib.gz", |
| 160 | + ], |
| 161 | + "gf180": ["lib.gz"], |
| 162 | + }.get( |
| 163 | + pdk, |
| 164 | + ["lib"], |
| 165 | + ) |
| 166 | + ]), |
| 167 | + visibility = ["//visibility:public"], |
| 168 | +) for pdk in [ |
| 169 | + "asap7", |
| 170 | + "gf180", |
| 171 | + "ihp-sg13g2", |
| 172 | + "nangate45", |
| 173 | + "sky130hd", |
| 174 | + "sky130hs", |
| 175 | +]] |
0 commit comments