data/full_repos/permissive/128426084/src/sources_1/new/draw_rect_ctl.v
 line:32: before: "mouse_in"
1: b"%Error: data/full_repos/permissive/128426084/src/sources_1/new/draw_rect_ctl.v:26: Define or directive not defined: '`MOUSE_BUS_SIZE'\n    input wire [`MOUSE_BUS_SIZE-1:0] mouse_in,\n                ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/draw_rect_ctl.v:27: Define or directive not defined: '`MOUSE_BUS_SIZE'\n    output wire [`MOUSE_BUS_SIZE-1:0] mouse_out,\n                 ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/draw_rect_ctl.v:32: Define or directive not defined: '`MOUSE_SPLIT_INPUT'\n    `MOUSE_SPLIT_INPUT(mouse_in)\n    ^~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/draw_rect_ctl.v:32: syntax error, unexpected '('\n    `MOUSE_SPLIT_INPUT(mouse_in)\n                       ^~~~~~~~\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/draw_rect_ctl.v:33: Define or directive not defined: '`MOUSE_OUT_REG'\n    `MOUSE_OUT_REG\n    ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/draw_rect_ctl.v:34: Define or directive not defined: '`MOUSE_MERGE_AT_OUTPUT'\n    `MOUSE_MERGE_AT_OUTPUT(mouse_out)\n    ^~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/128426084/src/sources_1/new/draw_rect_ctl.v:81: Unsupported: fork statements\n    fork\n    ^~~~\n%Error: Exiting due to 7 error(s)\n"
module draw_rect_ctl(
    input wire clk,
    input wire rst,
    input wire [`MOUSE_BUS_SIZE-1:0] mouse_in,
    output wire [`MOUSE_BUS_SIZE-1:0] mouse_out,
    input wire vsync
    );
    
    
    `MOUSE_SPLIT_INPUT(mouse_in)
    `MOUSE_OUT_REG
    `MOUSE_MERGE_AT_OUTPUT(mouse_out)
    
    localparam accel = 2;
    
    reg en,st,bt,start,rev;
    reg [10:0] Speed;
    reg [10:0] acceleration_ratio;
    reg [5:0] modifier;
    reg [11:0] xpos_next,ypos_next,ypos_int;
    
    localparam IDLE = 0;
    localparam FALLING = 1;
    localparam BOUNCE = 2;
    
    reg [3:0] state, next_state;

    always @(posedge clk)
        begin
            if ((vsync == 1) && (en == 1) )
                begin             
                    en <= 0;
                    st <= 1; 
                end
            else if ((vsync == 1) && (en == 0) && (st == 0))
                en <= 1;
            else if (vsync == 0)
                begin
                    en <= 0;
                    st <= 0;
                end        
        end 
    
    
    always @(posedge left_in)
    fork
        if(bt)
            bt <= 0;
        else
            bt <= 1;
       
    join
    
    always @(posedge clk)
    if(en)
    
        if(bt)
            begin
                if(!rev)
                    begin

                      
                       ypos_out = ((ypos_int + Speed) < 536) ? (ypos_int + Speed) : 536;
                       acceleration_ratio = (acceleration_ratio != 0) ? acceleration_ratio - 1 : accel;
                       if(ypos_out < 536)
                         Speed = (acceleration_ratio == 0) ? Speed + 1  : Speed;
                       else
                         begin
                            rev <= 1;
                            acceleration_ratio <= 1;
                         end
                             
                    end
                 else
                    begin
                    
                        acceleration_ratio = (acceleration_ratio != 0) ? acceleration_ratio - 1 : accel - 1;
                        if(Speed > 0)
                          Speed = (acceleration_ratio == 0) ? Speed - 1  : Speed;
                        else
                            begin
                                rev <= 0;
                                acceleration_ratio <= accel;
                            end
                        ypos_out = (ypos_int <= 536) ? (ypos_int - Speed) : 536;
                        
                    end
                ypos_int <= ypos_out;
            end
        else
            begin
                ypos_out = ypos_in;
                xpos_out = xpos_in;
                ypos_int <= ypos_in;
                Speed <= 0;

                acceleration_ratio <= accel;
                
            end
        

    
    
    
    
endmodule
module draw_rect_ctl(
    input wire clk,
    input wire rst,
    input wire [`MOUSE_BUS_SIZE-1:0] mouse_in,
    output wire [`MOUSE_BUS_SIZE-1:0] mouse_out,
    input wire vsync
    );

    
    
    `MOUSE_SPLIT_INPUT(mouse_in)
    `MOUSE_OUT_REG
    `MOUSE_MERGE_AT_OUTPUT(mouse_out)
    
    localparam accel = 2;
    
    reg en,st,bt,start,rev;
    reg [10:0] Speed;
    reg [10:0] acceleration_ratio;
    reg [5:0] modifier;
    reg [11:0] xpos_next,ypos_next,ypos_int;
    
    localparam IDLE = 0;
    localparam FALLING = 1;
    localparam BOUNCE = 2;
    
    reg [3:0] state, next_state;

    always @(posedge clk)
        begin
            if ((vsync == 1) && (en == 1) )
                begin             
                    en <= 0;
                    st <= 1; 
                end
            else if ((vsync == 1) && (en == 0) && (st == 0))
                en <= 1;
            else if (vsync == 0)
                begin
                    en <= 0;
                    st <= 0;
                end        
        end 
    
    
    always @(posedge left_in)
    fork
        if(bt)
            bt <= 0;
        else
            bt <= 1;
       
    join
    
    always @(posedge clk)
    if(en)
    
        if(bt)
            begin
                if(!rev)
                    begin

                      
                       ypos_out = ((ypos_int + Speed) < 536) ? (ypos_int + Speed) : 536;
                       acceleration_ratio = (acceleration_ratio != 0) ? acceleration_ratio - 1 : accel;
                       if(ypos_out < 536)
                         Speed = (acceleration_ratio == 0) ? Speed + 1  : Speed;
                       else
                         begin
                            rev <= 1;
                            acceleration_ratio <= 1;
                         end
                             
                    end
                 else
                    begin
                    
                        acceleration_ratio = (acceleration_ratio != 0) ? acceleration_ratio - 1 : accel - 1;
                        if(Speed > 0)
                          Speed = (acceleration_ratio == 0) ? Speed - 1  : Speed;
                        else
                            begin
                                rev <= 0;
                                acceleration_ratio <= accel;
                            end
                        ypos_out = (ypos_int <= 536) ? (ypos_int - Speed) : 536;
                        
                    end
                ypos_int <= ypos_out;
            end
        else
            begin
                ypos_out = ypos_in;
                xpos_out = xpos_in;
                ypos_int <= ypos_in;
                Speed <= 0;

                acceleration_ratio <= accel;
                
            end
        

    
    
    
    
endmodule