diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-07-18 13:10:40 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-07-18 13:10:40 +0200 |
commit | 48154cb6f452d3bdb4da36cc267b4b6c45588dc9 (patch) | |
tree | 3ec3be9ef7e8db1fb7c764ed8202e0215a8eb7c7 /icefuzz/glbmapbits.py | |
parent | 13e63e6b65e044e348356731b55610d02cb308b9 (diff) | |
download | icestorm-48154cb6f452d3bdb4da36cc267b4b6c45588dc9.tar.gz icestorm-48154cb6f452d3bdb4da36cc267b4b6c45588dc9.tar.bz2 icestorm-48154cb6f452d3bdb4da36cc267b4b6c45588dc9.zip |
Imported full dev sources
Diffstat (limited to 'icefuzz/glbmapbits.py')
-rw-r--r-- | icefuzz/glbmapbits.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/icefuzz/glbmapbits.py b/icefuzz/glbmapbits.py new file mode 100644 index 0000000..c971088 --- /dev/null +++ b/icefuzz/glbmapbits.py @@ -0,0 +1,34 @@ +#!/usr/bin/python + +from __future__ import division +from __future__ import print_function + +import re +import fileinput + +tiletype = "" +x, y = 0, 0 + +for line in fileinput.input(): + if line.startswith("LogicTile"): + fields = line.split("_") + tiletype = "Logic" + x, y = int(fields[1]), int(fields[2]) + continue + + if line.startswith("RAM_Tile") or line.startswith("IO_Tile"): + fields = line.split("_") + tiletype = fields[0] + x, y = int(fields[2]), int(fields[3]) + continue + + if line.startswith("GlobalNetwork"): + tiletype = "" + continue + + if tiletype != "": + fields = re.split('[ ()]*', line.strip()) + if len(fields) <= 1: continue + fields = [int(fields[i+1]) for i in range(4)] + print("%-5s %2d %2d %2d %2d %3d %3d" % (tiletype, x, y, fields[0], fields[1], fields[2], fields[3])) + |