Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EtherBone Core
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
EtherBone Core
Commits
04d77366
There was an error fetching the commit references. Please try again later.
Commit
04d77366
authored
12 years ago
by
Wesley W. Terpstra
Browse files
Options
Downloads
Patches
Plain Diff
Another test program: ECA fires a signal for the TLU to catch
parent
6991fe27
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/eca-to-tlu.sh
+58
-0
58 additions, 0 deletions
scripts/eca-to-tlu.sh
scripts/hack-flip.sh
+1
-1
1 addition, 1 deletion
scripts/hack-flip.sh
with
59 additions
and
1 deletion
scripts/eca-to-tlu.sh
0 → 100755
+
58
−
0
View file @
04d77366
#! /bin/bash
dev
=
"
$1
"
channel
=
1
let
fifo_pin
=
2
**
channel
FLAGS
=
"-p -a 32 -d 32 -r 0"
schedule
()
{
dev
=
"
$1
"
delay_s
=
"
$2
"
delay_ns
=
"
$3
"
echo
-n
"target: "
# Read the ppsgen time
UTC
=
0x
`
eb-read
$FLAGS
$dev
0x220308/4
`
# pps utc lo
CYC
=
0x
`
eb-read
$FLAGS
$dev
0x220304/4
`
# pps cycle count
# Compute the deadline
NS
=
$((
CYC
*
8
+
delay_ns
))
S_OVER
=
$((
NS/1000000000
))
UTC
=
$((
UTC
+
delay_s
+
S_OVER
))
NS
=
$((
NS-S_OVER
*
1000000000
))
CYC
=
$((
NS/8
))
echo
-n
`
date
+
"%Y-%m-%d %H:%M:%S"
-d
@
$UTC
`
printf
".%09d
\n
"
$NS
eb-write
$FLAGS
$dev
0x140010/4 0
# utchi
eb-write
$FLAGS
$dev
0x140014/4
`
printf
0x%x
$UTC
`
# utclo
eb-write
$FLAGS
$dev
0x140018/4
`
printf
0x%x
$CYC
`
# cycle
eb-write
$FLAGS
$dev
0x14001C/4 0xffffffff
# toggle all LEDs
eb-write
$FLAGS
$dev
0x140000/4 0
# enqueue command
}
# Flush the FIFO
if
!
eb-write
$dev
0x180004/4
$fifo_pin
;
then
echo
"
$dev
TLU not found"
;
exit
1
;
fi
# Enable capture
eb-write
$FLAGS
$dev
0x18000C/4
$fifo_pin
# Trigger a pulse in 5 seconds
schedule
$dev
5 0
# Wait 6 seconds
sleep
6
# Read back the time we set
UTC0
=
0x
`
eb-read
$FLAGS
$dev
$((
0
x180408+channel
*
0
x20
))
/4
`
UTC1
=
0x
`
eb-read
$FLAGS
$dev
$((
0
x18040C+channel
*
0
x20
))
/4
`
CYC
=
0x
`
eb-read
$FLAGS
$dev
$((
0
x180410+channel
*
0
x20
))
/4
`
# Compute the deadline
NS
=
$((
CYC
*
8
))
UTC
=
$((
UTC0
*
256
+
UTC1
))
echo
-n
"result: "
echo
-n
`
date
+
"%Y-%m-%d %H:%M:%S"
-d
@
$UTC
`
printf
".%09d
\n
"
$NS
This diff is collapsed.
Click to expand it.
scripts/hack-flip.sh
+
1
−
1
View file @
04d77366
...
...
@@ -32,7 +32,7 @@ schedule () {
NS
=
$((
NS-S_OVER
*
1000000000
))
CYC
=
$((
NS/8
))
echo
-n
`
date
+
"%Y-%
M
-%d %H:%M:%S"
-d
@
$UTC
`
echo
-n
`
date
+
"%Y-%
m
-%d %H:%M:%S"
-d
@
$UTC
`
printf
".%09d
\n
"
$NS
eb-write
$FLAGS
$dev
0x140010/4 0
# utchi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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