Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Software
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
Dmytro Levit
Software
Commits
bbd5451b
Commit
bbd5451b
authored
4 years ago
by
qzhou
Browse files
Options
Downloads
Patches
Plain Diff
add protection to PLL access
parent
36ce052c
No related branches found
Branches containing commit
No related tags found
1 merge request
!20
add protection to PLL access
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Pcie40Applications/main_pcie40_statlink.cpp
+9
-4
9 additions, 4 deletions
Pcie40Applications/main_pcie40_statlink.cpp
with
9 additions
and
4 deletions
Pcie40Applications/main_pcie40_statlink.cpp
+
9
−
4
View file @
bbd5451b
...
...
@@ -5,9 +5,10 @@
Qi-Dong Zhou, KEK
2020.04.28 0.01 first version based on staths.c
2020.12.19 0.01 rename statlink to pcie40_statlink
2020.12.23 0.02 add protection for pll status access
\*--------------------------------------------------------------------------------*/
#define VERSION 0
1
#define VERSION 0
2
#define MOD_DATE 20200428
#include
"pcie40_b2slc.h"
...
...
@@ -20,7 +21,7 @@
#include
<iostream>
#include
<vector>
#include
<bitset>
#include
<sys/file.h>
#define MAX_NUM_CH 48
#define MAX_SLOT 3
...
...
@@ -101,6 +102,7 @@ void argument(int argc, char **argv){
int
statpice40
(
pcie40reg_t
pcie40reg
)
{
FILE
*
fp
=
fopen
(
"/tmp/pcie40_pll_lockfile_statlink.lck"
,
"w"
);
pcie40reg_t
*
pcie
=
&
pcie40reg
;
memset
(
pcie
,
0
,
sizeof
(
*
pcie
));
int
pcie40_sta
=
pcie40_status
(
dev_slot
);
...
...
@@ -112,6 +114,7 @@ statpice40(pcie40reg_t pcie40reg)
pcie40_run_number
(
dev_slot
),
D
(
pcie40_sta
,
28
,
17
),
pcie40_trg_type
(
dev_slot
));
flock
(
fileno
(
fp
),
LOCK_EX
);
printf
(
"PLLs:%s | rxlink: %s | txlink: %s | txlink: %s | rxdisp: %s | rxdata: %s
\n
"
,
(
pcie40_pllLockStatus
(
dev_slot
,
1
)
&&
pcie40_pllLockStatus
(
dev_slot
,
2
)
&&
pcie40_pllLockStatus
(
dev_slot
,
3
))
?
"LOCKED"
:
"NOT LOCKED"
,
B
(
pcie40_sta
,
0
)
?
"READY"
:
"NOT READY"
,
...
...
@@ -146,7 +149,9 @@ statpice40(pcie40reg_t pcie40reg)
pcie40_pllInputCounter
(
dev_slot
,
3
)
?
"OK "
:
"LOS"
,
pcie40_pllFrequencyCounter
(
dev_slot
,
3
)
?
"OK "
:
"OOF"
);
printf
(
"__________________________________
\n
"
);
}
}
flock
(
fileno
(
fp
),
LOCK_UN
);
fclose
(
fp
);
return
0
;
}
...
...
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