Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 2cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
FMC DEL 1ns 2cha
Commits
3db419eb
Commit
3db419eb
authored
Apr 04, 2017
by
Jan Pospisil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed pulseGenerator for cases when g_PulseMinWidth==1
parent
d4ca5732
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
29 deletions
+35
-29
pulseGenerator.vhd
hdl/ffpg/rtl/pulseGenerator.vhd
+35
-29
No files found.
hdl/ffpg/rtl/pulseGenerator.vhd
View file @
3db419eb
...
...
@@ -7,41 +7,47 @@ library ieee;
use
ieee
.
std_logic_1164
.
all
;
entity
PulseGenerator
is
generic
(
g_PulseMinWidth
:
integer
:
=
3
-- multiply
of 'Clk_ik' periods
);
port
(
Clk_ik
:
in
std_logic
;
Reset_ir
:
in
std_logic
;
Signal_i
:
in
std_logic
;
Pulse_o
:
out
std_logic
);
generic
(
g_PulseMinWidth
:
positive
:
=
3
-- multiple
of 'Clk_ik' periods
);
port
(
Clk_ik
:
in
std_logic
;
Reset_ir
:
in
std_logic
;
Signal_i
:
in
std_logic
;
Pulse_o
:
out
std_logic
);
end
entity
;
architecture
base
of
PulseGenerator
is
signal
ShiftRegister_b
:
std_logic_vector
(
g_PulseMinWidth
-1
downto
0
)
:
=
(
others
=>
'0'
);
signal
ShiftRegister_b
:
std_logic_vector
(
g_PulseMinWidth
-1
downto
0
)
:
=
(
others
=>
'0'
);
begin
pShiftRegister
:
process
(
Clk_ik
)
begin
if
rising_edge
(
Clk_ik
)
then
if
Reset_ir
=
'1'
then
ShiftRegister_b
<=
(
others
=>
'0'
);
else
ShiftRegister_b
<=
ShiftRegister_b
(
g_PulseMinWidth
-2
downto
0
)
&
Signal_i
;
end
if
;
end
if
;
end
process
;
pPulseGenerator
:
process
(
ShiftRegister_b
)
is
variable
Pulse
:
std_logic
:
=
'0'
;
begin
Pulse
:
=
'0'
;
for
i
in
ShiftRegister_b
'range
loop
Pulse
:
=
Pulse
or
ShiftRegister_b
(
i
);
end
loop
;
Pulse_o
<=
Pulse
;
end
process
;
gMore
:
if
g_PulseMinWidth
>
1
generate
pShiftRegister
:
process
(
Clk_ik
)
begin
if
rising_edge
(
Clk_ik
)
then
if
Reset_ir
=
'1'
then
ShiftRegister_b
<=
(
others
=>
'0'
);
else
ShiftRegister_b
<=
ShiftRegister_b
(
g_PulseMinWidth
-2
downto
0
)
&
Signal_i
;
end
if
;
end
if
;
end
process
;
pPulseGenerator
:
process
(
ShiftRegister_b
)
is
variable
Pulse
:
std_logic
:
=
'0'
;
begin
Pulse
:
=
'0'
;
for
i
in
ShiftRegister_b
'range
loop
Pulse
:
=
Pulse
or
ShiftRegister_b
(
i
);
end
loop
;
Pulse_o
<=
Pulse
;
end
process
;
end
generate
;
gOne
:
if
g_PulseMinWidth
=
1
generate
Pulse_o
<=
Signal_i
;
end
generate
;
end
architecture
;
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