diff --git a/src/peakrdl_uvm/__peakrdl__.py b/src/peakrdl_uvm/__peakrdl__.py index 3f0d7bb..b660269 100644 --- a/src/peakrdl_uvm/__peakrdl__.py +++ b/src/peakrdl_uvm/__peakrdl__.py @@ -1,6 +1,7 @@ from typing import TYPE_CHECKING from peakrdl.plugins.exporter import ExporterSubcommandPlugin #pylint: disable=import-error +from peakrdl.config import schema #pylint: disable=import-error from .exporter import UVMExporter @@ -12,6 +13,12 @@ class Exporter(ExporterSubcommandPlugin): short_desc = "Generate a UVM register model" + cfg_schema = { + "user_template_dir": schema.DirectoryPath(), + "user_template_context": schema.UserMapping(schema.String()), + } + + def add_exporter_arguments(self, arg_group: 'argparse.ArgumentParser') -> None: arg_group.add_argument( "--file-type", @@ -43,7 +50,10 @@ def add_exporter_arguments(self, arg_group: 'argparse.ArgumentParser') -> None: def do_export(self, top_node: 'AddrmapNode', options: 'argparse.Namespace') -> None: - x = UVMExporter() + x = UVMExporter( + user_template_dir=self.cfg['user_template_dir'], + user_template_context=self.cfg['user_template_context'] + ) x.export( top_node, options.output,