Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ARGS
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
ARGS
Commits
3f8133eb
Commit
3f8133eb
authored
Nov 19, 2019
by
Pieter Donker
Browse files
Options
Downloads
Patches
Plain Diff
add init_args.sh
parent
00b6207f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
gen_doc.py
+4
-4
4 additions, 4 deletions
gen_doc.py
init_args.sh
+38
-0
38 additions, 0 deletions
init_args.sh
py_args_lib/peripheral_lib/common_func.py
+63
-0
63 additions, 0 deletions
py_args_lib/peripheral_lib/common_func.py
with
105 additions
and
4 deletions
gen_doc.py
100644 → 100755
+
4
−
4
View file @
3f8133eb
...
@@ -46,7 +46,7 @@ from math import ceil
...
@@ -46,7 +46,7 @@ from math import ceil
from
py_args_lib
import
*
from
py_args_lib
import
*
import
common
as
cm
#
import common as cm
def
gen_reg_tables
(
subsection
,
group_fields
):
def
gen_reg_tables
(
subsection
,
group_fields
):
"""
"""
...
@@ -637,9 +637,9 @@ if __name__ == "__main__":
...
@@ -637,9 +637,9 @@ if __name__ == "__main__":
parser
.
print_help
()
parser
.
print_help
()
else
:
else
:
if
args
.
system
:
if
args
.
system
:
fpga_libs
=
FPGALibrary
(
os
.
path
.
expandvars
(
'
$RADIOHDL
'
)).
library
fpga_libs
=
FPGALibrary
(
os
.
path
.
expandvars
(
'
$RADIOHDL
_WORK
'
)).
library
if
args
.
peripheral
:
if
args
.
peripheral
:
periph_libs
=
PeripheralLibrary
(
os
.
path
.
expandvars
(
'
$RADIOHDL
'
)).
library
periph_libs
=
PeripheralLibrary
(
os
.
path
.
expandvars
(
'
$RADIOHDL
_WORK
'
)).
library
unit_logger
.
set_stdout_log_level
(
args
.
verbosity
)
unit_logger
.
set_stdout_log_level
(
args
.
verbosity
)
logger
.
debug
(
"
Used arguments: {}
"
.
format
(
args
))
logger
.
debug
(
"
Used arguments: {}
"
.
format
(
args
))
...
...
This diff is collapsed.
Click to expand it.
init_args.sh
0 → 100644
+
38
−
0
View file @
3f8133eb
#!/usr/bin/env bash -e
###############################################################################
#
# Copyright (C) 2018
# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# $Id$
#
###############################################################################
#
# Initialisation script to setup the environment variables for args
#
#
# Make sure it is sourced and no one accidentally gave the script execution rights and just executes it.
if
[[
"
$_
"
==
"
${
0
}
"
]]
;
then
echo
"ERROR: Use this command with '. ' or 'source '"
sleep
1
exit
fi
# Figure out where this script is located and set environment variables accordingly
export
RADIOHDL_WORK
=
"
$GIT
/hdl"
This diff is collapsed.
Click to expand it.
py_args_lib/peripheral_lib/common_func.py
0 → 100644
+
63
−
0
View file @
3f8133eb
###############################################################################
#
# Copyright (C) 2012
# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
"""
Common definitions
"""
################################################################################
# System imports
import
math
# do not use numpy in common, to avoid making common to elaborate
import
re
################################################################################
# Functions
def
ceil_log2
(
num
):
"""
Return integer ceil value of log2(num)
"""
return
int
(
math
.
ceil
(
math
.
log
(
int
(
num
),
2
)))
def
ceil_pow2
(
num
):
"""
Return power of 2 value that is equal or greater than num
"""
return
2
**
ceil_log2
(
num
)
def
unique
(
in_list
):
"""
Extract unique list elements (without changing the order like set() does)
"""
seen
=
{}
result
=
[]
for
item
in
in_list
:
if
item
in
seen
:
continue
seen
[
item
]
=
1
result
.
append
(
item
)
return
result
def
path_string
(
dir
):
joined_dir
=
''
.
join
(
re
.
split
(
'
[/
\\\\
]+
'
,
dir
))
return
joined_dir
.
lower
()
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