7a988bee22
Ex of use in a SoC that issues a DHCP request per second: from liteeth.core.dhcp import LiteEthDHCP from migen.genlib.misc import WaitTimer # Signals. ip_address = Signal(32) mac_address = Signal(48, reset=0x10e2d5000001) # Request Timer. self.dhcp_timer = dhcp_timer = WaitTimer(int(sys_clk_freq/2)) self.comb += self.dhcp_timer.wait.eq(~self.dhcp_timer.done) # DHCP. dhcp_port = self.ethcore_etherbone.udp.crossbar.get_port(68, dw=32, cd="sys") self.dhcp = dhcp = LiteEthDHCP(udp_port=dhcp_port, sys_clk_freq=sys_clk_freq) self.comb += [ dhcp.start.eq(self.dhcp_timer.done), dhcp.mac_address.eq(mac_address), ] self.sync += [ If(dhcp.done, ip_address.eq(dhcp.offered_ip_address) ) ] |
||
---|---|---|
.. | ||
core | ||
frontend | ||
mac | ||
phy | ||
software | ||
__init__.py | ||
common.py | ||
crossbar.py | ||
gen.py | ||
packet.py |