# # #
+ den_pipe = Signal()
+ dwe_pipe = Signal()
+
drp_drdy = Signal()
self.params.update(
i_DCLK = ClockSignal(),
- i_DWE = self.drp_write.re,
- i_DEN = self.drp_read.re | self.drp_write.re,
+ i_DWE = dwe_pipe,
+ i_DEN = den_pipe,
o_DRDY = drp_drdy,
i_DADDR = self.drp_adr.storage,
i_DI = self.drp_dat_w.storage,
o_DO = self.drp_dat_r.status
)
self.sync += [
+ den_pipe.eq(self.drp_read.re | self.drp_write.re),
+ dwe_pipe.eq(self.drp_write.re),
If(self.drp_read.re | self.drp_write.re,
self.drp_drdy.status.eq(0)
).Elif(drp_drdy,
self.dadr = Signal(7)
self.di = Signal(16)
self.do = Signal(16)
+ self.drp_en = Signal()
self.specials += Instance("XADC",
# From ug480
p_INIT_40=0x9000, p_INIT_41=0x2ef0, p_INIT_42=0x0400,
o_DO = self.do
)
self.comb += [
- self.den.eq(eoc),
- self.dadr.eq(channel),
+ If(~self.drp_en,
+ self.den.eq(eoc),
+ self.dadr.eq(channel),
+ )
]
# Channels update --------------------------------------------------------------------------
# # #
+ den_pipe = Signal() # add a register to ease timing closure of den
+
self.comb += [
- self.dwe.eq(self.drp_write.re),
self.di.eq(self.drp_dat_w.storage),
self.drp_dat_r.status.eq(self.do),
- If(self.drp_enable.storage,
- self.den.eq(self.drp_read.re | self.drp_write.re),
- self.dadr.eq(self.drp_adr.storage),
- ),
+ If(self.drp_en,
+ self.den.eq(den_pipe),
+ self.dadr.eq(self.drp_adr.storage),
+ )
]
self.sync += [
+ self.dwe.eq(self.drp_write.re),
+ self.drp_en.eq(self.drp_enable.storage),
+ den_pipe.eq(self.drp_read.re | self.drp_write.re),
If(self.drp_read.re | self.drp_write.re,
self.drp_drdy.status.eq(0)
).Elif(self.drdy,