Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 5 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
2  migen/bank/csrgen.py
@@ -16,7 +16,7 @@ def GetFragment(self):
comb = []
sync = []
- comb.append(a(self._sel, self.interface.a_i[12:] == f.Constant(self.address, f.BV(4))))
+ comb.append(a(self._sel, self.interface.a_i[10:] == f.Constant(self.address, f.BV(4))))
nregs = len(self.description)
nbits = f.BitsFor(nregs-1)
View
4 migen/bus/csr.py
@@ -2,7 +2,7 @@
from .simple import Simple
_desc = [
- (True, "a", 16),
+ (True, "a", 14),
(True, "we", 1),
(True, "d", 32),
(False, "d", 32)
@@ -30,5 +30,5 @@ def GetFragment(self):
comb.append(a(slave.we_i, self.master.we_o))
comb.append(a(slave.d_i, self.master.d_o))
rb = rb | slave.d_o
- comb.append(a(master.d_i, rb))
+ comb.append(a(self.master.d_i, rb))
return f.Fragment(comb)
View
2  migen/bus/wishbone2csr.py
@@ -14,7 +14,7 @@ def GetFragment(self):
sync = [
f.Assign(self.csr.we_o, self.wishbone.we_i),
f.Assign(self.csr.d_o, self.wishbone.dat_i),
- f.Assign(self.csr.a_o, self.wishbone.adr_i[:16]),
+ f.Assign(self.csr.a_o, self.wishbone.adr_i[2:16]),
f.Assign(self.wishbone.ack_o, 0),
f.Assign(self.wishbone.dat_o, self.csr.d_i)
]
View
8 migen/fhdl/structure.py
@@ -147,7 +147,8 @@ def __init__(self, l, r):
self.r = _cst(r)
class StatementList:
- def __init__(self, l=[]):
+ def __init__(self, l=None):
+ if l is None: l = []
self.l = l
def _sl(x):
@@ -194,7 +195,10 @@ def __hash__(self):
return id(self)
class Fragment:
- def __init__(self, comb=[], sync=[], instances=[], pads=set()):
+ def __init__(self, comb=None, sync=None, instances=None, pads=set()):
+ if comb is None: comb = []
+ if sync is None: sync = []
+ if instances is None: instances = []
self.comb = _sl(comb)
self.sync = _sl(sync)
self.instances = instances
View
8 migen/fhdl/verilog.py
@@ -88,15 +88,17 @@ def _printinstances(ns, i, clk, rst):
r += ",\n"
firstp = False
r += "\t." + p[0] + "("
- if isinstance(p[1], int):
+ if isinstance(p[1], int) or isinstance(p[1], Constant):
r += str(p[1])
- elif isinstance(p[1], basestring):
+ elif isinstance(p[1], str):
r += "\"" + p[1] + "\""
else:
raise TypeError
r += ")"
r += "\n) "
- r += ns.GetName(x) + "(\n"
+ r += ns.GetName(x)
+ if x.parameters: r += " "
+ r += "(\n"
ports = list(x.ins.items()) + list(x.outs.items())
if x.clkport:
ports.append((x.clkport, clk))

No commit comments for this range

Something went wrong with that request. Please try again.