from litex.build.tools import write_to_file
from litex.soc.integration import cpu_interface, soc_core, soc_sdram
-from litedram import sdram_init
+from litedram.init import get_sdram_phy_c_header
__all__ = ["soc_software_packages", "soc_directory",
"Builder", "builder_args", "builder_argdict"]
if hasattr(self.soc, "sdram"):
write_to_file(
os.path.join(generated_dir, "sdram_phy.h"),
- sdram_init.get_sdram_phy_c_header(
+ get_sdram_phy_c_header(
self.soc.sdram.controller.settings.phy,
self.soc.sdram.controller.settings.timing))
class ControllerInjector(Module, AutoCSR):
- def __init__(self, phy, geom_settings, timing_settings, **kwargs):
+ def __init__(self, phy, geom_settings, timing_settings, clk_freq, **kwargs):
self.submodules.dfii = dfii.DFIInjector(
geom_settings.addressbits,
geom_settings.bankbits,
self.comb += self.dfii.master.connect(phy.dfi)
self.submodules.controller = controller = core.LiteDRAMController(
- phy.settings, geom_settings, timing_settings, **kwargs)
+ phy.settings, geom_settings, timing_settings,
+ clk_freq, **kwargs)
self.comb += controller.dfi.connect(self.dfii.slave)
self.submodules.crossbar = core.LiteDRAMCrossbar(controller.interface)
self._sdram_phy.append(phy) # encapsulate in list to prevent CSR scanning
self.submodules.sdram = ControllerInjector(
- phy, geom_settings, timing_settings, **kwargs)
+ phy, geom_settings, timing_settings, self.clk_freq, **kwargs)
main_ram_size = 2**(geom_settings.bankbits +
geom_settings.rowbits +