diff --git a/fpga_imp/scripts/flist_to_tcl.py b/fpga_imp/scripts/flist_to_tcl.py
index 8227e32d40efe0bd9eb7c027c222f5e31a9d81e7..b5d8f4ece5d5cd334509f2a869f1b6d16ef328fb 100644
--- a/fpga_imp/scripts/flist_to_tcl.py
+++ b/fpga_imp/scripts/flist_to_tcl.py
@@ -1,5 +1,5 @@
-import argparse
 import os
+import argparse
 parser = argparse.ArgumentParser(description="Take flist file for verilog simulation and convert to tcl readable",
                                  formatter_class=argparse.ArgumentDefaultsHelpFormatter)
 parser.add_argument("-i", "--input", help="input flist file")
@@ -7,19 +7,40 @@ parser.add_argument("-o", "--output", help="output tcl file")
 args = parser.parse_args()
 config = vars(args)
 
-if not os.path.exists(config["output"]):
-    outfile = open(config["output"], "a")
 
-
-    for line in open(config["input"]):
+def readFlist(fname, outfile):
+    for line in open(fname):
         li = line.strip()
         if not li.startswith("//"):
-            if li.endswith(".v"):
+            if li.startswith("-f"):
+                #Read file and run readFlist 
+                li = li.replace("-f ","")
+                tmp = li.split('/')
+                tmp[0]=tmp[0].replace("$","")
+                tmp[0]=tmp[0].replace('(','')
+                tmp[0]=tmp[0].replace(')','')
+                print(tmp)
+                envPath = os.environ.get(tmp[0])
+                print(envPath)
+                tmp.pop(0)
+                infile = envPath
+                for dir in tmp:
+                    infile += '/' + dir
+                print(infile)
+                readFlist(infile,outfile)
+            elif li.endswith(".v"):
                 output = (line.rstrip()).replace("$","read_verilog $env")
                 outfile.write(output+'\n')
+    return
 
 
-    outfile.close()
+if not os.path.exists(config["output"]):
+    if os.path.exists(config["input"]):
+        outfile = open(config["output"], "a")
+        readFlist(config["input"],outfile)
+        outfile.close()
+    else:
+        print("ERROR: Input file does not exist")
 else:
     print("ERROR: Output file already exists")