diff --git a/labs/2_graphics/2_10_color_shapes_and_functions/gtkwave.tcl b/labs/2_graphics/2_10_color_shapes_and_functions/gtkwave.tcl new file mode 100644 index 00000000..deeb9bce --- /dev/null +++ b/labs/2_graphics/2_10_color_shapes_and_functions/gtkwave.tcl @@ -0,0 +1,73 @@ +# gtkwave::loadFile "dump.vcd" + +set all_signals [list] + +lappend all_signals tb.i_display.pixel_29 +lappend all_signals tb.i_display.pixel_28 +lappend all_signals tb.i_display.pixel_27 +lappend all_signals tb.i_display.pixel_26 +lappend all_signals tb.i_display.pixel_25 +lappend all_signals tb.i_display.pixel_24 +lappend all_signals tb.i_display.pixel_23 +lappend all_signals tb.i_display.pixel_22 +lappend all_signals tb.i_display.pixel_21 +lappend all_signals tb.i_display.pixel_20 +lappend all_signals tb.i_display.pixel_19 +lappend all_signals tb.i_display.pixel_18 +lappend all_signals tb.i_display.pixel_17 +lappend all_signals tb.i_display.pixel_16 +lappend all_signals tb.i_display.pixel_15 +lappend all_signals tb.i_display.pixel_14 +lappend all_signals tb.i_display.pixel_13 +lappend all_signals tb.i_display.pixel_12 +lappend all_signals tb.i_display.pixel_11 +lappend all_signals tb.i_display.pixel_10 +lappend all_signals tb.i_display.pixel_09 +lappend all_signals tb.i_display.pixel_08 +lappend all_signals tb.i_display.pixel_07 +lappend all_signals tb.i_display.pixel_06 +lappend all_signals tb.i_display.pixel_05 +lappend all_signals tb.i_display.pixel_04 +lappend all_signals tb.i_display.pixel_03 +lappend all_signals tb.i_display.pixel_02 +lappend all_signals tb.i_display.pixel_01 +lappend all_signals tb.i_display.pixel_00 + +lappend all_signals tb.i_lcd.LCD_DE +lappend all_signals tb.LCD_R +lappend all_signals tb.LCD_G +lappend all_signals tb.LCD_B +lappend all_signals tb.x +lappend all_signals tb.y + +set num_added [ gtkwave::addSignalsFromList $all_signals ] + +gtkwave::highlightSignalsFromList "tb.LCD_R\[4:0\]" +gtkwave::/Edit/Data_Format/Analog/Step +gtkwave::/Edit/Data_Format/Decimal + +gtkwave::highlightSignalsFromList "tb.LCD_G\[5:0\]" +gtkwave::/Edit/Data_Format/Analog/Step +gtkwave::/Edit/Data_Format/Decimal + +gtkwave::highlightSignalsFromList "tb.LCD_B\[4:0\]" +gtkwave::/Edit/Data_Format/Analog/Step +gtkwave::/Edit/Data_Format/Decimal + +gtkwave::highlightSignalsFromList "tb.x\[8:0\]" +gtkwave::/Edit/Data_Format/Analog/Step +gtkwave::/Edit/Data_Format/Decimal + +gtkwave::highlightSignalsFromList "tb.y\[8:0\]" +gtkwave::/Edit/Data_Format/Analog/Step +gtkwave::/Edit/Data_Format/Decimal + +gtkwave::/Time/Zoom/Zoom_Full +gtkwave::/Time/Zoom/Zoom_In +gtkwave::/Time/Zoom/Zoom_In +gtkwave::/Time/Zoom/Zoom_In +gtkwave::/Time/Zoom/Zoom_In +gtkwave::/Time/Zoom/Zoom_In +gtkwave::/Time/Zoom/Zoom_To_End + +gtkwave::/Edit/UnHighlight_All diff --git a/labs/2_graphics/2_10_color_shapes_and_functions/lab_specific_board_config.svh b/labs/2_graphics/2_10_color_shapes_and_functions/lab_specific_board_config.svh index 9c68b07b..c77d4641 100644 --- a/labs/2_graphics/2_10_color_shapes_and_functions/lab_specific_board_config.svh +++ b/labs/2_graphics/2_10_color_shapes_and_functions/lab_specific_board_config.svh @@ -13,7 +13,7 @@ `define EMULATE_DYNAMIC_7SEG_ON_STATIC_WITHOUT_STICKY_FLOPS `define INSTANTIATE_GRAPHICS_INTERFACE_MODULE - `define INSTANTIATE_MICROPHONE_INTERFACE_MODULE - `define INSTANTIATE_SOUND_OUTPUT_INTERFACE_MODULE +// `define INSTANTIATE_MICROPHONE_INTERFACE_MODULE +// `define INSTANTIATE_SOUND_OUTPUT_INTERFACE_MODULE `endif // `ifndef LAB_SPECIFIC_CONFIG_SVH diff --git a/labs/2_graphics/2_10_color_shapes_and_functions/lab_top.sv b/labs/2_graphics/2_10_color_shapes_and_functions/lab_top.sv index 6cf10e65..00e553e8 100644 --- a/labs/2_graphics/2_10_color_shapes_and_functions/lab_top.sv +++ b/labs/2_graphics/2_10_color_shapes_and_functions/lab_top.sv @@ -115,7 +115,7 @@ module lab_top 16'b?????????????1??: rgb <= {{w_red {1'b1}}, {w_green {1'b0}}, {w_blue {1'b1}}}; 16'b??????????????1?: rgb <= {{w_red {1'b1}}, {w_green {1'b0}}, {w_blue {1'b0}}}; 16'b???????????????1: rgb <= {{w_red {1'b1}}, {w_green {1'b0}}, {w_blue {1'b1}}}; - default: rgb = {{w_red-1{1'b0}}, 1'b1, {w_green-1{1'b0}}, 1'b1, {w_blue-1{1'b0}}, 1'b1}; + default: rgb <= '0; endcase end diff --git a/labs/2_graphics/2_10_color_shapes_and_functions/surfer.scr b/labs/2_graphics/2_10_color_shapes_and_functions/surfer.scr new file mode 100644 index 00000000..e3cf85fe --- /dev/null +++ b/labs/2_graphics/2_10_color_shapes_and_functions/surfer.scr @@ -0,0 +1,93 @@ +variable_add tb.i_display.pixel_29 +variable_add tb.i_display.pixel_28 +variable_add tb.i_display.pixel_27 +variable_add tb.i_display.pixel_26 +variable_add tb.i_display.pixel_25 +variable_add tb.i_display.pixel_24 +variable_add tb.i_display.pixel_23 +variable_add tb.i_display.pixel_22 +variable_add tb.i_display.pixel_21 +variable_add tb.i_display.pixel_20 +variable_add tb.i_display.pixel_19 +variable_add tb.i_display.pixel_18 +variable_add tb.i_display.pixel_17 +variable_add tb.i_display.pixel_16 +variable_add tb.i_display.pixel_15 +variable_add tb.i_display.pixel_14 +variable_add tb.i_display.pixel_13 +variable_add tb.i_display.pixel_12 +variable_add tb.i_display.pixel_11 +variable_add tb.i_display.pixel_10 +variable_add tb.i_display.pixel_09 +variable_add tb.i_display.pixel_08 +variable_add tb.i_display.pixel_07 +variable_add tb.i_display.pixel_06 +variable_add tb.i_display.pixel_05 +variable_add tb.i_display.pixel_04 +variable_add tb.i_display.pixel_03 +variable_add tb.i_display.pixel_02 +variable_add tb.i_display.pixel_01 +variable_add tb.i_display.pixel_00 +variable_add tb.i_lcd.LCD_DE +variable_add tb.i_lcd.LCD_HSYNC +variable_add tb.LCD_R +variable_add tb.LCD_G +variable_add tb.LCD_B +variable_add tb.x +variable_add tb.y +variable_add tb.i_lab_top.paint.mx +variable_add tb.i_lab_top.paint.my +variable_add tb.i_lab_top.paint.rx +variable_add tb.i_lab_top.paint.ry + +scope_select tb.i_lcd + +item_focus bo +item_set_format Unsigned +item_set_color Yellow + +item_focus bp +item_set_format Unsigned +item_set_color Gray + +item_focus ca +item_set_format Unsigned +item_set_color Red + +item_focus cb +item_set_format Unsigned +item_set_color Green + +item_focus cc +item_set_format Unsigned +item_set_color Blue + +item_focus cd +item_set_format Unsigned +item_set_color Gray + +item_focus ce +item_set_format Unsigned +item_set_color Gray + +item_focus cf +item_set_format Unsigned + +item_focus cg +item_set_format Unsigned + +item_focus ch +item_set_format Unsigned + +item_focus ci +item_set_format Unsigned + +item_unfocus +remove_unavailable + +zoom_in +zoom_in +zoom_in +zoom_in +zoom_in +scroll_to_end diff --git a/labs/2_graphics/2_10_color_shapes_and_functions/tb.sv b/labs/2_graphics/2_10_color_shapes_and_functions/tb.sv index 70cb7106..3dc073bb 100644 --- a/labs/2_graphics/2_10_color_shapes_and_functions/tb.sv +++ b/labs/2_graphics/2_10_color_shapes_and_functions/tb.sv @@ -1,5 +1,7 @@ `include "config.svh" + // Shows the image on the VGA screen using signal lines in Wave Analyzer + module tb; timeunit 1ns; @@ -72,8 +74,39 @@ module tb; ); + // We output all the green pixels to signal lines in Wave Analyzer + // You can try it |LCD_G or |LCD_B or a mix of them + + assign pixel = |LCD_R || |LCD_G || |LCD_B; + //------------------------------------------------------------------------ + tb_lcd_480_272 i_lcd + ( + .PixelClk ( pixel_clk ), + .rst ( rst ), + .LCD_DE ( LCD_DE ), + .LCD_HSYNC ( LCD_HS ), + .LCD_VSYNC ( LCD_VS ), + .x ( x ), + .y ( y ) + ); + + //------------------------------------------------------------------------ + + // We output pixels to signal lines in Wave Analyzer + + tb_lcd_display i_display + ( + .PixelClk ( pixel_clk ), + .rst ( rst ), + .LCD_DE ( LCD_DE ), + .LCD_HSYNC ( LCD_HS ), + .LCD_VSYNC ( LCD_VS ), + .pixel ( pixel ) + ); + + //------------------------------------------------------------------------ initial begin clk = 1'b0; @@ -84,6 +117,16 @@ module tb; //------------------------------------------------------------------------ + initial + begin + pixel_clk = 1'b0; + + forever + # (clk_period / 6) pixel_clk = ~ pixel_clk; + end + + //------------------------------------------------------------------------ + initial begin rst <= 'bx;