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
36571faf
Commit
36571faf
authored
Jul 27, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Just another working refactoring checkpoint
parent
28f89a9e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
34 deletions
+35
-34
altera.py
hdlmake/module/altera.py
+6
-5
content.py
hdlmake/module/content.py
+3
-2
core.py
hdlmake/module/core.py
+9
-6
module.py
hdlmake/module/module.py
+8
-16
origin.py
hdlmake/module/origin.py
+2
-1
simulation.py
hdlmake/module/simulation.py
+3
-2
synthesis.py
hdlmake/module/synthesis.py
+4
-2
No files found.
hdlmake/module/altera.py
View file @
36571faf
import
os
from
.core
import
ModuleCore
from
hdlmake.util
import
path
as
path_mod
class
ModuleAltera
(
object
):
class
ModuleAltera
(
ModuleCore
):
def
__init__
(
self
):
# Manifest Altera Properties
self
.
quartus_preflow
=
None
...
...
@@ -12,14 +13,14 @@ class ModuleAltera(object):
def
process_manifest
(
self
):
self
.
_process_manifest_altera
()
#
super(ModuleAltera, self).process_manifest()
super
(
ModuleAltera
,
self
)
.
process_manifest
()
def
_process_manifest_altera
(
self
):
from
hdlmake.srcfile
import
TCLFile
if
self
.
manifest_dict
[
"quartus_preflow"
]
!=
None
:
path
=
path_mod
.
rel2abs
(
self
.
manifest_dict
[
"quartus_preflow"
],
self
.
path
);
if
not
os
.
path
.
exists
(
path
):
p
.
error
(
"quartus_preflow file listed in "
+
self
.
manifest
.
path
+
" doesn't exist: "
p
.
error
(
"quartus_preflow file listed in "
+
self
.
path
+
" doesn't exist: "
+
path
+
".
\n
Exiting."
)
quit
()
self
.
quartus_preflow
=
TCLFile
(
path
)
...
...
@@ -27,7 +28,7 @@ class ModuleAltera(object):
if
self
.
manifest_dict
[
"quartus_postmodule"
]
!=
None
:
path
=
path_mod
.
rel2abs
(
self
.
manifest_dict
[
"quartus_postmodule"
],
self
.
path
);
if
not
os
.
path
.
exists
(
path
):
p
.
error
(
"quartus_postmodule file listed in "
+
self
.
manifest
.
path
+
" doesn't exist: "
p
.
error
(
"quartus_postmodule file listed in "
+
self
.
path
+
" doesn't exist: "
+
path
+
".
\n
Exiting."
)
quit
()
self
.
quartus_postmodule
=
TCLFile
(
path
)
...
...
@@ -35,7 +36,7 @@ class ModuleAltera(object):
if
self
.
manifest_dict
[
"quartus_postflow"
]
!=
None
:
path
=
path_mod
.
rel2abs
(
self
.
manifest_dict
[
"quartus_postflow"
],
self
.
path
);
if
not
os
.
path
.
exists
(
path
):
p
.
error
(
"quartus_postflow file listed in "
+
self
.
manifest
.
path
+
" doesn't exist: "
p
.
error
(
"quartus_postflow file listed in "
+
self
.
path
+
" doesn't exist: "
+
path
+
".
\n
Exiting."
)
quit
()
self
.
quartus_postflow
=
TCLFile
(
path
)
...
...
hdlmake/module/content.py
View file @
36571faf
import
logging
from
.core
import
ModuleCore
from
hdlmake
import
fetch
from
hdlmake.util
import
path
as
path_mod
class
ModuleContent
(
object
):
class
ModuleContent
(
ModuleCore
):
def
__init__
(
self
):
# Manifest Files Properties
self
.
files
=
None
...
...
@@ -17,7 +18,7 @@ class ModuleContent(object):
self
.
_process_manifest_fetch
()
self
.
_process_manifest_files
()
self
.
_process_manifest_modules
()
#
super(ModuleContent, self).process_manifest()
super
(
ModuleContent
,
self
)
.
process_manifest
()
def
_process_manifest_files
(
self
):
from
hdlmake.srcfile
import
(
TCLFile
,
VerilogFile
,
VHDLFile
,
...
...
hdlmake/module/core.py
View file @
36571faf
"""Provides the core functionality for the HDLMake module"""
import
os
import
logging
from
hdlmake
import
fetch
class
ModuleCore
(
object
):
"""This is the class providing the module core functionality"""
...
...
@@ -12,11 +10,16 @@ class ModuleCore(object):
self
.
library
=
"work"
self
.
target
=
None
self
.
action
=
None
self
.
top_entity
=
None
super
(
ModuleCore
,
self
)
.
__init__
()
# Manifest Force tool Property
self
.
force_tool
=
None
self
.
pool
=
None
self
.
top_module
=
None
self
.
manifest_dict
=
None
#super(ModuleCore, self).__init__()
def
set_pool
(
self
,
pool
):
"""Set the associated pool for the module instance"""
self
.
pool
=
pool
self
.
top_module
=
pool
.
get_top_module
()
def
process_manifest
(
self
):
...
...
hdlmake/module/module.py
View file @
36571faf
...
...
@@ -35,32 +35,24 @@ import logging
from
hdlmake.manifest_parser
import
ManifestParser
from
hdlmake.util
import
path
as
path_mod
from
hdlmake
import
fetch
from
hdlmake.module
import
(
Module
Core
,
Module
Synthesis
,
ModuleOrigin
,
from
hdlmake.module
import
(
ModuleSynthesis
,
ModuleOrigin
,
ModuleSimulation
,
ModuleContent
,
ModuleAltera
)
class
Module
(
Module
Core
,
Module
Synthesis
,
ModuleOrigin
,
class
Module
(
ModuleSynthesis
,
ModuleOrigin
,
ModuleSimulation
,
ModuleContent
,
ModuleAltera
):
"""
This is the class providing the HDLMake module, the basic element
providing the modular behavior allowing for structured designs.
"""
def
set_pool
(
self
,
pool
):
"""Set the associated pool for the module instance"""
self
.
pool
=
pool
self
.
top_module
=
pool
.
get_top_module
()
def
__init__
(
self
,
parent
,
url
,
source
,
fetchto
):
"""Calculate and initialize the origin attributes: path, source..."""
assert
url
is
not
None
assert
source
is
not
None
self
.
pool
=
None
self
.
top_module
=
None
self
.
top_entity
=
None
self
.
source
=
source
self
.
parent
=
parent
self
.
manifest_dict
=
None
self
.
set_origin
(
parent
,
url
,
source
,
fetchto
)
super
(
Module
,
self
)
.
__init__
()
...
...
@@ -118,11 +110,11 @@ class Module(ModuleCore, ModuleSynthesis, ModuleOrigin,
contained in the action specific inherited Python modules.
"""
logging
.
debug
(
"Process manifest at: "
+
os
.
path
.
dirname
(
self
.
path
))
#
super(Module, self).process_manifest()
module_list
=
[
ModuleCore
,
ModuleSynthesis
,
ModuleSimulation
,
ModuleContent
,
ModuleAltera
]
for
module_plugin
in
module_list
:
module_plugin
.
process_manifest
(
self
)
super
(
Module
,
self
)
.
process_manifest
()
#module_list = [
ModuleSynthesis, ModuleSimulation,
#
ModuleContent, ModuleAltera]
#
for module_plugin in module_list:
#
module_plugin.process_manifest(self)
def
parse_manifest
(
self
):
...
...
hdlmake/module/origin.py
View file @
36571faf
import
os
import
logging
from
.core
import
ModuleCore
from
hdlmake
import
fetch
from
hdlmake.util
import
path
as
path_mod
class
ModuleOrigin
(
object
):
class
ModuleOrigin
(
ModuleCore
):
def
set_origin
(
self
,
parent
,
url
,
source
,
fetchto
):
# Manifest Module Origin Properties
self
.
fetchto
=
fetchto
...
...
hdlmake/module/simulation.py
View file @
36571faf
from
.core
import
ModuleCore
from
hdlmake.util
import
path
as
path_mod
class
ModuleSimulation
(
object
):
class
ModuleSimulation
(
ModuleCore
):
def
__init__
(
self
):
# Manifest Simulation Properties
...
...
@@ -21,7 +22,7 @@ class ModuleSimulation(object):
def
process_manifest
(
self
):
self
.
_process_manifest_simulation
()
self
.
_process_manifest_includes
()
#
super(ModuleSimulation, self).process_manifest()
super
(
ModuleSimulation
,
self
)
.
process_manifest
()
def
_process_manifest_simulation
(
self
):
from
hdlmake.srcfile
import
SourceFileSet
...
...
hdlmake/module/synthesis.py
View file @
36571faf
class
ModuleSynthesis
(
object
):
from
.core
import
ModuleCore
class
ModuleSynthesis
(
ModuleCore
):
def
__init__
(
self
):
# Manifest Synthesis Properties
self
.
syn_device
=
None
...
...
@@ -19,7 +21,7 @@ class ModuleSynthesis(object):
def
process_manifest
(
self
):
self
.
_process_manifest_synthesis
()
self
.
_process_manifest_included_makefiles
()
#
super(ModuleSynthesis, self).process_manifest()
super
(
ModuleSynthesis
,
self
)
.
process_manifest
()
def
_process_manifest_synthesis
(
self
):
# Synthesis properties
...
...
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