Repository navigation
Expand file tree
/
Copy pathsetup_ispd_benchmarks.sh
More file actions
182 lines (160 loc) · 4.46 KB
/
Copy pathsetup_ispd_benchmarks.sh
File metadata and controls
182 lines (160 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#!/usr/bin/env bash
# Download and prepare ISPD 2018/2019 detailed routing benchmarks.
#
# ISPD 2018: https://www.ispd.cc/contests/18/ispd18_contest.html
# ISPD 2019: https://www.ispd.cc/contests/19/
#
# The tarballs are served directly by the ISPD contest site with no
# registration or auth wall (verified: plain `curl` gets a 200 with no
# redirect to a login page) — despite older notes in this repo claiming
# otherwise. This script downloads them for real.
#
# Env vars:
# ISPD18_TESTS space-separated test numbers to fetch (default: "1 2 3 4 5 6")
# ISPD19_TESTS space-separated test numbers to fetch (default: none)
# SKIP_DOWNLOAD set to any value to skip network access (offline/CI use;
# only the synthetic mini_test benchmark is generated)
set -euo pipefail
BENCH_DIR="${1:-$(pwd)/benchmarks}"
mkdir -p "$BENCH_DIR"
cd "$BENCH_DIR"
ISPD18_TESTS="${ISPD18_TESTS:-1 2 3 4 5 6}"
ISPD19_TESTS="${ISPD19_TESTS:-}"
if [ -z "${SKIP_DOWNLOAD:-}" ]; then
echo "=== ISPD 2018 Benchmark Download ==="
for i in $ISPD18_TESTS; do
name="ispd18_test${i}"
if [ -f "$name/${name}.input.def" ]; then
echo " $name already present, skipping"
continue
fi
url="https://www.ispd.cc/contests/18/${name}.tgz"
echo " fetching $url"
mkdir -p "$name"
curl -sL "$url" -o "/tmp/${name}.tgz"
tar xzf "/tmp/${name}.tgz" -C "$name"
rm -f "/tmp/${name}.tgz"
done
if [ -n "$ISPD19_TESTS" ]; then
echo "=== ISPD 2019 Benchmark Download ==="
for i in $ISPD19_TESTS; do
name="ispd19_test${i}"
if [ -f "$name/${name}.input.def" ]; then
echo " $name already present, skipping"
continue
fi
url="https://www.ispd.cc/contests/19/benchmarks/${name}.tgz"
echo " fetching $url"
mkdir -p "$name"
curl -sL "$url" -o "/tmp/${name}.tgz"
tar xzf "/tmp/${name}.tgz" -C "$name"
rm -f "/tmp/${name}.tgz"
done
fi
else
echo "=== SKIP_DOWNLOAD set — only generating synthetic mini_test ==="
fi
# Create a synthetic mini-benchmark for testing without real benchmark files
echo "=== Creating synthetic test benchmark ==="
MINI_DIR="$BENCH_DIR/mini_test"
mkdir -p "$MINI_DIR"
# Minimal LEF
cat > "$MINI_DIR/mini_test.lef" << 'LEOF'
VERSION 5.8 ;
BUSBITCHARS "[]" ;
DIVIDERCHAR "/" ;
UNITS
DATABASE MICRONS 2000 ;
END UNITS
MANUFACTURINGGRID 0.005 ;
LAYER li1
TYPE ROUTING ;
DIRECTION HORIZONTAL ;
WIDTH 0.17 ;
PITCH 0.34 0.34 ;
OFFSET 0.17 0.17 ;
MINWIDTH 0.17 ;
AREA 0.0561 ;
END li1
LAYER met1
TYPE ROUTING ;
DIRECTION HORIZONTAL ;
WIDTH 0.14 ;
PITCH 0.28 0.28 ;
OFFSET 0.14 0.14 ;
MINWIDTH 0.14 ;
END met1
LAYER met2
TYPE ROUTING ;
DIRECTION VERTICAL ;
WIDTH 0.14 ;
PITCH 0.28 0.28 ;
OFFSET 0.14 0.14 ;
MINWIDTH 0.14 ;
END met2
LAYER mcon
TYPE CUT ;
WIDTH 0.17 ;
SPACING 0.19 ;
ENCLOSURE BELOW 0.03 0.06 ;
ENCLOSURE ABOVE 0.03 0.06 ;
END mcon
LAYER via
TYPE CUT ;
WIDTH 0.15 ;
SPACING 0.17 ;
ENCLOSURE BELOW 0.055 0.085 ;
ENCLOSURE ABOVE 0.055 0.085 ;
END via
END LIBRARY
LEOF
# Minimal DEF with a few nets
cat > "$MINI_DIR/mini_test.def" << 'DEOF'
VERSION 5.8 ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
DESIGN mini_test ;
UNITS DISTANCE MICRONS 2000 ;
DIEAREA ( 0 0 ) ( 20000 20000 ) ;
COMPONENTS 0 ;
END COMPONENTS
PINS 4 ;
- P_A + NET net_a + DIRECTION INPUT
+ LAYER met1 ( -100 -100 ) ( 100 100 )
+ FIXED ( 2000 2000 ) N ;
- P_B + NET net_b + DIRECTION INPUT
+ LAYER met1 ( -100 -100 ) ( 100 100 )
+ FIXED ( 2000 10000 ) N ;
- P_Y + NET net_a + DIRECTION OUTPUT
+ LAYER met2 ( -100 -100 ) ( 100 100 )
+ FIXED ( 18000 2000 ) N ;
- P_Z + NET net_b + DIRECTION OUTPUT
+ LAYER met2 ( -100 -100 ) ( 100 100 )
+ FIXED ( 18000 10000 ) N ;
END PINS
NETS 2 ;
- net_a ( PIN P_A ) ( PIN P_Y ) ;
- net_b ( PIN P_B ) ( PIN P_Z ) ;
END NETS
END DESIGN
DEOF
# Minimal guide file (rectangular guides for each net)
cat > "$MINI_DIR/mini_test.guide" << 'GEOF'
net_a
(
( 0 0 20000 20000 met1 )
( 0 0 20000 20000 met2 )
)
net_b
(
( 0 0 20000 20000 met1 )
( 0 0 20000 20000 met2 )
)
GEOF
echo "Created synthetic mini-benchmark at: $MINI_DIR"
echo ""
echo "Test with:"
echo " ./rba_router --lef $MINI_DIR/mini_test.lef \\"
echo " --def $MINI_DIR/mini_test.def \\"
echo " --guide $MINI_DIR/mini_test.guide \\"
echo " --output /tmp/rba_mini_out"