Exemplo n.º 1
0
class CompositeActor(Actor):
	def __init__(self, dfg, debugger=False, debugger_nbits=48):
		dfg.elaborate()
		self.dfg = dfg
		if debugger:
			self.debugger = DFGReporter(self.dfg, debugger_nbits)
		Actor.__init__(self)
	
	def get_registers(self):
		if hasattr(self, "debugger"):
			return self.debugger.get_registers()
		else:
			return []
	
	def get_fragment(self):
		comb = [self.busy.eq(optree("|", [node.busy for node in self.dfg]))]
		fragment = Fragment(comb)
		for node in self.dfg:
			fragment += node.get_fragment()
		for u, v, d in self.dfg.edges_iter(data=True):
			ep_src = u.endpoints[d["source"]]
			ep_dst = v.endpoints[d["sink"]]
			fragment += get_conn_fragment(ep_src, ep_dst)
		if hasattr(self, "debugger"):
			fragment += self.debugger.get_fragment()
		return fragment
Exemplo n.º 2
0
	def __init__(self, dfg, debugger=False, debugger_nbits=48):
		dfg.elaborate()
		self.dfg = dfg
		if debugger:
			self.debugger = DFGReporter(self.dfg, debugger_nbits)
		Actor.__init__(self)