From 827ed444fa927520ad56f90819de9e950da826be Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Mon, 12 Dec 2022 16:49:07 +0000 Subject: [PATCH] Fixes and adding missing setup.do script for vsim --- rtl/AHB_VGA/AHBVGASYS.sv | 63 +++++++++++++++------------------------- setup.do | 3 ++ 2 files changed, 26 insertions(+), 40 deletions(-) create mode 100644 setup.do diff --git a/rtl/AHB_VGA/AHBVGASYS.sv b/rtl/AHB_VGA/AHBVGASYS.sv index 2293435..3d24d3c 100644 --- a/rtl/AHB_VGA/AHBVGASYS.sv +++ b/rtl/AHB_VGA/AHBVGASYS.sv @@ -95,7 +95,6 @@ module AHBVGA( //VGA interface: control the synchronization and color signals for a particular resolution VGAInterface uVGAInterface ( .CLK(HCLK), - .resetn(HRESETn), .COLOUR_IN(cin), .cout(RGB), .hs(HSYNC), @@ -132,48 +131,33 @@ module AHBVGA( assign sel_image = (last_HADDR[23:0] != 12'h000000000000); //Set console write and write data - always @(posedge HCLK, negedge HRESETn) - begin - if(!HRESETn) - begin - console_write <= 0; - console_wdata <= 0; - end - else if(last_HWRITE & last_HSEL & last_HTRANS[1] & HREADYOUT & sel_console) - begin - console_write <= 1'b1; - console_wdata <= HWDATA[7:0]; - end - else - begin - console_write <= 1'b0; - console_wdata <= 0; - end - end + always_ff @(posedge HCLK, negedge HRESETn) + if(!HRESETn) begin + console_write <= 0; + console_wdata <= 0; + end else if (last_HWRITE & last_HSEL & last_HTRANS[1] & HREADYOUT & sel_console) begin + console_write <= 1'b1; + console_wdata <= HWDATA[7:0]; + end else begin + console_write <= 1'b0; + console_wdata <= 0; + end //Set image write and image write data - always @(posedge HCLK, negedge HRESETn) - begin - if(!HRESETn) - begin - image_write <= 0; - image_wdata <= 0; - end - else if(last_HWRITE & last_HSEL & last_HTRANS[1] & HREADYOUT & sel_image) - begin - image_write <= 1'b1; - image_wdata <= HWDATA[7:0]; - end - else - begin - image_write <= 1'b0; - image_wdata <= 0; - end - end + always_ff @(posedge HCLK, negedge HRESETn) + if(!HRESETn) begin + image_write <= 0; + image_wdata <= 0; + end else if(last_HWRITE & last_HSEL & last_HTRANS[1] & HREADYOUT & sel_image) begin + image_write <= 1'b1; + image_wdata <= HWDATA[7:0]; + end else begin + image_write <= 1'b0; + image_wdata <= 0; + end //Select the rgb color for a particular region - always @* - begin + always_comb if(!HRESETn) cin <= 8'h00; else @@ -181,7 +165,6 @@ module AHBVGA( cin <= console_rgb ; else cin <= image_rgb; - end endmodule diff --git a/setup.do b/setup.do new file mode 100644 index 0000000..104faa9 --- /dev/null +++ b/setup.do @@ -0,0 +1,3 @@ +log -r /* +add wave -r /* +run -all