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
ddf59eb9
Commit
ddf59eb9
authored
13 years ago
by
Paweł Szostek
Browse files
Options
Downloads
Patches
Plain Diff
Move manifest_options across files, module minor fixes
parent
7e62a761
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synthesis/helper_classes.py
+3
-33
3 additions, 33 deletions
synthesis/helper_classes.py
synthesis/module.py
+41
-9
41 additions, 9 deletions
synthesis/module.py
with
44 additions
and
42 deletions
synthesis/helper_classes.py
+
3
−
33
View file @
ddf59eb9
...
...
@@ -22,39 +22,7 @@ class Manifest:
def
exists
(
self
):
return
os
.
path
.
exists
(
self
.
path
)
class
ManifestOptions
(
object
):
def
__init__
(
self
):
self
.
items
=
{
"
files
"
:
None
,
#files from the module that should be taken
"
fetchto
"
:
None
,
#where this module should be fetched to, when fetching
"
path
"
:
None
,
#where the module is storek
"
url
"
:
None
,
#URL to the module
"
manifest
"
:
None
,
#manifest object
"
source
"
:
None
,
#where it should be fetched from
"
isparsed
"
:
None
,
#
"
isfetched
"
:
None
,
"
library
"
:
None
,
#target library for the vhdl compilation
"
root_module
"
:
None
,
#root module object
"
local
"
:
None
,
#local modules
"
target
"
:
None
,
"
git
"
:
None
,
#git modules
"
svn
"
:
None
,
#svn modules
"
ise
"
:
None
,
"
tcl
"
:
None
,
"
vmap_opt
"
:
None
,
"
vlog_opt
"
:
None
,
"
vcom_opt
"
:
None
}
def
__setitem__
(
self
,
key
,
value
):
if
key
in
self
.
items
:
self
.
items
[
key
]
=
value
else
:
raise
KeyError
(
"
__setitem__: there is no such key:
"
+
str
(
key
))
def
__getitem__
(
self
,
key
):
if
key
in
self
.
items
:
return
self
.
items
[
key
]
else
:
raise
KeyError
(
"
__getitem__:there is no such key:
"
+
str
(
key
))
class
ManifestParser
(
ConfigParser
):
def
__init__
(
self
):
...
...
@@ -75,8 +43,10 @@ class ManifestParser(ConfigParser):
self
.
add_option
(
'
vcom_opt
'
,
default
=
""
,
help
=
"
Additional options for vcom
"
,
type
=
''
)
self
.
add_option
(
'
vlog_opt
'
,
default
=
""
,
help
=
"
Additional options for vlog
"
,
type
=
''
)
self
.
add_option
(
'
vmap_opt
'
,
default
=
""
,
help
=
"
Additional options for vmap
"
,
type
=
''
)
self
.
add_option
(
'
modules
'
,
default
=
{},
help
=
"
List of local modules
"
,
type
=
{})
self
.
add_option
(
'
target
'
,
default
=
None
,
help
=
"
Target architecture for synthesis
"
,
type
=
''
)
self
.
add_allowed_key
(
'
modules
'
,
key
=
"
svn
"
)
self
.
add_allowed_key
(
'
modules
'
,
key
=
"
git
"
)
self
.
add_allowed_key
(
'
modules
'
,
key
=
"
local
"
)
...
...
@@ -85,7 +55,7 @@ class ManifestParser(ConfigParser):
help
=
"
Destination library for module
'
s VHDL files
"
,
type
=
""
)
self
.
add_option
(
'
files
'
,
default
=
[],
help
=
"
List of files from the current module
"
,
type
=
''
)
self
.
add_type
(
'
files
'
,
type
=
[])
self
.
add_option
(
'
root
'
,
default
=
None
,
type
=
''
,
help
=
"
Root catalog for local modules
"
)
def
add_manifest
(
self
,
manifest
):
return
self
.
add_config_file
(
manifest
.
path
)
...
...
This diff is collapsed.
Click to expand it.
synthesis/module.py
+
41
−
9
View file @
ddf59eb9
...
...
@@ -4,11 +4,44 @@ import msg as p
import
os
import
configparser
import
global_mod
from
helper_classes
import
Manifest
,
ManifestParser
,
IseProjectFile
,
ManifestOptions
from
helper_classes
import
Manifest
,
ManifestParser
,
IseProjectFile
from
srcfile
import
*
from
fetch
import
*
from
fetch
import
ModuleFetcher
,
ModulePool
class
ManifestOptions
(
object
):
def
__init__
(
self
):
self
.
items
=
{
"
files
"
:
None
,
#files from the module that should be taken
"
fetchto
"
:
None
,
#where this module should be fetched to, when fetching
"
path
"
:
None
,
#where the module is storek
"
url
"
:
None
,
#URL to the module
"
manifest
"
:
None
,
#manifest object
"
source
"
:
None
,
#where it should be fetched from
"
isparsed
"
:
None
,
#
"
isfetched
"
:
None
,
"
library
"
:
None
,
#target library for the vhdl compilation
"
root_module
"
:
None
,
#root module object
"
local
"
:
None
,
#local modules
"
target
"
:
None
,
"
git
"
:
None
,
#git modules
"
svn
"
:
None
,
#svn modules
"
ise
"
:
None
,
"
tcl
"
:
None
,
"
vmap_opt
"
:
None
,
"
vlog_opt
"
:
None
,
"
vcom_opt
"
:
None
}
def
__setitem__
(
self
,
key
,
value
):
if
key
in
self
.
items
:
self
.
items
[
key
]
=
value
else
:
raise
KeyError
(
"
__setitem__: there is no such key:
"
+
str
(
key
))
def
__getitem__
(
self
,
key
):
if
key
in
self
.
items
:
return
self
.
items
[
key
]
else
:
raise
KeyError
(
"
__getitem__:there is no such key:
"
+
str
(
key
))
class
Module
(
object
):
def
__init__
(
self
,
parent
,
url
=
None
,
files
=
None
,
manifest
=
None
,
...
...
@@ -42,7 +75,7 @@ class Module(object):
self
.
options
[
"
url
"
]
=
url
if
manifest
==
None
:
if
path
!=
None
:
self
.
options
[
"
manifest
"
]
=
self
.
search_for_manifest
()
self
.
options
[
"
manifest
"
]
=
self
.
__
search_for_manifest
()
else
:
self
.
options
[
"
manifest
"
]
=
None
else
:
...
...
@@ -75,6 +108,7 @@ class Module(object):
elif
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
options
[
"
fetchto
"
],
basename
)):
self
.
options
[
"
isfetched
"
]
=
True
self
.
path
=
os
.
path
.
join
(
self
.
options
[
"
fetchto
"
],
basename
)
self
.
manifest
=
self
.
__search_for_manifest
()
self
.
options
[
"
library
"
]
=
"
work
"
self
.
parse_manifest
()
...
...
@@ -83,10 +117,10 @@ class Module(object):
#options = object.__getattribute__(self, "options")
return
self
.
options
[
attr
]
#
def __str__(self):
#
return self.url
def
__str__
(
self
):
return
self
.
url
def
search_for_manifest
(
self
):
def
__
search_for_manifest
(
self
):
"""
Look for manifest in the given folder
"""
...
...
@@ -109,8 +143,6 @@ class Module(object):
return
sth
def
parse_manifest
(
self
):
p
.
vprint
(
self
);
p
.
vprint
(
"
IsParsed
"
+
str
(
self
.
isparsed
)
+
"
isFetched
"
+
str
(
self
.
isfetched
));
if
self
.
isparsed
==
True
:
return
if
self
.
isfetched
==
False
:
...
...
@@ -119,7 +151,7 @@ class Module(object):
manifest_parser
=
ManifestParser
()
if
(
self
.
parent
!=
None
):
print
(
"
GlobMod
"
+
str
(
global_mod
.
top_module
))
manifest_parser
.
add_arbitrary_code
(
"
target=
\"
"
+
global_mod
.
top_module
.
target
+
"
\"
"
)
manifest_parser
.
add_arbitrary_code
(
"
target=
\"
"
+
str
(
global_mod
.
top_module
.
target
)
+
"
\"
"
)
else
:
print
(
"
NoParent
"
)
global_mod
.
top_module
=
self
...
...
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