use --recursive on git submodule not --remote - one does a "latest update"
[soclayout.git] / experiments9 / coriolis2 / ioring.py
1 #!/usr/bin/env python
2
3 from helpers import l, u, n
4 import os
5 import json
6
7 def _byteify(data, ignore_dicts = False):
8 # if this is a unicode string, return its string representation
9 if isinstance(data, unicode):
10 return data.encode('utf-8')
11 # if this is a list of values, return list of byteified values
12 if isinstance(data, list):
13 return [ _byteify(item, ignore_dicts=True) for item in data ]
14 # if this is a dictionary, return dictionary of byteified keys and values
15 # but only if we haven't already byteified it
16 if isinstance(data, dict) and not ignore_dicts:
17 return dict((_byteify(key, ignore_dicts=True),
18 _byteify(value, ignore_dicts=True))
19 for key, value in data.iteritems())
20 # if it's anything else, return it in its original form
21 return data
22
23 # load JSON-formatted pad info from pinmux
24 pth = os.path.abspath(__file__)
25 pth = os.path.split(pth)[0]
26 print "path", pth
27 with open("%s/ls180/litex_pinpads.json" % pth) as f:
28 txt = f.read()
29 chip = json.loads(txt, object_hook=_byteify)
30 chip = _byteify(chip, ignore_dicts=True)
31 print chip
32
33 chip.update({ 'pads.ioPadGauge' : 'pxlib',
34 # core option (big, time-consuming)
35 #'core.size' : ( l(28000), l(28000) ),
36 #'chip.size' : ( l(30200), l(30200) ),
37 # no-core option (test_issuer but no actual core)
38 'core.size' : ( l(13000), l(13000) ),
39 'chip.size' : ( l(14400), l(14400) ),
40 'pads.useCoreSize': True,
41 'chip.clockTree' : True,
42 })