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
adae15e7
Commit
adae15e7
authored
Mar 17, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Plain Diff
Fix conflicts after merging feat_1176 branch into develop
parents
90ef9029
3b10299a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
26 additions
and
20 deletions
+26
-20
__main__.py
hdlmake/__main__.py
+5
-3
merge_cores.py
hdlmake/action/merge_cores.py
+4
-2
remote_synthesis.py
hdlmake/action/remote_synthesis.py
+1
-1
dep_file.py
hdlmake/dep_file.py
+1
-1
dep_solver.py
hdlmake/dep_solver.py
+1
-1
git.py
hdlmake/fetch/git.py
+6
-5
svn.py
hdlmake/fetch/svn.py
+3
-4
global_mod.py
hdlmake/global_mod.py
+1
-0
module_pool.py
hdlmake/module_pool.py
+1
-1
path.py
hdlmake/util/path.py
+3
-2
No files found.
hdlmake/__main__.py
View file @
adae15e7
...
...
@@ -48,13 +48,15 @@ from ._version import __version__
def
main
():
"""This is the main funcion, where HDLMake starts.
"""This is the main func
t
ion, where HDLMake starts.
Here, we make the next processes:
-- parse command
-- check and set the environment
-- prepare the global module containing the heavy common stuff
"""
"""
# Remember current path
global_mod
.
current_path
=
os
.
getcwd
()
#
# SET & GET PARSER
...
...
@@ -82,7 +84,7 @@ def main():
modules_pool
=
ModulePool
()
modules_pool
.
new_module
(
parent
=
None
,
url
=
os
.
getcwd
()
,
url
=
global_mod
.
current_path
,
source
=
fetch_mod
.
LOCAL
,
fetchto
=
"."
,
process_manifest
=
False
)
...
...
hdlmake/action/merge_cores.py
View file @
adae15e7
...
...
@@ -31,6 +31,8 @@ from hdlmake.vlog_parser import VerilogPreprocessor
from
.action
import
Action
import
global_mod
class
MergeCores
(
Action
):
def
_check_manifest
(
self
):
...
...
@@ -102,6 +104,6 @@ class MergeCores(Action):
for
ngc
in
flist
.
filter
(
NGCFile
):
import
shutil
logging
.
info
(
"copying NGC file:
%
s"
%
ngc
.
rel_path
())
shutil
.
copy
(
ngc
.
rel_path
(),
os
.
getcwd
()
)
shutil
.
copy
(
ngc
.
rel_path
(),
global_mod
.
current_path
)
logging
.
info
(
"Cores merged."
)
\ No newline at end of file
logging
.
info
(
"Cores merged."
)
hdlmake/action/remote_synthesis.py
View file @
adae15e7
...
...
@@ -91,7 +91,7 @@ class GenerateRemoteSynthesisMakefile(Action):
files
.
add
(
sff
.
new
(
top_mod
.
syn_project
,
module
=
None
))
tool_object
.
generate_remote_synthesis_makefile
(
files
=
files
,
name
=
top_mod
.
syn_name
,
cwd
=
os
.
getcwd
()
,
user
=
self
.
env
[
"rsynth_user"
],
cwd
=
global_mod
.
current_path
,
user
=
self
.
env
[
"rsynth_user"
],
server
=
self
.
env
[
"rsynth_server"
])
logging
.
info
(
"Remote synthesis makefile generated."
)
...
...
hdlmake/dep_file.py
View file @
adae15e7
...
...
@@ -99,7 +99,7 @@ class File(object):
def
rel_path
(
self
,
dir
=
None
):
if
dir
is
None
:
dir
=
os
.
getcwd
()
dir
=
global_mod
.
current_path
return
path_mod
.
relpath
(
self
.
path
,
dir
)
def
__str__
(
self
):
...
...
hdlmake/dep_solver.py
View file @
adae15e7
...
...
@@ -108,7 +108,7 @@ class VerilogDependencySolver(DependencySolver):
inc_dirs
=
self
.
_parse_vlog_opt
(
v_file
.
vlog_opt
)
for
dir
in
inc_dirs
:
dir
=
os
.
path
.
join
(
os
.
getcwd
()
,
dir
)
dir
=
os
.
path
.
join
(
global_mod
.
current_path
,
dir
)
if
not
os
.
path
.
exists
(
dir
)
or
not
os
.
path
.
isdir
(
dir
):
logging
.
warning
(
"Include path "
+
dir
+
" doesn't exist"
)
continue
...
...
hdlmake/fetch/git.py
View file @
adae15e7
...
...
@@ -26,13 +26,14 @@ from tempfile import TemporaryFile
from
subprocess
import
Popen
,
PIPE
from
.constants
import
(
GIT
,
GITSUBMODULE
)
from
.fetcher
import
Fetcher
import
global_mod
class
GitSubmodule
(
Fetcher
):
def
fetch
(
self
,
module
):
if
module
.
source
!=
GITSUBMODULE
:
raise
ValueError
(
"This backend should get git modules only."
)
cur_dir
=
os
.
getcwd
()
cur_dir
=
global_mod
.
current_path
os
.
chdir
(
module
.
fetchto
)
os
.
system
(
"git submodule init"
)
os
.
system
(
"git submodule update"
)
...
...
@@ -45,7 +46,7 @@ class Git(Fetcher):
@
staticmethod
def
get_git_toplevel
(
module
):
cur_dir
=
os
.
getcwd
()
cur_dir
=
global_mod
.
current_path
try
:
os
.
chdir
(
path
.
rel2abs
(
module
.
path
))
if
not
os
.
path
.
exists
(
".gitmodules"
):
...
...
@@ -63,7 +64,7 @@ class Git(Fetcher):
def
get_git_submodules
(
module
):
submodule_dir
=
path
.
rel2abs
(
module
.
path
)
logging
.
debug
(
"Checking git submodules in
%
s"
%
submodule_dir
)
cur_dir
=
os
.
getcwd
()
cur_dir
=
global_mod
.
current_path
try
:
os
.
chdir
(
submodule_dir
)
...
...
@@ -117,7 +118,7 @@ submodule.ip_cores/wr-cores.url=git://ohwr.org/hdl-core-lib/wr-cores.git
if
not
os
.
path
.
exists
(
module
.
fetchto
):
os
.
mkdir
(
module
.
fetchto
)
cur_dir
=
os
.
getcwd
()
cur_dir
=
global_mod
.
current_path
if
module
.
branch
is
None
:
module
.
branch
=
"master"
...
...
@@ -164,7 +165,7 @@ submodule.ip_cores/wr-cores.url=git://ohwr.org/hdl-core-lib/wr-cores.git
@
staticmethod
def
check_commit_id
(
path
):
cur_dir
=
os
.
getcwd
()
cur_dir
=
global_mod
.
current_path
commit
=
None
stderr
=
TemporaryFile
()
try
:
...
...
hdlmake/fetch/svn.py
View file @
adae15e7
...
...
@@ -23,10 +23,9 @@ import os
import
logging
from
tempfile
import
TemporaryFile
from
subprocess
import
Popen
,
PIPE
from
hdlmake.util
import
path
from
.fetcher
import
Fetcher
import
global_mod
class
Svn
(
Fetcher
):
...
...
@@ -37,7 +36,7 @@ class Svn(Fetcher):
if
not
os
.
path
.
exists
(
module
.
fetchto
):
os
.
mkdir
(
module
.
fetchto
)
cur_dir
=
os
.
getcwd
()
cur_dir
=
global_mod
.
current_path
os
.
chdir
(
module
.
fetchto
)
basename
=
path
.
url_basename
(
module
.
url
)
...
...
@@ -63,7 +62,7 @@ class Svn(Fetcher):
@
staticmethod
def
check_revision_number
(
path
):
cur_dir
=
os
.
getcwd
()
cur_dir
=
global_mod
.
current_path
revision
=
None
stderr
=
TemporaryFile
()
...
...
hdlmake/global_mod.py
View file @
adae15e7
...
...
@@ -30,3 +30,4 @@ sim_tool = None
env
=
None
tool_module
=
None
makefile_writer
=
None
current_path
=
None
hdlmake/module_pool.py
View file @
adae15e7
...
...
@@ -114,7 +114,7 @@ class ModulePool(list):
def
_guess_origin
(
self
,
path
):
"""Guess origin (git, svn, local) of a module at given path"""
cwd
=
os
.
getcwd
()
cwd
=
global_mod
.
current_path
try
:
os
.
chdir
(
path
)
git_out
=
Popen
(
"git config --get remote.origin.url"
,
stdout
=
PIPE
,
shell
=
True
,
close_fds
=
True
)
...
...
hdlmake/util/path.py
View file @
adae15e7
...
...
@@ -23,6 +23,7 @@
from
__future__
import
print_function
import
os
import
logging
import
global_mod
def
url_parse
(
url
):
...
...
@@ -114,7 +115,7 @@ def is_abs_path(path):
def
relpath
(
p1
,
p2
=
None
):
if
p2
is
None
:
p2
=
os
.
getcwd
()
p2
=
global_mod
.
current_path
if
p1
==
p2
:
return
'.'
p1
,
p2
=
p2
,
p1
...
...
@@ -142,7 +143,7 @@ def rel2abs(path, base=None):
@return the relative path of path from base
"""
if
base
is
None
:
base
=
os
.
getcwd
()
base
=
global_mod
.
current_path
if
os
.
path
.
isabs
(
path
):
return
path
retval
=
os
.
path
.
join
(
base
,
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