data/full_repos/permissive/484553918/rtl/RGB_Color_Bars_Generator.v
1: b"%Error: data/full_repos/permissive/484553918/rtl/RGB_Color_Bars_Generator.v:19: syntax error, unexpected ')', expecting '['\n);\n^\n%Error: data/full_repos/permissive/484553918/rtl/RGB_Color_Bars_Generator.v:24: syntax error, unexpected input\ninput clk_i;\n^~~~~\n%Error: data/full_repos/permissive/484553918/rtl/RGB_Color_Bars_Generator.v:28: syntax error, unexpected output\noutput reg[23:0] rgb_o;\n^~~~~~\n%Error: data/full_repos/permissive/484553918/rtl/RGB_Color_Bars_Generator.v:33: syntax error, unexpected assign\nassign RGB_table[0] = {8'd255, 8'd255, 8'd255};\n^~~~~~\n%Error: data/full_repos/permissive/484553918/rtl/RGB_Color_Bars_Generator.v:45: syntax error, unexpected always\nalways @ (posedge clk_i) begin\n^~~~~~\n%Error: Exiting due to 5 error(s)\n"
module RGB_Color_Bars_Generator(
    clk_i,

    end_of_frame_i,
    end_of_line_i,
    hsync_n_i,
    vsync_n_i,
    visible_i,

    end_of_frame_o,
    end_of_line_o,
    hsync_n_o,
    vsync_n_o,
    visible_o,

    rgb_o,
);

localparam PIXELS_PER_VISIBLE_LINE = 640;
localparam PIXELS_PER_STRIPE = PIXELS_PER_VISIBLE_LINE / 8;

input clk_i;
input end_of_frame_i, end_of_line_i, hsync_n_i, vsync_n_i, visible_i;

output reg end_of_frame_o, end_of_line_o, hsync_n_o, vsync_n_o, visible_o;
output reg[23:0] rgb_o;

wire[23:0] RGB_table[0:7];


assign RGB_table[0] = {8'd255, 8'd255, 8'd255};
assign RGB_table[1] = {8'd255, 8'd255, 8'd0  };
assign RGB_table[2] = {8'd0  , 8'd255, 8'd255};
assign RGB_table[3] = {8'd0  , 8'd255, 8'd0  };
assign RGB_table[4] = {8'd255, 8'd0  , 8'd255};
assign RGB_table[5] = {8'd255, 8'd0  , 8'd0  };
assign RGB_table[6] = {8'd0  , 8'd0  , 8'd255};
assign RGB_table[7] = {8'd0  , 8'd0  , 8'd0  };

reg[2:0] index;
reg[$clog2(PIXELS_PER_STRIPE)-1:0] cnt;

always @ (posedge clk_i) begin
    if (end_of_line_i == 1'b1) begin
        index <= 0;
        cnt <= 0;
    end else if (visible_i) begin
        if (cnt < PIXELS_PER_STRIPE-1) begin
            cnt <= cnt + 1'b1;
        end else begin

            index <= index + 1'b1;
            cnt <= 0;
        end;
    end;

    visible_o <= visible_i;
    end_of_frame_o <= end_of_frame_i;
    end_of_line_o <= end_of_line_i;
    hsync_n_o <= hsync_n_i;
    vsync_n_o <= vsync_n_i;

    rgb_o <= RGB_table[index];
end

endmodule
module RGB_Color_Bars_Generator(
    clk_i,

    end_of_frame_i,
    end_of_line_i,
    hsync_n_i,
    vsync_n_i,
    visible_i,

    end_of_frame_o,
    end_of_line_o,
    hsync_n_o,
    vsync_n_o,
    visible_o,

    rgb_o,
);


localparam PIXELS_PER_VISIBLE_LINE = 640;
localparam PIXELS_PER_STRIPE = PIXELS_PER_VISIBLE_LINE / 8;

input clk_i;
input end_of_frame_i, end_of_line_i, hsync_n_i, vsync_n_i, visible_i;

output reg end_of_frame_o, end_of_line_o, hsync_n_o, vsync_n_o, visible_o;
output reg[23:0] rgb_o;

wire[23:0] RGB_table[0:7];


assign RGB_table[0] = {8'd255, 8'd255, 8'd255};
assign RGB_table[1] = {8'd255, 8'd255, 8'd0  };
assign RGB_table[2] = {8'd0  , 8'd255, 8'd255};
assign RGB_table[3] = {8'd0  , 8'd255, 8'd0  };
assign RGB_table[4] = {8'd255, 8'd0  , 8'd255};
assign RGB_table[5] = {8'd255, 8'd0  , 8'd0  };
assign RGB_table[6] = {8'd0  , 8'd0  , 8'd255};
assign RGB_table[7] = {8'd0  , 8'd0  , 8'd0  };

reg[2:0] index;
reg[$clog2(PIXELS_PER_STRIPE)-1:0] cnt;

always @ (posedge clk_i) begin
    if (end_of_line_i == 1'b1) begin
        index <= 0;
        cnt <= 0;
    end else if (visible_i) begin
        if (cnt < PIXELS_PER_STRIPE-1) begin
            cnt <= cnt + 1'b1;
        end else begin

            index <= index + 1'b1;
            cnt <= 0;
        end;
    end;

    visible_o <= visible_i;
    end_of_frame_o <= end_of_frame_i;
    end_of_line_o <= end_of_line_i;
    hsync_n_o <= hsync_n_i;
    vsync_n_o <= vsync_n_i;

    rgb_o <= RGB_table[index];
end

endmodule