Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Named buses

  • Loading branch information...
commit 7c99e51b907e76553b1474d18a4434c5e1950fd7 1 parent 5720a51
@sbourdeauducq sbourdeauducq authored
Showing with 12 additions and 10 deletions.
  1. +4 −4 migen/bus/csr.py
  2. +4 −2 migen/bus/simple.py
  3. +4 −4 migen/bus/wishbone.py
View
8 migen/bus/csr.py
@@ -9,12 +9,12 @@
]
class Master(Simple):
- def __init__(self):
- Simple.__init__(self, _desc, False)
+ def __init__(self, name=""):
+ Simple.__init__(self, _desc, False, name)
class Slave(Simple):
- def __init__(self):
- Simple.__init__(self, _desc, True)
+ def __init__(self, name=""):
+ Simple.__init__(self, _desc, True, name)
class Interconnect:
def __init__(self, master, slaves):
View
6 migen/bus/simple.py
@@ -5,7 +5,7 @@
# 1) string: name
# 2) int: width
class Simple():
- def __init__(self, desc, slave):
+ def __init__(self, desc, slave, name):
for signal in desc:
if signal[0] ^ slave:
suffix = "_o"
@@ -13,5 +13,7 @@ def __init__(self, desc, slave):
suffix = "_i"
modules = self.__module__.split('.')
busname = modules[len(modules)-1]
+ if name:
+ busname += "_" + name
signame = signal[1]+suffix
- setattr(self, signame, f.Signal(f.BV(signal[2]), busname+"_"+signame))
+ setattr(self, signame, f.Signal(f.BV(signal[2]), busname + "_" + signame))
View
8 migen/bus/wishbone.py
@@ -16,9 +16,9 @@
]
class Master(Simple):
- def __init__(self):
- Simple.__init__(self, _desc, False)
+ def __init__(self, name=""):
+ Simple.__init__(self, _desc, False, name)
class Slave(Simple):
- def __init__(self):
- Simple.__init__(self, _desc, True)
+ def __init__(self, name=""):
+ Simple.__init__(self, _desc, True, name)
Please sign in to comment.
Something went wrong with that request. Please try again.