From 7584bf46da1eeaecc272ec1a124c1d4fe1f4e7af Mon Sep 17 00:00:00 2001 From: "D. Mitch Bailey" Date: Sun, 26 Jun 2022 19:18:44 -0700 Subject: [PATCH 1/2] Remove pre-existing magic and gate level verilog because they may be out-of-date. --- scripts/gen_gpio_defaults.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/gen_gpio_defaults.py b/scripts/gen_gpio_defaults.py index 9eaeb487..0c54e18e 100755 --- a/scripts/gen_gpio_defaults.py +++ b/scripts/gen_gpio_defaults.py @@ -66,6 +66,7 @@ import os import sys import re +import glob def usage(): print('Usage:') @@ -207,6 +208,12 @@ def usage(): cellsused = [None] * 38 + # Remove pre-existing versions of mag and verilog files because they may be out-of-date. + for old_mag_file in glob.glob(magpath + '/gpio_defaults_block*.mag'): + os.remove(old_mag_file) + for old_verilog_file in glob.glob(glpath + '/gpio_defaults_block*.v'): + os.remove(old_verilog_file) + for i in range(0, 38): config_name = '`USER_CONFIG_GPIO_' + str(i) + '_INIT' try: From 22f2e9c6d5f97071f86b63e17d26d36cb09ff8da Mon Sep 17 00:00:00 2001 From: Mitch Bailey Date: Thu, 29 Feb 2024 03:53:00 +0900 Subject: [PATCH 2/2] Update gen_gpio_defaults.py Only remove created copies. Do not remove originals (which shouldn't exist in the user area). --- scripts/gen_gpio_defaults.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gen_gpio_defaults.py b/scripts/gen_gpio_defaults.py index 21454ba1..a108c349 100755 --- a/scripts/gen_gpio_defaults.py +++ b/scripts/gen_gpio_defaults.py @@ -213,9 +213,9 @@ def usage(): cellsused = [None] * 38 # Remove pre-existing versions of mag and verilog files because they may be out-of-date. - for old_mag_file in glob.glob(magpath + '/gpio_defaults_block*.mag'): + for old_mag_file in glob.glob(magpath + '/gpio_defaults_block_*.mag'): os.remove(old_mag_file) - for old_verilog_file in glob.glob(glpath + '/gpio_defaults_block*.v'): + for old_verilog_file in glob.glob(glpath + '/gpio_defaults_block_*.v'): os.remove(old_verilog_file) for i in range(0, 38):