forked from M-Labs/artiq
1
0
Fork 0

use new Migen signal attribute API

This commit is contained in:
Sebastien Bourdeauducq 2016-10-29 21:17:13 +08:00
parent 6872017449
commit ed4d57c638
2 changed files with 6 additions and 11 deletions

View File

@ -24,10 +24,8 @@ class _GrayCodeTransfer(Module):
self.sync.rtio += value_gray_rtio.eq(self.i ^ self.i[1:]) self.sync.rtio += value_gray_rtio.eq(self.i ^ self.i[1:])
# transfer to system clock domain # transfer to system clock domain
value_gray_sys = Signal(width) value_gray_sys = Signal(width)
self.specials += [ value_gray_rtio.attr.add("no_retiming")
NoRetiming(value_gray_rtio), self.specials += MultiReg(value_gray_rtio, value_gray_sys)
MultiReg(value_gray_rtio, value_gray_sys)
]
# convert back to binary # convert back to binary
value_sys = Signal(width) value_sys = Signal(width)
self.comb += value_sys[-1].eq(value_gray_sys[-1]) self.comb += value_sys[-1].eq(value_gray_sys[-1])

View File

@ -8,7 +8,6 @@ from migen.genlib.cdc import MultiReg
from migen.build.generic_platform import * from migen.build.generic_platform import *
from migen.build.xilinx.vivado import XilinxVivadoToolchain from migen.build.xilinx.vivado import XilinxVivadoToolchain
from migen.build.xilinx.ise import XilinxISEToolchain from migen.build.xilinx.ise import XilinxISEToolchain
from migen.fhdl.specials import Keep
from misoc.interconnect.csr import * from misoc.interconnect.csr import *
from misoc.interconnect import wishbone from misoc.interconnect import wishbone
@ -147,12 +146,10 @@ class _NIST_Ions(MiniSoC, AMPSoC):
self.submodules.rtio_moninj = rtio.MonInj(rtio_channels) self.submodules.rtio_moninj = rtio.MonInj(rtio_channels)
self.csr_devices.append("rtio_moninj") self.csr_devices.append("rtio_moninj")
self.specials += [ self.rtio.cd_rsys.clk.attr.add("keep")
Keep(self.rtio.cd_rsys.clk), self.rtio_crg.cd_rtio.clk.attr.add("keep")
Keep(self.rtio_crg.cd_rtio.clk), self.ethphy.crg.cd_eth_rx.clk.attr.add("keep")
Keep(self.ethphy.crg.cd_eth_rx.clk), self.ethphy.crg.cd_eth_tx.clk.attr.add("keep")
Keep(self.ethphy.crg.cd_eth_tx.clk),
]
self.platform.add_period_constraint(self.rtio.cd_rsys.clk, 8.) self.platform.add_period_constraint(self.rtio.cd_rsys.clk, 8.)
self.platform.add_period_constraint(self.rtio_crg.cd_rtio.clk, 8.) self.platform.add_period_constraint(self.rtio_crg.cd_rtio.clk, 8.)