Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
STITCH
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
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
Show more breadcrumbs
Pascal Engeler
STITCH
Commits
72cb76fd
Commit
72cb76fd
authored
6 months ago
by
Pascal Engeler
Browse files
Options
Downloads
Patches
Plain Diff
Widened buses, input by sign extension
parent
7fca5f6c
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Resolve "Distance wrapping invalidates lock sum"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
stitch_project/stitch/LockInAccumulator.vhd
+22
-13
22 additions, 13 deletions
stitch_project/stitch/LockInAccumulator.vhd
with
22 additions
and
13 deletions
stitch_project/stitch/LockInAccumulator.vhd
+
22
−
13
View file @
72cb76fd
...
...
@@ -27,7 +27,7 @@ entity LockInAccumulator is
Port
(
CLK100
:
in
STD_LOGIC
;
sin
:
in
STD_LOGIC_VECTOR
(
20
downto
0
);
cos
:
in
STD_LOGIC_VECTOR
(
20
downto
0
);
data
:
in
STD_LOGIC_VECTOR
(
2
0
downto
0
);
data
:
in
STD_LOGIC_VECTOR
(
2
4
downto
0
);
trig
:
in
STD_LOGIC
;
clear
:
in
STD_LOGIC
;
enable
:
in
STD_LOGIC
;
...
...
@@ -45,9 +45,9 @@ signal current_state: STATE_T := STATE_IDLE;
signal
clear_old
:
STD_LOGIC
:
=
'0'
;
signal
trig_old
:
STD_LOGIC
:
=
'0'
;
signal
sinInternal
:
STD_LOGIC_VECTOR
(
2
0
downto
0
);
signal
cosInternal
:
STD_LOGIC_VECTOR
(
2
0
downto
0
);
signal
dataInternal
:
STD_LOGIC_VECTOR
(
2
0
downto
0
);
signal
sinInternal
:
STD_LOGIC_VECTOR
(
2
4
downto
0
)
:
=
(
others
=>
'0'
)
;
signal
cosInternal
:
STD_LOGIC_VECTOR
(
2
4
downto
0
)
:
=
(
others
=>
'0'
)
;
signal
dataInternal
:
STD_LOGIC_VECTOR
(
2
4
downto
0
)
:
=
(
others
=>
'0'
)
;
signal
trigInternal
:
STD_LOGIC
:
=
'0'
;
signal
enableInternal
:
STD_LOGIC
:
=
'1'
;
signal
clearInternal
:
STD_LOGIC
:
=
'0'
;
...
...
@@ -55,9 +55,9 @@ signal bypassInternal : STD_LOGIC := '0';
signal
n_samples_int
:
STD_LOGIC_VECTOR
(
31
downto
0
)
:
=
(
others
=>
'0'
);
signal
idle_int
:
STD_LOGIC
:
=
'1'
;
signal
sinApplied
:
STD_LOGIC_VECTOR
(
2
0
downto
0
)
:
=
(
others
=>
'0'
);
signal
cosApplied
:
STD_LOGIC_VECTOR
(
2
0
downto
0
)
:
=
(
others
=>
'0'
);
signal
dataApplied
:
STD_LOGIC_VECTOR
(
2
0
downto
0
)
:
=
(
others
=>
'0'
);
signal
sinApplied
:
STD_LOGIC_VECTOR
(
2
4
downto
0
)
:
=
(
others
=>
'0'
);
signal
cosApplied
:
STD_LOGIC_VECTOR
(
2
4
downto
0
)
:
=
(
others
=>
'0'
);
signal
dataApplied
:
STD_LOGIC_VECTOR
(
2
4
downto
0
)
:
=
(
others
=>
'0'
);
signal
dataAccumSin
:
STD_LOGIC_VECTOR
(
69
downto
0
);
signal
dataAccumCos
:
STD_LOGIC_VECTOR
(
69
downto
0
);
...
...
@@ -69,8 +69,8 @@ PORT (
ce
:
IN
STD_LOGIC
;
sclr
:
IN
STD_LOGIC
;
bypass
:
IN
STD_LOGIC
;
a
:
IN
STD_LOGIC_VECTOR
(
2
0
DOWNTO
0
);
b
:
IN
STD_LOGIC_VECTOR
(
2
0
DOWNTO
0
);
a
:
IN
STD_LOGIC_VECTOR
(
2
4
DOWNTO
0
);
b
:
IN
STD_LOGIC_VECTOR
(
2
4
DOWNTO
0
);
s
:
OUT
STD_LOGIC_VECTOR
(
69
DOWNTO
0
)
);
END
COMPONENT
;
...
...
@@ -80,8 +80,8 @@ PORT (
ce
:
IN
STD_LOGIC
;
sclr
:
IN
STD_LOGIC
;
bypass
:
IN
STD_LOGIC
;
a
:
IN
STD_LOGIC_VECTOR
(
2
0
DOWNTO
0
);
b
:
IN
STD_LOGIC_VECTOR
(
2
0
DOWNTO
0
);
a
:
IN
STD_LOGIC_VECTOR
(
2
4
DOWNTO
0
);
b
:
IN
STD_LOGIC_VECTOR
(
2
4
DOWNTO
0
);
s
:
OUT
STD_LOGIC_VECTOR
(
69
DOWNTO
0
)
);
END
COMPONENT
;
...
...
@@ -120,8 +120,17 @@ begin
if
rising_edge
(
CLK100
)
then
case
current_state
is
when
STATE_IDLE
=>
sinInternal
<=
sin
;
cosInternal
<=
cos
;
--latch SIGNED sin by sign extending
sinInternal
(
20
downto
0
)
<=
sin
;
sinInternal
(
24
)
<=
sin
(
20
);
sinInternal
(
23
)
<=
sin
(
20
);
sinInternal
(
22
)
<=
sin
(
20
);
sinInternal
(
21
)
<=
sin
(
20
);
cosInternal
(
20
downto
0
)
<=
cos
;
cosInternal
(
24
)
<=
cos
(
20
);
cosInternal
(
23
)
<=
cos
(
20
);
cosInternal
(
22
)
<=
cos
(
20
);
cosInternal
(
21
)
<=
cos
(
20
);
dataInternal
<=
data
;
sinApplied
<=
(
others
=>
'0'
);
cosApplied
<=
(
others
=>
'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