Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fpgamatrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
moho1
fpgamatrix
Commits
baaa8c28
Commit
baaa8c28
authored
7 years ago
by
Moritz Holtz
Browse files
Options
Downloads
Patches
Plain Diff
added logic to increment addr
parent
3248f8c9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fpgamatrix.vhd
+15
-4
15 additions, 4 deletions
fpgamatrix.vhd
ledctl.vhd
+35
-2
35 additions, 2 deletions
ledctl.vhd
ledgen.vhd
+3
-2
3 additions, 2 deletions
ledgen.vhd
with
53 additions
and
8 deletions
fpgamatrix.vhd
+
15
−
4
View file @
baaa8c28
...
...
@@ -27,8 +27,10 @@ entity fpgamatrix is
end
entity
fpgamatrix
;
architecture
fpgamatrix_arch
of
fpgamatrix
is
constant
maxaddr
:
natural
:
=
7
;
signal
ledclk
:
std_logic
;
signal
addr
:
std_logic_vector
(
3
downto
0
)
;
signal
addr
:
natural
range
0
to
maxaddr
;
component
mypll
is
Port
(
...
...
@@ -38,21 +40,25 @@ architecture fpgamatrix_arch of fpgamatrix is
end
component
mypll
;
component
ledctl
is
Generic
(
maxaddr
:
natural
);
Port
(
ledclk
:
in
std_logic
;
ledoutclk
:
out
std_logic
;
addr
:
out
std_logic_vector
(
3
downto
0
)
;
addr
:
out
natural
range
0
to
maxaddr
;
latch
:
out
std_logic
);
end
component
ledctl
;
component
ledgen
is
Generic
(
maxaddr
:
natural
;
topdown
:
topdown_type
);
Port
(
clk
:
in
std_logic
;
addr
:
in
std_logic_vector
(
3
downto
0
)
;
addr
:
in
natural
range
0
to
maxaddr
;
r
:
out
std_logic
;
g
:
out
std_logic
;
b
:
out
std_logic
...
...
@@ -66,6 +72,9 @@ begin
);
ledctl_inst
:
ledctl
Generic
Map
(
maxaddr
=>
maxaddr
)
Port
Map
(
ledclk
=>
ledclk
,
addr
=>
addr
,
...
...
@@ -74,6 +83,7 @@ begin
ledgen_top
:
ledgen
Generic
Map
(
maxaddr
=>
maxaddr
,
topdown
=>
top
)
Port
Map
(
...
...
@@ -86,6 +96,7 @@ begin
ledgen_down
:
ledgen
Generic
Map
(
maxaddr
=>
maxaddr
,
topdown
=>
down
)
Port
Map
(
...
...
@@ -103,6 +114,6 @@ begin
assignaddr
:
process
(
addr
)
is
begin
outaddr
<=
addr
;
outaddr
<=
std_logic_vector
(
to_unsigned
(
addr
,
4
))
;
end
process
assignaddr
;
end
fpgamatrix_arch
;
This diff is collapsed.
Click to expand it.
ledctl.vhd
+
35
−
2
View file @
baaa8c28
...
...
@@ -3,14 +3,47 @@ use IEEE.STD_LOGIC_1164.ALL;
use
IEEE
.
numeric_std
.
all
;
entity
ledctl
is
Generic
(
maxaddr
:
natural
);
Port
(
ledclk
:
in
std_logic
;
ledoutclk
:
out
std_logic
;
addr
:
out
std_logic_vector
(
3
downto
0
)
;
addr
:
out
natural
range
0
to
maxaddr
;
latch
:
out
std_logic
);
end
entity
ledctl
;
architecture
ledctl_arch
of
ledctl
is
constant
lednum
:
natural
:
=
32
;
signal
newline
:
std_logic
:
=
'0'
;
begin
end
architecture
ledctl_arch
;
\ No newline at end of file
ledcounter
:
process
(
ledclk
)
is
variable
curled
:
natural
range
0
to
lednum
;
begin
if
falling_edge
(
ledclk
)
then
newline
<=
'0'
;
curled
:
=
curled
+
1
;
if
curled
=
lednum
then
curled
:
=
0
;
newline
<=
'1'
;
end
if
;
end
if
;
end
process
ledcounter
;
addrcounter
:
process
(
newline
)
is
variable
curaddr
:
natural
range
0
to
maxaddr
+
1
:
=
0
;
begin
if
rising_edge
(
newline
)
then
curaddr
:
=
curaddr
+
1
;
if
curaddr
=
maxaddr
+
1
then
curaddr
:
=
0
;
end
if
;
addr
<=
curaddr
;
end
if
;
end
process
addrcounter
;
end
architecture
ledctl_arch
;
This diff is collapsed.
Click to expand it.
ledgen.vhd
+
3
−
2
View file @
baaa8c28
...
...
@@ -7,11 +7,12 @@ use mylib.mytypes.all;
entity
ledgen
is
Generic
(
maxaddr
:
natural
;
topdown
:
topdown_type
);
);
Port
(
clk
:
in
std_logic
;
addr
:
in
std_logic_vector
(
3
downto
0
)
;
addr
:
in
natural
range
0
to
maxaddr
;
r
:
out
std_logic
;
g
:
out
std_logic
;
b
:
out
std_logic
...
...
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