Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 17 additions and 5 deletions.
  1. +9 −4 migen/bus/wishbone2lasmi.py
  2. +8 −1 migen/genlib/misc.py
View
13 migen/bus/wishbone2lasmi.py
@@ -11,8 +11,8 @@ def __init__(self, cachesize, lasmim):
###
- if lasmim.dw <= 32:
- raise ValueError("LASMI data width must be strictly larger than 32")
+ if lasmim.dw < 32:
+ raise ValueError("LASMI data width must be >= 32")
if (lasmim.dw % 32) != 0:
raise ValueError("LASMI data width must be a multiple of 32")
@@ -31,7 +31,12 @@ def __init__(self, cachesize, lasmim):
write_from_lasmi = Signal()
write_to_lasmi = Signal()
- adr_offset_r = Signal(offsetbits)
+ if adr_offset is None:
+ adr_offset_r = None
+ else:
+ adr_offset_r = Signal(offsetbits)
+ self.sync += adr_offset_r.eq(adr_offset)
+
self.comb += [
data_port.adr.eq(adr_line),
If(write_from_lasmi,
@@ -49,7 +54,7 @@ def __init__(self, cachesize, lasmim):
),
chooser(data_port.dat_r, adr_offset_r, self.wishbone.dat_r, reverse=True)
]
- self.sync += adr_offset_r.eq(adr_offset)
+
# Tag memory
tag_layout = [("tag", tagbits), ("dirty", 1)]
View
9 migen/genlib/misc.py
@@ -24,11 +24,16 @@ def split(v, *counts):
r = []
offset = 0
for n in counts:
- r.append(v[offset:offset+n])
+ if n != 0:
+ r.append(v[offset:offset+n])
+ else:
+ r.append(None)
offset += n
return tuple(r)
def displacer(signal, shift, output, n=None, reverse=False):
+ if shift is None:
+ return output.eq(signal)
if n is None:
n = 2**flen(shift)
w = flen(signal)
@@ -40,6 +45,8 @@ def displacer(signal, shift, output, n=None, reverse=False):
return output.eq(Cat(*l))
def chooser(signal, shift, output, n=None, reverse=False):
+ if shift is None:
+ return output.eq(signal)
if n is None:
n = 2**flen(shift)
w = flen(output)

No commit comments for this range

Something went wrong with that request. Please try again.