From 88818212521a2f6763c8939226bdca4ea2a46206 Mon Sep 17 00:00:00 2001 From: Dennis Date: Sun, 22 Aug 2021 20:46:35 -0700 Subject: [PATCH] Give more consistent names to modules and packages --- srdl2sv/components/addrmap.py | 4 ++-- .../{amba3ahblite.sv => srdl2sv_amba3ahblite.sv} | 4 ++-- ...amba3ahblite.yaml => srdl2sv_amba3ahblite.yaml} | 4 ++-- .../{srdl2sv_widget_pkg.sv => srdl2sv_if_pkg.sv} | 2 +- srdl2sv/main.py | 14 +++++++------- 5 files changed, 14 insertions(+), 14 deletions(-) rename srdl2sv/components/widgets/{amba3ahblite.sv => srdl2sv_amba3ahblite.sv} (98%) rename srdl2sv/components/widgets/{amba3ahblite.yaml => srdl2sv_amba3ahblite.yaml} (97%) rename srdl2sv/components/widgets/{srdl2sv_widget_pkg.sv => srdl2sv_if_pkg.sv} (90%) diff --git a/srdl2sv/components/addrmap.py b/srdl2sv/components/addrmap.py index aa235ba..3753f55 100644 --- a/srdl2sv/components/addrmap.py +++ b/srdl2sv/components/addrmap.py @@ -134,7 +134,7 @@ class AddrMap(Component): # b2w and w2b defines. import_package_list = [ AddrMap.templ_dict['import_package']['rtl'].format( - name = 'srdl2sv_widget'), + name = 'srdl2sv_if'), '\n' ] @@ -236,7 +236,7 @@ class AddrMap(Component): def __get_widget_ports_rtl(self): self.widget_templ_dict = yaml.load( - pkg_resources.read_text(widgets, '{}.yaml'.format(self.config['bus'])), + pkg_resources.read_text(widgets, 'srdl2sv_{}.yaml'.format(self.config['bus'])), Loader=yaml.FullLoader) return self.process_yaml( diff --git a/srdl2sv/components/widgets/amba3ahblite.sv b/srdl2sv/components/widgets/srdl2sv_amba3ahblite.sv similarity index 98% rename from srdl2sv/components/widgets/amba3ahblite.sv rename to srdl2sv/components/widgets/srdl2sv_amba3ahblite.sv index c910fa5..4257467 100644 --- a/srdl2sv/components/widgets/amba3ahblite.sv +++ b/srdl2sv/components/widgets/srdl2sv_amba3ahblite.sv @@ -23,8 +23,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -module amba3ahblite_widget - import srdl2sv_widget_pkg::*; +module srdl2sv_amba3ahblite + import srdl2sv_if_pkg::*; #( parameter FLOP_IN = 0, // Set to '1' to flop input from the AHB bus. This is meant // to help meet timing. Don't use this to synchronize the input. diff --git a/srdl2sv/components/widgets/amba3ahblite.yaml b/srdl2sv/components/widgets/srdl2sv_amba3ahblite.yaml similarity index 97% rename from srdl2sv/components/widgets/amba3ahblite.yaml rename to srdl2sv/components/widgets/srdl2sv_amba3ahblite.yaml index 52a13c3..dd1f2b8 100644 --- a/srdl2sv/components/widgets/amba3ahblite.yaml +++ b/srdl2sv/components/widgets/srdl2sv_amba3ahblite.yaml @@ -15,8 +15,8 @@ module_instantiation: * (not the registers). The deassertion of this * reset shall be synchronized to bus_clk *******************************************************************/ - amba3ahblite_widget - amba3ahblite_widget_inst + srdl2sv_amba3ahblite + srdl2sv_amba3ahblite_inst (// Register clock .reg_clk, diff --git a/srdl2sv/components/widgets/srdl2sv_widget_pkg.sv b/srdl2sv/components/widgets/srdl2sv_if_pkg.sv similarity index 90% rename from srdl2sv/components/widgets/srdl2sv_widget_pkg.sv rename to srdl2sv/components/widgets/srdl2sv_if_pkg.sv index e938dec..afa1bf7 100644 --- a/srdl2sv/components/widgets/srdl2sv_widget_pkg.sv +++ b/srdl2sv/components/widgets/srdl2sv_if_pkg.sv @@ -1,4 +1,4 @@ -package srdl2sv_widget_pkg; +package srdl2sv_if_pkg; typedef struct { logic [31:0] addr; diff --git a/srdl2sv/main.py b/srdl2sv/main.py index ddd7618..9fc4bbd 100755 --- a/srdl2sv/main.py +++ b/srdl2sv/main.py @@ -79,24 +79,24 @@ if __name__ == "__main__": print(value, file=file) # Copy over widget RTL from widget directory - widget_rtl = pkg_resources.read_text(widgets, '{}.sv'.format(config['bus'])) + widget_rtl = pkg_resources.read_text(widgets, 'srdl2sv_{}.sv'.format(config['bus'])) - out_widget_file = "{}/{}.sv".format(config['output_dir'], config['bus']) + out_widget_file = "{}/srdl2sv_{}.sv".format(config['output_dir'], config['bus']) with open(out_widget_file, 'w') as file: print(widget_rtl, file=file) logger.info("Selected, implemented, and copied '{}' widget".format(config['bus'])) - # Copy over generic srdl2sv_widget_pkg - widget_if_rtl = pkg_resources.read_text(widgets, 'srdl2sv_widget_pkg.sv') + # Copy over generic srdl2sv_interface_pkg + widget_if_rtl = pkg_resources.read_text(widgets, 'srdl2sv_if_pkg.sv') - out_widget_if_file = "{}/srdl2sv_widget_pkg.sv".format(config['output_dir']) + out_if_file = "{}/srdl2sv_if_pkg.sv".format(config['output_dir']) - with open(out_widget_if_file, 'w') as file: + with open(out_if_file, 'w') as file: print(widget_if_rtl,file=file) - logger.info("Copied 'srdl2sv_widget_pkg.sv") + logger.info("Copied 'srdl2sv_if_pkg.sv") # Print elapsed time logger.info("Elapsed time: %f seconds", time.time() - start)