data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash/flash_dri.v
1: b"%Error: data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash/flash_dri.v:113: Cannot find file containing module: 'flash_write_enable'\nflash_write_enable u_flash_write_enable\n^~~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash,data/full_repos/permissive/194847941/flash_write_enable\n             data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash,data/full_repos/permissive/194847941/flash_write_enable.v\n             data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash,data/full_repos/permissive/194847941/flash_write_enable.sv\n             flash_write_enable\n             flash_write_enable.v\n             flash_write_enable.sv\n             obj_dir/flash_write_enable\n             obj_dir/flash_write_enable.v\n             obj_dir/flash_write_enable.sv\n%Error: data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash/flash_dri.v:128: Cannot find file containing module: 'flash_wait_free'\nflash_wait_free u_flash_wait_free\n^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash/flash_dri.v:143: Cannot find file containing module: 'flash_erase'\nflash_erase u_flash_erase\n^~~~~~~~~~~\n%Error: data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash/flash_dri.v:158: Cannot find file containing module: 'flash_sector_erase'\nflash_sector_erase u_flash_sector_erase\n^~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash/flash_dri.v:176: Cannot find file containing module: 'flash_write'\nflash_write u_flash_write\n^~~~~~~~~~~\n%Error: data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash/flash_dri.v:195: Cannot find file containing module: 'flash_read'\nflash_read u_flash_read\n^~~~~~~~~~\n%Error: data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash/flash_dri.v:214: Cannot find file containing module: 'flash_fast_read'\nflash_fast_read u_flash_fast_read\n^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/194847941/demo_v_5_6/11_SparkRoad/FPGA/sparkroad/src/rtl/flash/flash_dri.v:241: Cannot find file containing module: 'flash_id'\nflash_id u_flash_id\n^~~~~~~~\n%Error: Exiting due to 8 error(s)\n"
module flash_dri
(
    input   wire        clk,


    output  reg         fls_sck,
    output  reg         fls_ncs,
    output  reg         fls_sdo,
    input   wire        fls_sdi,


    input   wire        start,
    input   wire [2:0]  mod_sel,


    input   wire [23:0] fls_addr,
    input   wire [7:0]  fls_write,
    output  wire [7:0]  fls_read,
    

    output  wire        frd_en,
    output  wire [23:0] frd_addr,
    output  wire [7:0]  frd_data,


    output  wire [15:0] id,
    output  reg         busy
);


wire fls_sck_wen;
wire fls_sck_wfree;
wire fls_sck_erase;
wire fls_sck_sector;
wire fls_sck_wr;
wire fls_sck_rd;
wire fls_sck_frd;
wire fls_sck_id;


wire fls_ncs_wen;
wire fls_ncs_wfree;
wire fls_ncs_erase;
wire fls_ncs_sector;
wire fls_ncs_wr;
wire fls_ncs_rd;
wire fls_ncs_frd;
wire fls_ncs_id;


wire fls_sdo_wen;
wire fls_sdo_wfree;
wire fls_sdo_erase;
wire fls_sdo_sector;
wire fls_sdo_wr;
wire fls_sdo_rd;
wire fls_sdo_frd;
wire fls_sdo_id;


reg fls_sdi_wen;
reg fls_sdi_wfree;
reg fls_sdi_erase;
reg fls_sdi_sector;
reg fls_sdi_wr;
reg fls_sdi_rd;
reg fls_sdi_frd;
reg fls_sdi_id;


reg start_wen;
reg start_wfree;
reg start_erase;
reg start_sector;
reg start_wr;
reg start_rd;
reg start_frd;
reg start_id;


wire busy_wen;
wire busy_wfree;
wire busy_erase;
wire busy_sector;
wire busy_wr;
wire busy_rd;
wire busy_frd;
wire busy_id;



flash_write_enable u_flash_write_enable
(
    .clk        (clk            ),


    .fls_sck    (fls_sck_wen    ),
    .fls_ncs    (fls_ncs_wen    ),
    .fls_sdo    (fls_sdo_wen    ),
    .fls_sdi    (fls_sdi_wen    ),

    .start      (start_wen      ),
    .busy       (busy_wen       )
);


flash_wait_free u_flash_wait_free
(
    .clk        (clk            ),
    

    .fls_sck    (fls_sck_wfree  ),
    .fls_ncs    (fls_ncs_wfree  ),
    .fls_sdo    (fls_sdo_wfree  ),
    .fls_sdi    (fls_sdi_wfree  ),

    .start      (start_wfree    ),
    .busy       (busy_wfree     )
);


flash_erase u_flash_erase
(
    .clk        (clk            ),
    

    .fls_sck    (fls_sck_erase  ),
    .fls_ncs    (fls_ncs_erase  ),
    .fls_sdo    (fls_sdo_erase  ),
    .fls_sdi    (fls_sdi_erase  ),

    .start      (start_erase    ),
    .busy       (busy_erase     )
);


flash_sector_erase u_flash_sector_erase
(
    .clk        (clk            ),
    

    .fls_sck    (fls_sck_sector ),
    .fls_ncs    (fls_ncs_sector ),
    .fls_sdo    (fls_sdo_sector ),
    .fls_sdi    (fls_sdi_sector ),


    .start      (start_sector   ),
    .addr       (fls_addr       ),

    .busy       (busy_sector    )
);


flash_write u_flash_write
(
    .clk        (clk            ),


    .fls_sck    (fls_sck_wr     ),
    .fls_ncs    (fls_ncs_wr     ),
    .fls_sdo    (fls_sdo_wr     ),
    .fls_sdi    (fls_sdi_wr     ),


    .start      (start_wr       ),
    .addr       (fls_addr       ),
    .din        (fls_write      ),

    .busy       (busy_wr        )
);


flash_read u_flash_read
(
    .clk        (clk            ),


    .fls_sck    (fls_sck_rd     ),
    .fls_ncs    (fls_ncs_rd     ),
    .fls_sdo    (fls_sdo_rd     ),
    .fls_sdi    (fls_sdi_rd     ),


    .start      (start_rd       ),
    .addr       (fls_addr       ),
    .dout       (fls_read       ),

    .busy       (busy_rd        )
);


flash_fast_read u_flash_fast_read
(
    .clk        (clk            ),


    .fls_sck    (fls_sck_frd    ),
    .fls_ncs    (fls_ncs_frd    ),
    .fls_sdo    (fls_sdo_frd    ),
    .fls_sdi    (fls_sdi_frd    ),


    .start      (start_frd      ),
    .dout_en    (frd_en         ),
    .addr       (frd_addr       ),
    .dout       (frd_data       ),

    .busy       (busy_frd       )
);


flash_id u_flash_id
(
    .clk        (clk            ),
    

    .fls_sck    (fls_sck_id     ),
    .fls_ncs    (fls_ncs_id     ),
    .fls_sdo    (fls_sdo_id     ),
    .fls_sdi    (fls_sdi_id     ),

    .start      (start_id       ),
    .fls_id     (id             ),
    .busy       (busy_id        )
);



always@(posedge clk)
begin
    start_wfree  <= start && (mod_sel == 0);
    start_wen    <= start && (mod_sel == 1);
    start_erase  <= start && (mod_sel == 2);
    start_wr     <= start && (mod_sel == 3);
    start_rd     <= start && (mod_sel == 4);
    start_frd    <= start && (mod_sel == 5);
    start_id     <= start && (mod_sel == 6);
    start_sector <= start && (mod_sel == 7);
end


always@(posedge clk)
begin
    fls_sdi_wfree <= fls_sdi && (mod_sel == 0);
    fls_sdi_wen   <= fls_sdi && (mod_sel == 1);
    fls_sdi_erase <= fls_sdi && (mod_sel == 2);
    fls_sdi_wr    <= fls_sdi && (mod_sel == 3);
    fls_sdi_rd    <= fls_sdi && (mod_sel == 4);
    fls_sdi_frd   <= fls_sdi && (mod_sel == 5);
    fls_sdi_id    <= fls_sdi && (mod_sel == 6);
    fls_sdi_sector<= fls_sdi && (mod_sel == 7);
end


always@(posedge clk)
begin
    case(mod_sel)
     0: fls_sck <= fls_sck_wfree;
     1: fls_sck <= fls_sck_wen;
     2: fls_sck <= fls_sck_erase;
     3: fls_sck <= fls_sck_wr;
     4: fls_sck <= fls_sck_rd;
     5: fls_sck <= fls_sck_frd;
     6: fls_sck <= fls_sck_id;
     7: fls_sck <= fls_sck_sector;
    endcase
end


always@(posedge clk)
begin
    case(mod_sel)
     0: fls_ncs <= fls_ncs_wfree;
     1: fls_ncs <= fls_ncs_wen;
     2: fls_ncs <= fls_ncs_erase;
     3: fls_ncs <= fls_ncs_wr;
     4: fls_ncs <= fls_ncs_rd;
     5: fls_ncs <= fls_ncs_frd;
     6: fls_ncs <= fls_ncs_id;
     7: fls_ncs <= fls_ncs_sector;
    endcase
