Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp-filtre-etudiant-a24carne
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Admin message
La purge estivale des projets de gitlab-df sera réalisée jeudi 10 juillet vers 10h.
Show more breadcrumbs
UEEE
sar-signal-audio
gr-vhdl-a24carne
tp-filtre-etudiant-a24carne
Commits
ea66d4ae
Commit
ea66d4ae
authored
1 month ago
by
Alexandre CARNEIRO--GILLET
Browse files
Options
Downloads
Patches
Plain Diff
cours 9 mai
parent
a0f3a451
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/img/FSM_2.drawio
+150
-0
150 additions, 0 deletions
docs/img/FSM_2.drawio
docs/img/FSM_2.png
+0
-0
0 additions, 0 deletions
docs/img/FSM_2.png
src/hdl/controlUnit.vhd
+37
-13
37 additions, 13 deletions
src/hdl/controlUnit.vhd
src/hdl/operativeUnit.vhd
+31
-15
31 additions, 15 deletions
src/hdl/operativeUnit.vhd
with
218 additions
and
28 deletions
docs/img/FSM_2.drawio
0 → 100644
+
150
−
0
View file @
ea66d4ae
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0" version="26.2.14">
<diagram name="Page-1" id="lufUWjv2mjaYaQ6cVEt1">
<mxGraphModel dx="1109" dy="1626" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="bw7OO0sNot4gaAuLXok9-1" value="" style="ellipse;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="240" y="40" width="160" height="80" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-2" value="<font style="font-size: 21px;" face="Ubuntu Mono">Wait Sample</font>" style="ellipse;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="250" y="50" width="140" height="60" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-3" value="Store" style="ellipse;whiteSpace=wrap;html=1;fontSize=21;fontFamily=Ubuntu Mono;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="240" y="160" width="160" height="80" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-5" value="Processing<br>Loop" style="ellipse;whiteSpace=wrap;html=1;fontSize=21;fontFamily=Ubuntu Mono;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="240" y="280" width="160" height="80" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-6" value="Output" style="ellipse;whiteSpace=wrap;html=1;fontSize=21;fontFamily=Ubuntu Mono;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="240" y="400" width="160" height="80" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-7" value="Wait End<br>Sample" style="ellipse;whiteSpace=wrap;html=1;fontSize=21;fontFamily=Ubuntu Mono;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="240" y="520" width="160" height="80" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-8" value="" style="endArrow=block;html=1;rounded=0;endFill=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="bw7OO0sNot4gaAuLXok9-1" target="bw7OO0sNot4gaAuLXok9-3" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="560" y="650" as="sourcePoint" />
<mxPoint x="610" y="600" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-9" value="" style="endArrow=block;html=1;rounded=0;endFill=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" target="bw7OO0sNot4gaAuLXok9-5" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="319.76" y="240" as="sourcePoint" />
<mxPoint x="319.76" y="320" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-10" value="" style="endArrow=block;html=1;rounded=0;endFill=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" target="bw7OO0sNot4gaAuLXok9-6" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="319.76" y="360" as="sourcePoint" />
<mxPoint x="320" y="400" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-11" value="" style="endArrow=block;html=1;rounded=0;endFill=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="bw7OO0sNot4gaAuLXok9-6" target="bw7OO0sNot4gaAuLXok9-7" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="319.76" y="480" as="sourcePoint" />
<mxPoint x="319.76" y="560" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-12" value="" style="curved=1;endArrow=block;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=0;entryDy=0;endFill=1;" parent="1" source="bw7OO0sNot4gaAuLXok9-7" target="bw7OO0sNot4gaAuLXok9-1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="510" y="320" as="sourcePoint" />
<mxPoint x="560" y="270" as="targetPoint" />
<Array as="points">
<mxPoint x="320" y="670" />
<mxPoint x="170" y="640" />
<mxPoint x="180" y="80" />
<mxPoint x="230" y="20" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-14" value="" style="endArrow=none;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="300" y="140" as="sourcePoint" />
<mxPoint x="340" y="140" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-17" value="<font face="Ubuntu Mono">InputValid = '1'</font>" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;labelBorderColor=none;fontStyle=2" parent="bw7OO0sNot4gaAuLXok9-14" vertex="1" connectable="0">
<mxGeometry x="0.564" relative="1" as="geometry">
<mxPoint x="10" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-15" value="" style="endArrow=none;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="300" y="380" as="sourcePoint" />
<mxPoint x="340" y="380" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-16" value="" style="endArrow=none;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="300" y="620" as="sourcePoint" />
<mxPoint x="340" y="620" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-18" value="<font face="Ubuntu Mono">ProcessingDone = '1'</font>" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;labelBorderColor=none;fontStyle=2" parent="1" vertex="1" connectable="0">
<mxGeometry x="340.00279069767436" y="380" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-19" value="<font face="Ubuntu Mono">InputValid = '0'</font>" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;labelBorderColor=none;fontStyle=2" parent="1" vertex="1" connectable="0">
<mxGeometry x="340.00279069767436" y="620" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-20" value="" style="curved=1;endArrow=block;html=1;rounded=0;endFill=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" target="bw7OO0sNot4gaAuLXok9-1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="350" y="-10" as="sourcePoint" />
<mxPoint x="460" y="90" as="targetPoint" />
<Array as="points">
<mxPoint x="330" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-21" value="<font face="Ubuntu Mono"><span style="font-size: 15px;">Rst = '1'</span></font>" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];" parent="1" vertex="1" connectable="0">
<mxGeometry x="350.00279069767436" y="-10" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-23" value="<font style="font-size: 15px;" face="Ubuntu Mono">LoadShift = '0'<br>InitAddress = '0'<br>IncrAddress = '0'<br>InitSum = '0'<br>LoadSum = '0'<br>LoadOutput = '1'<br></font>" style="rounded=0;whiteSpace=wrap;html=1;align=left;fontStyle=2;container=0;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" parent="1" vertex="1">
<mxGeometry x="480" y="380" width="240" height="110" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-24" value="" style="endArrow=block;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endFill=1;dashed=1;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="439.77" as="sourcePoint" />
<mxPoint x="480" y="439.77" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-33" value="<font style="font-size: 15px;" face="Ubuntu Mono">LoadShift = '0'<br>InitAddress = '0'<br>IncrAddress = '0'<br>InitSum = '0'<br>LoadSum = '0'<br>LoadOutput = '0'</font>" style="rounded=0;whiteSpace=wrap;html=1;align=left;fontStyle=2;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" parent="1" vertex="1">
<mxGeometry x="480" y="20" width="240" height="110" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-34" value="" style="endArrow=block;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endFill=1;dashed=1;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="79.80999999999995" as="sourcePoint" />
<mxPoint x="480" y="79.80999999999995" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-30" value="<font style="font-size: 15px;" face="Ubuntu Mono">LoadShift = '1'<br>InitAddress = '0'<br>IncrAddress = '0'<br>InitSum = '0'<br>LoadSum = '0'<br>LoadOutput = '0'</font>" style="rounded=0;whiteSpace=wrap;html=1;align=left;fontStyle=2;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" parent="1" vertex="1">
<mxGeometry x="480" y="140" width="240" height="110" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-31" value="" style="endArrow=block;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endFill=1;dashed=1;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="199.80999999999995" as="sourcePoint" />
<mxPoint x="480" y="199.80999999999995" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-25" value="<font style="font-size: 15px;" face="Ubuntu Mono">LoadShift = '0'<br>InitAddress = '1' <br>IncrAddress = '1'<br>InitSum = '1'<br>LoadSum = '1'<br>LoadOutput = '0'</font>" style="rounded=0;whiteSpace=wrap;html=1;align=left;fontStyle=2;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" parent="1" vertex="1">
<mxGeometry x="480" y="260" width="240" height="110" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-27" value="" style="endArrow=block;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endFill=1;dashed=1;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="319.80999999999995" as="sourcePoint" />
<mxPoint x="480" y="319.80999999999995" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-36" value="<font style="font-size: 15px;" face="Ubuntu Mono">LoadShift = '0'<br>InitAddress = '0'<br>IncrAddress = '0'<br>InitSum = '0'<br>LoadSum = '0'<br>LoadOutput = '0'</font>" style="rounded=0;whiteSpace=wrap;html=1;align=left;fontStyle=2;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" parent="1" vertex="1">
<mxGeometry x="480" y="500" width="240" height="110" as="geometry" />
</mxCell>
<mxCell id="bw7OO0sNot4gaAuLXok9-37" value="" style="endArrow=block;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endFill=1;dashed=1;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="559.81" as="sourcePoint" />
<mxPoint x="480" y="559.81" as="targetPoint" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
This diff is collapsed.
Click to expand it.
docs/img/FSM_2.png
0 → 100644
+
0
−
0
View file @
ea66d4ae
126 KiB
This diff is collapsed.
Click to expand it.
src/hdl/controlUnit.vhd
+
37
−
13
View file @
ea66d4ae
...
@@ -54,23 +54,47 @@ begin
...
@@ -54,23 +54,47 @@ begin
-- Process to describe the state register
-- Process to describe the state register
-- Current state is provide at the output of the register
-- Current state is provide at the output of the register
-- and is updated with the next state at each rising edge of clock
-- and is updated with the next state at each rising edge of clock
process
(
_
BLANK_
)
is
process
(
I_reset
,
I_clock
)
is
begin
begin
if
I_reset
=
'1'
then
-- asynchronous reset (active high)
if
I_reset
=
'1'
then
-- asynchronous reset (active high)
SR_currentState
<=
_
BLANK_
SR_currentState
<=
WAIT_SAMPLE
;
elsif
rising_edge
(
I_clock
)
then
-- rising clock edge
elsif
rising_edge
(
I_clock
)
then
-- rising clock edge
_
BLANK_
SR_currentState
<=
SR_nextState
;
end
if
;
end
if
;
end
process
;
end
process
;
-- Combinatorial process computing the next state which depends on
-- Combinatorial process computing the next state which depends on
-- the current state and on the inputs
-- the current state and on the inputs
process
(
_
BLANK_
)
is
process
(
SR_currentState
,
I_inputSampleValid
,
I_processingDone
)
is
begin
begin
case
SR_currentState
is
case
SR_currentState
is
when
WAIT_SAMPLE
=>
when
WAIT_SAMPLE
=>
_
BLANK_
if
I_inputSampleValid
=
'1'
then
SR_nextState
<=
STORE
;
else
SR_nextState
<=
WAIT_SAMPLE
;
end
if
;
when
STORE
=>
SR_nextState
<=
PROCESSING_LOOP
;
when
PROCESSING_LOOP
=>
if
I_processingDone
=
'1'
then
SR_nextState
<=
OUTPUT
;
else
SR_nextState
<=
PROCESSING_LOOP
;
end
if
;
when
OUTPUT
=>
SR_nextState
<=
WAIT_END_SAMPLE
;
when
WAIT_END_SAMPLE
=>
if
I_inputSampleValid
=
'0'
then
SR_nextState
<=
WAIT_SAMPLE
;
else
SR_nextState
<=
WAIT_END_SAMPLE
;
end
if
;
when
others
=>
null
;
when
others
=>
null
;
end
case
;
end
case
;
...
@@ -78,13 +102,13 @@ begin
...
@@ -78,13 +102,13 @@ begin
-- Rules to compute the outputs depending on the current state
-- Rules to compute the outputs depending on the current state
-- (and on the inputs, if you want a Mealy machine).
-- (and on the inputs, if you want a Mealy machine).
O_loadShift
<=
'1'
when
_
BLANK_
else
'0'
;
O_loadShift
<=
'1'
when
SR_currentState
=
STORE
else
'0'
;
O_initAddress
<=
'1'
when
_
BLANK_
else
'0'
;
O_initAddress
<=
'1'
when
SR_currentState
=
WAIT_SAMPLE
else
'0'
;
O_incrAddress
<=
'1'
when
_
BLANK_
else
'0'
;
O_incrAddress
<=
'1'
when
SR_currentState
=
PROCESSING_LOOP
else
'0'
;
O_initSum
<=
'1'
when
_
BLANK_
else
'0'
;
O_initSum
<=
'1'
when
SR_currentState
=
WAIT_SAMPLE
else
'0'
;
O_loadSum
<=
'1'
when
_
BLANK_
else
'0'
;
O_loadSum
<=
'1'
when
SR_currentState
=
PROCESSING_LOOP
else
'0'
;
O_loadOutput
<=
'1'
when
_
BLANK_
else
'0'
;
O_loadOutput
<=
'1'
when
SR_currentState
=
OUTPUT
else
'0'
;
O_FilteredSampleValid
<=
'1'
when
_
BLANK_
else
'0'
;
O_FilteredSampleValid
<=
'1'
when
SR_currentState
=
WAIT_END_SAMPLE
else
'0'
;
...
...
This diff is collapsed.
Click to expand it.
src/hdl/operativeUnit.vhd
+
31
−
15
View file @
ea66d4ae
...
@@ -45,7 +45,7 @@ entity operativeUnit is
...
@@ -45,7 +45,7 @@ entity operativeUnit is
I_incrAddress
:
in
std_logic
;
-- Control signal to increment register read address
I_incrAddress
:
in
std_logic
;
-- Control signal to increment register read address
I_initSum
:
in
std_logic
;
-- Control signal to initialize the MAC register
I_initSum
:
in
std_logic
;
-- Control signal to initialize the MAC register
I_loadSum
:
in
std_logic
;
-- Control signal to load the MAC register;
I_loadSum
:
in
std_logic
;
-- Control signal to load the MAC register;
I_load
Y
:
in
std_logic
;
-- Control signal to load Y register
I_load
Output
:
in
std_logic
;
-- Control signal to load Y register
O_processingDone
:
out
std_logic
;
-- Indicate that processing is done
O_processingDone
:
out
std_logic
;
-- Indicate that processing is done
O_filteredSample
:
out
std_logic_vector
(
15
downto
0
)
-- filtered sample
O_filteredSample
:
out
std_logic_vector
(
15
downto
0
)
-- filtered sample
);
);
...
@@ -114,36 +114,43 @@ begin
...
@@ -114,36 +114,43 @@ begin
);
);
-- Process to describe the shift register storing the input samples
-- Process to describe the shift register storing the input samples
shift
:
process
(
_
BLANK_
)
is
shift
:
process
(
I_reset
,
I_clock
)
is
begin
-- process shift
begin
-- process shift
if
I_reset
=
'1'
then
-- asynchronous reset (active high)
if
I_reset
=
'1'
then
-- asynchronous reset (active high)
SR_shiftRegister
<=
(
others
=>
(
others
=>
'0'
));
SR_shiftRegister
<=
(
others
=>
(
others
=>
'0'
));
elsif
_
BLANK_
elsif
rising_edge
(
I_clock
)
then
if
I_loadShift
=
'1'
then
SR_shiftRegister
(
1
to
15
)
<=
SR_shiftRegister
(
0
to
14
);
SR_shiftRegister
(
0
)
<=
signed
(
I_inputSample
);
end
if
;
end
if
;
end
if
;
end
process
shift
;
end
process
shift
;
-- Process to describe the counter providing the selection adresses
-- Process to describe the counter providing the selection adresses
-- of the multiplexers
-- of the multiplexers
incr_address
:
process
(
_
BLANK_
)
is
incr_address
:
process
(
I_reset
,
I_incrAddress
,
I_clock
)
is
begin
begin
if
I_reset
=
'1'
then
-- asynchronous reset (active high)
if
I_reset
=
'1'
then
-- asynchronous reset (active high)
SR_readAddress
<=
0
;
SR_readAddress
<=
0
;
elsif
_
BLANK_
elsif
I_initAddress
=
'1'
then
SR_readAddress
<=
0
;
elsif
rising_edge
(
I_clock
)
then
if
I_incrAddress
=
'1'
then
SR_readAddress
<=
SR_readAddress
+
1
;
end
if
;
end
if
;
end
if
;
end
process
incr_address
;
end
process
incr_address
;
-- Signal detecting that the next cycle will be the one
-- Signal detecting that the next cycle will be the one
-- providing the last product used to compute the convolution
-- providing the last product used to compute the convolution
O_processingDone
<=
'1'
when
_
BLANK_
;
O_processingDone
<=
'1'
when
SR_readAddress
>
14
else
'0'
;
-- Signals connected with multiplexers (SIMPLY inferred with table indices)
-- Signals connected with multiplexers (SIMPLY inferred with table indices)
SC_multOperand1
<=
_
BLANK_
;
-- 16 bits
SC_multOperand1
<=
SR_shiftRegister
(
SR_readAddress
)
;
-- 16 bits
SC_multOperand2
<=
_
BLANK_
;
-- 16 bits
SC_multOperand2
<=
SR_coefRegister
(
SR_readAddress
)
;
-- 16 bits
-- Multiplication of the operands
-- Multiplication of the operands
SC_MultResult
<=
_
BLANK_
;
-- 32 bits
SC_MultResult
<=
SC_multOperand1
*
SC_multOperand2
;
-- 32 bits
-- Sum of the multiplication result and the accumulated value
-- Sum of the multiplication result and the accumulated value
SC_addResult
<=
resize
(
SC_MultResult
,
SC_addResult
'length
)
+
SR_sum
;
SC_addResult
<=
resize
(
SC_MultResult
,
SC_addResult
'length
)
+
SR_sum
;
...
@@ -151,18 +158,27 @@ begin
...
@@ -151,18 +158,27 @@ begin
-- Register to store the accumulated value if the loadSum is active
-- Register to store the accumulated value if the loadSum is active
-- It also reduces the width of the sum to fit to the input and output
-- It also reduces the width of the sum to fit to the input and output
-- signal widths (be careful with truncating/rounding)
-- signal widths (be careful with truncating/rounding)
sum_acc
:
process
(
_
BLANK_
)
is
sum_acc
:
process
(
I_reset
,
I_loadSum
,
I_clock
)
is
begin
begin
if
I_reset
=
'1'
then
-- asynchronous reset (active high)
if
I_reset
=
'1'
then
-- asynchronous reset (active high)
SR_sum
<=
(
others
=>
'0'
);
SR_sum
<=
(
others
=>
'0'
);
elsif
_
BLANK_
elsif
rising_edge
(
I_clock
)
then
if
I_loadSum
=
'1'
then
SR_sum
<=
SC_addResult
;
end
if
;
end
if
;
end
if
;
end
process
sum_acc
;
end
process
sum_acc
;
-- Register to store the final result if the loadOuput is active
-- Register to store the final result if the loadOuput is active
store_result
:
process
(
_
BLANK_
)
is
store_result
:
process
(
I_reset
,
I_clock
)
is
begin
begin
_
BLANK_
if
I_reset
=
'1'
then
-- asynchronous reset (active high)
SR_filteredSample
<=
(
others
=>
'0'
);
elsif
rising_edge
(
I_clock
)
then
if
I_loadOutput
=
'1'
then
SR_filteredSample
<=
SR_sum
(
30
downto
15
);
end
if
;
end
if
;
end
process
store_result
;
end
process
store_result
;
...
...
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