Skip to content
Snippets Groups Projects
Commit 64ac1e4b authored by Paweł Szostek's avatar Paweł Szostek
Browse files

remove errors found by Pychecker

parent 324543ac
No related merge requests found
......@@ -20,6 +20,8 @@
# along with Hdlmake. If not, see <http://www.gnu.org/licenses/>.
from action import Action
import logging
import global_mod
from manifest_parser import ManifestParser
......@@ -32,9 +34,10 @@ class CheckManifest(Action):
###
### THIS IS JUST A STUB
###
manifest_parser = ManifestParser()
pass
#manifest_parser = ManifestParser()
manifest_parser.add_arbitrary_code("__manifest=\""+self.path+"\"")
manifest_parser.add_arbitrary_code(global_mod.options.arbitrary_code)
#manifest_parser.add_arbitrary_code("__manifest=\""+self.path+"\"")
#manifest_parser.add_arbitrary_code(global_mod.options.arbitrary_code)
opt_map = manifest_parser.parse()
#opt_map = manifest_parser.parse()
......@@ -53,13 +53,13 @@ print = _PrintClass()
class _IsePath(object):
_ise_path_64 = {
_ise_path_32 = {
10: {0: "/opt/Xilinx/10.0/ISE/bin/lin",
1: "/opt/Xilinx/10.1/ISE/bin/lin"},
12: {1: "/opt/Xilinx/12.1/ISE_DS/ISE/bin/lin",
2: "/opt/Xilinx/12.2/ISE_DS/ISE/bin/lin64",
4: "/opt/Xilinx/12.4/ISE_DS/ISE/bin/lin64"},
13: {1: "/opt/Xilinx/13.1/ISE_DS/ISE/bin/lin64"}
2: "/opt/Xilinx/12.2/ISE_DS/ISE/bin/lin",
4: "/opt/Xilinx/12.4/ISE_DS/ISE/bin/lin"},
13: {1: "/opt/Xilinx/13.1/ISE_DS/ISE/bin/lin"}
}
_ise_path_64 = {
......
......@@ -54,8 +54,6 @@ class Module(object):
#PLEASE don't use this constructor. Create all modules with ModulePool.new_module()
def __init__(self, parent, url, source, fetchto, pool):
from util import path
assert url is not None
assert source is not None
......@@ -98,7 +96,7 @@ class Module(object):
self.raw_url = url
if source != fetch.LOCAL:
self.url, self.branch, self.revision = path.url_parse(url)
self.url, self.branch, self.revision = path_mod.url_parse(url)
else:
self.url, self.branch, self.revision = url, None, None
......@@ -168,7 +166,6 @@ class Module(object):
return
import shutil
import os
logging.debug("Removing " + self.path)
shutil.rmtree(self.path)
......@@ -305,11 +302,11 @@ class Module(object):
self.manifest_dict["include_dirs"])
self.include_dirs.extend(ll)
for dir in self.include_dirs:
if path_mod.is_abs_path(dir):
logging.warning("%s contains absolute path to an include directory: %s" % (self.path, dir))
if not os.path.exists(dir):
logging.warning(self.path + " has an unexisting include directory: " + dir)
for dir_ in self.include_dirs:
if path_mod.is_abs_path(dir_):
logging.warning("%s contains absolute path to an include directory: %s" % (self.path, dir_))
if not os.path.exists(dir_):
logging.warning(self.path + " has an unexisting include directory: " + dir_)
if self.manifest_dict["files"] == []:
self.files = SourceFileSet()
......@@ -478,8 +475,8 @@ class Module(object):
srcs = SourceFileSet()
for p in paths:
if os.path.isdir(p):
dir = os.listdir(p)
for f_dir in dir:
dir_ = os.listdir(p)
for f_dir in dir_:
f_dir = os.path.join(self.path, p, f_dir)
if not os.path.isdir(f_dir):
srcs.add(sff.new(path=f_dir,
......
......@@ -27,7 +27,6 @@ import global_mod
import sys
import new_dep_solver as dep_solver
from util import path as path_mod
from fetch import BackendFactory
import fetch
from subprocess import PIPE, Popen
......@@ -150,7 +149,7 @@ class ModulePool(list):
new_modules = []
logging.debug("Fetching module: " + str(module))
bf = BackendFactory()
bf = fetch.BackendFactory()
fetcher = bf.get_backend(module)
result = fetcher.fetch(module)
if result is False:
......
......@@ -30,7 +30,7 @@ class DepParser(object):
def __init__(self, dep_file):
self.dep_file = dep_file
def parse():
def parse(self, dep_file):
raise
......@@ -73,7 +73,7 @@ class ParserFactory(object):
def solve(fileset):
from srcfile import SourceFileSet
from dep_file import DepFile, DepRelation
from dep_file import DepRelation
assert isinstance(fileset, SourceFileSet)
fset = fileset.filter(DepFile)
......@@ -107,7 +107,9 @@ def solve(fileset):
logging.warning("Relation %s in %s not satisfied by any source file" % (str(rel), investigated_file.name))
not_satisfied += 1
if not_satisfied != 0:
logging.info("Dependencies solved, but %d relations were not satisfied." % not_satisfied)
logging.info("Dependencies solved, but %d relations were not satisfied.\n"
"It doesn't necessarily mean that there is some file missing, as it might be defined\n"
"internally in the compiler." % not_satisfied)
else:
logging.info("Dependencies solved")
......@@ -149,14 +151,3 @@ def make_dependency_sorted_list(fileset, purge_unused=True):
ret = sorted(dependable, cmp=compare_dep_files)
ret.extend(non_depednable)
return ret
if __name__ == "__main__":
logging.basicConfig(format="%(levelname)s %(funcName)s() %(filename)s:%(lineno)d: %(message)s", level=logging.DEBUG)
df = DepFile("/home/pawel/cern/hdl-make/tests/lr_test/wr-cores/modules/wrc_lm32/lm32_shifter.v", [])
df.show_relations()
print("-----------------------\n"
"---------- VHDL -------\n"
"-----------------------\n")
df1 = DepFile("/home/pawel/cern/hdl-make/examples/fine_delay/hdl/testbench/top/wr-cores/testbench/top_level/gn4124_bfm/mem_model.vhd")
df1.show_relations()
......@@ -2,7 +2,7 @@
from subprocess import Popen, PIPE
IVERILOG_STARDAND_LIBS = ['std', 'ieee', 'ieee_proposed', 'vl', 'synopsys',
IVERILOG_STANDARD_LIBS = ['std', 'ieee', 'ieee_proposed', 'vl', 'synopsys',
'simprim', 'unisim', 'unimacro', 'aim', 'cpld',
'pls', 'xilinxcorelib', 'aim_ver', 'cpld_ver',
'simprims_ver', 'unisims_ver', 'uni9000_ver',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment