[reggen] Make Params class less reggen-specific
The Params class is a nice container for holding parameters, only two
methods make it specific to the use in reggen. Leave only the common
parts in Params, and move all reggen-specific things into a new class
ReggenParams.
(I did go this route instead of renaming Params -> BaseParams to
indicate in the class name that the code is actually specific to reggen.
ReggenParams isn't the greatest name either, but the usage scenarios for
the class are rather wide, so RegParams sounded wrong as well ...)
Signed-off-by: Philipp Wagner <phw@lowrisc.org>
diff --git a/util/reggen/ip_block.py b/util/reggen/ip_block.py
index 92d6c38..e2bf3dd 100644
--- a/util/reggen/ip_block.py
+++ b/util/reggen/ip_block.py
@@ -13,7 +13,7 @@
from .inter_signal import InterSignal
from .lib import (check_keys, check_name, check_int, check_bool,
check_list, check_optional_str, check_name_list)
-from .params import Params, LocalParam
+from .params import ReggenParams, LocalParam
from .reg_block import RegBlock
from .signal import Signal
@@ -74,7 +74,7 @@
def __init__(self,
name: str,
regwidth: int,
- params: Params,
+ params: ReggenParams,
reg_blocks: Dict[Optional[str], RegBlock],
interrupts: Sequence[Signal],
no_auto_intr: bool,
@@ -146,8 +146,8 @@
'{} is not positive.'
.format(what, regwidth))
- params = Params.from_raw('parameter list for ' + what,
- rd.get('param_list', []))
+ params = ReggenParams.from_raw('parameter list for ' + what,
+ rd.get('param_list', []))
try:
params.apply_defaults(param_defaults)
except (ValueError, KeyError) as err: