From f3d01ce98cd71cad90d9e567134f65a4c6a03ebc Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 6 Oct 2021 14:30:50 +0200 Subject: [PATCH] litedram_gen: Expose ControllerSettings to user (and make cmd_buffer_length optional). --- litedram/gen.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/litedram/gen.py b/litedram/gen.py index d1f131c..65bcfe5 100755 --- a/litedram/gen.py +++ b/litedram/gen.py @@ -33,6 +33,7 @@ import math import struct import yaml import argparse +import inspect from migen import * from migen.genlib.resetsync import AsyncResetSynchronizer @@ -602,7 +603,11 @@ class LiteDRAMCore(SoCCore): raise NotImplementedError # Controller Settings. - controller_settings = controller_settings = ControllerSettings(cmd_buffer_depth=core_config["cmd_buffer_depth"]) + controller_kwargs = {} + for name in inspect.getfullargspec(ControllerSettings. __init__).args: + if core_config.get(name, None) is not None: + controller_kwargs[name] = core_config[name] + controller_settings = controller_settings = ControllerSettings(**controller_kwargs) # Add LiteDRAM Core to SoC. self.add_sdram("sdram",