Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor
13  migen/bus/wishbone2lasmi.py
@@ -11,8 +11,8 @@ def __init__(self, cachesize, lasmim):
11 11
 
12 12
 		###
13 13
 
14  
-		if lasmim.dw <= 32:
15  
-			raise ValueError("LASMI data width must be strictly larger than 32")
  14
+		if lasmim.dw < 32:
  15
+			raise ValueError("LASMI data width must be >= 32")
16 16
 		if (lasmim.dw % 32) != 0:
17 17
 			raise ValueError("LASMI data width must be a multiple of 32")
18 18
 
@@ -31,7 +31,12 @@ def __init__(self, cachesize, lasmim):
31 31
 		
32 32
 		write_from_lasmi = Signal()
33 33
 		write_to_lasmi = Signal()
34  
-		adr_offset_r = Signal(offsetbits)
  34
+		if adr_offset is None:
  35
+			adr_offset_r = None
  36
+		else:
  37
+			adr_offset_r = Signal(offsetbits)
  38
+			self.sync += adr_offset_r.eq(adr_offset)
  39
+
35 40
 		self.comb += [
36 41
 			data_port.adr.eq(adr_line),
37 42
 			If(write_from_lasmi,
@@ -49,7 +54,7 @@ def __init__(self, cachesize, lasmim):
49 54
 			),
50 55
 			chooser(data_port.dat_r, adr_offset_r, self.wishbone.dat_r, reverse=True)
51 56
 		]
52  
-		self.sync += adr_offset_r.eq(adr_offset)
  57
+
53 58
 		
54 59
 		# Tag memory
55 60
 		tag_layout = [("tag", tagbits), ("dirty", 1)]
9  migen/genlib/misc.py
@@ -24,11 +24,16 @@ def split(v, *counts):
24 24
 	r = []
25 25
 	offset = 0
26 26
 	for n in counts:
27  
-		r.append(v[offset:offset+n])
  27
+		if n != 0:
  28
+			r.append(v[offset:offset+n])
  29
+		else:
  30
+			r.append(None)
28 31
 		offset += n
29 32
 	return tuple(r)
30 33
 
31 34
 def displacer(signal, shift, output, n=None, reverse=False):
  35
+	if shift is None:
  36
+		return output.eq(signal)
32 37
 	if n is None:
33 38
 		n = 2**flen(shift)
34 39
 	w = flen(signal)
@@ -40,6 +45,8 @@ def displacer(signal, shift, output, n=None, reverse=False):
40 45
 	return output.eq(Cat(*l))
41 46
 
42 47
 def chooser(signal, shift, output, n=None, reverse=False):
  48
+	if shift is None:
  49
+		return output.eq(signal)
43 50
 	if n is None:
44 51
 		n = 2**flen(shift)
45 52
 	w = flen(output)

No commit comments for this range

Something went wrong with that request. Please try again.