data/full_repos/permissive/111499712/fw/src/video_hack_2.v
data/verilator_xmls/0baae946-f3ae-4e51-b009-28ce38d905b3.xml
module video_hack_2(clk, reset, frame_begin, x, y, pixel_data);
parameter Width = 96;
parameter Height = 64;
input clk, reset, frame_begin;
input [$clog2(Width-1)-1:0] x;
input [$clog2(Height-1)-1:0] y;
output [15:0] pixel_data;

reg [26:0] t;

wire [4:0] digit = {x[6:4], y[5:4]};
wire [23:0] count = t[26:3];
assign pixel_data = count[digit] ? {5'd0, 6'd48, 5'd24} : {5'd0, 6'd16, 5'd8};

always @(negedge clk) begin
  if (reset)
    t <= 0;
  else if (frame_begin)
    t <= t + 1;
end

endmodule
module video_hack_2(clk, reset, frame_begin, x, y, pixel_data);

parameter Width = 96;
parameter Height = 64;
input clk, reset, frame_begin;
input [$clog2(Width-1)-1:0] x;
input [$clog2(Height-1)-1:0] y;
output [15:0] pixel_data;

reg [26:0] t;

wire [4:0] digit = {x[6:4], y[5:4]};
wire [23:0] count = t[26:3];
assign pixel_data = count[digit] ? {5'd0, 6'd48, 5'd24} : {5'd0, 6'd16, 5'd8};

always @(negedge clk) begin
  if (reset)
    t <= 0;
  else if (frame_begin)
    t <= t + 1;
end

endmodule