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
f9a1af27
Commit
f9a1af27
authored
Sep 23, 2013
by
Paweł Szostek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename build_global_file_list and build_very_global_file_list
parent
17804a7d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
31 deletions
+39
-31
__init__.py
hdlmake/action/__init__.py
+0
-1
ise_project.py
hdlmake/action/ise_project.py
+1
-1
merge_cores.py
hdlmake/action/merge_cores.py
+1
-1
quartus_project.py
hdlmake/action/quartus_project.py
+2
-2
remote_synthesis.py
hdlmake/action/remote_synthesis.py
+1
-1
simulation.py
hdlmake/action/simulation.py
+3
-3
module.py
hdlmake/module.py
+1
-9
module_pool.py
hdlmake/module_pool.py
+24
-10
new_dep_solver.py
hdlmake/new_dep_solver.py
+6
-3
No files found.
hdlmake/action/__init__.py
View file @
f9a1af27
...
...
@@ -22,7 +22,6 @@
from
check_condition
import
CheckCondition
from
check_manifest
import
CheckManifest
from
clean
import
CleanModules
from
default
import
Default
from
fetch
import
FetchModules
from
fetch_makefile
import
GenerateFetchMakefile
from
ise_makefile
import
GenerateISEMakefile
...
...
hdlmake/action/ise_project.py
View file @
f9a1af27
...
...
@@ -64,7 +64,7 @@ class GenerateISEProject(Action):
def
_handle_ise_project
(
self
,
update
=
False
):
top_mod
=
self
.
modules_pool
.
get_top_module
()
fileset
=
self
.
modules_pool
.
build_
global_file_lis
t
()
fileset
=
self
.
modules_pool
.
build_
file_se
t
()
flist
=
dep_solver
.
make_dependency_sorted_list
(
fileset
)
prj
=
ISEProject
(
ise
=
self
.
env
[
"ise_version"
],
...
...
hdlmake/action/merge_cores.py
View file @
f9a1af27
...
...
@@ -43,7 +43,7 @@ class MergeCores(Action):
pool
=
self
.
modules_pool
self
.
_check_all_fetched_or_quit
()
flist
=
pool
.
build_
very_global_file_lis
t
()
flist
=
pool
.
build_
global_file_se
t
()
# if not os.path.exists(self.options.merge_cores):
# os.makedirs(self.options.merge_cores)
base
=
self
.
options
.
dest
...
...
hdlmake/action/quartus_project.py
View file @
f9a1af27
...
...
@@ -45,7 +45,7 @@ class GenerateQuartusProject(Action):
def
_create_new_quartus_project
(
self
):
top_mod
=
self
.
modules_pool
.
get_top_module
()
fileset
=
self
.
modules_pool
.
build_
global_file_lis
t
()
fileset
=
self
.
modules_pool
.
build_
file_se
t
()
non_dependable
=
fileset
.
inversed_filter
(
DependableFile
)
fileset
.
add
(
non_dependable
)
...
...
@@ -63,7 +63,7 @@ class GenerateQuartusProject(Action):
def
_update_existing_quartus_project
(
self
):
top_mod
=
self
.
modules_pool
.
get_top_module
()
fileset
=
self
.
modules_pool
.
build_
global_file_lis
t
()
fileset
=
self
.
modules_pool
.
build_
file_se
t
()
non_dependable
=
fileset
.
inversed_filter
(
DependableFile
)
fileset
.
add
(
non_dependable
)
prj
=
QuartusProject
(
top_mod
.
syn_project
)
...
...
hdlmake/action/remote_synthesis.py
View file @
f9a1af27
...
...
@@ -39,7 +39,7 @@ class GenerateRemoteSynthesisMakefile(Action):
if
tcl
is
None
:
self
.
_generate_tcl
()
tcl
=
"run.tcl"
files
=
self
.
modules_pool
.
build_
very_global_file_lis
t
()
files
=
self
.
modules_pool
.
build_
global_file_se
t
()
sff
=
SourceFileFactory
()
files
.
add
(
sff
.
new
(
tcl
,
module
=
None
))
...
...
hdlmake/action/simulation.py
View file @
f9a1af27
...
...
@@ -57,7 +57,7 @@ class GenerateSimulationMakefile(Action):
pool
=
self
.
modules_pool
top_module
=
pool
.
get_top_module
()
fset
=
pool
.
build_
global_file_lis
t
()
fset
=
pool
.
build_
file_se
t
()
dep_files
=
fset
.
filter
(
DepFile
)
global_mod
.
makefile_writer
.
generate_vsim_makefile
(
dep_files
,
top_module
)
...
...
@@ -71,7 +71,7 @@ class GenerateSimulationMakefile(Action):
pool
=
self
.
modules_pool
top_module
=
pool
.
get_top_module
()
fset
=
pool
.
build_
global_file_lis
t
()
fset
=
pool
.
build_
file_se
t
()
global_mod
.
makefile_writer
.
generate_isim_makefile
(
fset
,
top_module
)
def
_generate_iverilog_makefile
(
self
):
...
...
@@ -83,5 +83,5 @@ class GenerateSimulationMakefile(Action):
pool
=
self
.
modules_pool
tm
=
pool
.
get_top_module
()
fset
=
pool
.
build_
global_file_lis
t
()
fset
=
pool
.
build_
file_se
t
()
global_mod
.
makefile_writer
.
generate_iverilog_makefile
(
fset
,
tm
,
pool
)
hdlmake/module.py
View file @
f9a1af27
...
...
@@ -225,7 +225,7 @@ class Module(object):
self
.
manifest_dict
=
opt_map
def
process_manifest
(
self
):
from
srcfile
import
VerilogFile
,
VHDLFile
,
SourceFile
Factory
,
SourceFile
Set
from
srcfile
import
VerilogFile
,
VHDLFile
,
SourceFileSet
if
self
.
isprocessed
is
True
:
return
if
self
.
manifest_dict
is
None
:
...
...
@@ -496,11 +496,3 @@ class Module(object):
vlog_opt
=
self
.
vlog_opt
,
include_dirs
=
self
.
include_dirs
))
return
srcs
def
build_global_file_list
(
self
):
f_set
=
SourceFileSet
()
modules
=
self
.
make_list_of_modules
()
for
m
in
modules
:
f_set
.
add
(
m
.
files
)
return
f_set
hdlmake/module_pool.py
View file @
f9a1af27
...
...
@@ -40,6 +40,7 @@ class ModulePool(list):
self
.
_deps_solved
=
False
def
get_module_by_path
(
self
,
path
):
"""Get instance of Module being stored at a given location"""
path
=
path_mod
.
rel2abs
(
path
)
for
module
in
self
:
if
module
.
path
==
path
:
...
...
@@ -60,6 +61,11 @@ class ModulePool(list):
def
new_module
(
self
,
parent
,
url
,
source
,
fetchto
,
process_manifest
=
True
):
"""Add new module to the pool.
This is the only way to add new modules to the pool. Thanks to it the pool can easily
control its content
"""
from
module
import
Module
self
.
_deps_solved
=
False
if
source
!=
fetch
.
LOCAL
:
...
...
@@ -100,12 +106,14 @@ class ModulePool(list):
return
new_module
def
process_top_module_manifest
(
self
):
"""Process the top module without descending to children modules"""
url
=
self
.
_guess_origin
(
global_mod
.
top_module
.
path
)
if
url
:
global_mod
.
top_module
.
url
=
url
global_mod
.
top_module
.
process_manifest
()
def
_guess_origin
(
self
,
path
):
"""Guess origin (git, svn, local) of a module at given path"""
cwd
=
os
.
getcwd
()
try
:
os
.
chdir
(
path
)
...
...
@@ -159,6 +167,7 @@ class ModulePool(list):
return
new_modules
def
fetch_all
(
self
,
unfetched_only
=
False
,
flatten
=
False
):
"""Fetch recursively all modules"""
fetch_queue
=
[
m
for
m
in
self
]
while
len
(
fetch_queue
)
>
0
:
...
...
@@ -182,22 +191,26 @@ class ModulePool(list):
logging
.
debug
(
"NOT appended to fetch queue: "
+
str
(
mod
.
url
))
def
solve_dependencies
(
self
):
dep_solver
.
solve
(
self
.
build_global_file_list
())
self
.
_deps_solved
=
True
"""Set dependencies for all project files"""
if
not
self
.
_deps_solved
:
dep_solver
.
solve
(
self
.
build_file_set
())
self
.
_deps_solved
=
True
def
build_global_file_list
(
self
):
def
build_file_set
(
self
):
"""Build set of all files listed in the manifests"""
from
srcfile
import
SourceFileSet
ret
=
SourceFileSet
()
all_manifested_files
=
SourceFileSet
()
for
module
in
self
:
ret
.
add
(
module
.
files
)
return
ret
all_manifested_files
.
add
(
module
.
files
)
def
build_very_global_file_list
(
self
):
return
all_manifested_files
def
build_global_file_set
(
self
):
"""Build set of all files from manifests plus all include files from sources"""
from
srcfile
import
SourceFileSet
files
=
self
.
build_
global_file_lis
t
()
files
=
self
.
build_
file_se
t
()
assert
isinstance
(
files
,
SourceFileSet
)
if
not
self
.
_deps_solved
:
self
.
solve_dependencies
()
self
.
solve_dependencies
()
ret
=
[]
for
file
in
files
:
try
:
...
...
@@ -213,6 +226,7 @@ class ModulePool(list):
return
self
.
top_module
def
is_everything_fetched
(
self
):
"""Check if every module is already fetched"""
if
len
([
m
for
m
in
self
if
not
m
.
isfetched
])
==
0
:
return
True
else
:
...
...
hdlmake/new_dep_solver.py
View file @
f9a1af27
...
...
@@ -75,14 +75,13 @@ def solve(fileset):
from
srcfile
import
SourceFileSet
from
dep_file
import
DepFile
,
DepRelation
assert
isinstance
(
fileset
,
SourceFileSet
)
fset
=
fileset
.
filter
(
DepFile
)
# for fle in fset:
# print(fle.path)
# for rel in fle.rels:
# print('\t' + str(rel))
not_satisfied
=
0
for
investigated_file
in
fset
:
for
rel
in
investigated_file
.
rels
:
if
rel
.
direction
is
DepRelation
.
PROVIDE
:
# PROVIDE relations dont have to be satisfied
...
...
@@ -106,7 +105,11 @@ def solve(fileset):
'
\n
'
.
join
([
file
.
path
for
file
in
list
(
satisfied_by
)]))
elif
len
(
satisfied_by
)
==
0
:
logging
.
warning
(
"Relation
%
s in
%
s not satisfied by any source file"
%
(
str
(
rel
),
investigated_file
.
name
))
logging
.
info
(
"Dependencies solved"
)
not_satisfied
+=
1
if
not_satisfied
!=
0
:
logging
.
info
(
"Dependencies solved, but
%
d relations were not satisfied."
%
not_satisfied
)
else
:
logging
.
info
(
"Dependencies solved"
)
def
make_dependency_sorted_list
(
fileset
,
purge_unused
=
True
):
...
...
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