projects
/
pinmux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b4adac4
)
start adding fast/external bus spec
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Wed, 25 Jul 2018 04:35:11 +0000
(
05:35
+0100)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Wed, 25 Jul 2018 04:35:11 +0000
(
05:35
+0100)
src/bsv/peripheral_gen/base.py
patch
|
blob
|
history
src/bsv/peripheral_gen/jtag.py
patch
|
blob
|
history
src/bsv/peripheral_gen/rgbttl.py
patch
|
blob
|
history
src/bsv/pinmux_generator.py
patch
|
blob
|
history
src/pinmux_generator.py
patch
|
blob
|
history
src/spec/base.py
patch
|
blob
|
history
src/spec/gen.py
patch
|
blob
|
history
src/spec/i_class.py
patch
|
blob
|
history
diff --git
a/src/bsv/peripheral_gen/base.py
b/src/bsv/peripheral_gen/base.py
index a595dbe23306444b58474dcb8386a4713cf9630c..6de39323750f674a4ac3f0c59a8efba2ccac0b17 100644
(file)
--- a/
src/bsv/peripheral_gen/base.py
+++ b/
src/bsv/peripheral_gen/base.py
@@
-8,9
+8,6
@@
class PBase(object):
def slowifdeclmux(self, name, count):
return ''
def slowifdeclmux(self, name, count):
return ''
- def slowifinstance(self, name, count):
- return ''
-
def slowimport(self):
return ''
def slowimport(self):
return ''
@@
-179,6
+176,13
@@
class PBase(object):
def mk_ext_ifacedef(self, iname, inum):
return ''
def mk_ext_ifacedef(self, iname, inum):
return ''
+ def extifinstance(self, name, count):
+ sname = self.peripheral.iname().format(count)
+ pname = self.get_iname(count)
+ template = " interface {0} = pinmux.peripheral_side.{1};"
+ return template.format(pname, sname)
+
+
mkplic_rule = """\
rule rl_connect_{0}_to_plic_{2};
mkplic_rule = """\
rule rl_connect_{0}_to_plic_{2};
@@
-230,7
+234,7
@@
class PeripheralIface(object):
self.slow = slow(ifacename)
self.slow.peripheral = self
for fname in ['slowimport',
self.slow = slow(ifacename)
self.slow.peripheral = self
for fname in ['slowimport',
- '
slow
ifinstance', 'slowifdecl', 'slowifdeclmux',
+ '
ext
ifinstance', 'slowifdecl', 'slowifdeclmux',
'mkslow_peripheral', 'mk_plic', 'mk_ext_ifacedef',
'mk_connection', 'mk_cellconn', 'mk_pincon']:
fn = CallFn(self, fname)
'mkslow_peripheral', 'mk_plic', 'mk_ext_ifacedef',
'mk_connection', 'mk_cellconn', 'mk_pincon']:
fn = CallFn(self, fname)
@@
-271,11
+275,11
@@
class PeripheralInterfaces(object):
ret.append(self.data[name].slowimport())
return '\n'.join(list(filter(None, ret)))
ret.append(self.data[name].slowimport())
return '\n'.join(list(filter(None, ret)))
- def
slow
ifinstance(self, *args):
+ def
ext
ifinstance(self, *args):
ret = []
for (name, count) in self.ifacecount:
for i in range(count):
ret = []
for (name, count) in self.ifacecount:
for i in range(count):
- ret.append(self.data[name].
slow
ifinstance(name, i))
+ ret.append(self.data[name].
ext
ifinstance(name, i))
return '\n'.join(list(filter(None, ret)))
def slowifdeclmux(self, *args):
return '\n'.join(list(filter(None, ret)))
def slowifdeclmux(self, *args):
diff --git
a/src/bsv/peripheral_gen/jtag.py
b/src/bsv/peripheral_gen/jtag.py
index e86880d22d43a0f8b21f0b0343eacf91ddb4f53f..589ecf8af6c6d65f44c581aa1264b99cd8594c98 100644
(file)
--- a/
src/bsv/peripheral_gen/jtag.py
+++ b/
src/bsv/peripheral_gen/jtag.py
@@
-14,11
+14,5
@@
class jtag(PBase):
def slowifdeclmux(self, name, count):
sname = self.get_iname(count)
def slowifdeclmux(self, name, count):
sname = self.get_iname(count)
- return " interface PeripheralSideJTAG %s_out;" % sname
-
- def slowifinstance(self, name, count):
- sname = self.peripheral.iname().format(count)
- pname = self.get_iname(count)
- template = " interface {0}_out = pinmux.peripheral_side.{1};"
- return template.format(pname, sname)
+ return " interface PeripheralSideJTAG %s;" % sname
diff --git
a/src/bsv/peripheral_gen/rgbttl.py
b/src/bsv/peripheral_gen/rgbttl.py
index fa7e49ab7773647dbe10e8c3dd87fe9e196bacd3..3d3f6b536c03cd34fbdfb0e0fdecc6102daa699b 100644
(file)
--- a/
src/bsv/peripheral_gen/rgbttl.py
+++ b/
src/bsv/peripheral_gen/rgbttl.py
@@
-36,11
+36,5
@@
class rgbttl(PBase):
def slowifdeclmux(self, name, count):
sname = self.get_iname(count)
def slowifdeclmux(self, name, count):
sname = self.get_iname(count)
- return " interface PeripheralSideLCD %s_out;" % sname
-
- def slowifinstance(self, name, count):
- sname = self.peripheral.iname().format(count)
- pname = self.get_iname(count)
- template = " interface {0}_out = pinmux.peripheral_side.{1};"
- return template.format(pname, sname)
+ return " interface PeripheralSideLCD %s;" % sname
diff --git
a/src/bsv/pinmux_generator.py
b/src/bsv/pinmux_generator.py
index bf4bfa6576eb539a6037799329542ee7a3e57ead..2abce7c8768fe57766874dff30f8caeb0e65a4a9 100644
(file)
--- a/
src/bsv/pinmux_generator.py
+++ b/
src/bsv/pinmux_generator.py
@@
-110,7
+110,7
@@
def write_slow(slow, slowt, p, ifaces, iocells):
mkcon = ifaces.mk_connection()
mkcellcon = ifaces.mk_cellconn()
pincon = ifaces.mk_pincon()
mkcon = ifaces.mk_connection()
mkcellcon = ifaces.mk_cellconn()
pincon = ifaces.mk_pincon()
- inst = ifaces.
slow
ifinstance()
+ inst = ifaces.
ext
ifinstance()
mkplic = ifaces.mk_plic()
numsloirqs = ifaces.mk_sloirqsdef()
ifacedef = ifaces.mk_ext_ifacedef()
mkplic = ifaces.mk_plic()
numsloirqs = ifaces.mk_sloirqsdef()
ifacedef = ifaces.mk_ext_ifacedef()
diff --git
a/src/pinmux_generator.py
b/src/pinmux_generator.py
index b8afe99d69ccff76eb55a4ec58d77ed49233d882..2f04f34b08f638d60aec0b58a8a106a065e57695 100644
(file)
--- a/
src/pinmux_generator.py
+++ b/
src/pinmux_generator.py
@@
-90,7
+90,8
@@
if __name__ == '__main__':
if testing:
dummytest(ps, output_dir, output_type)
else:
if testing:
dummytest(ps, output_dir, output_type)
else:
- specgen(of, output_dir, pinout, bankspec, pinspec, fixedpins)
+ specgen(of, output_dir, pinout,
+ bankspec, pinspec, fixedpins, ps.fastbus)
else:
if output_type == 'bsv':
from bsv.pinmux_generator import pinmuxgen as gentypes
else:
if output_type == 'bsv':
from bsv.pinmux_generator import pinmuxgen as gentypes
diff --git
a/src/spec/base.py
b/src/spec/base.py
index af2d2ab58ae324fb1047d14daed3ba7e617d7e76..b41cc3790ee8a4b53af789e7414b017f5c71a03b 100644
(file)
--- a/
src/spec/base.py
+++ b/
src/spec/base.py
@@
-5,7
+5,8
@@
from spec.ifaceprint import display_fixed
class PinSpec(Pinouts):
class PinSpec(Pinouts):
- def __init__(self, pinbanks, fixedpins, function_names):
+ def __init__(self, pinbanks, fixedpins, function_names, fast=None):
+ self.fastbus = fast or []
self.pinbanks = pinbanks
self.fixedpins = fixedpins
self.function_names = function_names
self.pinbanks = pinbanks
self.fixedpins = fixedpins
self.function_names = function_names
diff --git
a/src/spec/gen.py
b/src/spec/gen.py
index 2c1335f6d0d89a11504794c774ff1562a5dec55d..1ce10e3cdc473f0f7255aeec86fe40b461dc8d54 100644
(file)
--- a/
src/spec/gen.py
+++ b/
src/spec/gen.py
@@
-3,7
+3,7
@@
import os.path
from spec.interfaces import Pinouts
from spec.interfaces import Pinouts
-def specgen(of, pth, pinouts, bankspec, pinbanks, fixedpins):
+def specgen(of, pth, pinouts, bankspec, pinbanks, fixedpins
, fastbus
):
""" generates a specification of pinouts (tsv files)
for reading in by pinmux.
""" generates a specification of pinouts (tsv files)
for reading in by pinmux.
@@
-31,7
+31,12
@@
def specgen(of, pth, pinouts, bankspec, pinbanks, fixedpins):
with open(os.path.join(pth, 'interfaces.txt'), 'w') as f:
for k in pinouts.fnspec.keys():
s = pinouts.fnspec[k]
with open(os.path.join(pth, 'interfaces.txt'), 'w') as f:
for k in pinouts.fnspec.keys():
s = pinouts.fnspec[k]
- f.write("%s\t%d\n" % (k.lower(), len(s)))
+ line = [k.lower(), str(len(s))]
+ for b in fastbus:
+ if b.startswith(k.lower()):
+ line.append(b)
+ line = '\t'.join(line)
+ f.write("%s\n" % line)
s0 = s[list(s.keys())[0]] # hack, take first
gangedgroup = pinouts.ganged[k]
with open(os.path.join(pth, '%s.txt' % k.lower()), 'w') as g:
s0 = s[list(s.keys())[0]] # hack, take first
gangedgroup = pinouts.ganged[k]
with open(os.path.join(pth, '%s.txt' % k.lower()), 'w') as g:
diff --git
a/src/spec/i_class.py
b/src/spec/i_class.py
index 8a456117dd2e43b7c558c17bc53ba0a69ab1f2d4..daf064a6b76b321ee189bbdb7abcde36aa3a2176 100644
(file)
--- a/
src/spec/i_class.py
+++ b/
src/spec/i_class.py
@@
-57,7
+57,8
@@
def pinspec():
'ULPI2': 'ULPI (USB Low Pin-count) 2',
}
'ULPI2': 'ULPI (USB Low Pin-count) 2',
}
- ps = PinSpec(pinbanks, fixedpins, function_names)
+ ps = PinSpec(pinbanks, fixedpins, function_names,
+ ['lcd0', 'jtag0'])
# Bank A, 0-27
ps.gpio("", ('A', 0), 0, 0, 28)
# Bank A, 0-27
ps.gpio("", ('A', 0), 0, 0, 28)