Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
c65f7616
Commit
c65f7616
authored
Oct 24, 2023
by
Tomasz Wlostowski
Committed by
Adam Wujek
Nov 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
softpll: fix for 1-out-of-1000 can't-locks
Solution V2 Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
18503d5f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
spll_main.c
softpll/spll_main.c
+29
-0
spll_main.h
softpll/spll_main.h
+1
-1
No files found.
softpll/spll_main.c
View file @
c65f7616
...
...
@@ -12,6 +12,7 @@
#include <wrc.h>
#include "softpll_ng.h"
#define MPLL_DISCARD_EARLY_TAGS 10
#define MPLL_TAG_WRAPAROUND 100000000
#undef WITH_SEQUENCING
...
...
@@ -126,6 +127,7 @@ void mpll_start(struct spll_main_state *s)
{
pll_verbose
(
"MPLL_Start [dac %d]
\n
"
,
s
->
dac_index
);
s
->
discard_early_cnt
=
MPLL_DISCARD_EARLY_TAGS
;
s
->
ps_freeze
=
0
;
s
->
vco_freeze
=
0
;
...
...
@@ -294,6 +296,33 @@ int mpll_update(struct spll_main_state *s, int tag, int source)
if
(
s
->
tag_ref
>=
0
&&
s
->
tag_out
>=
0
)
{
#ifndef CONFIG_FRAC_SPLL
if
(
s
->
discard_early_cnt
==
1
)
{
int
adj_ref
=
s
->
tag_ref
+
s
->
adder_ref
;
int
adj_out
=
s
->
tag_out
+
s
->
adder_out
;
if
(
adj_ref
>
adj_out
)
{
int
delta
=
adj_ref
-
adj_out
;
s
->
adder_ref
-=
(
delta
>>
HPLL_N
)
<<
HPLL_N
;
}
else
{
int
delta
=
adj_out
-
adj_ref
;
s
->
adder_out
-=
(
delta
>>
HPLL_N
)
<<
HPLL_N
;
}
if
(
s
->
adder_ref
<
0
||
s
->
adder_out
<
0
)
{
s
->
adder_ref
+=
MPLL_TAG_WRAPAROUND
;
s
->
adder_out
+=
MPLL_TAG_WRAPAROUND
;
}
}
if
(
s
->
discard_early_cnt
>
0
)
s
->
discard_early_cnt
--
;
#endif
#ifdef CONFIG_FRAC_SPLL
if
(
abs
(
s
->
dout_dt
-
s
->
dref_dt
)
>
s
->
frequency_lock_threshold
)
{
...
...
softpll/spll_main.h
View file @
c65f7616
...
...
@@ -34,7 +34,7 @@ struct spll_main_state {
int
dref_dt
,
dout_dt
,
tag_ref_raw_d
,
tag_out_raw_d2
;
int
frequency_lock_threshold
;
#endif
int
discard_early_cnt
;
int
adder_ref
,
adder_out
;
int
tag_ref
,
tag_ref_d
;
int
tag_out
,
tag_out_d
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment