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
75fc16f7
Commit
75fc16f7
authored
11 years ago
by
Paweł Szostek
Browse files
Options
Downloads
Patches
Plain Diff
makefile_writer.py: correct fetch and add sync remote
parent
de46931c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/makefile_writer.py
+27
-19
27 additions, 19 deletions
src/makefile_writer.py
with
27 additions
and
19 deletions
src/makefile_writer.py
+
27
−
19
View file @
75fc16f7
...
...
@@ -23,13 +23,17 @@
import
os
import
string
import
logging
import
global_mod
from
string
import
Template
class
MakefileWriter
(
object
):
def
__init__
(
self
,
filename
):
def
__init__
(
self
,
filename
=
None
):
self
.
_file
=
None
self
.
_filename
=
filename
if
filename
:
self
.
_filename
=
filename
else
:
self
.
_filename
=
"
Makefile
"
self
.
_is_initialized
=
False
def
__del__
(
self
):
...
...
@@ -38,7 +42,10 @@ class MakefileWriter(object):
def
initialize
(
self
):
if
not
self
.
_is_initialized
:
self
.
_file
=
open
(
self
.
_filename
,
"
w
"
)
if
global_mod
.
options
.
append
is
True
:
self
.
_file
=
open
(
self
.
_filename
,
"
a+
"
)
else
:
self
.
_file
=
open
(
self
.
_filename
,
"
w
"
)
self
.
writeln
(
"
########################################
"
)
self
.
writeln
(
"
# This file was generated by hdlmake #
"
)
self
.
writeln
(
"
# http://ohwr.org/projects/hdl-make/ #
"
)
...
...
@@ -103,7 +110,7 @@ endif
self
.
writeln
(
files_tmpl
.
format
(
'
\\\n
'
.
join
([
s
.
rel_path
()
for
s
in
files
])))
self
.
writeln
(
""
)
self
.
writeln
(
"
#target for running simulation in the remote location
"
)
self
.
writeln
(
"
remote: __test_for_remote_synthesis_variables __send __do_synthesis
__send_back
"
)
self
.
writeln
(
"
remote: __test_for_remote_synthesis_variables __send __do_synthesis
"
)
self
.
writeln
(
"
__send_back: __do_synthesis
"
)
self
.
writeln
(
"
__do_synthesis: __send
"
)
self
.
writeln
(
"
__send: __test_for_remote_synthesis_variables
"
)
...
...
@@ -118,15 +125,15 @@ endif
tcl
=
"
run.tcl
"
synthesis_cmd
=
"""
__do_synthesis:
ifeq (x$(HDLMAKE_RSYNTH_USE_SCREEN), x1)
\t\t
ssh $(USER)@$(SERVER)
'
screen bash -c
"
cd $(R_NAME)$(CWD) && $(HDLMAKE_RSYNTH_ISE_PATH)/xtclsh {
1
}
"'
\t\t
ssh $(USER)@$(SERVER)
'
screen bash -c
"
cd $(R_NAME)$(CWD) && $(HDLMAKE_RSYNTH_ISE_PATH)/xtclsh {
0
}
"'
else
\t\t
ssh $(USER)@$(SERVER)
'
cd $(R_NAME)$(CWD) && $(HDLMAKE_RSYNTH_ISE_PATH)/xtclsh {
1
}
'
\t\t
ssh $(USER)@$(SERVER)
'
cd $(R_NAME)$(CWD) && $(HDLMAKE_RSYNTH_ISE_PATH)/xtclsh {
0
}
'
endif
"""
self
.
writeln
(
synthesis_cmd
.
format
(
tcl
))
self
.
writeln
()
send_back_cmd
=
"
__send_back
:
\n\t\t
cd .. && rsync -av $(USER)@$(SERVER):$(R_NAME)$(CWD) . && cd $(CWD)
"
send_back_cmd
=
"
sync
:
\n\t\t
cd .. && rsync -av $(USER)@$(SERVER):$(R_NAME)
/
$(CWD) . && cd $(CWD)
"
self
.
write
(
send_back_cmd
)
self
.
write
(
"
\n\n
"
)
...
...
@@ -243,29 +250,30 @@ mrproper:
basename
=
module
.
basename
if
module
.
source
==
"
svn
"
:
self
.
write
(
"
__
"
+
basename
+
"
_fetch:
\n
"
)
self
.
write
(
"
\t\t
"
)
self
.
write
(
"
PWD=$(shell pwd)
"
)
self
.
write
(
"
cd
"
+
rp
(
module
.
fetchto
)
+
'
'
)
c
=
"
svn checkout {0}{1}
{2}
"
self
.
write
(
"
\t\t
mkdir -p %s
\n
"
%
rp
(
module
.
fetchto
)
)
self
.
write
(
"
\t\t
PWD=$(shell pwd)
"
)
self
.
write
(
"
cd
"
+
rp
(
module
.
fetchto
)
+
'
&&
'
)
c
=
"
svn checkout {0}{1}
"
if
module
.
revision
:
c
=
c
.
format
(
module
.
url
,
"
@
"
+
module
.
revision
,
module
.
basename
)
c
=
c
.
format
(
module
.
url
,
"
@
"
+
module
.
revision
)
else
:
c
=
c
.
format
(
module
.
url
,
""
,
module
.
basename
)
c
=
c
.
format
(
module
.
url
,
""
)
self
.
write
(
c
)
self
.
write
(
"
cd $(PWD)
\n\n
"
)
self
.
write
(
"
;
cd $(PWD)
\n\n
"
)
elif
module
.
source
==
"
git
"
:
self
.
write
(
"
__
"
+
basename
+
"
_fetch:
\n
"
)
self
.
write
(
"
\t\t
mkdir -p %s
\n
"
%
rp
(
module
.
fetchto
))
self
.
write
(
"
\t\t
"
)
self
.
write
(
"
PWD=$(shell pwd)
"
)
self
.
write
(
"
cd
"
+
rp
(
module
.
fetchto
)
+
'
'
)
self
.
write
(
"
if [ -d
"
+
basename
+
"
] then cd
"
+
basename
+
'
'
)
self
.
write
(
"
cd
"
+
rp
(
module
.
fetchto
)
+
'
;
'
)
self
.
write
(
"
if [ -d
"
+
basename
+
"
]
;
then cd
"
+
basename
+
'
&&
'
)
self
.
write
(
"
git pull
"
)
if
module
.
revision
:
self
.
write
(
"
git checkout
"
+
module
.
revision
+
''
)
self
.
write
(
"
else git clone
"
+
module
.
url
+
'
fi
'
)
self
.
write
(
"
&&
git checkout
"
+
module
.
revision
+
''
)
self
.
write
(
"
else git clone
"
+
module
.
url
+
'
;
fi
;
'
)
if
module
.
revision
:
self
.
write
(
"
git checkout
"
+
module
.
revision
+
''
)
self
.
write
(
"
\t\t
git checkout
"
+
module
.
revision
)
self
.
write
(
"
cd $(PWD)
\n\n
"
)
def
generate_iverilog_makefile
(
self
,
fileset
,
top_module
,
modules_pool
):
...
...
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