Example #1
0
	def __init__(self, baseapp):
		dac_pins = baseapp.constraints.request("ti_dac")
		width = 2*len(dac_pins.dat_p)
		
		spc = 2 if baseapp.double_dac else 1
		dac_class = DAC2X if baseapp.double_dac else DAC
		
		wg_i = WaveformGenerator(1024, width, spc)
		wg_q = WaveformGenerator(1024, width, spc)
		dac = dac_class(dac_pins, baseapp.crg.dacio_strb)

		registers = regprefix("i_", wg_i.get_registers()) \
			+ regprefix("q_", wg_q.get_registers()) \
			+ dac.get_registers()
		baseapp.csrs.request("wg", UID_WAVEFORM_GENERATOR, *registers)
		
		g = DataFlowGraph()
		if baseapp.double_dac:
			g.add_connection(wg_i, dac, sink_subr=["i0", "i1"])
			g.add_connection(wg_q, dac, sink_subr=["q0", "q1"])
		else:
			g.add_connection(wg_i, dac, sink_subr=["i"])
			g.add_connection(wg_q, dac, sink_subr=["q"])
		CompositeActor.__init__(self, g)
	def get_fragment(self):
		return WaveformGenerator.get_fragment(self) + self.bank.get_fragment()
	def __init__(self, address, depth, width, spc):
		WaveformGenerator.__init__(self, depth, width, spc)
		self.bank = csrgen.Bank(self.get_registers(), address)