summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrahulp132022-02-22 01:39:49 +0530
committerrahulp132022-02-22 01:39:49 +0530
commit2b0b878d72c74e3a335b346362eaa533c5459821 (patch)
tree29075732acd91939919dbb52be26f63af53fe4c6
parentb6dcef53727c4a216d7b80d3085c1c0e4651a95a (diff)
downloadeSim-2b0b878d72c74e3a335b346362eaa533c5459821.tar.gz
eSim-2b0b878d72c74e3a335b346362eaa533c5459821.tar.bz2
eSim-2b0b878d72c74e3a335b346362eaa533c5459821.zip
Fix empty line lint_off crash issues
-rwxr-xr-xsrc/maker/ModelGeneration.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/maker/ModelGeneration.py b/src/maker/ModelGeneration.py
index 0a6df82c..cbb268af 100755
--- a/src/maker/ModelGeneration.py
+++ b/src/maker/ModelGeneration.py
@@ -806,10 +806,12 @@ and set the load for input ports */
init_path = ''
self.cur_dir = os.getcwd()
- file = open(init_path + "library/tlv/lint_off.txt").readlines()
wno = " "
- for item in file:
- wno += " -Wno-" + item.strip("\n")
+ with open(init_path + "library/tlv/lint_off.txt") as file:
+ for item in file.readlines():
+ if item and item.strip():
+ wno += " -Wno-" + item.strip("\n")
+
print("Running Verilator.............")
os.chdir(self.modelpath)
self.release_home = self.parser.get('NGHDL', 'RELEASE')