Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Distributed Arithmetic MAC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
jf3g19
Distributed Arithmetic MAC
Commits
d7c46ff0
Commit
d7c46ff0
authored
4 years ago
by
jf3g19
Browse files
Options
Downloads
Plain Diff
moved LUT to the port list for more flexibility
parents
210fb86e
c3e2c38a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DA.sv
+31
-9
31 additions, 9 deletions
DA.sv
with
31 additions
and
9 deletions
DA.sv
+
31
−
9
View file @
d7c46ff0
...
...
@@ -49,6 +49,7 @@ always_ff@(posedge ck, posedge rst)
// ==== DA accumulator ====
<<<<<<<
HEAD
always_ff
@
(
posedge
ck
)
if
(
reset_accumulator
)
begin
...
...
@@ -68,9 +69,30 @@ always_ff @(posedge ck)
begin
shifted_out
<=
{
partial_sum
[
0
],
shifted_out
[
N
-
1
:
1
]
}
;
partial_sum
<=
{
partial_sum
[(
N
-
1
)
+
8
],
partial_sum
[(
N
-
1
)
+
8
:
1
]
}
-
multiplication_coefficients
[
multiplication_addresses
[
address
]];
=======
always_ff
@
(
posedge
ck
,
posedge
rst
)
if
(
reset_accumulator
)
begin
partial_sum
<=
'0
;
shifted_out
<=
'0
;
end
else
begin
if
(
compute
)
begin
if
(
address
<
N
-
1
)
begin
shifted_out
<=
{
partial_sum
[
0
],
shifted_out
[
N
-
1
:
1
]
}
;
partial_sum
<=
{
partial_sum
[(
N
-
1
)
+
8
],
partial_sum
[(
N
-
1
)
+
8
:
1
]
}
+
multiplication_coefficients
[
multiplication_addresses
[
address
]];
end
else
begin
shifted_out
<=
{
partial_sum
[
0
],
shifted_out
[
N
-
1
:
1
]
}
;
partial_sum
<=
{
partial_sum
[(
N
-
1
)
+
8
],
partial_sum
[(
N
-
1
)
+
8
:
1
]
}
-
multiplication_coefficients
[
multiplication_addresses
[
address
]];
end
>>>>>>>
c3e2c38a62bbbf0555b4b676ad01f703f9b1ee10
end
end
end
// ==== DA accumulator ====
...
...
@@ -96,15 +118,15 @@ always_ff @(posedge ck, posedge rst)
// === state machine to control the MAC ====
always_ff
@
(
posedge
ck
,
posedge
rst
)
begin:
SEQ
if
(
rst
)
state
<=
waiting
;
else
state
<=
next_state
;
end:
SEQ
begin:
SEQ
if
(
rst
)
state
<=
waiting
;
else
state
<=
next_state
;
end:
SEQ
always_comb
begin:
COM
begin:
COM
load
=
'0
;
reset_accumulator
=
'0
;
output_ready
=
'0
;
...
...
@@ -138,7 +160,7 @@ always_comb
end
default
:
next_state
=
waiting
;
endcase
end:
COM
end:
COM
// ==== state machine to control the FIR ====
endmodule
\ No newline at end of file
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