Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Gateware
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
Beam Positoning Monitor - Gateware
Commits
d85f086f
Commit
d85f086f
authored
Jun 06, 2016
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modules/dbe_common/*: add heartbeat module
parent
189d2cde
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
1 deletion
+72
-1
Manifest.py
hdl/modules/dbe_common/Manifest.py
+2
-1
dbe_common_pkg.vhd
hdl/modules/dbe_common/dbe_common_pkg.vhd
+16
-0
Manifest.py
hdl/modules/dbe_common/hearbeat/Manifest.py
+1
-0
heartbeat.vhd
hdl/modules/dbe_common/hearbeat/heartbeat.vhd
+53
-0
No files found.
hdl/modules/dbe_common/Manifest.py
View file @
d85f086f
...
...
@@ -2,6 +2,7 @@ modules = { "local" : ["reset_synch",
"pulse2level"
,
"trigger_rcv"
,
"counter_simple"
,
"extend_pulse_dyn"
]
};
"extend_pulse_dyn"
,
"heartbeat"
]
};
files
=
[
"dbe_common_pkg.vhd"
];
hdl/modules/dbe_common/dbe_common_pkg.vhd
View file @
d85f086f
...
...
@@ -74,5 +74,21 @@ package dbe_common_pkg is
count_o
:
out
std_logic_vector
(
g_output_width
-1
downto
0
));
end
component
counter_simple
;
component
heartbeat
generic
(
-- number of system clock cycles to count before blinking
g_clk_counts
:
natural
:
=
100000000
);
port
(
-- 100 MHz system clock
clk_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
-- Heartbeat pulse output
heartbeat_o
:
out
std_logic
);
end
component
;
end
dbe_common_pkg
;
hdl/modules/dbe_common/hearbeat/Manifest.py
0 → 100644
View file @
d85f086f
files
=
[
"heartbeat.vhd"
];
hdl/modules/dbe_common/hearbeat/heartbeat.vhd
0 → 100755
View file @
d85f086f
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
-- Common cores
use
work
.
genram_pkg
.
all
;
entity
heartbeat
is
generic
(
-- number of system clock cycles to count before blinking
g_clk_counts
:
natural
:
=
100000000
);
port
(
-- 100 MHz system clock
clk_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
-- Heartbeat pulse output
heartbeat_o
:
out
std_logic
);
end
heartbeat
;
architecture
rtl
of
heartbeat
is
constant
c_pps_counter_width
:
natural
:
=
f_log2_size
(
g_clk_counts
);
signal
hb
:
std_logic
:
=
'0'
;
signal
pps_counter
:
unsigned
(
c_pps_counter_width
-1
downto
0
)
:
=
(
others
=>
'0'
);
begin
p_heartbeat
:
process
(
clk_i
)
begin
if
rising_edge
(
clk_i
)
then
if
rst_n_i
=
'0'
then
pps_counter
<=
to_unsigned
(
0
,
pps_counter
'length
);
hb
<=
'0'
;
else
if
pps_counter
=
g_clk_counts
-1
then
pps_counter
<=
to_unsigned
(
0
,
pps_counter
'length
);
hb
<=
not
hb
;
else
pps_counter
<=
pps_counter
+
1
;
end
if
;
end
if
;
end
if
;
end
process
;
heartbeat_o
<=
hb
;
end
rtl
;
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