simplify MAC dispatch (use onehot mode if Dispatcher)

This commit is contained in:
Florent Kermarrec 2015-01-29 01:10:40 +01:00
parent 51c9f84ef0
commit cb9ec51de8
1 changed files with 3 additions and 7 deletions

View File

@ -11,16 +11,12 @@ class LiteEthIPStack(Module, AutoCSR):
self.submodules.ip = ip = LiteEthMACIP() self.submodules.ip = ip = LiteEthMACIP()
# MAC dispatch # MAC dispatch
self.submodules.unknown_sink = unknown_sink = Sink(eth_mac_description(8)) self.submodules.mac_dispatcher = mac_dispatcher = Dispatcher(mac.source, [arp.sink, ip.sink], one_hot=True)
self.comb += unknown_sink.ack.eq(1)
self.submodules.mac_dispatcher = mac_dispatcher = Dispatcher(mac.source, [arp.sink, ip.sink, unknown_sink])
self.comb += [ self.comb += [
If(mac.source.eth_type == ethernet_type_arp, If(mac.source.eth_type == ethernet_type_arp,
mac_dispatcher.sel.eq(0)
).Elif(mac.source.eth_type == ethernet_type_ip,
mac_dispatcher.sel.eq(1) mac_dispatcher.sel.eq(1)
).Else( ).Elif(mac.source.eth_type == ethernet_type_ip,
mac_dispatcher.sel.eq(2) # connect to unknown sink that always acknowledge data mac_dispatcher.sel.eq(2)
) )
] ]
# MAC arbitrate # MAC arbitrate