Add support for CPUIFs to have parameters #80

This commit is contained in:
Alex Mykyta
2024-03-29 22:39:45 -07:00
parent f25ba60bfc
commit 4dfd9b10d6
2 changed files with 12 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING from typing import TYPE_CHECKING, List
import inspect import inspect
import os import os
@@ -34,6 +34,13 @@ class CpuifBase:
def port_declaration(self) -> str: def port_declaration(self) -> str:
raise NotImplementedError() raise NotImplementedError()
@property
def parameters(self) -> List[str]:
"""
Optional list of additional parameters this CPU interface provides to
the module's definition
"""
return []
def _get_template_path_class_dir(self) -> str: def _get_template_path_class_dir(self) -> str:
""" """

View File

@@ -1,7 +1,10 @@
// Generated by PeakRDL-regblock - A free and open-source SystemVerilog generator // Generated by PeakRDL-regblock - A free and open-source SystemVerilog generator
// https://github.com/SystemRDL/PeakRDL-regblock // https://github.com/SystemRDL/PeakRDL-regblock
module {{ds.module_name}} ( module {{ds.module_name}}
{%- if cpuif.parameters %} #(
{{",\n ".join(cpuif.parameters)}}
) {%- endif %} (
input wire clk, input wire clk,
input wire {{default_resetsignal_name}}, input wire {{default_resetsignal_name}},