data/full_repos/permissive/507055729/common/spi_file.v
1: b"%Error: data/full_repos/permissive/507055729/common/spi_file.v:29: Cannot find file containing module: 'spi_dev_core'\n    spi_dev_core _communication (\n    ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/507055729/common,data/full_repos/permissive/507055729/spi_dev_core\n             data/full_repos/permissive/507055729/common,data/full_repos/permissive/507055729/spi_dev_core.v\n             data/full_repos/permissive/507055729/common,data/full_repos/permissive/507055729/spi_dev_core.sv\n             spi_dev_core\n             spi_dev_core.v\n             spi_dev_core.sv\n             obj_dir/spi_dev_core\n             obj_dir/spi_dev_core.v\n             obj_dir/spi_dev_core.sv\n%Error: data/full_repos/permissive/507055729/common/spi_file.v:60: Cannot find file containing module: 'spi_dev_proto'\n    spi_dev_proto _protocol (\n    ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/507055729/common/spi_file.v:100: Cannot find file containing module: 'spi_dev_fread'\n    spi_dev_fread #(\n    ^~~~~~~~~~~~~\n%Error: Exiting due to 3 error(s)\n"
module spi_file(

    input  spi_mosi,   output spi_miso,
    input  spi_cs_n,   input  spi_clk,
    output irq_n,
    input  clk,        input  resetq,

    output        file_request_ready,
    input         file_request_valid,
    input  [31:0] file_request_offset,

    output [7:0]  file_data,
    output        file_data_avail
);





    wire [7:0] usr_miso_data, usr_mosi_data;
    wire usr_mosi_stb, usr_miso_ack;
    wire csn_state, csn_rise, csn_fall;

    spi_dev_core _communication (

        .clk (clk),
        .rst (resetq),

        .usr_mosi_data (usr_mosi_data),
        .usr_mosi_stb  (usr_mosi_stb),
        .usr_miso_data (usr_miso_data),
        .usr_miso_ack  (usr_miso_ack),

        .csn_state (csn_state),
        .csn_rise  (csn_rise),
        .csn_fall  (csn_fall),



        .spi_miso (spi_miso),
        .spi_mosi (spi_mosi),
        .spi_clk  (spi_clk),
        .spi_cs_n (spi_cs_n)
    );

    wire [7:0] pw_wdata;
    wire pw_wcmd, pw_wstb, pw_end;

    wire [7:0] pw_rdata;
    wire pw_req, pw_rstb, pw_gnt;

    wire [3:0] pw_irq;
    wire irq;

    spi_dev_proto _protocol (
        .clk (clk),
        .rst (resetq),



        .usr_mosi_data (usr_mosi_data),
        .usr_mosi_stb  (usr_mosi_stb),
        .usr_miso_data (usr_miso_data),
        .usr_miso_ack  (usr_miso_ack),

        .csn_state (csn_state),
        .csn_rise  (csn_rise),
        .csn_fall  (csn_fall),



        .pw_wdata (pw_wdata),
        .pw_wcmd  (pw_wcmd),
        .pw_wstb  (pw_wstb),
        .pw_end   (pw_end),



        .pw_req   (pw_req),
        .pw_gnt   (pw_gnt),
        .pw_rdata (pw_rdata),
        .pw_rstb  (pw_rstb),

        .pw_irq   (pw_irq),
        .irq      (irq)
    );

    assign pw_irq[3:1] = 3'b000;
    assign irq_n = irq ? 1'b0 : 1'bz;





    spi_dev_fread #(
        .INTERFACE("STREAM")
    ) _fread (
        .clk (clk),
        .rst (resetq),


        .pw_wdata     (pw_wdata),
        .pw_wcmd      (pw_wcmd),
        .pw_wstb      (pw_wstb),
        .pw_end       (pw_end),
        .pw_req       (pw_req),
        .pw_gnt       (pw_gnt),
        .pw_rdata     (pw_rdata),
        .pw_rstb      (pw_rstb),
        .pw_irq       (pw_irq[0]),


        .req_file_id  (32'hBFBFBFBF),
        .req_offset   (file_request_offset),
        .req_len      (10'd1023),

        .req_valid    (file_request_valid),
        .req_ready    (file_request_ready),


        .resp_data    (file_data),
        .resp_valid   (file_data_avail)
    );

endmodule
module spi_file(

    input  spi_mosi,   output spi_miso,
    input  spi_cs_n,   input  spi_clk,
    output irq_n,
    input  clk,        input  resetq,

    output        file_request_ready,
    input         file_request_valid,
    input  [31:0] file_request_offset,

    output [7:0]  file_data,
    output        file_data_avail
);






    wire [7:0] usr_miso_data, usr_mosi_data;
    wire usr_mosi_stb, usr_miso_ack;
    wire csn_state, csn_rise, csn_fall;

    spi_dev_core _communication (

        .clk (clk),
        .rst (resetq),

        .usr_mosi_data (usr_mosi_data),
        .usr_mosi_stb  (usr_mosi_stb),
        .usr_miso_data (usr_miso_data),
        .usr_miso_ack  (usr_miso_ack),

        .csn_state (csn_state),
        .csn_rise  (csn_rise),
        .csn_fall  (csn_fall),



        .spi_miso (spi_miso),
        .spi_mosi (spi_mosi),
        .spi_clk  (spi_clk),
        .spi_cs_n (spi_cs_n)
    );

    wire [7:0] pw_wdata;
    wire pw_wcmd, pw_wstb, pw_end;

    wire [7:0] pw_rdata;
    wire pw_req, pw_rstb, pw_gnt;

    wire [3:0] pw_irq;
    wire irq;

    spi_dev_proto _protocol (
        .clk (clk),
        .rst (resetq),



        .usr_mosi_data (usr_mosi_data),
        .usr_mosi_stb  (usr_mosi_stb),
        .usr_miso_data (usr_miso_data),
        .usr_miso_ack  (usr_miso_ack),

        .csn_state (csn_state),
        .csn_rise  (csn_rise),
        .csn_fall  (csn_fall),



        .pw_wdata (pw_wdata),
        .pw_wcmd  (pw_wcmd),
        .pw_wstb  (pw_wstb),
        .pw_end   (pw_end),



        .pw_req   (pw_req),
        .pw_gnt   (pw_gnt),
        .pw_rdata (pw_rdata),
        .pw_rstb  (pw_rstb),

        .pw_irq   (pw_irq),
        .irq      (irq)
    );

    assign pw_irq[3:1] = 3'b000;
    assign irq_n = irq ? 1'b0 : 1'bz;





    spi_dev_fread #(
        .INTERFACE("STREAM")
    ) _fread (
        .clk (clk),
        .rst (resetq),


        .pw_wdata     (pw_wdata),
        .pw_wcmd      (pw_wcmd),
        .pw_wstb      (pw_wstb),
        .pw_end       (pw_end),
        .pw_req       (pw_req),
        .pw_gnt       (pw_gnt),
        .pw_rdata     (pw_rdata),
        .pw_rstb      (pw_rstb),
        .pw_irq       (pw_irq[0]),


        .req_file_id  (32'hBFBFBFBF),
        .req_offset   (file_request_offset),
        .req_len      (10'd1023),

        .req_valid    (file_request_valid),
        .req_ready    (file_request_ready),


        .resp_data    (file_data),
        .resp_valid   (file_data_avail)
    );

endmodule