from litex.soc.integration.builder import *
from litedram.modules import EDY4016A
-from litedram.phy import kusddrphy
+from litedram.phy import usddrphy
class _CRG(Module):
self.submodules.crg = _CRG(platform)
# sdram
- self.submodules.ddrphy = kusddrphy.KUSDDRPHY(platform.request("ddram"), memtype="DDR4", sys_clk_freq=sys_clk_freq)
- self.add_constant("KUSDDRPHY", None)
+ self.submodules.ddrphy = usddrphy.USDDRPHY(platform.request("ddram"), memtype="DDR4", sys_clk_freq=sys_clk_freq)
+ self.add_constant("USDDRPHY", None)
sdram_module = EDY4016A(sys_clk_freq, "1:4")
self.register_sdram(self.ddrphy,
sdram_module.geom_settings,
#ifdef CSR_DDRPHY_BASE
-#ifdef KUSDDRPHY
+#ifdef USDDRPHY
#define ERR_DDRPHY_DELAY 512
#else
#define ERR_DDRPHY_DELAY 32
ddrphy_dly_sel_write(1 << i);
ddrphy_wdly_dq_rst_write(1);
ddrphy_wdly_dqs_rst_write(1);
-#ifdef KUSDDRPHY /* need to init manually on Ultrascale */
+#ifdef USDDRPHY /* need to init manually on Ultrascale */
for(j=0; j<ddrphy_half_sys8x_taps_read(); j++)
ddrphy_wdly_dqs_inc_write(1);
#endif
int zero_count = 0;
int one_count = 0;
int show = 1;
-#ifdef KUSDDRPHY
+#ifdef USDDRPHY
show = (j%16 == 0);
#endif
for (k=0; k<128; k++) {
/* configure delays */
ddrphy_wdly_dq_rst_write(1);
ddrphy_wdly_dqs_rst_write(1);
-#ifdef KUSDDRPHY /* need to init manually on Ultrascale */
+#ifdef USDDRPHY /* need to init manually on Ultrascale */
for(j=0; j<ddrphy_half_sys8x_taps_read(); j++)
ddrphy_wdly_dqs_inc_write(1);
#endif
for(j=0; j<ERR_DDRPHY_DELAY;j++) {
int working;
int show = 1;
-#ifdef KUSDDRPHY
+#ifdef USDDRPHY
show = (j%16 == 0);
#endif
command_prd(DFII_COMMAND_CAS|DFII_COMMAND_CS|DFII_COMMAND_RDDATA);
delay_min = delay;
/* Get a bit further into the working zone */
-#ifdef KUSDDRPHY
+#ifdef USDDRPHY
for(j=0;j<16;j++) {
delay += 1;
ddrphy_rdly_dq_inc_write(1);