Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
meta-soleil-fofb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
DG
FOFB
meta-soleil-fofb
Commits
93c5ec7c
Commit
93c5ec7c
authored
2 years ago
by
BRONES Romain
Browse files
Options
Downloads
Patches
Plain Diff
wip:usefulle script in waiting
parent
9d82a7e7
Branches
test_chtk
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
recipes-app/fpgaversion.sh
+64
-0
64 additions, 0 deletions
recipes-app/fpgaversion.sh
with
64 additions
and
0 deletions
recipes-app/fpgaversion.sh
0 → 100755
+
64
−
0
View file @
93c5ec7c
#!/bin/bash
PATH_MAPT
=
/opt/fofb-opcua-server/app.mapt
function
read_reg
()
{
# ARGS: regname
# Fix name for grep
fname
=
"^
${
1
}
"
# Grep MAPT file for reg name
l
=
$(
grep
-e
${
fname
}
${
PATH_MAPT
}
)
if
[[
-z
"
$l
"
]]
;
then
echo
"Could not find register named
$1
"
>
&2
exit
1
fi
# Retrieve fields
raddr
=
$(
awk
'{print $3}'
<<<
$l
)
rsize
=
$(
awk
'{print $4}'
<<<
$l
)
# Read register
data
=
$(
devmem
$raddr
)
echo
$((
data
))
}
function
get_appname
()
{
appcode
=
$(
read_reg APP.ID
)
if
[[
$appcode
-eq
0x507E17A0
]]
;
then
echo
cellnode
return
fi
if
[[
$appcode
-eq
0x507E1722
]]
;
then
echo
centralnode
return
fi
printf
"Application ID not recognized: %X
\n
"
$appcode
>
&2
echo
\#
NA
return
1
}
function
get_version
()
{
vers
=
$(
read_reg BSP.PRJ_VERSION
)
changes
=
$((
$vers
&
0
xFF
))
patch
=
$((
$((
$vers
>>
8
))
&
0
xFF
))
minor
=
$((
$((
$vers
>>
16
))
&
0
xFF
))
major
=
$((
$((
$vers
>>
24
))
&
0
xFF
))
shasum
=
$(
printf
"%x"
$(
read_reg BSP.PRJ_SHASUM
))
echo
"
${
major
}
.
${
minor
}
.
${
patch
}
-
${
changes
}
-(
${
shasum
}
)"
}
printf
"%10s %s
\n
"
$(
get_appname
)
$(
get_version
)
printf
"SynthTime: %s
\n
"
"
$(
date
-d
"@
$(
read_reg BSP.PRJ_TIMESTAMP
)
"
)
"
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