Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
1c11df5e
Commit
1c11df5e
authored
9 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Added get_lib_names_from_lib_dicts(), check_library_names() and command line options --run, --lib.
parent
208ab8af
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/oneclick/base/hdl_config.py
+34
-4
34 additions, 4 deletions
tools/oneclick/base/hdl_config.py
with
34 additions
and
4 deletions
tools/oneclick/base/hdl_config.py
+
34
−
4
View file @
1c11df5e
...
...
@@ -50,7 +50,6 @@
import
common
as
cm
import
common_dict_file
import
sys
import
os
import
os.path
import
shutil
from
distutils.dir_util
import
copy_tree
...
...
@@ -118,6 +117,15 @@ class HdlConfig:
self
.
lib_names
=
self
.
libs
.
get_key_values
(
'
hdl_lib_name
'
)
def
check_library_names
(
self
,
check_lib_names
,
lib_names
=
None
):
"""
Check that HDL library names exists, if not then exit with Error message.
"""
if
lib_names
==
None
:
lib_names
=
self
.
lib_names
for
check_lib_name
in
cm
.
listify
(
check_lib_names
):
if
check_lib_name
not
in
cm
.
listify
(
lib_names
):
sys
.
exit
(
'
Error : Unknown HDL library name %s found with check_lib_name()
'
%
check_lib_name
)
def
get_used_libs
(
self
,
build_type
,
lib_dict
,
arg_include_ip_libs
=
[]):
"""
Get the list of used HDL libraries from the lib_dict. Which libraries are actually used depends on the build_type:
...
...
@@ -265,6 +273,13 @@ class HdlConfig:
return
lib_dicts
def
get_lib_names_from_lib_dicts
(
self
,
lib_dicts
=
None
):
"""
Get list the HDL libraries lib_names from list of HDL libraries lib_dicts and preseve the library order.
"""
lib_names
=
self
.
libs
.
get_key_values
(
'
hdl_lib_name
'
,
lib_dicts
)
return
lib_names
def
get_tool_build_dir
(
self
,
build_type
):
"""
Get the central tool build directory.
...
...
@@ -387,13 +402,24 @@ class HdlParseArgs:
def
__init__
(
self
,
toolsetSelect
):
# Parse command line arguments
argparser
=
argparse
.
ArgumentParser
(
description
=
'
HDL config command line parser arguments
'
)
argparser
.
add_argument
(
'
-t
'
,
'
--toolset
'
,
help
=
'
choose toolset %s (default: %s)
'
%
(
toolsetSelect
,
toolsetSelect
[
0
]),
default
=
toolsetSelect
[
0
],
required
=
False
)
argparser
.
add_argument
(
'
-v
'
,
'
--verbosity
'
,
help
=
'
verbosity >= 0 for more info
'
,
type
=
int
,
default
=
0
,
required
=
False
)
argparser
.
add_argument
(
'
-t
'
,
'
--toolset
'
,
required
=
False
,
help
=
'
choose toolset %s (default: %s)
'
%
(
toolsetSelect
,
toolsetSelect
[
0
]),
default
=
toolsetSelect
[
0
])
argparser
.
add_argument
(
'
-l
'
,
'
--lib
'
,
default
=
None
,
required
=
False
,
help
=
'
library names separated by commas
'
)
argparser
.
add_argument
(
'
-r
'
,
'
--run
'
,
required
=
False
,
action
=
'
store_true
'
,
default
=
False
,
help
=
'
run command
'
)
argparser
.
add_argument
(
'
-v
'
,
'
--verbosity
'
,
required
=
False
,
type
=
int
,
default
=
0
,
help
=
'
verbosity >= 0 for more info
'
)
args
=
vars
(
argparser
.
parse_args
())
# Keep the argparser for external access of e.g. print_help
self
.
argparser
=
argparser
# Keep arguments in class record
self
.
toolset
=
args
[
'
toolset
'
]
self
.
lib_names
=
[]
if
args
[
'
lib
'
]
!=
None
:
self
.
lib_names
=
args
[
'
lib
'
].
split
(
'
,
'
)
self
.
run
=
args
[
'
run
'
]
if
self
.
toolset
not
in
toolsetSelect
:
print
'
Toolset %s is not supported
'
%
self
.
toolset
print
'
Hint: give argument -h for possible options
'
...
...
@@ -478,6 +504,10 @@ if __name__ == '__main__':
print
''
print
'
derive_lib_order for %s of %s =
\n
'
%
(
build_type
,
top_lib
),
hdl
.
derive_lib_order
(
build_type
,
top_lib
)
print
''
print
'
Help: use -h
'
hdl_args
.
argparser
.
print_help
()
if
mode
==
1
:
key
=
'
build_dir
'
new_value
=
'
$HDL_BUILD_DIR
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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