data/full_repos/permissive/194450802/raytracer.v
1: b"%Error: data/full_repos/permissive/194450802/raytracer.v:150: Cannot find file containing module: 'bytian_to_vector'\n    bytian_to_vector btv0 (.bytian(angle),\n    ^~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/194450802,data/full_repos/permissive/194450802/bytian_to_vector\n             data/full_repos/permissive/194450802,data/full_repos/permissive/194450802/bytian_to_vector.v\n             data/full_repos/permissive/194450802,data/full_repos/permissive/194450802/bytian_to_vector.sv\n             bytian_to_vector\n             bytian_to_vector.v\n             bytian_to_vector.sv\n             obj_dir/bytian_to_vector\n             obj_dir/bytian_to_vector.v\n             obj_dir/bytian_to_vector.sv\n%Error: data/full_repos/permissive/194450802/raytracer.v:156: Cannot find file containing module: 'coordinate_to_grid'\n    coordinate_to_grid ctg0 (.coord_x(pos_x),\n    ^~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/194450802/raytracer.v:163: Cannot find file containing module: 'coordinate_to_grid'\n    coordinate_to_grid ctg1 (.coord_x(prev_pos_x),\n    ^~~~~~~~~~~~~~~~~~\n%Error: Exiting due to 3 error(s)\n"
module _raytracer_datapath(clock, reset,
                           x, y, angle,
                           grid_x, grid_y, grid_out,
                           result_x, result_y, result_dir,
                           load_values, go_to_next_pos, on_obstacle);

    input clock;
    input reset;


    output [5:0] grid_x;
    output [4:0] grid_y;
    input [2:0] grid_out;


    input [13:0] x;
    input [12:0] y;
    input [7:0] angle;


    output [5:0] result_x;
    output [4:0] result_y;



    output result_dir;


    input load_values;
    input go_to_next_pos;
    output on_obstacle;


    reg [14:0] dir_x;
    reg [13:0] dir_y;


    reg [13:0] pos_x;
    reg [12:0] pos_y;


    reg [13:0] prev_pos_x;
    reg [12:0] prev_pos_y;

    wire [14:0] angle_vector_x;
    wire [13:0] angle_vector_y;
    bytian_to_vector btv0 (.bytian(angle),
                           .x(angle_vector_x),
                           .y(angle_vector_y));

    wire [5:0] grid_coord_x;
    wire [4:0] grid_coord_y;
    coordinate_to_grid ctg0 (.coord_x(pos_x),
                             .coord_y(pos_y),
                             .grid_x(grid_coord_x),
                             .grid_y(grid_coord_y));

    wire [5:0] prev_grid_coord_x;
    wire [4:0] prev_grid_coord_y;
    coordinate_to_grid ctg1 (.coord_x(prev_pos_x),
                             .coord_y(prev_pos_y),
                             .grid_x(prev_grid_coord_x),
                             .grid_y(prev_grid_coord_y));

    wire [14:0] next_pos_x;
    wire [13:0] next_pos_y;
    assign next_pos_x = {1'b0, pos_x} + dir_x;
    assign next_pos_y = {1'b0, pos_y} + dir_y;

    always @(posedge clock) begin
        if (reset) begin
            dir_x <= 15'b0;
            dir_y <= 14'b0;
            pos_x <= 14'b0;
            pos_y <= 13'b0;
            prev_pos_x <= 14'b0;
            prev_pos_y <= 13'b0;
        end
        else begin
            if (load_values) begin
                pos_x <= x;
                pos_y <= y;
                prev_pos_x <= x;
                prev_pos_y <= y;
                dir_x <= angle_vector_x;
                dir_y <= angle_vector_y;
            end
            if (go_to_next_pos) begin
                pos_x <= next_pos_x[13:0];
                pos_y <= next_pos_y[12:0];
                prev_pos_x <= pos_x;
                prev_pos_y <= pos_y;
            end
        end
    end

    assign result_x = grid_coord_x;
    assign result_y = grid_coord_y;
    assign grid_x = grid_coord_x;
    assign grid_y = grid_coord_y;
    assign on_obstacle = grid_out != 3'b0;

    wire [14:0] abs_dir_x;
    wire [13:0] abs_dir_y;
    assign abs_dir_x = dir_x[14] ? (-dir_x) : dir_x;
    assign abs_dir_y = dir_y[13] ? (-dir_y) : dir_y;
    assign result_dir = ((prev_grid_coord_x != grid_coord_x & prev_grid_coord_y == grid_coord_y) |
                         (prev_grid_coord_x != grid_coord_x & prev_grid_coord_y != grid_coord_y & abs_dir_x > {1'b0, abs_dir_y}) |
                         (prev_grid_coord_x == grid_coord_x & prev_grid_coord_y == grid_coord_y & abs_dir_x > {1'b0, abs_dir_y}));
endmodule
module _raytracer_datapath(clock, reset,
                           x, y, angle,
                           grid_x, grid_y, grid_out,
                           result_x, result_y, result_dir,
                           load_values, go_to_next_pos, on_obstacle);


    input clock;
    input reset;


    output [5:0] grid_x;
    output [4:0] grid_y;
    input [2:0] grid_out;


    input [13:0] x;
    input [12:0] y;
    input [7:0] angle;


    output [5:0] result_x;
    output [4:0] result_y;



    output result_dir;


    input load_values;
    input go_to_next_pos;
    output on_obstacle;


    reg [14:0] dir_x;
    reg [13:0] dir_y;


    reg [13:0] pos_x;
    reg [12:0] pos_y;


    reg [13:0] prev_pos_x;
    reg [12:0] prev_pos_y;

    wire [14:0] angle_vector_x;
    wire [13:0] angle_vector_y;
    bytian_to_vector btv0 (.bytian(angle),
                           .x(angle_vector_x),
                           .y(angle_vector_y));

    wire [5:0] grid_coord_x;
    wire [4:0] grid_coord_y;
    coordinate_to_grid ctg0 (.coord_x(pos_x),
                             .coord_y(pos_y),
                             .grid_x(grid_coord_x),
                             .grid_y(grid_coord_y));

    wire [5:0] prev_grid_coord_x;
    wire [4:0] prev_grid_coord_y;
    coordinate_to_grid ctg1 (.coord_x(prev_pos_x),
                             .coord_y(prev_pos_y),
                             .grid_x(prev_grid_coord_x),
                             .grid_y(prev_grid_coord_y));

    wire [14:0] next_pos_x;
    wire [13:0] next_pos_y;
    assign next_pos_x = {1'b0, pos_x} + dir_x;
    assign next_pos_y = {1'b0, pos_y} + dir_y;

    always @(posedge clock) begin
        if (reset) begin
            dir_x <= 15'b0;
            dir_y <= 14'b0;
            pos_x <= 14'b0;
            pos_y <= 13'b0;
            prev_pos_x <= 14'b0;
            prev_pos_y <= 13'b0;
        end
        else begin
            if (load_values) begin
                pos_x <= x;
                pos_y <= y;
                prev_pos_x <= x;
                prev_pos_y <= y;
                dir_x <= angle_vector_x;
                dir_y <= angle_vector_y;
            end
            if (go_to_next_pos) begin
                pos_x <= next_pos_x[13:0];
                pos_y <= next_pos_y[12:0];
                prev_pos_x <= pos_x;
                prev_pos_y <= pos_y;
            end
        end
    end

    assign result_x = grid_coord_x;
    assign result_y = grid_coord_y;
    assign grid_x = grid_coord_x;
    assign grid_y = grid_coord_y;
    assign on_obstacle = grid_out != 3'b0;

    wire [14:0] abs_dir_x;
    wire [13:0] abs_dir_y;
    assign abs_dir_x = dir_x[14] ? (-dir_x) : dir_x;
    assign abs_dir_y = dir_y[13] ? (-dir_y) : dir_y;
    assign result_dir = ((prev_grid_coord_x != grid_coord_x & prev_grid_coord_y == grid_coord_y) |
                         (prev_grid_coord_x != grid_coord_x & prev_grid_coord_y != grid_coord_y & abs_dir_x > {1'b0, abs_dir_y}) |
                         (prev_grid_coord_x == grid_coord_x & prev_grid_coord_y == grid_coord_y & abs_dir_x > {1'b0, abs_dir_y}));
endmodule