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