mirror of
https://github.com/supleed2/ELEC70056-HSV-CW2.git
synced 2024-12-22 21:55:48 +00:00
Fixes and adding missing setup.do script for vsim
This commit is contained in:
parent
5c4334ab76
commit
827ed444fa
|
@ -95,7 +95,6 @@ module AHBVGA(
|
||||||
//VGA interface: control the synchronization and color signals for a particular resolution
|
//VGA interface: control the synchronization and color signals for a particular resolution
|
||||||
VGAInterface uVGAInterface (
|
VGAInterface uVGAInterface (
|
||||||
.CLK(HCLK),
|
.CLK(HCLK),
|
||||||
.resetn(HRESETn),
|
|
||||||
.COLOUR_IN(cin),
|
.COLOUR_IN(cin),
|
||||||
.cout(RGB),
|
.cout(RGB),
|
||||||
.hs(HSYNC),
|
.hs(HSYNC),
|
||||||
|
@ -132,48 +131,33 @@ module AHBVGA(
|
||||||
assign sel_image = (last_HADDR[23:0] != 12'h000000000000);
|
assign sel_image = (last_HADDR[23:0] != 12'h000000000000);
|
||||||
|
|
||||||
//Set console write and write data
|
//Set console write and write data
|
||||||
always @(posedge HCLK, negedge HRESETn)
|
always_ff @(posedge HCLK, negedge HRESETn)
|
||||||
begin
|
if(!HRESETn) begin
|
||||||
if(!HRESETn)
|
|
||||||
begin
|
|
||||||
console_write <= 0;
|
console_write <= 0;
|
||||||
console_wdata <= 0;
|
console_wdata <= 0;
|
||||||
end
|
end else if (last_HWRITE & last_HSEL & last_HTRANS[1] & HREADYOUT & sel_console) begin
|
||||||
else if(last_HWRITE & last_HSEL & last_HTRANS[1] & HREADYOUT & sel_console)
|
|
||||||
begin
|
|
||||||
console_write <= 1'b1;
|
console_write <= 1'b1;
|
||||||
console_wdata <= HWDATA[7:0];
|
console_wdata <= HWDATA[7:0];
|
||||||
end
|
end else begin
|
||||||
else
|
|
||||||
begin
|
|
||||||
console_write <= 1'b0;
|
console_write <= 1'b0;
|
||||||
console_wdata <= 0;
|
console_wdata <= 0;
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
//Set image write and image write data
|
//Set image write and image write data
|
||||||
always @(posedge HCLK, negedge HRESETn)
|
always_ff @(posedge HCLK, negedge HRESETn)
|
||||||
begin
|
if(!HRESETn) begin
|
||||||
if(!HRESETn)
|
|
||||||
begin
|
|
||||||
image_write <= 0;
|
image_write <= 0;
|
||||||
image_wdata <= 0;
|
image_wdata <= 0;
|
||||||
end
|
end else if(last_HWRITE & last_HSEL & last_HTRANS[1] & HREADYOUT & sel_image) begin
|
||||||
else if(last_HWRITE & last_HSEL & last_HTRANS[1] & HREADYOUT & sel_image)
|
|
||||||
begin
|
|
||||||
image_write <= 1'b1;
|
image_write <= 1'b1;
|
||||||
image_wdata <= HWDATA[7:0];
|
image_wdata <= HWDATA[7:0];
|
||||||
end
|
end else begin
|
||||||
else
|
|
||||||
begin
|
|
||||||
image_write <= 1'b0;
|
image_write <= 1'b0;
|
||||||
image_wdata <= 0;
|
image_wdata <= 0;
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
//Select the rgb color for a particular region
|
//Select the rgb color for a particular region
|
||||||
always @*
|
always_comb
|
||||||
begin
|
|
||||||
if(!HRESETn)
|
if(!HRESETn)
|
||||||
cin <= 8'h00;
|
cin <= 8'h00;
|
||||||
else
|
else
|
||||||
|
@ -181,7 +165,6 @@ module AHBVGA(
|
||||||
cin <= console_rgb ;
|
cin <= console_rgb ;
|
||||||
else
|
else
|
||||||
cin <= image_rgb;
|
cin <= image_rgb;
|
||||||
end
|
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue