|
| 1 | +load("@bazel-orfs//:sweep.bzl", "orfs_sweep") |
| 2 | +load("@orfs-pip//:requirements.bzl", "requirement") |
| 3 | + |
| 4 | +# Format densities, rounding to 2 decimal places. |
| 5 | +PLACEMENT_DENSITIES = [str(0.60 + x * 0.01 + 0.005)[:4] for x in range(20)] |
| 6 | +#PLACEMENT_DENSITIES.remove("0.67") |
| 7 | + |
| 8 | +orfs_sweep( |
| 9 | + name = "ethmac_lvt", |
| 10 | + arguments = { |
| 11 | + # Faster builds |
| 12 | + "SKIP_INCREMENTAL_REPAIR": "1", |
| 13 | + "GPL_TIMING_DRIVEN": "0", |
| 14 | + # Various |
| 15 | + "SDC_FILE": "$(location :constraint.sdc)", |
| 16 | + "ABC_AREA": "1", |
| 17 | + "CORE_UTILIZATION": "40", |
| 18 | + "CORE_ASPECT_RATIO": "1", |
| 19 | + "CORE_MARGIN": "2", |
| 20 | + "PLACE_DENSITY": "0.60", |
| 21 | + "ASAP7_USELVT": "1", |
| 22 | + "RECOVER_POWER": "1", |
| 23 | + "ADDITIONAL_LIBS": "$(LIB_DIR)/asap7sc7p5t_AO_RVT_FF_nldm_211120.lib.gz \ |
| 24 | + $(LIB_DIR)/asap7sc7p5t_INVBUF_RVT_FF_nldm_220122.lib.gz \ |
| 25 | + $(LIB_DIR)/asap7sc7p5t_OA_RVT_FF_nldm_211120.lib.gz \ |
| 26 | + $(LIB_DIR)/asap7sc7p5t_SIMPLE_RVT_FF_nldm_211120.lib.gz \ |
| 27 | + $(LIB_DIR)/asap7sc7p5t_SEQ_RVT_FF_nldm_220123.lib", |
| 28 | + "ADDITIONAL_GDS": "$(PLATFORM_DIR)/gds/asap7sc7p5t_28_R_220121a.gds", |
| 29 | + "ADDITIONAL_LEFS": "$(PLATFORM_DIR)/lef/asap7sc7p5t_28_R_1x_220121a.lef", |
| 30 | + }, |
| 31 | + other_variants = {"base": {}}, |
| 32 | + sources = { |
| 33 | + "SDC_FILE": [":constraint.sdc"], |
| 34 | + }, |
| 35 | + sweep = { |
| 36 | + density: { |
| 37 | + "arguments": { |
| 38 | + "PLACE_DENSITY": density, |
| 39 | + }, |
| 40 | + "previous_stage": { |
| 41 | + "floorplan": "ethmac_lvt_synth", |
| 42 | + }, |
| 43 | + } |
| 44 | + for density in PLACEMENT_DENSITIES |
| 45 | + }, |
| 46 | + top = "ethmac", |
| 47 | + verilog_files = ["//:ethmac_lvt_src"], |
| 48 | +) |
| 49 | + |
| 50 | +[filegroup( |
| 51 | + name = "ethmac_lvt_{density}_congestion".format(density = density), |
| 52 | + srcs = [":ethmac_lvt_{density}_grt".format(density = density)], |
| 53 | + output_group = "congestion.rpt", |
| 54 | +) for density in PLACEMENT_DENSITIES] |
| 55 | + |
| 56 | +filegroup( |
| 57 | + name = "congestion", |
| 58 | + srcs = [":ethmac_lvt_{density}_congestion".format(density = density) for density in PLACEMENT_DENSITIES], |
| 59 | +) |
| 60 | + |
| 61 | +py_binary( |
| 62 | + name = "plot_congestion", |
| 63 | + srcs = ["plot_congestion.py"], |
| 64 | + main = "plot_congestion.py", |
| 65 | + deps = [requirement("matplotlib")], |
| 66 | +) |
| 67 | + |
| 68 | +genrule( |
| 69 | + name = "plot_pdf", |
| 70 | + srcs = [":congestion"], |
| 71 | + outs = ["congestion.pdf"], |
| 72 | + cmd = "$(execpath :plot_congestion) $@ $(locations :congestion)", |
| 73 | + tools = [":plot_congestion"], |
| 74 | +) |
| 75 | + |
| 76 | +sh_binary( |
| 77 | + name = "plot", |
| 78 | + srcs = [":open_plots.sh"], |
| 79 | + args = ["$(location :plot_pdf)"], |
| 80 | + data = [":plot_pdf"], |
| 81 | +) |
0 commit comments