From de6424920f8a5b60718cbbefa8f33643343a3954 Mon Sep 17 00:00:00 2001
From: dam1n19 <dam1n19@soton.ac.uk>
Date: Wed, 17 May 2023 11:50:30 +0100
Subject: [PATCH] SOC1-205: Added exclusions options to filelist compile to
 remove filelists including specific arm IP

---
 bin/{htmlgen => }/filelist_compile.py | 11 ++++++++---
 bin/htmlgen/makefile                  |  2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)
 rename bin/{htmlgen => }/filelist_compile.py (89%)

diff --git a/bin/htmlgen/filelist_compile.py b/bin/filelist_compile.py
similarity index 89%
rename from bin/htmlgen/filelist_compile.py
rename to bin/filelist_compile.py
index 1ccbf2a..454e619 100755
--- a/bin/htmlgen/filelist_compile.py
+++ b/bin/filelist_compile.py
@@ -14,6 +14,8 @@ import os
 
 verilog_extensions = (".v", ".sv")
 
+filelist_exclusions = ["cortex","dma"]
+
 filelist_header = """//-----------------------------------------------------------------------------
 // AUTOGENERATED: Compiled Filelist
 // A joint work commissioned on behalf of SoC Labs, under Arm Academic Access license.
@@ -51,14 +53,16 @@ def read_list(filelist):
     for line in filelines:
         # Remove whitespace and split line into arguments
         line_list = line.strip().split()
-        # print(line_list)
         # Check Line isn't a comment
         if not line_list[0].startswith("//"):
             # If line is a reference to another filelist 
             if line_list[0] == "-f":
                 # Recursively call this function and append list to this compiled Filelist
-                print(line_list[1])
-                compiled_filelist += read_list(env_var_substitute(line_list[1]))
+                if any(ext in line_list[1] for ext in filelist_exclusions) and args.exclude == True:
+                    print(line_list[1]+" is in the exclusions list")
+                else:
+                    print(line_list[1])
+                    compiled_filelist += read_list(env_var_substitute(line_list[1]))
 
             elif line_list[0] == "-y":
                 # Append to filelist
@@ -100,5 +104,6 @@ if __name__ == "__main__":
     parser = argparse.ArgumentParser(description='Compiles Filelist to Read')
     parser.add_argument("-f", "--filelist", type=str, help="Input Filelist to Read")
     parser.add_argument("-o", "--output", type=str, help="Output Filelist location")
+    parser.add_argument("-e", "--exclude", action='store_true', help="Exclude filists including these strings")
     args = parser.parse_args()
     filelist_compile(args)
\ No newline at end of file
diff --git a/bin/htmlgen/makefile b/bin/htmlgen/makefile
index 6b57eb4..b675dd9 100644
--- a/bin/htmlgen/makefile
+++ b/bin/htmlgen/makefile
@@ -26,5 +26,5 @@ gen_html:
 	@mkdir -p $(OUT_DIR)/build
 	@(cd $(OUT_DIR)/build; \
 	rm *.html; rm *.gif; \
-	$(SOCTOOLS_FLOW_DIR)/bin/htmlgen/filelist_compile.py -f $(FILELIST) -o $(OUTPUT_FILELIST) ; \
+	$(SOCTOOLS_FLOW_DIR)/bin/filelist_compile.py -e -f $(FILELIST) -o $(OUTPUT_FILELIST) ; \
 	$(SOCTOOLS_FLOW_DIR)/bin/htmlgen/v2html/v2html -f $(OUTPUT_FILELIST) -ht $(TOP_MODULE) ; )
-- 
GitLab