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
2ff181e5
Commit
2ff181e5
authored
Apr 30, 2019
by
Nicolas Chevillot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced sys.exit with exception
parent
f6ba3e94
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
28 deletions
+16
-28
action.py
hdlmake/action/action.py
+3
-5
core.py
hdlmake/action/core.py
+1
-2
core.py
hdlmake/module/core.py
+1
-2
make_sim.py
hdlmake/tools/make_sim.py
+2
-4
make_syn.py
hdlmake/tools/make_syn.py
+4
-8
quartus.py
hdlmake/tools/quartus.py
+2
-3
vlog_parser.py
hdlmake/vlog_parser.py
+3
-4
No files found.
hdlmake/action/action.py
View file @
2ff181e5
...
@@ -38,7 +38,7 @@ def set_logging_level(options):
...
@@ -38,7 +38,7 @@ def set_logging_level(options):
"""Set the log level and config (A.K.A. log verbosity)"""
"""Set the log level and config (A.K.A. log verbosity)"""
numeric_level
=
getattr
(
logging
,
options
.
log
.
upper
(),
None
)
numeric_level
=
getattr
(
logging
,
options
.
log
.
upper
(),
None
)
if
not
isinstance
(
numeric_level
,
int
):
if
not
isinstance
(
numeric_level
,
int
):
sys
.
exit
(
'Invalid log level:
%
s'
%
options
.
log
)
raise
Exception
(
'Invalid log level:
%
s'
%
options
.
log
)
if
not
shell
.
check_windows
()
and
options
.
logfile
==
None
:
if
not
shell
.
check_windows
()
and
options
.
logfile
==
None
:
logging
.
basicConfig
(
logging
.
basicConfig
(
...
@@ -117,11 +117,10 @@ class Action(list):
...
@@ -117,11 +117,10 @@ class Action(list):
def
_check_manifest_variable_is_set
(
self
,
name
):
def
_check_manifest_variable_is_set
(
self
,
name
):
"""Method to check if a specific manifest variable is set"""
"""Method to check if a specific manifest variable is set"""
if
getattr
(
self
.
top_module
,
name
)
is
None
:
if
getattr
(
self
.
top_module
,
name
)
is
None
:
logging
.
error
(
raise
Exception
(
"Variable
%
s must be set in the manifest "
"Variable
%
s must be set in the manifest "
"to perform current action (
%
s)"
,
"to perform current action (
%
s)"
,
name
,
self
.
__class__
.
__name__
)
name
,
self
.
__class__
.
__name__
)
sys
.
exit
(
"
\n
Exiting"
)
def
_check_manifest_variable_value
(
self
,
name
,
value
):
def
_check_manifest_variable_value
(
self
,
name
,
value
):
"""Method to check if a manifest variable is set to a specific value"""
"""Method to check if a manifest variable is set to a specific value"""
...
@@ -131,10 +130,9 @@ class Action(list):
...
@@ -131,10 +130,9 @@ class Action(list):
variable_match
=
True
variable_match
=
True
if
variable_match
is
False
:
if
variable_match
is
False
:
logging
.
error
(
raise
Exception
(
"Variable
%
s must be set in the manifest and equal to '
%
s'."
,
"Variable
%
s must be set in the manifest and equal to '
%
s'."
,
name
,
value
)
name
,
value
)
sys
.
exit
(
"Exiting"
)
def
build_complete_file_set
(
self
):
def
build_complete_file_set
(
self
):
"""Build file set with all the files listed in the complete pool"""
"""Build file set with all the files listed in the complete pool"""
...
...
hdlmake/action/core.py
View file @
2ff181e5
...
@@ -83,8 +83,7 @@ class ActionCore(Action):
...
@@ -83,8 +83,7 @@ class ActionCore(Action):
elif
module
.
source
is
LOCAL
:
elif
module
.
source
is
LOCAL
:
result
=
self
.
local_backend
.
fetch
(
module
)
result
=
self
.
local_backend
.
fetch
(
module
)
if
result
is
False
:
if
result
is
False
:
logging
.
error
(
"Unable to fetch module
%
s"
,
str
(
module
.
url
))
raise
Exception
(
"Unable to fetch module
%
s"
,
str
(
module
.
url
))
sys
.
exit
(
"Exiting"
)
module
.
parse_manifest
()
module
.
parse_manifest
()
new_modules
.
extend
(
module
.
local
)
new_modules
.
extend
(
module
.
local
)
new_modules
.
extend
(
module
.
svn
)
new_modules
.
extend
(
module
.
svn
)
...
...
hdlmake/module/core.py
View file @
2ff181e5
...
@@ -91,10 +91,9 @@ class ModuleConfig(object):
...
@@ -91,10 +91,9 @@ class ModuleConfig(object):
return
False
return
False
filepath
=
os
.
path
.
join
(
self
.
path
,
filepath
)
filepath
=
os
.
path
.
join
(
self
.
path
,
filepath
)
if
not
os
.
path
.
exists
(
filepath
):
if
not
os
.
path
.
exists
(
filepath
):
logging
.
error
(
raise
Exception
(
"Path specified in manifest in
%
s doesn't exist:
%
s"
,
"Path specified in manifest in
%
s doesn't exist:
%
s"
,
self
.
path
,
filepath
)
self
.
path
,
filepath
)
sys
.
exit
(
"Exiting"
)
filepath
=
path_mod
.
rel2abs
(
filepath
,
self
.
path
)
filepath
=
path_mod
.
rel2abs
(
filepath
,
self
.
path
)
if
os
.
path
.
isdir
(
filepath
):
if
os
.
path
.
isdir
(
filepath
):
...
...
hdlmake/tools/make_sim.py
View file @
2ff181e5
...
@@ -14,11 +14,9 @@ from hdlmake.srcfile import VerilogFile, VHDLFile, SVFile
...
@@ -14,11 +14,9 @@ from hdlmake.srcfile import VerilogFile, VHDLFile, SVFile
def
_check_simulation_manifest
(
manifest_dict
):
def
_check_simulation_manifest
(
manifest_dict
):
"""Check if the simulation keys are provided by the top manifest"""
"""Check if the simulation keys are provided by the top manifest"""
if
not
manifest_dict
[
"sim_top"
]:
if
not
manifest_dict
[
"sim_top"
]:
logging
.
error
(
"sim_top variable must be set in the top manifest."
)
raise
Exception
(
"sim_top variable must be set in the top manifest."
)
sys
.
exit
(
"Exiting"
)
if
not
manifest_dict
[
"sim_tool"
]:
if
not
manifest_dict
[
"sim_tool"
]:
logging
.
error
(
"sim_tool variable must be set in the top manifest."
)
raise
Exception
(
"sim_tool variable must be set in the top manifest."
)
sys
.
exit
(
"Exiting"
)
class
ToolSim
(
ToolMakefile
):
class
ToolSim
(
ToolMakefile
):
...
...
hdlmake/tools/make_syn.py
View file @
2ff181e5
...
@@ -14,21 +14,17 @@ from hdlmake.srcfile import VerilogFile, SVFile
...
@@ -14,21 +14,17 @@ from hdlmake.srcfile import VerilogFile, SVFile
def
_check_synthesis_manifest
(
manifest_dict
):
def
_check_synthesis_manifest
(
manifest_dict
):
"""Check the manifest contains all the keys for a synthesis project"""
"""Check the manifest contains all the keys for a synthesis project"""
if
not
manifest_dict
[
"syn_tool"
]:
if
not
manifest_dict
[
"syn_tool"
]:
logging
.
error
(
raise
Exception
(
"syn_tool variable must be set in the top manifest."
)
"syn_tool variable must be set in the top manifest."
)
sys
.
exit
(
"Exiting"
)
if
not
manifest_dict
[
"syn_device"
]:
if
not
manifest_dict
[
"syn_device"
]:
logging
.
error
(
raise
Exception
(
"syn_device variable must be set in the top manifest."
)
"syn_device variable must be set in the top manifest."
)
sys
.
exit
(
"Exiting"
)
if
not
manifest_dict
[
"syn_grade"
]:
if
not
manifest_dict
[
"syn_grade"
]:
logging
.
error
(
raise
Exception
(
"syn_grade variable must be set in the top manifest."
)
"syn_grade variable must be set in the top manifest."
)
sys
.
exit
(
"Exiting"
)
if
not
manifest_dict
[
"syn_package"
]:
if
not
manifest_dict
[
"syn_package"
]:
logging
.
error
(
raise
Exception
(
"syn_package variable must be set in the top manifest."
)
"syn_package variable must be set in the top manifest."
)
sys
.
exit
(
"Exiting"
)
if
not
manifest_dict
[
"syn_top"
]:
if
not
manifest_dict
[
"syn_top"
]:
logging
.
error
(
logging
.
error
(
"syn_top variable must be set in the top manifest."
)
"syn_top variable must be set in the top manifest."
)
...
...
hdlmake/tools/quartus.py
View file @
2ff181e5
...
@@ -135,9 +135,8 @@ class ToolQuartus(ToolSyn):
...
@@ -135,9 +135,8 @@ class ToolQuartus(ToolSyn):
"Auto-guessed syn_family to be
%
s (
%
s =>
%
s)"
,
"Auto-guessed syn_family to be
%
s (
%
s =>
%
s)"
,
family
,
device
,
key
)
family
,
device
,
key
)
if
family
is
None
:
if
family
is
None
:
logging
.
error
(
"Could not auto-guess device family, please "
raise
Exception
(
"Could not auto-guess device family, please "
"specify in Manifest.py using syn_family!"
)
"specify in Manifest.py using syn_family!"
)
sys
.
exit
(
"
\n
Exiting"
)
return
family
return
family
family_string
=
__get_family_string
(
family_string
=
__get_family_string
(
...
...
hdlmake/vlog_parser.py
View file @
2ff181e5
...
@@ -119,10 +119,9 @@ class VerilogPreprocessor(object):
...
@@ -119,10 +119,9 @@ class VerilogPreprocessor(object):
probable_file
=
os
.
path
.
join
(
searchdir
,
filename
)
probable_file
=
os
.
path
.
join
(
searchdir
,
filename
)
if
os
.
path
.
isfile
(
probable_file
):
if
os
.
path
.
isfile
(
probable_file
):
return
os
.
path
.
abspath
(
probable_file
)
return
os
.
path
.
abspath
(
probable_file
)
logging
.
error
(
"Can't find
%
s for
%
s in any of the include "
raise
Exception
(
"Can't find
%
s for
%
s in any of the include "
"directories:
%
s"
,
filename
,
self
.
vlog_file
.
file_path
,
"directories:
%
s"
,
filename
,
self
.
vlog_file
.
file_path
,
', '
.
join
(
self
.
vlog_file
.
include_dirs
))
', '
.
join
(
self
.
vlog_file
.
include_dirs
))
sys
.
exit
(
"
\n
Exiting"
)
def
_parse_macro_def
(
self
,
macro
):
def
_parse_macro_def
(
self
,
macro
):
"""Parse the provided 'macro' and, if it's not a reserved keyword,
"""Parse the provided 'macro' and, if it's not a reserved keyword,
...
...
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