Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

asmibus: remove port sharing

  • Loading branch information...
commit ac2cde0e873a8223c5c71f8c284ceb47d9583ffb 1 parent 0c52c08
Sébastien Bourdeauducq authored June 14, 2013

Showing 1 changed file with 0 additions and 80 deletions. Show diff stats Hide diff stats

  1. 80  migen/bus/asmibus.py
80  migen/bus/asmibus.py
@@ -302,83 +302,3 @@ def do_simulation(self, s):
302 302
 		else:
303 303
 			s.wr(self.hub.call, 0)
304 304
 			self._calling_tag = -1
305  
-
306  
-# Port sharing
307  
-
308  
-class SharedPort:
309  
-	def __init__(self, base_port):
310  
-		if not base_port.finalized:
311  
-			raise FinalizeError
312  
-		self.finalized = True
313  
-
314  
-		nslots = len(base_port.slots)
315  
-
316  
-		self.hub = base_port.hub
317  
-		self.base = base_port.base
318  
-		# 1 if that slot is assigned to us
319  
-		self.slots = [Signal() for i in range(nslots)]
320  
-		
321  
-		# request issuance
322  
-		self.adr = Signal(self.hub.aw)
323  
-		self.we = Signal()
324  
-		self.stb = Signal()
325  
-		if nslots > 1:
326  
-			self.tag_issue = Signal(max=nslots)
327  
-		self.ack = Signal()
328  
-		
329  
-		# request completion
330  
-		self.call = Signal()
331  
-		self.tag_call = Signal(self.hub.tagbits)
332  
-		self.dat_r = Signal(self.hub.dw)
333  
-		self.dat_w = Signal(self.hub.dw)
334  
-		self.dat_wm = Signal(self.hub.dw//8)
335  
-
336  
-	def get_call_expression(self, slotn=0):
337  
-		if not self.finalized:
338  
-			raise FinalizeError
339  
-		return self.call \
340  
-			& (self.tag_call == (self.base + slotn))
341  
-
342  
-class PortSharer(Module):
343  
-	def __init__(self, base_port, nshares):
344  
-		self.shared_ports = [SharedPort(base_port) for i in range(nshares)]
345  
-
346  
-		###
347  
-
348  
-		# request issuance
349  
-		self.submodules.rr = roundrobin.RoundRobin(nshares, roundrobin.SP_CE)
350  
-		self.comb += [
351  
-			self.rr.request.eq(Cat(*[sp.stb for sp in self.shared_ports])),
352  
-			self.rr.ce.eq(base_port.ack)
353  
-		]
354  
-		self.comb += [
355  
-			base_port.adr.eq(Array(sp.adr for sp in self.shared_ports)[self.rr.grant]),
356  
-			base_port.we.eq(Array(sp.we for sp in self.shared_ports)[self.rr.grant]),
357  
-			base_port.stb.eq(Array(sp.stb for sp in self.shared_ports)[self.rr.grant]),
358  
-		]
359  
-		if hasattr(base_port, "tag_issue"):
360  
-			self.comb += [sp.tag_issue.eq(base_port.tag_issue) for sp in self.shared_ports]
361  
-		self.comb += [sp.ack.eq(base_port.ack & (self.rr.grant == n)) for n, sp in enumerate(self.shared_ports)]
362  
-
363  
-		# request completion
364  
-		self.comb += [sp.call.eq(base_port.call & Array(sp.slots)[base_port.tag_call-base_port.base])
365  
-			for sp in self.shared_ports]
366  
-		self.comb += [sp.tag_call.eq(base_port.tag_call) for sp in self.shared_ports]
367  
-		self.comb += [sp.dat_r.eq(base_port.dat_r) for sp in self.shared_ports]
368  
-		self.comb += [
369  
-			base_port.dat_w.eq(optree("|", [sp.dat_w for sp in self.shared_ports])),
370  
-			base_port.dat_wm.eq(optree("|", [sp.dat_wm for sp in self.shared_ports])),
371  
-		]
372  
-		
373  
-		# request ownership tracking
374  
-		if hasattr(base_port, "tag_issue"):
375  
-			for sp in self.shared_ports:
376  
-				self.sync += If(sp.stb & sp.ack, Array(sp.slots)[sp.tag_issue].eq(1))
377  
-				for n, slot in enumerate(sp.slots):
378  
-					self.sync += If(base_port.call & (base_port.tag_call == (base_port.base + n)), slot.eq(0))
379  
-		else:
380  
-			for sp in self.shared_ports:
381  
-				self.sync += [
382  
-					If(sp.stb & sp.ack, sp.slots[0].eq(1)),
383  
-					If(base_port.call & (base_port.tag_call == base_port.base), sp.slots[0].eq(0))
384  
-				]

0 notes on commit ac2cde0

Please sign in to comment.
Something went wrong with that request. Please try again.