diff --git a/scripts/iob_soc_create_system.py b/scripts/iob_soc_create_system.py index 43edbd8b7..58e73c1a6 100644 --- a/scripts/iob_soc_create_system.py +++ b/scripts/iob_soc_create_system.py @@ -67,6 +67,9 @@ def create_systemv(build_dir, top, peripherals_list, internal_wires=None): periphs_inst_str += " #(\n" # Insert parameters for param in params_list[instance.__class__.name]: + # If param has 'doc_only' attribute set to True, skip it + if "doc_only" in param.keys() and param["doc_only"]: + continue periphs_inst_str += " .{}({}){}\n".format( param["name"], instance.name + "_" + param["name"], "," ) diff --git a/submodules/LIB/scripts/config_gen.py b/submodules/LIB/scripts/config_gen.py index d7dcebeab..81f63bd67 100755 --- a/submodules/LIB/scripts/config_gen.py +++ b/submodules/LIB/scripts/config_gen.py @@ -16,6 +16,9 @@ def params_vh(params, top_module, out_dir): file2create = open(f"{out_dir}/{top_module}_params.vs", "w") core_prefix = f"{top_module}_".upper() for parameter in params: + # If parameter has 'doc_only' attribute set to True, skip it + if "doc_only" in parameter.keys() and parameter["doc_only"]: + continue if parameter["type"] in ["P", "F"]: p_name = parameter["name"].upper() file2create.write(f"\n parameter {p_name} = `{core_prefix}{p_name},") @@ -28,6 +31,9 @@ def params_vh(params, top_module, out_dir): file2create = open(f"{out_dir}/{top_module}_inst_params.vs", "w") for parameter in params: + # If parameter has 'doc_only' attribute set to True, skip it + if "doc_only" in parameter.keys() and parameter["doc_only"]: + continue if parameter["type"] in ["P", "F"]: p_name = parameter["name"].upper() file2create.write(f"\n .{p_name}({p_name}),") @@ -50,6 +56,9 @@ def conf_vh(macros, top_module, out_dir): # file2create.write(f"`ifndef VH_{fname}_VH\n") # file2create.write(f"`define VH_{fname}_VH\n\n") for macro in macros: + # If macro has 'doc_only' attribute set to True, skip it + if "doc_only" in macro.keys() and macro["doc_only"]: + continue if "if_defined" in macro.keys(): file2create.write(f"`ifdef {macro['if_defined']}\n") # Only insert macro if its is not a bool define, and if so only insert it if it is true @@ -75,6 +84,9 @@ def conf_h(macros, top_module, out_dir): file2create.write(f"#ifndef H_{fname}_H\n") file2create.write(f"#define H_{fname}_H\n\n") for macro in macros: + # If macro has 'doc_only' attribute set to True, skip it + if "doc_only" in macro.keys() and macro["doc_only"]: + continue # Only insert macro if its is not a bool define, and if so only insert it if it is true if type(macro["val"]) != bool: m_name = macro["name"].upper() diff --git a/submodules/LIB/scripts/csr_gen.py b/submodules/LIB/scripts/csr_gen.py index 57e8359bc..19a0b77ee 100755 --- a/submodules/LIB/scripts/csr_gen.py +++ b/submodules/LIB/scripts/csr_gen.py @@ -46,6 +46,9 @@ def get_reg_table(self, regs, rw_overlap, autoaddr): # Create reg table reg_table = [] for i_regs in regs: + # If i_regs has 'doc_only' attribute set to True, skip it + if "doc_only" in i_regs.keys() and i_regs["doc_only"]: + continue reg_table += i_regs["regs"] return self.compute_addr(reg_table, rw_overlap, autoaddr) @@ -1191,12 +1194,13 @@ def generate_regs_tex(cls, regs, regs_with_addr, out_dir): for table in regs: tex_table = [] for reg in table["regs"]: + addr = "None" # Find address of matching register in regs_with_addr list - addr = next( - register["addr"] - for register in regs_with_addr - if register["name"] == reg["name"] - ) + for reg_with_addr in regs_with_addr: + if reg_with_addr["name"] == reg["name"]: + addr = reg_with_addr["addr"] + break + tex_table.append( [ reg["name"], diff --git a/submodules/LIB/scripts/ipxact_gen.py b/submodules/LIB/scripts/ipxact_gen.py index d07eaea72..c5963526b 100644 --- a/submodules/LIB/scripts/ipxact_gen.py +++ b/submodules/LIB/scripts/ipxact_gen.py @@ -105,7 +105,9 @@ def __init__( while True: for param in parameters_list: # only replace complete words - max_size = re.sub(r"\b" + param.name + r"\b", param.max_value , max_size) + max_size = re.sub( + r"\b" + param.name + r"\b", param.max_value, max_size + ) # if the string only contains numbers or operators, evaluate it and break the loop if re.match(r"^[0-9\+\-\*\/\(\)]+$", max_size):