Skip to content

Commit

Permalink
py: Import utility to generate web preview config
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Munaut <[email protected]>
  • Loading branch information
smunaut committed Sep 10, 2024
1 parent 74b157f commit eceeedb
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions py/gen_tt_web_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python3

#
# Outputs config file for the web visualization
#
# Copyright (c) 2024 Sylvain Munaut <[email protected]>
# SPDX-License-Identifier: Apache-2.0
#

import json
import sys

import tt


def main(argv0):
tti = tt.TinyTapeout(modules=False)
tti.layout

web_cfg = {
'rowCount' : tti.cfg.tt.grid.x,
'colCount' : tti.cfg.tt.grid.y // 2,
'dieWidth' : tti.cfg.pdk.die.width / 1000,
'dieHeight' : tti.cfg.pdk.die.height / 1000,
'xPad' : tti.layout.glb.top.pos_x / 1000,
'topPad' : (tti.cfg.pdk.die.height - tti.layout.glb.top.pos_y - tti.layout.glb.top.height) / 1000,
'bottomPad' : tti.layout.glb.top.pos_y / 1000,
'spineWidth' : (tti.layout.glb.ctrl.width + 2 * tti.layout.glb.margin.x) / 1000,
'muxWidth' : tti.layout.glb.mux.width / 1000,
'muxHeight' : tti.layout.glb.mux.height / 1000,
'ctrlWidth' : tti.layout.glb.ctrl.width / 1000,
'ctrlHeight' : tti.layout.glb.ctrl.height / 1000,
'colDistance' : tti.layout.glb.block.pitch / 1000,
'rowDistance' : tti.layout.glb.branch.pitch / 1000,
'powerGateWidth' : (tti.layout.glb.pg_vdd.width + tti.layout.glb.margin.x) / 1000,
'tileHeight' : tti.layout.glb.block.height / 1000,
'verticalSpacing' : tti.layout.glb.margin.y / 1000,
}

print(json.dumps(web_cfg, indent=4))


if __name__ == '__main__':
main(*sys.argv)

0 comments on commit eceeedb

Please sign in to comment.