Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hdlmake
Manage
Activity
Members
Labels
Plan
Issues
20
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Hdlmake
Commits
4381445f
Commit
4381445f
authored
13 years ago
by
Paweł Szostek
Browse files
Options
Downloads
Patches
Plain Diff
Make SourceFileSet iterable
parent
896aa29d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synthesis/dep_solver.py
+3
-1
3 additions, 1 deletion
synthesis/dep_solver.py
synthesis/hdlmake.py
+0
-3
0 additions, 3 deletions
synthesis/hdlmake.py
synthesis/srcfile.py
+27
-12
27 additions, 12 deletions
synthesis/srcfile.py
with
30 additions
and
16 deletions
synthesis/dep_solver.py
+
3
−
1
View file @
4381445f
# -*- coding: utf-8 -*-
import
msg
as
p
...
...
@@ -60,7 +61,8 @@ class DependencySolver:
fset
[
idx
]
=
fset
[
idx
][
1
]
if
(
n_iter
==
max_iter
):
p
.
vprint
(
"
Maximum number of iterations reached when trying to solve the dependencies. Perhaps a cyclic inter-dependency problem...
"
);
p
.
rawprint
(
"
Maximum number of iterations reached when trying to solve the dependencies.
"
+
"
Perhaps a cyclic inter-dependency problem...
"
);
return
None
for
f
in
fset
:
...
...
This diff is collapsed.
Click to expand it.
synthesis/hdlmake.py
+
0
−
3
View file @
4381445f
...
...
@@ -20,12 +20,9 @@ from fetch import *
def
main
():
# print("Start");
global_mod
.
t0
=
time
.
time
()
parser
=
optparse
.
OptionParser
()
#disabled due to introducing a new parser class. Help msg printing is not ready yet.
parser
.
add_option
(
"
--manifest-help
"
,
action
=
"
store_true
"
,
dest
=
"
manifest_help
"
,
help
=
"
print manifest file variables description
"
)
...
...
This diff is collapsed.
Click to expand it.
synthesis/srcfile.py
+
27
−
12
View file @
4381445f
# -*- coding: utf-8 -*-
from
dep_solver
import
*
import
os
...
...
@@ -125,7 +126,6 @@ class VerilogFile(SourceFile):
if
not
library
:
library
=
"
work
"
SourceFile
.
__init__
(
self
,
path
,
library
);
# self.path = path;
self
.
create_deps
();
def
create_deps
(
self
):
...
...
@@ -147,21 +147,37 @@ class WBGenFile(SourceFile):
def
__init__
(
self
,
path
):
SourceFile
.
__init__
(
self
,
path
);
class
SourceFileSet
:
class
SourceFileSet
(
list
):
def
__init__
(
self
):
self
.
files
=
[];
def
__iter__
(
self
):
return
self
.
files
.
__iter__
()
def
__len__
(
self
):
return
len
(
self
.
files
)
def
__contains__
(
self
,
v
):
return
v
in
self
.
files
def
__getitem__
(
self
,
v
):
return
self
.
files
(
v
)
def
add
(
self
,
files
):
if
(
isinstance
(
files
,
SourceFileSet
)):
for
f
in
files
.
files
:
self
.
files
.
append
(
f
)
elif
(
isinstance
(
files
,
list
)):
for
f
in
files
:
self
.
files
.
append
(
f
)
else
:
if
isinstance
(
files
,
basestring
):
raise
RuntimeError
(
"
Expected object, not a string
"
)
elif
isinstance
(
files
,
list
):
self
.
files
.
extend
(
files
)
else
:
#single file, not a list
self
.
files
.
append
(
files
)
#if(isinstance(files, SourceFileSet)):
# for f in files.files:
# self.files.append(f)
#elif(isinstance(files, list)):
# for f in files:
# self.files.append(f)
#else:
# self.files.append(files)
def
filter
(
self
,
type
):
out
=
[]
...
...
@@ -173,7 +189,6 @@ class SourceFileSet:
def
get_libs
(
self
):
return
set
(
file
.
library
for
file
in
self
.
files
)
class
SourceFileFactory
:
def
new
(
self
,
path
,
library
=
None
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment