data/full_repos/permissive/14193640/fpga/led_controller.v
1: b'%Warning-WIDTH: data/full_repos/permissive/14193640/fpga/led_controller.v:26: Operator ASSIGNW expects 7 bits on the Assign RHS, but Assign RHS\'s SEL generates 6 bits.\n                                                                            : ... In instance led_controller\n   assign driver_step = count[5:0];\n                      ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/14193640/fpga/led_controller.v:30: Cannot find file containing module: \'rom\'\n   rom control_rom\n   ^~~\n        ... Looked in:\n             data/full_repos/permissive/14193640/fpga,data/full_repos/permissive/14193640/rom\n             data/full_repos/permissive/14193640/fpga,data/full_repos/permissive/14193640/rom.v\n             data/full_repos/permissive/14193640/fpga,data/full_repos/permissive/14193640/rom.sv\n             rom\n             rom.v\n             rom.sv\n             obj_dir/rom\n             obj_dir/rom.v\n             obj_dir/rom.sv\n%Error: data/full_repos/permissive/14193640/fpga/led_controller.v:35: Cannot find file containing module: \'binary_counter\'\n   binary_counter #(.N(18), .MAX_COUNT(2**18-1)) counter\n   ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/14193640/fpga/led_controller.v:38: Cannot find file containing module: \'decoder\'\n   decoder #(.WIDTH(2)) panel_addr_decoder\n   ^~~~~~~\n%Error: data/full_repos/permissive/14193640/fpga/led_controller.v:41: Cannot find file containing module: \'inverting_decoder\'\n   inverting_decoder #(.WIDTH(4)) row_driver_decoder\n   ^~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/14193640/fpga/led_controller.v:49: Cannot find file containing module: \'panel_driver\'\n           panel_driver panel_driver_instance\n           ^~~~~~~~~~~~\n%Error: Exiting due to 5 error(s), 1 warning(s)\n'
module led_controller
  (
   input         clk,
   input         reset_n,
   input         test_panel_select_n,
   input [31:0]  chunk_data,
   input [3:0]   chunk_addr,
   input         chunk_write_enable,
   input [3:0]   row_addr,
   input [1:0]   panel_addr,
   output        serial_clk,
   output        latch_enable,
   output        output_enable_n,
   output [11:0] serial_data_out,
   output [15:0] row_select_n
   );

   wire          load, load_led_vals, load_brightness, shift;
   wire [17:0]   count;
   wire [6:0]    driver_step;
   wire [7:0]    pwm_time;
   wire [3:0]    active_row_addr;
   wire [3:0]    panel_select;

   
   assign driver_step = count[5:0];
   assign pwm_time = count[13:6];
   assign active_row_addr = count[17:14];

   rom control_rom
     (.clk(clk), .reset_n(reset_n), .addr(driver_step),
      .load(load), .shift(shift), .sclk(serial_clk), 
      .output_enable_n(output_enable_n), .latch_enable(latch_enable));

   binary_counter #(.N(18), .MAX_COUNT(2**18-1)) counter
     (.clk(clk), .reset_n(reset_n), .count(count));

   decoder #(.WIDTH(2)) panel_addr_decoder
     (.addr(panel_addr), .y(panel_select));
   
   inverting_decoder #(.WIDTH(4)) row_driver_decoder
     (.addr(active_row_addr), .y_n(row_select_n));


   genvar        i;
   generate
      for (i=0; i<4; i=i+1)
        begin : panel_drivers
           panel_driver panel_driver_instance
             (.clk(clk), 
              .reset_n(reset_n),
              .test_panel_select_n(test_panel_select_n),
              .shift(shift), 
              .load_led_vals(load), 
              .load_brightness(1'b0),
              .pwm_time(pwm_time),
              .chunk_data(chunk_data),
              .chunk_addr(chunk_addr),
              .chunk_write_enable(panel_select[i] & chunk_write_enable),
              .row_addr(row_addr),
              .active_row_addr(active_row_addr),
              .serial_data_out({serial_data_out[i*3], 
                                serial_data_out[i*3+1], 
                                serial_data_out[i*3+2]}));
        end
   endgenerate

endmodule
module led_controller
  (
   input         clk,
   input         reset_n,
   input         test_panel_select_n,
   input [31:0]  chunk_data,
   input [3:0]   chunk_addr,
   input         chunk_write_enable,
   input [3:0]   row_addr,
   input [1:0]   panel_addr,
   output        serial_clk,
   output        latch_enable,
   output        output_enable_n,
   output [11:0] serial_data_out,
   output [15:0] row_select_n
   );


   wire          load, load_led_vals, load_brightness, shift;
   wire [17:0]   count;
   wire [6:0]    driver_step;
   wire [7:0]    pwm_time;
   wire [3:0]    active_row_addr;
   wire [3:0]    panel_select;

   
   assign driver_step = count[5:0];
   assign pwm_time = count[13:6];
   assign active_row_addr = count[17:14];

   rom control_rom
     (.clk(clk), .reset_n(reset_n), .addr(driver_step),
      .load(load), .shift(shift), .sclk(serial_clk), 
      .output_enable_n(output_enable_n), .latch_enable(latch_enable));

   binary_counter #(.N(18), .MAX_COUNT(2**18-1)) counter
     (.clk(clk), .reset_n(reset_n), .count(count));

   decoder #(.WIDTH(2)) panel_addr_decoder
     (.addr(panel_addr), .y(panel_select));
   
   inverting_decoder #(.WIDTH(4)) row_driver_decoder
     (.addr(active_row_addr), .y_n(row_select_n));


   genvar        i;
   generate
      for (i=0; i<4; i=i+1)
        begin : panel_drivers
           panel_driver panel_driver_instance
             (.clk(clk), 
              .reset_n(reset_n),
              .test_panel_select_n(test_panel_select_n),
              .shift(shift), 
              .load_led_vals(load), 
              .load_brightness(1'b0),
              .pwm_time(pwm_time),
              .chunk_data(chunk_data),
              .chunk_addr(chunk_addr),
              .chunk_write_enable(panel_select[i] & chunk_write_enable),
              .row_addr(row_addr),
              .active_row_addr(active_row_addr),
              .serial_data_out({serial_data_out[i*3], 
                                serial_data_out[i*3+1], 
                                serial_data_out[i*3+2]}));
        end
   endgenerate

endmodule