Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
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
Hdlmake
Commits
7feedf4d
Commit
7feedf4d
authored
Mar 10, 2017
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the VHDL counter test
parent
feff4994
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
counter.vhd
tests/counter/modules/counter/vhdl/counter.vhd
+18
-7
No files found.
tests/counter/modules/counter/vhdl/counter.vhd
View file @
7feedf4d
...
...
@@ -11,6 +11,8 @@ use ieee.numeric_std.all;
entity
counter
is
generic
(
cycles_per_second
:
unsigned
:
=
12000000
);
port
(
clock
:
in
std_logic
;
clear
:
in
std_logic
;
...
...
@@ -22,18 +24,27 @@ end counter;
-------------------------------------------------------
architecture
behv
of
counter
is
signal
ready
:
std_logic
;
signal
Pre_Q
:
unsigned
(
7
downto
0
);
signal
divider
:
unsigned
(
23
downto
0
);
begin
process
(
clock
,
count
,
clear
)
begin
if
clear
=
'1'
then
Pre_Q
<=
"00000000"
;
elsif
(
clock
=
'1'
and
clock
'event
)
then
if
count
=
'1'
then
Pre_Q
<=
Pre_Q
+
1
;
if
(
clock
=
'1'
and
clock
'event
)
then
if
ready
=
'1'
then
if
divider
=
cycles_per_second
then
divider
<=
(
others
=>
'0'
);
Pre_Q
(
7
downto
1
)
<=
Pre_Q
(
6
downto
0
);
Pre_Q
(
0
)
<=
Pre_Q
(
7
);
else
divider
<=
divider
+
1
;
end
if
;
else
ready
<=
'1'
;
Pre_Q
<=
"00010001"
;
divider
<=
(
others
=>
'0'
);
end
if
;
end
if
;
end
process
;
...
...
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