Advertisement
kevinking0814

Untitled

Dec 7th, 2023
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module tb4();
  2.  
  3.     reg clk, rst, switch_en;
  4.     reg [3:0] r_switches, g_switches, b_switches;
  5.     wire [3:0] pix_r, pix_g, pix_b;
  6.     wire hsync, vsync;
  7.  
  8.     // instantiation
  9.     vga_out uut(
  10.         .clk(clk),
  11.         .rst(rst),
  12.         .switch_en(switch_en),
  13.         .r_switches(r_switches),
  14.         .g_switches(g_switches),
  15.         .b_switches(b_switches),
  16.         .pix_r(pix_r),
  17.         .pix_g(pix_g),
  18.         .pix_b(pix_b),
  19.         .hsync(hsync),
  20.         .vsync(vsync)
  21.     );
  22.  
  23.     // Initial block for setting up inputs
  24.     initial begin
  25.         clk = 1'b0;
  26.         rst = 1'b1;
  27.         switch_en = 1'b1; // Assuming you want to enable the switches initially
  28.         r_switches = 4'b1111;
  29.         g_switches = 4'b0000;
  30.         b_switches = 4'b0000;
  31.        
  32.         // Add more testbench logic as needed
  33.        
  34.         // Simulation time for observation
  35.         #1000;
  36.         $finish;
  37.     end
  38.    
  39.     // Clock generation
  40.     always #5 clk = ~clk;
  41.  
  42. endmodule
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement