Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
ks6n19
project
Commits
ec794fd5
Commit
ec794fd5
authored
4 years ago
by
ks6n19
Browse files
Options
Downloads
Patches
Plain Diff
pixel_x, pixel_y follows hcount and vcount
parent
89eadf37
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
behavioural/razzle.sv
+5
-31
5 additions, 31 deletions
behavioural/razzle.sv
with
5 additions
and
31 deletions
behavioural/razzle.sv
+
5
−
31
View file @
ec794fd5
...
@@ -19,7 +19,6 @@ module razzle (
...
@@ -19,7 +19,6 @@ module razzle (
logic
[
10
:
0
]
H_count
,
V_count
;
logic
[
10
:
0
]
H_count
,
V_count
;
logic
Red_Data
;
logic
Red_Data
;
logic
red_square
;
logic
video_on
,
video_on_H
,
video_on_V
,
clock_enable
;
logic
video_on
,
video_on_H
,
video_on_V
,
clock_enable
;
timeunit
1
ns
;
timeunit
1
ns
;
...
@@ -41,7 +40,7 @@ assign VGA_BLANK_N = video_on;
...
@@ -41,7 +40,7 @@ assign VGA_BLANK_N = video_on;
// Colors for pixel data on video signal
// Colors for pixel data on video signal
assign
Red_Data
=
red_square
;
assign
Red_Data
=
pixel
;
assign
Green_Data
=
0
;
assign
Green_Data
=
0
;
assign
Blue_Data
=
0
;
assign
Blue_Data
=
0
;
...
@@ -53,26 +52,11 @@ assign Blue = Blue_Data && video_on;
...
@@ -53,26 +52,11 @@ assign Blue = Blue_Data && video_on;
// video_on turns off pixel color data when not in the pixel view area
// video_on turns off pixel color data when not in the pixel view area
assign
video_on
=
video_on_H
&&
video_on_V
;
assign
video_on
=
video_on_H
&&
video_on_V
;
assign
pixel_x
=
H_count
;
assign
pixel_y
=
V_count
;
// Red square calculation
always
@
(
posedge
CLOCK_50
,
negedge
nReset
)
if
(
!
nReset
)
begin
red_square
=
0
;
end
else
begin
:
FRACTAL_COMPUTE
if
(
video_on
)
begin
if
((
V_count
==
pixel_y
)
&&
(
H_count
==
pixel_x
))
red_square
=
1
;
else
red_square
=
'0
;
end
end
:
FRACTAL_COMPUTE
// Generate Horizontal and Vertical Timing Signals for Video Signal
// Generate Horizontal and Vertical Timing Signals for Video Signal
//VIDEO_DISPLAY
//VIDEO_DISPLAY
...
@@ -84,8 +68,6 @@ always @(posedge CLOCK_50, negedge nReset)
...
@@ -84,8 +68,6 @@ always @(posedge CLOCK_50, negedge nReset)
V_count
=
0
;
V_count
=
0
;
video_on_H
=
0
;
video_on_H
=
0
;
video_on_V
=
0
;
video_on_V
=
0
;
pixel_x
=
0
;
pixel_y
=
0
;
end
end
else
else
...
@@ -106,10 +88,6 @@ always @(posedge CLOCK_50, negedge nReset)
...
@@ -106,10 +88,6 @@ always @(posedge CLOCK_50, negedge nReset)
if
(
clock_enable
)
if
(
clock_enable
)
begin
begin
if
(
pixel_x
>=
320
)
pixel_x
=
0
;
else
pixel_x
=
pixel_x
+
1
;
if
(
H_count
>=
799
)
if
(
H_count
>=
799
)
H_count
=
0
;
H_count
=
0
;
...
@@ -133,11 +111,7 @@ always @(posedge CLOCK_50, negedge nReset)
...
@@ -133,11 +111,7 @@ always @(posedge CLOCK_50, negedge nReset)
else
if
(
H_count
==
699
)
else
if
(
H_count
==
699
)
V_count
=
V_count
+
1
;
V_count
=
V_count
+
1
;
if
(
pixel_y
>=
240
)
pixel_y
=
0
;
else
pixel_y
=
pixel_y
+
1
;
// Generate Vertical Sync Signal
// Generate Vertical Sync Signal
if
((
V_count
<=
494
)
&&
(
V_count
>=
493
))
if
((
V_count
<=
494
)
&&
(
V_count
>=
493
))
VGA_VS
=
0
;
VGA_VS
=
0
;
...
...
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