end


always@(posedge clk)
begin
    case(mod_sel)
     0: fls_sdo <= fls_sdo_wfree;
     1: fls_sdo <= fls_sdo_wen;
     2: fls_sdo <= fls_sdo_erase;
     3: fls_sdo <= fls_sdo_wr;
     4: fls_sdo <= fls_sdo_rd;
     5: fls_sdo <= fls_sdo_frd;
     6: fls_sdo <= fls_sdo_id;
     7: fls_sdo <= fls_sdo_sector;
    endcase
end


always@(posedge clk)
begin
    busy <= busy_wfree | busy_wen | busy_erase | busy_wr | busy_rd | busy_frd | busy_id | busy_sector;
end

endmodule
module flash_dri
(
    input   wire        clk,


    output  reg         fls_sck,
    output  reg         fls_ncs,
    output  reg         fls_sdo,
    input   wire        fls_sdi,


    input   wire        start,
    input   wire [2:0]  mod_sel,


    input   wire [23:0] fls_addr,
    input   wire [7:0]  fls_write,
    output  wire [7:0]  fls_read,
    

    output  wire        frd_en,
    output  wire [23:0] frd_addr,
    output  wire [7:0]  frd_data,


    output  wire [15:0] id,
    output  reg         busy
);



wire fls_sck_wen;
wire fls_sck_wfree;
wire fls_sck_erase;
wire fls_sck_sector;
wire fls_sck_wr;
wire fls_sck_rd;
wire fls_sck_frd;
wire fls_sck_id;


wire fls_ncs_wen;
wire fls_ncs_wfree;
wire fls_ncs_erase;
wire fls_ncs_sector;
wire fls_ncs_wr;
wire fls_ncs_rd;
wire fls_ncs_frd;
wire fls_ncs_id;


wire fls_sdo_wen;
wire fls_sdo_wfree;
wire fls_sdo_erase;
wire fls_sdo_sector;
wire fls_sdo_wr;
wire fls_sdo_rd;
wire fls_sdo_frd;
wire fls_sdo_id;


reg fls_sdi_wen;
reg fls_sdi_wfree;
reg fls_sdi_erase;
reg fls_sdi_sector;
reg fls_sdi_wr;
reg fls_sdi_rd;
reg fls_sdi_frd;
reg fls_sdi_id;


reg start_wen;
reg start_wfree;
reg start_erase;
reg start_sector;
reg start_wr;
reg start_rd;
reg start_frd;
reg start_id;


wire busy_wen;
wire busy_wfree;
wire busy_erase;
wire busy_sector;
wire busy_wr;
wire busy_rd;
wire busy_frd;
wire busy_id;



flash_write_enable u_flash_write_enable
(
    .clk        (clk            ),


    .fls_sck    (fls_sck_wen    ),
    .fls_ncs    (fls_ncs_wen    ),
    .fls_sdo    (fls_sdo_wen    ),
    .fls_sdi    (fls_sdi_wen    ),

    .start      (start_wen      ),
    .busy       (busy_wen       )
);


flash_wait_free u_flash_wait_free
(
    .clk        (clk            ),
    

    .fls_sck    (fls_sck_wfree  ),
    .fls_ncs    (fls_ncs_wfree  ),
    .fls_sdo    (fls_sdo_wfree  ),
    .fls_sdi    (fls_sdi_wfree  ),

    .start      (start_wfree    ),
    .busy       (busy_wfree     )
);


flash_erase u_flash_erase
(
    .clk        (clk            ),
    

    .fls_sck    (fls_sck_erase  ),
    .fls_ncs    (fls_ncs_erase  ),
    .fls_sdo    (fls_sdo_erase  ),
    .fls_sdi    (fls_sdi_erase  ),

    .start      (start_erase    ),
    .busy       (busy_erase     )
);


flash_sector_erase u_flash_sector_erase
(
    .clk        (clk            ),
    

    .fls_sck    (fls_sck_sector ),
    .fls_ncs    (fls_ncs_sector ),
    .fls_sdo    (fls_sdo_sector ),
    .fls_sdi    (fls_sdi_sector ),


    .start      (start_sector   ),
    .addr       (fls_addr       ),

    .busy       (busy_sector    )
);


flash_write u_flash_write
(
    .clk        (clk            ),


    .fls_sck    (fls_sck_wr     ),
    .fls_ncs    (fls_ncs_wr     ),
    .fls_sdo    (fls_sdo_wr     ),
    .fls_sdi    (fls_sdi_wr     ),


    .start      (start_wr       ),
    .addr       (fls_addr       ),
    .din        (fls_write      ),

    .busy       (busy_wr        )
);


flash_read u_flash_read
(
    .clk        (clk            ),


    .fls_sck    (fls_sck_rd     ),
    .fls_ncs    (fls_ncs_rd     ),
    .fls_sdo    (fls_sdo_rd     ),
    .fls_sdi    (fls_sdi_rd     ),


    .start      (start_rd       ),
    .addr       (fls_addr       ),
    .dout       (fls_read       ),

    .busy       (busy_rd        )
);


flash_fast_read u_flash_fast_read
(
    .clk        (clk            ),


    .fls_sck    (fls_sck_frd    ),
    .fls_ncs    (fls_ncs_frd    ),
    .fls_sdo    (fls_sdo_frd    ),
    .fls_sdi    (fls_sdi_frd    ),


    .start      (start_frd      ),
    .dout_en    (frd_en         ),
    .addr       (frd_addr       ),
    .dout       (frd_data       ),

    .busy       (busy_frd       )
);


flash_id u_flash_id
(
    .clk        (clk            ),
    

    .fls_sck    (fls_sck_id     ),
    .fls_ncs    (fls_ncs_id     ),
    .fls_sdo    (fls_sdo_id     ),
    .fls_sdi    (fls_sdi_id     ),

    .start      (start_id       ),
    .fls_id     (id             ),
    .busy       (busy_id        )
);



always@(posedge clk)
begin
    start_wfree  <= start && (mod_sel == 0);
    start_wen    <= start && (mod_sel == 1);
    start_erase  <= start && (mod_sel == 2);
    start_wr     <= start && (mod_sel == 3);
    start_rd     <= start && (mod_sel == 4);
    start_frd    <= start && (mod_sel == 5);
    start_id     <= start && (mod_sel == 6);
    start_sector <= start && (mod_sel == 7);
end


always@(posedge clk)
begin
    fls_sdi_wfree <= fls_sdi && (mod_sel == 0);
    fls_sdi_wen   <= fls_sdi && (mod_sel == 1);
    fls_sdi_erase <= fls_sdi && (mod_sel == 2);
    fls_sdi_wr    <= fls_sdi && (mod_sel == 3);
    fls_sdi_rd    <= fls_sdi && (mod_sel == 4);
    fls_sdi_frd   <= fls_sdi && (mod_sel == 5);
    fls_sdi_id    <= fls_sdi && (mod_sel == 6);
    fls_sdi_sector<= fls_sdi && (mod_sel == 7);
end


always@(posedge clk)
begin
    case(mod_sel)
     0: fls_sck <= fls_sck_wfree;
     1: fls_sck <= fls_sck_wen;
     2: fls_sck <= fls_sck_erase;
     3: fls_sck <= fls_sck_wr;
     4: fls_sck <= fls_sck_rd;
     5: fls_sck <= fls_sck_frd;
     6: fls_sck <= fls_sck_id;
     7: fls_sck <= fls_sck_sector;
    endcase
end


always@(posedge clk)
begin
    case(mod_sel)
     0: fls_ncs <= fls_ncs_wfree;
     1: fls_ncs <= fls_ncs_wen;
     2: fls_ncs <= fls_ncs_erase;
     3: fls_ncs <= fls_ncs_wr;
     4: fls_ncs <= fls_ncs_rd;
     5: fls_ncs <= fls_ncs_frd;
     6: fls_ncs <= fls_ncs_id;
     7: fls_ncs <= fls_ncs_sector;
    endcase
end


always@(posedge clk)
begin
    case(mod_sel)
     0: fls_sdo <= fls_sdo_wfree;
     1: fls_sdo <= fls_sdo_wen;
     2: fls_sdo <= fls_sdo_erase;
     3: fls_sdo <= fls_sdo_wr;
     4: fls_sdo <= fls_sdo_rd;
     5: fls_sdo <= fls_sdo_frd;
     6: fls_sdo <= fls_sdo_id;
     7: fls_sdo <= fls_sdo_sector;
    endcase
end


always@(posedge clk)
begin
    busy <= busy_wfree | busy_wen | busy_erase | busy_wr | busy_rd | busy_frd | busy_id | busy_sector;
end

endmodule