Skip to content

Commit eceeedb

Browse files
committed
py: Import utility to generate web preview config
Signed-off-by: Sylvain Munaut <[email protected]>
1 parent 74b157f commit eceeedb

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

py/gen_tt_web_cfg.py

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env python3
2+
3+
#
4+
# Outputs config file for the web visualization
5+
#
6+
# Copyright (c) 2024 Sylvain Munaut <[email protected]>
7+
# SPDX-License-Identifier: Apache-2.0
8+
#
9+
10+
import json
11+
import sys
12+
13+
import tt
14+
15+
16+
def main(argv0):
17+
tti = tt.TinyTapeout(modules=False)
18+
tti.layout
19+
20+
web_cfg = {
21+
'rowCount' : tti.cfg.tt.grid.x,
22+
'colCount' : tti.cfg.tt.grid.y // 2,
23+
'dieWidth' : tti.cfg.pdk.die.width / 1000,
24+
'dieHeight' : tti.cfg.pdk.die.height / 1000,
25+
'xPad' : tti.layout.glb.top.pos_x / 1000,
26+
'topPad' : (tti.cfg.pdk.die.height - tti.layout.glb.top.pos_y - tti.layout.glb.top.height) / 1000,
27+
'bottomPad' : tti.layout.glb.top.pos_y / 1000,
28+
'spineWidth' : (tti.layout.glb.ctrl.width + 2 * tti.layout.glb.margin.x) / 1000,
29+
'muxWidth' : tti.layout.glb.mux.width / 1000,
30+
'muxHeight' : tti.layout.glb.mux.height / 1000,
31+
'ctrlWidth' : tti.layout.glb.ctrl.width / 1000,
32+
'ctrlHeight' : tti.layout.glb.ctrl.height / 1000,
33+
'colDistance' : tti.layout.glb.block.pitch / 1000,
34+
'rowDistance' : tti.layout.glb.branch.pitch / 1000,
35+
'powerGateWidth' : (tti.layout.glb.pg_vdd.width + tti.layout.glb.margin.x) / 1000,
36+
'tileHeight' : tti.layout.glb.block.height / 1000,
37+
'verticalSpacing' : tti.layout.glb.margin.y / 1000,
38+
}
39+
40+
print(json.dumps(web_cfg, indent=4))
41+
42+
43+
if __name__ == '__main__':
44+
main(*sys.argv)

0 commit comments

Comments
 (0)