frontend/adapter/LiteDRAMNativePortConverter: simplify using ratio.
This commit is contained in:
parent
a3dfc1db25
commit
06f7192fb6
|
@ -348,15 +348,16 @@ class LiteDRAMNativePortConverter(Module):
|
||||||
|
|
||||||
# # #
|
# # #
|
||||||
|
|
||||||
mode = port_from.mode
|
ratio = port_from.data_width/port_to.data_width
|
||||||
|
|
||||||
if port_from.data_width > port_to.data_width:
|
if ratio > 1:
|
||||||
converter = LiteDRAMNativePortDownConverter(port_from, port_to, reverse)
|
# DownConverter
|
||||||
self.submodules += converter
|
self.submodules.converter = LiteDRAMNativePortDownConverter(port_from, port_to, reverse)
|
||||||
elif port_from.data_width < port_to.data_width:
|
elif ratio < 1:
|
||||||
converter = LiteDRAMNativePortUpConverter(port_from, port_to, reverse)
|
# UpConverter
|
||||||
self.submodules += converter
|
self.submodules.converter = LiteDRAMNativePortUpConverter(port_from, port_to, reverse)
|
||||||
else:
|
else:
|
||||||
|
# Identity
|
||||||
self.comb += [
|
self.comb += [
|
||||||
port_from.cmd.connect(port_to.cmd),
|
port_from.cmd.connect(port_to.cmd),
|
||||||
port_from.wdata.connect(port_to.wdata),
|
port_from.wdata.connect(port_to.wdata),
|
||||||
|
|
Loading…
Reference in New Issue