Skip to content

Commit dae95e0

Browse files
committed
asap7/ethmac_lvt: study placement densities and grt
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent de2e957 commit dae95e0

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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+
)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
xdg-open $1
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import matplotlib.pyplot as plt
2+
import numpy as np
3+
import sys
4+
import re
5+
import os
6+
7+
8+
sweep = sys.argv[1]
9+
output = sys.argv[2]
10+
files = sys.argv[3:]
11+
12+
# count lines in each file and divide by 3 and create a list of those
13+
# numbers
14+
congestion = []
15+
for file in files:
16+
with open(file, "r") as f:
17+
lines = f.readlines()
18+
print(file)
19+
density = re.search(r"(\d+\.?\d+)", file).group(1)
20+
congestion.append((float(density), len(lines) // 4))
21+
22+
# xy plot of density vs DRC errors
23+
x, y = zip(*congestion)
24+
plt.plot(x, y, "o-")
25+
plt.xlabel(sweep)
26+
plt.ylabel("DRC Errors")
27+
plt.title(sweep + " vs DRC Errors")
28+
plt.grid()
29+
plt.yscale("log")
30+
plt.savefig(output)

0 commit comments

Comments
 (0)