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
808898cf
Commit
808898cf
authored
Feb 13, 2012
by
Paweł Szostek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add HDLMAKE_COREDIR env var handling
parent
94de4b49
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
31 deletions
+31
-31
__main__.py
src/__main__.py
+3
-6
fetch.py
src/fetch.py
+15
-12
flow.py
src/flow.py
+1
-1
module.py
src/module.py
+4
-3
msg.py
src/msg.py
+5
-5
path.py
src/path.py
+0
-1
srcfile.py
src/srcfile.py
+3
-3
No files found.
src/__main__.py
View file @
808898cf
...
...
@@ -25,7 +25,6 @@ from connection import Connection
import
global_mod
import
msg
as
p
import
optparse
from
module
import
Module
from
fetch
import
ModulePool
def
main
():
...
...
@@ -103,15 +102,13 @@ use 0 for current version""", metavar="ISE")
p
.
vprint
(
"LoadTopManifest"
);
pool
=
ModulePool
()
m
=
Module
(
parent
=
None
,
url
=
os
.
getcwd
(),
source
=
"local"
,
fetchto
=
"."
,
pool
=
pool
)
pool
.
set_top_module
(
m
)
pool
.
new_module
(
parent
=
None
,
url
=
os
.
getcwd
(),
source
=
"local"
,
fetchto
=
"."
)
if
m
.
manifest
==
None
:
if
pool
.
get_top_module
()
.
manifest
==
None
:
p
.
rawprint
(
"No manifest found. At least an empty one is needed"
)
p
.
rawprint
(
"To see some help, type hdlmake --help"
)
quit
()
global_mod
.
top_module
=
m
global_mod
.
top_module
.
parse_manifest
()
global_mod
.
top_module
=
pool
.
get_top_module
()
global_mod
.
global_target
=
global_mod
.
top_module
.
target
...
...
src/fetch.py
View file @
808898cf
...
...
@@ -22,12 +22,12 @@
import
os
import
msg
as
p
import
path
import
global_mod
class
ModulePool
(
list
):
class
ModuleFetcher
:
def
__init__
(
self
):
pass
def
fetch_single_module
(
self
,
module
):
import
global_mod
new_modules
=
[]
...
...
@@ -47,7 +47,7 @@ class ModulePool(list):
new_modules
.
extend
(
module
.
local
)
new_modules
.
extend
(
module
.
svn
)
new_modules
.
extend
(
module
.
git
)
return
new_modules
return
new_modules
def
__fetch_from_svn
(
self
,
module
):
if
not
os
.
path
.
exists
(
module
.
fetchto
):
...
...
@@ -119,7 +119,8 @@ class ModulePool(list):
#end class ModuleFetcher
def
__init__
(
self
):
self
.
top_module
=
None
self
.
top_module
=
None
self
.
global_fetch
=
os
.
getenv
(
"HDLMAKE_COREDIR"
)
def
get_fetchable_modules
(
self
):
return
[
m
for
m
in
self
if
m
.
source
!=
"local"
]
...
...
@@ -132,21 +133,23 @@ class ModulePool(list):
if
mod
.
url
==
module
.
url
:
return
True
return
False
def
set_top_module
(
self
,
module
):
self
.
top_module
=
module
self
.
add
(
module
)
def
M
odule
(
self
,
parent
,
url
,
source
,
fetchto
):
def
new_m
odule
(
self
,
parent
,
url
,
source
,
fetchto
):
from
module
import
Module
if
url
in
[
m
.
url
for
m
in
self
]:
return
[
m
for
m
in
self
if
m
.
url
==
url
][
0
]
else
:
if
self
.
global_fetch
:
# if there is global fetch parameter (HDLMAKE_COREDIR env variable)
fetchto
=
self
.
global_fetch
# screw module's particular fetchto
new_module
=
Module
(
parent
=
parent
,
url
=
url
,
source
=
source
,
fetchto
=
fetchto
,
pool
=
self
)
self
.
add
(
new_module
)
self
.
_add
(
new_module
)
if
not
self
.
top_module
:
global_mod
.
top_module
=
new_module
self
.
top_module
=
new_module
new_module
.
parse_manifest
()
return
new_module
def
add
(
self
,
new_module
):
def
_
add
(
self
,
new_module
):
from
module
import
Module
if
not
isinstance
(
new_module
,
Module
):
raise
RuntimeError
(
"Expecting a Module instance"
)
...
...
@@ -154,13 +157,13 @@ class ModulePool(list):
return
False
if
new_module
.
isfetched
:
for
mod
in
new_module
.
submodules
():
self
.
add
(
mod
)
self
.
_
add
(
mod
)
self
.
append
(
new_module
)
return
True
def
fetch_all
(
self
,
unfetched_only
=
False
):
fetcher
=
self
.
ModuleFetcher
()
fetch_queue
=
list
(
self
)
fetch_queue
=
[
m
for
m
in
self
]
while
len
(
fetch_queue
)
>
0
:
cur_mod
=
fetch_queue
.
pop
()
...
...
src/flow.py
View file @
808898cf
...
...
@@ -283,7 +283,7 @@ class ModelsiminiReader(object):
try
:
ini
=
open
(
self
.
path
,
"r"
)
except
Exception
,
e
:
except
Exception
:
return
[]
reading_libraries
=
False
...
...
src/module.py
View file @
808898cf
...
...
@@ -46,6 +46,7 @@ class Module(object):
else
:
return
path
.
url_basename
(
self
.
url
)
#PLEASE don't use this constructor. Create all modules with ModulePool.new_module()
def
__init__
(
self
,
parent
,
url
,
source
,
fetchto
,
pool
):
import
path
self
.
fetchto
=
fetchto
...
...
@@ -197,7 +198,7 @@ class Module(object):
p
.
echo
(
"("
+
self
.
path
+
")"
)
quit
()
path
=
path_mod
.
rel2abs
(
path
,
self
.
path
)
local_mods
.
append
(
self
.
pool
.
M
odule
(
parent
=
self
,
url
=
path
,
source
=
"local"
,
fetchto
=
fetchto
))
local_mods
.
append
(
self
.
pool
.
new_m
odule
(
parent
=
self
,
url
=
path
,
source
=
"local"
,
fetchto
=
fetchto
))
self
.
local
=
local_mods
else
:
self
.
local
=
[]
...
...
@@ -246,7 +247,7 @@ class Module(object):
opt_map
[
"modules"
][
"svn"
]
=
self
.
__make_list
(
opt_map
[
"modules"
][
"svn"
])
svn_mods
=
[]
for
url
in
opt_map
[
"modules"
][
"svn"
]:
svn_mods
.
append
(
self
.
pool
.
M
odule
(
parent
=
self
,
url
=
url
,
source
=
"svn"
,
fetchto
=
fetchto
))
svn_mods
.
append
(
self
.
pool
.
new_m
odule
(
parent
=
self
,
url
=
url
,
source
=
"svn"
,
fetchto
=
fetchto
))
self
.
svn
=
svn_mods
else
:
self
.
svn
=
[]
...
...
@@ -255,7 +256,7 @@ class Module(object):
opt_map
[
"modules"
][
"git"
]
=
self
.
__make_list
(
opt_map
[
"modules"
][
"git"
])
git_mods
=
[]
for
url
in
opt_map
[
"modules"
][
"git"
]:
git_mods
.
append
(
self
.
pool
.
M
odule
(
parent
=
self
,
url
=
url
,
source
=
"git"
,
fetchto
=
fetchto
))
git_mods
.
append
(
self
.
pool
.
new_m
odule
(
parent
=
self
,
url
=
url
,
source
=
"git"
,
fetchto
=
fetchto
))
self
.
git
=
git_mods
else
:
self
.
git
=
[]
...
...
src/msg.py
View file @
808898cf
...
...
@@ -55,13 +55,13 @@ def print_version():
rawprint
(
"Hdlmake build "
+
global_mod
.
BUILD_ID
)
def
print_action_help
():
p
.
rawprint
(
"`Action' variable was not specified"
)
p
.
rawprint
(
"Allowed values are:
\"
simulation
\"
or
\"
synthesis
\"
"
)
p
.
rawprint
()
p
.
rawprint
(
"This variable in a manifest file is necessary for Hdlmake "
\
rawprint
(
"`Action' variable was not specified"
)
rawprint
(
"Allowed values are:
\"
simulation
\"
or
\"
synthesis
\"
"
)
rawprint
()
rawprint
(
"This variable in a manifest file is necessary for Hdlmake "
\
"to be able to know what to do with the given modules' structure."
)
basic
()
def
basic
():
p
.
rawprint
(
"For more help type `hdlmake --help' "
\
rawprint
(
"For more help type `hdlmake --help' "
\
"or visit http://www.ohwr.org/projects/hdl-make"
)
\ No newline at end of file
src/path.py
View file @
808898cf
...
...
@@ -42,7 +42,6 @@ def url_parse(url):
"""
Check if link to a repo seems to be correct. Filter revision number and branch
"""
import
re
"""url_pat = re.compile("[
\t
]*([^
\t
]+?)[
\t
]*(::)?([^
\t
@]+)?(@[
\t
]*(.+))?[
\t
]*")
url_match = re.match(url_pat, url)
if url_match == None:
...
...
src/srcfile.py
View file @
808898cf
...
...
@@ -205,10 +205,10 @@ class VerilogFile(SourceFile):
self
.
vlog_opt
=
vlog_opt
def
__create_deps
(
self
):
self
.
dep_requires
=
self
.
__
search
_includes
()
self
.
dep_requires
=
self
.
__
get
_includes
()
self
.
dep_provides
=
self
.
name
def
__
search
_includes
(
self
):
def
__
get
_includes
(
self
):
import
re
f
=
open
(
self
.
path
,
"r"
)
try
:
...
...
@@ -264,7 +264,7 @@ class WBGenFile(File):
class
SourceFileSet
(
list
):
def
__init__
(
self
):
self
=
[];
pass
def
__str__
(
self
):
return
str
([
str
(
f
)
for
f
in
self
.
files
])
...
...
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