diff options
author | rahulp13 | 2022-02-22 02:31:30 +0530 |
---|---|---|
committer | rahulp13 | 2022-02-22 02:31:30 +0530 |
commit | 87bc2c82192c948ddb88c52dfcd5213920920c2f (patch) | |
tree | e19ba25793ab0de04e9b337d653589c74aac2da1 /src/maker/Maker.py | |
parent | 272bf20219595c3c541797b1045ce9c400ab02d6 (diff) | |
download | eSim-87bc2c82192c948ddb88c52dfcd5213920920c2f.tar.gz eSim-87bc2c82192c948ddb88c52dfcd5213920920c2f.tar.bz2 eSim-87bc2c82192c948ddb88c52dfcd5213920920c2f.zip |
Fixed typos and resolved flake8 issues
Diffstat (limited to 'src/maker/Maker.py')
-rwxr-xr-x | src/maker/Maker.py | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/src/maker/Maker.py b/src/maker/Maker.py index 9f4263c2..c7a66204 100755 --- a/src/maker/Maker.py +++ b/src/maker/Maker.py @@ -27,17 +27,11 @@ # ========================================================================= # importing the files and libraries -from xml.etree import ElementTree as ET # noqa:F401 import hdlparse.verilog_parser as vlog -import time # noqa:F401 from PyQt5 import QtCore, QtWidgets -from PyQt5.QtCore import QThread, Qt # noqa:F401 -from PyQt5.QtWidgets \ - import QApplication, \ - QWidget, QLabel, QVBoxLayout # noqa:F401 +from PyQt5.QtCore import QThread from configuration.Appconfig import Appconfig import os -import subprocess # noqa:F401 import watchdog.events import watchdog.observers from os.path import expanduser @@ -101,7 +95,7 @@ class Maker(QtWidgets.QWidget): # self.grid.addWidget(self.creategroup(), 1, 0, 5, 0) self.show() - # This function is to Add new verilog file + # This function is to Add new verilog file def addverilog(self): init_path = '../../' @@ -109,7 +103,7 @@ class Maker(QtWidgets.QWidget): init_path = '' self.verilogfile = QtCore.QDir.toNativeSeparators( QtWidgets.QFileDialog.getOpenFileName( - self, "Open verilog Directory", + self, "Open Verilog Directory", init_path + "home", "*v" )[0] ) @@ -120,9 +114,10 @@ class Maker(QtWidgets.QWidget): reply = QtWidgets.QMessageBox.critical( None, "Error Message", - "<b>Error: No Verilog File Chosen.\ - Please chose a Verilog file</b>", + "<b>No Verilog File Chosen. \ + Please choose a verilog file.</b>", QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel) + if reply == QtWidgets.QMessageBox.Ok: self.addverilog() @@ -211,12 +206,12 @@ class Maker(QtWidgets.QWidget): def runmakerchip(self): init_path = '../../' if os.name == 'nt': - init_path = '' # noqa:F841 + init_path = '' try: if not makerchipTOSAccepted(True): return - print("Running Makerchip..............................") + print("Running Makerchip IDE...........................") # self.file = open(self.verilogfile,"w") # self.file.write(self.entry_var[1].toPlainText()) # self.file.close() @@ -246,13 +241,13 @@ class Maker(QtWidgets.QWidget): file = os.path.basename('.'.join( self.verilogfile.split('.')[:-1])) f = open(filename, 'w') - flag = 1 # noqa F841 - ports = "" # noqa F841 code = code.replace(" wire ", " ") code = code.replace(" reg ", " ") vlog_ex = vlog.VerilogExtractor() vlog_mods = vlog_ex.extract_objects_from_source(code) - lint_off = open(init_path + "library/tlv/lint_off.txt").readlines() + lint_off = open( + init_path + "library/tlv/lint_off.txt" + ).readlines() string = '''\\TLV_version 1d: tl-x.org\n\\SV\n''' for item in lint_off: string += "/* verilator lint_off " + \ @@ -281,11 +276,11 @@ output logic passed, output logic failed);\n''' "Error Message", "<b>Error: File name and module \ name are not same. Please \ - ensure that they are same</b>", + ensure that they are same.</b>", QtWidgets.QMessageBox.Ok) self.obj_Appconfig.print_info( - 'NgVeri Stopped due to File \ + 'NgVeri stopped due to file \ name and module name not matching error') return string += "//The $random() can be replaced \ @@ -325,7 +320,7 @@ Add \\TLV here if desired\ print("File: " + filename) self.process.start(cmd) print( - "Makerchip command process pid ---------- >", + "Makerchip IDE command process pid ---------->", self.process.pid()) except BaseException as e: print(e) @@ -333,11 +328,11 @@ Add \\TLV here if desired\ self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( - "Error in running Makerchip. \ -Please check if Verilog File Chosen.") + "Error in running Makerchip IDE. \ +Please check if verilog file is chosen.") self.msg.exec_() - print("Error in running Makerchip. \ -Please check if Verilog File Chosen.") + print("Error in running Makerchip IDE. \ +Please check if verilog file is chosen.") # initial = self.read_file() # while True: @@ -402,7 +397,6 @@ Please check if Verilog File Chosen.") # This function adds the other parts of widget like text box def creategroup(self): - self.trbox = QtWidgets.QGroupBox() self.trbox.setTitle(".tlv file") # self.trbox.setDisabled(True) @@ -413,7 +407,7 @@ Please check if Verilog File Chosen.") self.start = QtWidgets.QLabel("Path to .tlv file") self.trgrid.addWidget(self.start, 1, 0) self.count = 0 - self.entry_var[self.count] = QtWidgets.QLabel(" - ") + self.entry_var[self.count] = QtWidgets.QLabel() self.trgrid.addWidget(self.entry_var[self.count], 1, 1) self.entry_var[self.count].setMaximumWidth(1000) self.count += 1 |