data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new/ViewToScreenConverter.v
1: b'%Warning-WIDTH: data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new/ViewToScreenConverter.v:33: Operator ASSIGNW expects 16 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 24 bits.\n                                                                                                                : ... In instance ViewToScreenConverter\n    wire [N-1:0] fixedPointHalfWidth = {{4{1\'b0}},halfWidth, {Q{1\'b0}}};\n                                     ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new/ViewToScreenConverter.v:34: Operator ASSIGNW expects 16 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 24 bits.\n                                                                                                                : ... In instance ViewToScreenConverter\n    wire [N-1:0] fixedPointHalfHeight = {{4{1\'b0}},halfHeight, {Q{1\'b0}}};\n                                      ^\n%Error: data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new/ViewToScreenConverter.v:37: Cannot find file containing module: \'qadd\'\n     qadd #(\n     ^~~~\n        ... Looked in:\n             data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new,data/full_repos/permissive/180282590/qadd\n             data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new,data/full_repos/permissive/180282590/qadd.v\n             data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new,data/full_repos/permissive/180282590/qadd.sv\n             qadd\n             qadd.v\n             qadd.sv\n             obj_dir/qadd\n             obj_dir/qadd.v\n             obj_dir/qadd.sv\n%Error: data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new/ViewToScreenConverter.v:41: Cannot find file containing module: \'qadd\'\n     qadd #(\n     ^~~~\n%Error: data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new/ViewToScreenConverter.v:46: Cannot find file containing module: \'qmult\'\n     qmult #(\n     ^~~~~\n%Error: data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new/ViewToScreenConverter.v:50: Cannot find file containing module: \'qmult\'\n     qmult #(\n     ^~~~~\n%Warning-WIDTH: data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new/ViewToScreenConverter.v:59: Operator ASSIGNW expects 12 bits on the Assign RHS, but Assign RHS\'s SEL generates 8 bits.\n                                                                                                                : ... In instance ViewToScreenConverter\n     assign xpix_out = xResult2[N-1:Q];\n                     ^\n%Warning-WIDTH: data/full_repos/permissive/180282590/SimpleGPUonS7.srcs/sources_1/new/ViewToScreenConverter.v:60: Operator ASSIGNW expects 12 bits on the Assign RHS, but Assign RHS\'s SEL generates 8 bits.\n                                                                                                                : ... In instance ViewToScreenConverter\n     assign ypix_out = yResult2[N-1:Q];\n                     ^\n%Error: Exiting due to 4 error(s), 4 warning(s)\n'
module ViewToScreenConverter(
        
       
        input  [11:0] width_in,
        input  [11:0] height_in,

        input [(N*3)-1:0] vector_in,
        

        output  [11:0] xpix_out,
        output  [11:0] ypix_out,
        output on_screen_out

    );
    
     parameter Q = 8;
     parameter N = 16;
    
    wire [N-1:0] xResult1;
    wire [N-1:0] yResult1;
    wire [N-1:0] xResult2;
    wire [N-1:0] yResult2;
    
    wire  [N-1:0]  xInteger;
    wire  [N-1:0]  yInteger;
    
    wire  [11:0] halfWidth = width_in >> 1;
    wire  [11:0] halfHeight = height_in >> 1;
    


    wire [N-1:0] fixedPointHalfWidth = {{4{1'b0}},halfWidth, {Q{1'b0}}};
    wire [N-1:0] fixedPointHalfHeight = {{4{1'b0}},halfHeight, {Q{1'b0}}};
    
    
     qadd #(
             .Q(Q),
            .N(N)) addXandWidth(xInteger,fixedPointHalfWidth,xResult2);
    
     qadd #(
             .Q(Q),
            .N(N)) addYandHeight(yInteger,fixedPointHalfHeight,yResult2);
    

     qmult #(
        .Q(Q),
       .N(N)) mult1x(fixedPointHalfWidth,vector_in[(N*3)-1:(N*2)],xResult1);

     qmult #(
         .Q(Q),
        .N(N)) mult1y({1'b1,fixedPointHalfHeight[N-2:0]},vector_in[(N*2)-1:(N*1)],yResult1);
        


     assign xInteger = {xResult1[N-1:Q],{Q{1'b0}}};
     assign yInteger = {yResult1[N-1:Q],{Q{1'b0}}};

     assign xpix_out = xResult2[N-1:Q];
     assign ypix_out = yResult2[N-1:Q];
        

     assign on_screen_out = (xpix_out < width_in) && (xpix_out >=0) && (ypix_out < height_in) && (ypix_out >= 0);
     
    
endmodule
module ViewToScreenConverter(
        
       
        input  [11:0] width_in,
        input  [11:0] height_in,

        input [(N*3)-1:0] vector_in,
        

        output  [11:0] xpix_out,
        output  [11:0] ypix_out,
        output on_screen_out

    );

    
     parameter Q = 8;
     parameter N = 16;
    
    wire [N-1:0] xResult1;
    wire [N-1:0] yResult1;
    wire [N-1:0] xResult2;
    wire [N-1:0] yResult2;
    
    wire  [N-1:0]  xInteger;
    wire  [N-1:0]  yInteger;
    
    wire  [11:0] halfWidth = width_in >> 1;
    wire  [11:0] halfHeight = height_in >> 1;
    


    wire [N-1:0] fixedPointHalfWidth = {{4{1'b0}},halfWidth, {Q{1'b0}}};
    wire [N-1:0] fixedPointHalfHeight = {{4{1'b0}},halfHeight, {Q{1'b0}}};
    
    
     qadd #(
             .Q(Q),
            .N(N)) addXandWidth(xInteger,fixedPointHalfWidth,xResult2);
    
     qadd #(
             .Q(Q),
            .N(N)) addYandHeight(yInteger,fixedPointHalfHeight,yResult2);
    

     qmult #(
        .Q(Q),
       .N(N)) mult1x(fixedPointHalfWidth,vector_in[(N*3)-1:(N*2)],xResult1);

     qmult #(
         .Q(Q),
        .N(N)) mult1y({1'b1,fixedPointHalfHeight[N-2:0]},vector_in[(N*2)-1:(N*1)],yResult1);
        


     assign xInteger = {xResult1[N-1:Q],{Q{1'b0}}};
     assign yInteger = {yResult1[N-1:Q],{Q{1'b0}}};

     assign xpix_out = xResult2[N-1:Q];
     assign ypix_out = yResult2[N-1:Q];
        

     assign on_screen_out = (xpix_out < width_in) && (xpix_out >=0) && (ypix_out < height_in) && (ypix_out >= 0);
     
    
endmodule