Hi,

Attached is a build script that does two things:
1) instantiates the new DDC/EDID core from milkymist-ng
2) blinks a LED using the DVI/HDMI pixel clock - basically this makes a xrandr-controlled LED blinker :)

It is useful for tracking down EDID problems on the video mixer (faster to synthesize than the whole SoC) and as an example of using Mibuild.

Sebastien
from migen.fhdl.structure import *
from migen.fhdl.module import Module
from mibuild.platforms import m1
from mibuild.crg import CRG

from milkymist.dvisampler.edid import EDID

class EDIDTester(EDID, CRG):
	def __init__(self):
		EDID.__init__(self)
		
		self.clk = Signal()
		self.data0_n = Signal()
		self.data1 = Signal()
		self.data2_n = Signal()

		self.clk50 = Signal()
		self.rst = Signal()
		self.led = Signal()

		self.cd_sys = ClockDomain("sys")
		self.cd_pix = ClockDomain("pix")

		self.comb += [
			self.cd_sys.clk.eq(self.clk50),
			self.cd_sys.rst.eq(self.rst),
			self.cd_pix.clk.eq(self.clk)
		]
		counter = Signal(23)
		self.comb += self.led.eq(counter[22])
		self.sync.pix += counter.eq(counter + 1)

dut = EDIDTester()
plat = m1.Platform()
plat.request("clk50", 0, dut.clk50)
plat.request("user_btn", 0, dut.rst)
plat.request("dvi_in", 0, dut)
plat.request("user_led", 0, dut.led)
plat.add_platform_command("NET \"{clk}\" CLOCK_DEDICATED_ROUTE = FALSE;", clk=dut.clk)
plat.build_cmdline(dut, clock_domains=dut.get_clock_domains())
_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode

Reply via email to