Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
477b81e6
Commit
477b81e6
authored
Jan 21, 2012
by
Paweł Szostek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change visibility for 'private' class members
parent
d88dc982
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
13 deletions
+55
-13
__main__.py
src/__main__.py
+6
-1
dep_solver.py
src/dep_solver.py
+38
-8
hdlmake_kernel.py
src/hdlmake_kernel.py
+8
-1
srcfile.py
src/srcfile.py
+3
-3
No files found.
src/__main__.py
View file @
477b81e6
...
...
@@ -53,7 +53,10 @@ def main():
default
=
None
,
help
=
"remove all modules fetched for this one"
)
parser
.
add_option
(
"--list"
,
action
=
"store_true"
,
dest
=
"list"
,
default
=
None
,
help
=
"List all modules togather with their files"
)
default
=
None
,
help
=
"List all modules together with their files"
)
parser
.
add_option
(
"--list-files"
,
action
=
"store_true"
,
dest
=
"list_files"
,
default
=
None
,
help
=
"List all files in a from of a space-separated string"
)
parser
.
add_option
(
"--ise-proj"
,
action
=
"store_true"
,
dest
=
"ise_proj"
,
default
=
None
,
help
=
"create/update an ise project including list of project files"
)
...
...
@@ -126,6 +129,8 @@ use 0 for current version""", metavar="ISE")
kernel
.
generate_remote_synthesis_makefile
()
elif
options
.
list
:
kernel
.
list_modules
()
elif
options
.
list_files
:
kernel
.
list_files
()
elif
options
.
clean
:
kernel
.
clean_modules
()
else
:
...
...
src/dep_solver.py
View file @
477b81e6
...
...
@@ -23,11 +23,41 @@ import msg as p
class
IDependable
:
def
__init__
(
self
):
self
.
dep_fixed
=
False
;
self
.
dep_index
=
0
;
self
.
dep_provides
=
[];
self
.
dep_requires
=
[];
self
.
dep_depends_on
=
[];
self
.
__dep_fixed
=
False
;
self
.
__dep_provides
=
[];
self
.
__dep_requires
=
[];
self
.
__dep_depends_on
=
[];
pass
##
#use proxy template here
def
get_dep_provides
(
self
):
if
self
.
__dep_fixed
==
False
:
self
.
__create_deps
()
self
.
__dep_fixed
=
True
return
self
.
__dep_provides
def
set_dep_provides
(
self
,
what
):
self
.
__dep_provides
=
what
dep_provides
=
property
(
get_dep_provides
,
set_dep_provides
)
##
def
get_dep_requires
(
self
):
if
self
.
__dep_fixed
==
False
:
self
.
__create_deps
()
self
.
__dep_fixed
=
True
return
self
.
__dep_provides
def
set_dep_requires
(
self
,
what
):
self
.
__dep_requires
=
what
dep_requires
=
property
(
get_dep_requires
,
set_dep_requires
)
##
def
get_dep_depends_on
(
self
):
return
self
.
__dep_depends_on
def
set_dep_depends_on
(
self
,
what
):
self
.
__dep_depends_on
=
what
dep_depends_on
=
property
(
get_dep_depends_on
,
set_dep_depends_on
)
##
def
__create_deps
(
self
):
"""Used solely for polymorphism"""
class
DependencySolver
:
def
__init__
(
self
):
...
...
@@ -107,7 +137,7 @@ class DependencySolver:
n_iter
=
n_iter
+
1
done
=
True
for
f
in
fset
:
if
not
f
.
dep_fixed
:
if
not
f
.
__
dep_fixed
:
idx
=
fset
.
index
(
f
)
k
=
self
.
__lookup_post_provider
(
files
=
fset
,
start_index
=
idx
,
file
=
f
);
...
...
@@ -122,7 +152,7 @@ class DependencySolver:
return
None
for
f
in
fset
:
if
f
.
dep_fixed
:
if
f
.
__
dep_fixed
:
f_nondep
.
append
(
copy
.
copy
(
f
))
del
f
...
...
@@ -162,11 +192,11 @@ class DependencySolver:
newobj
.
add
(
f_nondep
);
for
f
in
fset
:
try
:
if
not
f
.
dep_fixed
:
if
not
f
.
__
dep_fixed
:
newobj
.
add
(
f
)
except
:
newobj
.
add
(
f
)
for
k
in
newobj
:
p
.
vprint
(
str
(
k
.
dep_index
)
+
" "
+
k
.
path
+
str
(
k
.
dep_fixed
))
p
.
vprint
(
str
(
k
.
dep_index
)
+
" "
+
k
.
path
+
str
(
k
.
__
dep_fixed
))
return
newobj
src/hdlmake_kernel.py
View file @
477b81e6
...
...
@@ -70,7 +70,14 @@ class HdlmakeKernel(object):
for
f
in
m
.
files
:
print
(
" "
+
path
.
relpath
(
f
.
path
,
m
.
path
))
print
(
""
)
def
list_files
(
self
):
files_str
=
[]
for
m
in
self
.
modules_pool
:
if
not
m
.
isfetched
:
continue
files_str
.
append
(
" "
.
join
([
f
.
path
for
f
in
m
.
files
]))
print
(
" "
.
join
(
files_str
))
def
fetch
(
self
,
unfetched_only
=
False
):
p
.
rawprint
(
"Fetching needed modules..."
)
self
.
modules_pool
.
fetch_all
(
unfetched_only
)
...
...
src/srcfile.py
View file @
477b81e6
...
...
@@ -96,7 +96,7 @@ class SourceFile(IDependable, File):
class
VHDLFile
(
SourceFile
):
def
__init__
(
self
,
path
,
library
=
None
,
vcom_opt
=
None
):
SourceFile
.
__init__
(
self
,
path
,
library
);
self
.
__create_deps
();
##
self.__create_deps();
if
not
vcom_opt
:
self
.
vcom_opt
=
""
else
:
...
...
@@ -114,7 +114,7 @@ class VHDLFile(SourceFile):
def
__create_deps
(
self
):
if
self
.
__check_encryption
():
self
.
dep_index
=
SourceFile
.
gen_index
(
self
)
self
.
dep_fixed
=
True
self
.
__
dep_fixed
=
True
else
:
self
.
dep_requires
=
list
(
self
.
__search_use_clauses
())
self
.
dep_provides
=
list
(
self
.
__search_packages
())
...
...
@@ -248,7 +248,7 @@ class CDCFile(File):
class
NGCFile
(
SourceFile
):
def
__init__
(
self
,
path
):
SourceFile
.
__init__
(
self
,
path
);
self
.
dep_fixed
=
True
self
.
__
dep_fixed
=
True
class
WBGenFile
(
File
):
def
__init__
(
self
,
path
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment