Removed version numbers from verilog modules, Fixed output for RGB so lines are low when there is no active drawing
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
`timescale 1 ns / 1 ps
|
`timescale 1 ns / 1 ps
|
||||||
|
|
||||||
module simplevga_v1_0 #
|
module simplevga #
|
||||||
(
|
(
|
||||||
// Users to add parameters here
|
// Users to add parameters here
|
||||||
|
|
||||||
@ -53,10 +53,10 @@
|
|||||||
wire [C_S00_AXI_DATA_WIDTH-1:0] reg_y;
|
wire [C_S00_AXI_DATA_WIDTH-1:0] reg_y;
|
||||||
wire [C_S00_AXI_DATA_WIDTH-1:0] reg_color;
|
wire [C_S00_AXI_DATA_WIDTH-1:0] reg_color;
|
||||||
// Instantiation of Axi Bus Interface S00_AXI
|
// Instantiation of Axi Bus Interface S00_AXI
|
||||||
simplevga_v1_0_S00_AXI # (
|
simplevga_S00_AXI # (
|
||||||
.C_S_AXI_DATA_WIDTH(C_S00_AXI_DATA_WIDTH),
|
.C_S_AXI_DATA_WIDTH(C_S00_AXI_DATA_WIDTH),
|
||||||
.C_S_AXI_ADDR_WIDTH(C_S00_AXI_ADDR_WIDTH)
|
.C_S_AXI_ADDR_WIDTH(C_S00_AXI_ADDR_WIDTH)
|
||||||
) simplevga_v1_0_S00_AXI_inst (
|
) simplevga_S00_AXI_inst (
|
||||||
.slave_reg0(reg_x),
|
.slave_reg0(reg_x),
|
||||||
.slave_reg1(reg_y),
|
.slave_reg1(reg_y),
|
||||||
.slave_reg2(reg_color),
|
.slave_reg2(reg_color),
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
`timescale 1 ns / 1 ps
|
`timescale 1 ns / 1 ps
|
||||||
|
|
||||||
module simplevga_v1_0_S00_AXI #
|
module simplevga_S00_AXI #
|
||||||
(
|
(
|
||||||
// Users to add parameters here
|
// Users to add parameters here
|
||||||
|
|
||||||
|
11
vgasquare.v
11
vgasquare.v
@ -40,9 +40,10 @@ module vgasquare(
|
|||||||
|
|
||||||
// Draw one square
|
// Draw one square
|
||||||
wire square = ((x > box_x1) & (y > box_y1) & (x < box_x2) & (y < box_y2)) ? 1 : 0; //Is box within range?
|
wire square = ((x > box_x1) & (y > box_y1) & (x < box_x2) & (y < box_y2)) ? 1 : 0; //Is box within range?
|
||||||
|
wire R = square ? box_color[0] : box_color[3];
|
||||||
|
wire G = square ? box_color[1] : box_color[4];
|
||||||
assign VGA_R = square ? box_color[0] : box_color[3]; // Set R (Foreground and then background)
|
wire B = square ? box_color[2] : box_color[5];
|
||||||
assign VGA_G = square ? box_color[1] : box_color[4]; // Set G
|
assign VGA_R = VGA_ACTIVE ? R : 0; // Set R (Foreground and then background)
|
||||||
assign VGA_B = square ? box_color[2] : box_color[5]; // Set B
|
assign VGA_G = VGA_ACTIVE ? G : 0; // Set G
|
||||||
|
assign VGA_B = VGA_ACTIVE ? B : 0; // Set B
|
||||||
endmodule
|
endmodule
|
||||||
|
Reference in New Issue
Block a user