diff --git a/iob_soc.py b/iob_soc.py index f9f841625..2eb096f93 100755 --- a/iob_soc.py +++ b/iob_soc.py @@ -61,8 +61,8 @@ def _generate_files(cls): if num_extmem_connections == 1: inplace_change( os.path.join(cls.build_dir, "hardware/src", cls.name + ".v"), - "[0+:1])", - ")", + "[0+:1]", + "", ) # Generate hw, sw, doc files super()._generate_files() diff --git a/submodules/AXI b/submodules/AXI index ed747453e..de725f23f 160000 --- a/submodules/AXI +++ b/submodules/AXI @@ -1 +1 @@ -Subproject commit ed747453e3e51046710894b4d400e5124fc09547 +Subproject commit de725f23fbd5658363f8df740a4cac912bdf796c diff --git a/submodules/LIB/scripts/submodule_utils.py b/submodules/LIB/scripts/submodule_utils.py index a5dc56e5c..bc6580bb5 100755 --- a/submodules/LIB/scripts/submodule_utils.py +++ b/submodules/LIB/scripts/submodule_utils.py @@ -136,27 +136,30 @@ def get_peripheral_macros(confs, peripherals_list): # Append macros with ID of each peripheral confs.extend(get_periphs_id_as_macros(peripherals_list)) # Append macro with number of peripherals - confs.append( - { - "name": "N_SLAVES", - "type": "M", - "val": get_n_periphs(peripherals_list), - "min": "NA", - "max": "NA", - "descr": "Number of peripherals", - } - ) - # Append macro with width of peripheral bus - confs.append( - { - "name": "N_SLAVES_W", - "type": "M", - "val": get_n_periphs_w(peripherals_list), - "min": "NA", - "max": "NA", - "descr": "Peripheral bus width", - } - ) + # Only append macro if it does not exist (to allow subclasses set their own number) + if not list([i for i in confs if i["name"] == "N_SLAVES"]): + confs.append( + { + "name": "N_SLAVES", + "type": "M", + "val": get_n_periphs(peripherals_list), + "min": "NA", + "max": "NA", + "descr": "Number of peripherals", + } + ) + if not list([i for i in confs if i["name"] == "N_SLAVES_W"]): + # Append macro with width of peripheral bus + confs.append( + { + "name": "N_SLAVES_W", + "type": "M", + "val": get_n_periphs_w(peripherals_list), + "min": "NA", + "max": "NA", + "descr": "Peripheral bus width", + } + ) # Check if a module of certain type is in given modules list.