data/full_repos/permissive/128426084/src/sources_1/new/Car_display.v
[Errno 2] No such file or directory: 'preprocess.output'
1: b'%Error: data/full_repos/permissive/128426084/src/sources_1/new/Car_display.v:21: Cannot find include file: verilog_macro_bus.vh\n`include "verilog_macro_bus.vh" \n         ^~~~~~~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/128426084/src/sources_1/new,data/full_repos/permissive/128426084/verilog_macro_bus.vh\n             data/full_repos/permissive/128426084/src/sources_1/new,data/full_repos/permissive/128426084/verilog_macro_bus.vh.v\n             data/full_repos/permissive/128426084/src/sources_1/new,data/full_repos/permissive/128426084/verilog_macro_bus.vh.sv\n             verilog_macro_bus.vh\n             verilog_macro_bus.vh.v\n             verilog_macro_bus.vh.sv\n             obj_dir/verilog_macro_bus.vh\n             obj_dir/verilog_macro_bus.vh.v\n             obj_dir/verilog_macro_bus.vh.sv\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/Car_display.v:25: Define or directive not defined: \'`VGA_BUS_SIZE\'\n    input wire [`VGA_BUS_SIZE-1:0] vga_in,\n                ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/Car_display.v:26: Define or directive not defined: \'`VGA_BUS_SIZE\'\n    output wire [`VGA_BUS_SIZE-1:0] vga_out,\n                 ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/Car_display.v:39: Define or directive not defined: \'`VGA_SPLIT_INPUT\'\n    `VGA_SPLIT_INPUT(vga_in)\n    ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/Car_display.v:39: syntax error, unexpected \'(\'\n    `VGA_SPLIT_INPUT(vga_in)\n                     ^~~~~~\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/Car_display.v:40: Define or directive not defined: \'`VGA_OUT_WIRE\'\n    `VGA_OUT_WIRE\n    ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/Car_display.v:41: Define or directive not defined: \'`VGA_MERGE_AT_OUTPUT\'\n    `VGA_MERGE_AT_OUTPUT(vga_out)\n    ^~~~~~~~~~~~~~~~~~~~\n%Error: Exiting due to 7 error(s)\n'
module Car_display(

    input wire [`VGA_BUS_SIZE-1:0] vga_in,
    output wire [`VGA_BUS_SIZE-1:0] vga_out,
    input wire clk,
    input wire [3:0] direction,
    output reg [10:0] xpos,ypos,
    input wire enable,
    input wire go,
    input wire rst
    );
    
    parameter X = 300;
    parameter Y = 500;
    parameter Color = 3'b111;
    
    `VGA_SPLIT_INPUT(vga_in)
    `VGA_OUT_WIRE
    `VGA_MERGE_AT_OUTPUT(vga_out)
    
    wire [4:0] Car_xpixel,Car_ypixel;
    wire [11:0] rgb;
    
     cardata mycar(
         .direction(direction),
         .xpos(Car_xpixel),
         .ypos(Car_ypixel),  
         .rgb(rgb)
     );
    
    reg en,st;
    
    reg frame_count = 0;
    
        always @(posedge clk)
        begin
            if ((vsync_in == 1) && (en == 1) )
                begin             
                    en <= 0;
                    st <= 1; 
                end
            else if ((vsync_in == 1) && (en == 0) && (st == 0))
                en <= 1;
            else if (vsync_in == 0)
                begin
                    en <= 0;
                    st <= 0;
                end        
        end 
    
    
    always @(posedge clk or negedge rst)
        if(!rst)
            begin
                xpos = X;
                ypos = Y;
                frame_count = 0;
             end
        else
            if(en && go)
                begin
                    xpos = 
                        (direction == 0)? xpos :
                        (direction == 1)? ((frame_count == 1)?xpos + 2 : xpos):
                        (direction == 2)? ((frame_count == 1)?xpos + 3 : xpos):
                        (direction == 3)? xpos + 2:
                        (direction == 4)? xpos + 3:
                        (direction == 5)? xpos + 2:
                        (direction == 6)? ((frame_count == 1)?xpos + 3 : xpos):
                        (direction == 7)? ((frame_count == 1)?xpos + 2 : xpos):
                        (direction == 8)? xpos:
                        (direction == 9)? ((frame_count == 1)?xpos - 2 : xpos):
                        (direction == 10)?((frame_count == 1)?xpos - 3 : xpos): 
                        (direction == 11)? xpos - 2:
                        (direction == 12)? xpos - 3:
                        (direction == 13)? xpos - 2:
                        (direction == 14)? ((frame_count == 1)?xpos - 3 : xpos):
                        (direction == 15)? ((frame_count == 1)?xpos - 2 : xpos):
                        xpos;
                    
                    
                    ypos = 
                        (direction == 0)? ypos - 3:
                        (direction == 1)? ypos - 2:
                        (direction == 2)? ((frame_count == 1)?ypos - 3 : ypos):
                        (direction == 3)? ((frame_count == 1)?ypos - 2 : ypos):
                        (direction == 4)? ypos:
                        (direction == 5)? ((frame_count == 1)?ypos + 2 : ypos):
                        (direction == 6)? ((frame_count == 1)?ypos + 3 : ypos):
                        (direction == 7)? ypos + 2:
                        (direction == 8)? ypos + 3:
                        (direction == 9)? ypos + 2:
                        (direction == 10)? ((frame_count == 1)?ypos + 3 : ypos): 
                        (direction == 11)? ((frame_count == 1)?ypos + 2 : ypos):
                        (direction == 12)? ypos:
                        (direction == 13)? ((frame_count == 1)?ypos - 2 : ypos):
                        (direction == 14)? ((frame_count == 1)?ypos - 3 : ypos):
                        (direction == 15)? ypos - 2:
                        ypos;
                        
                        xpos = (xpos >= 704)? 704 :
                        (xpos <= 65)? 65: xpos;
                        ypos = (ypos >= 569)? 569 :
                        (ypos <= 105)? 105: ypos;              
                        frame_count =  frame_count + 1;
                end
       
    
    assign hcount_out = hcount_in;
    assign vcount_out = vcount_in;
    assign hblnk_out = hblnk_in;
    assign vblnk_out = vblnk_in;
    assign vsync_out = vsync_in;
    assign hsync_out = hsync_in;
    
    assign Car_xpixel = ((hcount_in >= xpos) && (hcount_in - xpos <= 31))?(hcount_in - xpos):0;
    assign Car_ypixel = ((vcount_in >= ypos) && (vcount_in - ypos <= 31))?(vcount_in - ypos):0;
    assign rgb_out = 
    ((hblnk_in == 0) && (vblnk_in == 0))? 
    ((
    (hcount_in >= xpos) && (hcount_in - xpos <= 31) && 
    (vcount_in >= ypos) && (vcount_in - ypos <= 31)
    )?
    ((enable == 1)?((rgb[3:0] > 4'h8)? 
    {(rgb[11:8]&(Color[2]*4'hf)),(rgb[7:4]&(Color[1]*4'hf)),(rgb[3:0]&(Color[0]*4'hf))}:rgb_in)
    :rgb_in) : rgb_in) : 0;
    
    
    
endmodule
module Car_display(

    input wire [`VGA_BUS_SIZE-1:0] vga_in,
    output wire [`VGA_BUS_SIZE-1:0] vga_out,
    input wire clk,
    input wire [3:0] direction,
    output reg [10:0] xpos,ypos,
    input wire enable,
    input wire go,
    input wire rst
    );

    
    parameter X = 300;
    parameter Y = 500;
    parameter Color = 3'b111;
    
    `VGA_SPLIT_INPUT(vga_in)
    `VGA_OUT_WIRE
    `VGA_MERGE_AT_OUTPUT(vga_out)
    
    wire [4:0] Car_xpixel,Car_ypixel;
    wire [11:0] rgb;
    
     cardata mycar(
         .direction(direction),
         .xpos(Car_xpixel),
         .ypos(Car_ypixel),  
         .rgb(rgb)
     );
    
    reg en,st;
    
    reg frame_count = 0;
    
        always @(posedge clk)
        begin
            if ((vsync_in == 1) && (en == 1) )
                begin             
                    en <= 0;
                    st <= 1; 
                end
            else if ((vsync_in == 1) && (en == 0) && (st == 0))
                en <= 1;
            else if (vsync_in == 0)
                begin
                    en <= 0;
                    st <= 0;
                end        
        end 
    
    
    always @(posedge clk or negedge rst)
        if(!rst)
            begin
                xpos = X;
                ypos = Y;
                frame_count = 0;
             end
        else
            if(en && go)
                begin
                    xpos = 
                        (direction == 0)? xpos :
                        (direction == 1)? ((frame_count == 1)?xpos + 2 : xpos):
                        (direction == 2)? ((frame_count == 1)?xpos + 3 : xpos):
                        (direction == 3)? xpos + 2:
                        (direction == 4)? xpos + 3:
                        (direction == 5)? xpos + 2:
                        (direction == 6)? ((frame_count == 1)?xpos + 3 : xpos):
                        (direction == 7)? ((frame_count == 1)?xpos + 2 : xpos):
                        (direction == 8)? xpos:
                        (direction == 9)? ((frame_count == 1)?xpos - 2 : xpos):
                        (direction == 10)?((frame_count == 1)?xpos - 3 : xpos): 
                        (direction == 11)? xpos - 2:
                        (direction == 12)? xpos - 3:
                        (direction == 13)? xpos - 2:
                        (direction == 14)? ((frame_count == 1)?xpos - 3 : xpos):
                        (direction == 15)? ((frame_count == 1)?xpos - 2 : xpos):
                        xpos;
                    
                    
                    ypos = 
                        (direction == 0)? ypos - 3:
                        (direction == 1)? ypos - 2:
                        (direction == 2)? ((frame_count == 1)?ypos - 3 : ypos):
                        (direction == 3)? ((frame_count == 1)?ypos - 2 : ypos):
                        (direction == 4)? ypos:
                        (direction == 5)? ((frame_count == 1)?ypos + 2 : ypos):
                        (direction == 6)? ((frame_count == 1)?ypos + 3 : ypos):
                        (direction == 7)? ypos + 2:
                        (direction == 8)? ypos + 3:
                        (direction == 9)? ypos + 2:
                        (direction == 10)? ((frame_count == 1)?ypos + 3 : ypos): 
                        (direction == 11)? ((frame_count == 1)?ypos + 2 : ypos):
                        (direction == 12)? ypos:
                        (direction == 13)? ((frame_count == 1)?ypos - 2 : ypos):
                        (direction == 14)? ((frame_count == 1)?ypos - 3 : ypos):
                        (direction == 15)? ypos - 2:
                        ypos;
                        
                        xpos = (xpos >= 704)? 704 :
                        (xpos <= 65)? 65: xpos;
                        ypos = (ypos >= 569)? 569 :
                        (ypos <= 105)? 105: ypos;              
                        frame_count =  frame_count + 1;
                end
       
    
    assign hcount_out = hcount_in;
    assign vcount_out = vcount_in;
    assign hblnk_out = hblnk_in;
    assign vblnk_out = vblnk_in;
    assign vsync_out = vsync_in;
    assign hsync_out = hsync_in;
    
    assign Car_xpixel = ((hcount_in >= xpos) && (hcount_in - xpos <= 31))?(hcount_in - xpos):0;
    assign Car_ypixel = ((vcount_in >= ypos) && (vcount_in - ypos <= 31))?(vcount_in - ypos):0;
    assign rgb_out = 
    ((hblnk_in == 0) && (vblnk_in == 0))? 
    ((
    (hcount_in >= xpos) && (hcount_in - xpos <= 31) && 
    (vcount_in >= ypos) && (vcount_in - ypos <= 31)
    )?
    ((enable == 1)?((rgb[3:0] > 4'h8)? 
    {(rgb[11:8]&(Color[2]*4'hf)),(rgb[7:4]&(Color[1]*4'hf)),(rgb[3:0]&(Color[0]*4'hf))}:rgb_in)
    :rgb_in) : rgb_in) : 0;
    
    
    
endmodule