From b08d00e408a3532802857b047cbbd394d4c7dce2 Mon Sep 17 00:00:00 2001
From: dam1n19 <dam1n19@soton.ac.uk>
Date: Mon, 3 Jul 2023 12:05:41 +0100
Subject: [PATCH] Changes to filel adding

---
 bin/filelist_compile.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/bin/filelist_compile.py b/bin/filelist_compile.py
index 7b61cfd..47486d3 100755
--- a/bin/filelist_compile.py
+++ b/bin/filelist_compile.py
@@ -104,7 +104,11 @@ def read_list(filelist, first, args):
                         else:
                             compiled_filelist.append("set search_path [ concat $search_path " + str(env_var_substitute(line_list[0].lstrip("+incdir+"), tcl=True)).replace("$","$env") + " ]")
                     else:
-                        compiled_filelist.append(str(line_list[0].lstrip("+incdir+")).replace("$","$env")+"/")
+                        if first == True:
+                            compiled_filelist.append("set search_path " + str(line_list[0].lstrip("+incdir+")).replace("$","$env"))
+                            first = False
+                        else:
+                            compiled_filelist.append("set search_path [ concat $search_path " + str(line_list[0].lstrip("+incdir+")).replace("$","$env") + " ]")
                 
             # If file list a verilog file
             elif line_list[0].endswith(verilog_extensions):
@@ -116,7 +120,8 @@ def read_list(filelist, first, args):
                         compiled_filelist.append(env_var_substitute(line_list[0]))
                 else:
                     if args.tcl == True:
-                        compiled_filelist.append("read_verilog " + str(line_list[0]).replace("$","$env"))
+                        # compiled_filelist.append("read_verilog " + str(line_list[0]).replace("$","$env"))
+                        compiled_filelist.append("add_files -norecurse -scan_for_includes " + str(line_list[0]).replace("$","$env"))
                     else:
                         compiled_filelist.append(line_list[0])
     return compiled_filelist, first
-- 
GitLab