data/full_repos/permissive/443520440/code/dcam_top.v
1: b"%Error: data/full_repos/permissive/443520440/code/dcam_top.v:127: Cannot find file containing module: 'clk_wiz_0'\n    clk_wiz_0 clk_wiz_div(\n    ^~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/443520440/code,data/full_repos/permissive/443520440/clk_wiz_0\n             data/full_repos/permissive/443520440/code,data/full_repos/permissive/443520440/clk_wiz_0.v\n             data/full_repos/permissive/443520440/code,data/full_repos/permissive/443520440/clk_wiz_0.sv\n             clk_wiz_0\n             clk_wiz_0.v\n             clk_wiz_0.sv\n             obj_dir/clk_wiz_0\n             obj_dir/clk_wiz_0.v\n             obj_dir/clk_wiz_0.sv\n%Error: data/full_repos/permissive/443520440/code/dcam_top.v:138: Cannot find file containing module: 'ov2640_sccb_cfg_init'\n    ov2640_sccb_cfg_init ov2640_sccb_cfg_init_0(\n    ^~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/443520440/code/dcam_top.v:153: Cannot find file containing module: 'ov2640_data_driver'\n    ov2640_data_driver ov2640_data_driver_0(\n    ^~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/443520440/code/dcam_top.v:167: Cannot find file containing module: 'blk_mem_gen_0'\n    blk_mem_gen_0 ram_0(\n    ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/443520440/code/dcam_top.v:184: Cannot find file containing module: 'vga_driver'\n    vga_driver vga(\n    ^~~~~~~~~~\n%Error: data/full_repos/permissive/443520440/code/dcam_top.v:199: Cannot find file containing module: 'bluetooth_mode_control'\n    bluetooth_mode_control bluetooth_mode_control_0(\n    ^~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/443520440/code/dcam_top.v:212: Cannot find file containing module: 'display7'\n    display7 display7_0( \n    ^~~~~~~~\n%Error: data/full_repos/permissive/443520440/code/dcam_top.v:229: Cannot find file containing module: 'sd_ctrl'\n    sd_ctrl sd_ctrl_0(\n    ^~~~~~~\n%Error: data/full_repos/permissive/443520440/code/dcam_top.v:253: Cannot find file containing module: 'sd_read_photo'\n    sd_read_photo sd_read_photo_0(\n    ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/443520440/code/dcam_top.v:267: Cannot find file containing module: 'sd_write_photo'\n    sd_write_photo sd_write_photo_0(\n    ^~~~~~~~~~~~~~\n%Error: Exiting due to 10 error(s)\n"
module camera_top(
    input               sys_clk         ,
    input               sys_rst         ,


    output              camera_sio_c    ,   
    inout               camera_sio_d    ,   
    output              camera_reset    ,   
    output              camera_pwdn     ,   
    output              camera_xclk     ,   
    input               camera_pclk     ,
    input               camera_href     ,
    input               camera_vsync    ,   
    input  [7:0]        camera_data     ,


    input  [7:0]        key             ,
    output [7:0]        led             ,


    output [7:0]        seg_ena         ,
    output [7:0]        seg_ctl         ,


    output [11:0]       vga_rgb         ,
    output              vga_hsync       ,
    output              vga_vsync       ,


    input               bluetooth_rxd   ,
    input               bluetooth_txd   ,


    input               sd_cd           ,
    output              sd_reset        ,
    output              sd_sck          ,
    output              sd_cmd          ,
    inout  [3:0]        sd_data         
);



    wire                clk_sd_50m          ;
    wire                clk_sd_50m_180deg   ;
    wire                clk_vga_24m         ;
    wire                clk_sccb_init_25m   ;


    wire                sd_clk              ;
    wire                sd_cs               ;
    wire                sd_mosi             ;
    wire                sd_miso             ;


    wire                wr_start_en         ;
    wire    [31:0]      wr_sec_addr         ;
    wire    [15:0]      wr_data             ;
    wire                rd_start_en         ;
    wire    [31:0]      rd_sec_addr         ;


    wire                wr_busy             ;
    wire                wr_req              ;
    wire                rd_busy             ;
    wire                rd_val_en           ;
    wire    [15:0]      rd_val_data         ;
    wire                sd_init_done        ;


    wire                photo_out_ena       ;
    wire    [3:0]       select_photo_no     ;
    wire                get_photo_mode      ;
    wire                caught_photo_mode   ;
    wire                camera_show_mode    ;
    wire                camera_init_done    ;

    wire    [18:0]      sd_wr_ram_addr      ;
    wire    [11:0]      photo_out_data      ;
    wire    [18:0]      photo_out_position  ;
    wire    [18:0]      sd_rd_ram_addr      ;


    wire    [11:0]      ram_data            ;
    wire    [18:0]      ram_addr            ;
    wire    [11:0]      vga_rd_data         ;
    wire    [18:0]      rd_addr             ;
    wire    [18:0]      baddr               ;
    wire    [11:0]      mem_douta           ;
    wire                wea_enable          ;
    wire                wr_en               ;
    wire    [11:0]      vga_color_in        ;
    wire    [11:0]      doutb               ;



    assign sd_reset = 0;
    assign sd_data[1] = 1;
    assign sd_data[2] = 1;
    assign sd_data[3] = sd_cs;
    assign sd_cmd = sd_mosi;
    assign sd_sck = sd_clk;
    assign sd_miso = sd_data[0];
    

    assign led[0] = camera_show_mode;
    assign led[1] = caught_photo_mode;
    assign led[2] = get_photo_mode;
    assign led[3] = sd_init_done;
    assign led[4] = camera_init_done;
    assign led[5] = ~sd_cd;


    assign wr_data = {4'b0, mem_douta};
    assign baddr = (rd_val_en ? sd_rd_ram_addr : ( caught_photo_mode ? sd_wr_ram_addr : rd_addr));
    assign mem_douta = doutb;
    assign vga_rd_data = doutb;
    assign wea_enable = wr_en & camera_show_mode;
    assign vga_color_in = (caught_photo_mode ? 12'hf00 : vga_rd_data);


    clk_wiz_0 clk_wiz_div(
        .clk_in1            (sys_clk)               ,
        .clk_out1           (clk_vga_24m)           ,
        .clk_out2           (clk_sccb_init_25m)     ,
        .clk_out3           (clk_sd_50m)            ,
        .clk_out4           (clk_sd_50m_180deg)
    );


    ov2640_sccb_cfg_init ov2640_sccb_cfg_init_0(
        .clk                (clk_sccb_init_25m)     ,
        .sio_c              (camera_sio_c)          ,
        .sio_d              (camera_sio_d)          ,
        .reset              (camera_reset)          ,
        .pwdn               (camera_pwdn)           ,  
        .rst                (sys_rst)               ,
        .camera_init_done   (camera_init_done)      ,
        .bright             (key[3:0])              ,
        .xclk               (camera_xclk)
    );


    ov2640_data_driver ov2640_data_driver_0(
        .rst                (sys_rst)               ,
        .pclk               (camera_pclk)           ,
        .href               (camera_href)           ,
        .vsync              (camera_vsync)          ,
        .data_in            (camera_data)           ,
        .data_out           (ram_data)              ,
        .wr_en              (wr_en)                 ,
        .ram_out_addr       (ram_addr)
    );


    blk_mem_gen_0 ram_0(
        .clka               (sys_clk)               ,
        .ena                (1'b1)                  ,
        .wea                (wea_enable)            ,
        .addra              (ram_addr)              ,
        .dina               (ram_data)              ,
        .clkb               (sys_clk)               ,
        .enb                (1'b1)                  ,
        .addrb              (baddr)                 ,
        .dinb               (rd_val_data[11:0])     ,
        .doutb              (doutb)                 ,
        .web                (rd_val_en)
    );


    vga_driver vga(
        .vga_clk            (clk_vga_24m)           ,
        .sys_rst_n          (~sys_rst)              ,
        .pixel_data         (vga_color_in)          ,
        .pixel_addr         (rd_addr)               ,
        .vga_hs             (vga_hsync)             ,
        .vga_vs             (vga_vsync)             ,
        .vga_rgb            (vga_rgb)               ,
        .camera_show_mode   (camera_show_mode)
    );

    

    bluetooth_mode_control bluetooth_mode_control_0(
        .sys_clk            (sys_clk)               ,
        .sys_rst            (sys_rst)               ,
        .bluetooth_rxd      (bluetooth_txd)         ,
        .get_photo_mode     (get_photo_mode)        ,
        .caught_photo_mode  (caught_photo_mode)     ,
        .camera_show_mode   (camera_show_mode)      ,
        .select_photo_no    (select_photo_no)
    );


    display7 display7_0( 
		.clk                (sys_clk)               ,
		.led1               (sd_wr_ram_addr[3:0])   ,
		.led2               (sd_wr_ram_addr[7:4])   ,
		.led3               (sd_wr_ram_addr[11:8])  ,
		.led4               (sd_wr_ram_addr[15:12]) ,
		.led5               ({1'b0,sd_wr_ram_addr[18:16]}),
		.led6               (4'b0)                  ,
		.led7               (4'b0)                  ,
		.led8               (select_photo_no)       ,
		.ena                (seg_ena)               ,
		.ctl                (seg_ctl)
	);


    sd_ctrl sd_ctrl_0(
        .clk_ref            (clk_sd_50m)            ,
        .clk_ref_180deg     (clk_sd_50m_180deg)     ,
        .rst_n              (~sys_rst)              ,
        .sd_miso            (sd_miso)               ,
        .sd_clk             (sd_clk)                ,   
        .sd_cs              (sd_cs)                 ,
        .sd_mosi            (sd_mosi)               ,
        .wr_start_en        (wr_start_en)           ,
        .wr_sec_addr        (wr_sec_addr)           ,
        .wr_data            (wr_data)               ,
        .wr_busy            (wr_busy)               ,
        .wr_req             (wr_req)                ,
        .rd_start_en        (rd_start_en)           ,
        .rd_sec_addr        (rd_sec_addr)           ,
        .rd_busy            (rd_busy)               ,
        .rd_val_en          (rd_val_en)             ,
        .rd_val_data        (rd_val_data)           ,    
        .sd_init_done       (sd_init_done)          
    );


    sd_read_photo sd_read_photo_0(
        .clk                (clk_sd_50m)            ,
        .get_photo_mode     (get_photo_mode)        ,
        .rd_start_en        (rd_start_en)           ,
        .select_photo_no    (select_photo_no)       ,
        .rd_busy            (rd_busy)               ,
        .rd_val_en          (rd_val_en)             ,
        .sd_rd_ram_addr     (sd_rd_ram_addr)        ,
        .rd_sec_addr        (rd_sec_addr)
    );


    sd_write_photo sd_write_photo_0(
        .clk                (clk_sd_50m)            ,
        .caught_photo_mode  (caught_photo_mode)     ,
        .select_photo_no    (select_photo_no)       ,
        .wr_start_en        (wr_start_en)           ,
        .wr_sec_addr        (wr_sec_addr)           ,
        .wr_busy            (wr_busy)               ,
        .wr_req             (wr_req)                ,
        .sd_wr_ram_addr     (sd_wr_ram_addr)
    );
endmodule
module camera_top(
    input               sys_clk         ,
    input               sys_rst         ,


    output              camera_sio_c    ,   
    inout               camera_sio_d    ,   
    output              camera_reset    ,   
    output              camera_pwdn     ,   
    output              camera_xclk     ,   
    input               camera_pclk     ,
    input               camera_href     ,
    input               camera_vsync    ,   
    input  [7:0]        camera_data     ,


    input  [7:0]        key             ,
    output [7:0]        led             ,


    output [7:0]        seg_ena         ,
    output [7:0]        seg_ctl         ,


    output [11:0]       vga_rgb         ,
    output              vga_hsync       ,
    output              vga_vsync       ,


    input               bluetooth_rxd   ,
    input               bluetooth_txd   ,


    input               sd_cd           ,
    output              sd_reset        ,
    output              sd_sck          ,
    output              sd_cmd          ,
    inout  [3:0]        sd_data         
);




    wire                clk_sd_50m          ;
    wire                clk_sd_50m_180deg   ;
    wire                clk_vga_24m         ;
    wire                clk_sccb_init_25m   ;


    wire                sd_clk              ;
    wire                sd_cs               ;
    wire                sd_mosi             ;
    wire                sd_miso             ;


    wire                wr_start_en         ;
    wire    [31:0]      wr_sec_addr         ;
    wire    [15:0]      wr_data             ;
    wire                rd_start_en         ;
    wire    [31:0]      rd_sec_addr         ;


    wire                wr_busy             ;
    wire                wr_req              ;
    wire                rd_busy             ;
    wire                rd_val_en           ;
    wire    [15:0]      rd_val_data         ;
    wire                sd_init_done        ;


    wire                photo_out_ena       ;
    wire    [3:0]       select_photo_no     ;
    wire                get_photo_mode      ;
    wire                caught_photo_mode   ;
    wire                camera_show_mode    ;
    wire                camera_init_done    ;

    wire    [18:0]      sd_wr_ram_addr      ;
    wire    [11:0]      photo_out_data      ;
    wire    [18:0]      photo_out_position  ;
    wire    [18:0]      sd_rd_ram_addr      ;


    wire    [11:0]      ram_data            ;
    wire    [18:0]      ram_addr            ;
    wire    [11:0]      vga_rd_data         ;
    wire    [18:0]      rd_addr             ;
    wire    [18:0]      baddr               ;
    wire    [11:0]      mem_douta           ;
    wire                wea_enable          ;
    wire                wr_en               ;
    wire    [11:0]      vga_color_in        ;
    wire    [11:0]      doutb               ;



    assign sd_reset = 0;
    assign sd_data[1] = 1;
    assign sd_data[2] = 1;
    assign sd_data[3] = sd_cs;
    assign sd_cmd = sd_mosi;
    assign sd_sck = sd_clk;
    assign sd_miso = sd_data[0];
    

    assign led[0] = camera_show_mode;
    assign led[1] = caught_photo_mode;
    assign led[2] = get_photo_mode;
    assign led[3] = sd_init_done;
    assign led[4] = camera_init_done;
    assign led[5] = ~sd_cd;


    assign wr_data = {4'b0, mem_douta};
    assign baddr = (rd_val_en ? sd_rd_ram_addr : ( caught_photo_mode ? sd_wr_ram_addr : rd_addr));
    assign mem_douta = doutb;
    assign vga_rd_data = doutb;
    assign wea_enable = wr_en & camera_show_mode;
    assign vga_color_in = (caught_photo_mode ? 12'hf00 : vga_rd_data);


    clk_wiz_0 clk_wiz_div(
        .clk_in1            (sys_clk)               ,
        .clk_out1           (clk_vga_24m)           ,
        .clk_out2           (clk_sccb_init_25m)     ,
        .clk_out3           (clk_sd_50m)            ,
        .clk_out4           (clk_sd_50m_180deg)
    );


    ov2640_sccb_cfg_init ov2640_sccb_cfg_init_0(
        .clk                (clk_sccb_init_25m)     ,
        .sio_c              (camera_sio_c)          ,
        .sio_d              (camera_sio_d)          ,
        .reset              (camera_reset)          ,
        .pwdn               (camera_pwdn)           ,  
        .rst                (sys_rst)               ,
        .camera_init_done   (camera_init_done)      ,
        .bright             (key[3:0])              ,
        .xclk               (camera_xclk)
    );


    ov2640_data_driver ov2640_data_driver_0(
        .rst                (sys_rst)               ,
        .pclk               (camera_pclk)           ,
        .href               (camera_href)           ,
        .vsync              (camera_vsync)          ,
        .data_in            (camera_data)           ,
        .data_out           (ram_data)              ,
        .wr_en              (wr_en)                 ,
        .ram_out_addr       (ram_addr)
    );


    blk_mem_gen_0 ram_0(
        .clka               (sys_clk)               ,
        .ena                (1'b1)                  ,
        .wea                (wea_enable)            ,
        .addra              (ram_addr)              ,
        .dina               (ram_data)              ,
        .clkb               (sys_clk)               ,
        .enb                (1'b1)                  ,
        .addrb              (baddr)                 ,
        .dinb               (rd_val_data[11:0])     ,
        .doutb              (doutb)                 ,
        .web                (rd_val_en)
    );


    vga_driver vga(
        .vga_clk            (clk_vga_24m)           ,
        .sys_rst_n          (~sys_rst)              ,
        .pixel_data         (vga_color_in)          ,
        .pixel_addr         (rd_addr)               ,
        .vga_hs             (vga_hsync)             ,
        .vga_vs             (vga_vsync)             ,
        .vga_rgb            (vga_rgb)               ,
        .camera_show_mode   (camera_show_mode)
    );

    

    bluetooth_mode_control bluetooth_mode_control_0(
        .sys_clk            (sys_clk)               ,
        .sys_rst            (sys_rst)               ,
        .bluetooth_rxd      (bluetooth_txd)         ,
        .get_photo_mode     (get_photo_mode)        ,
        .caught_photo_mode  (caught_photo_mode)     ,
        .camera_show_mode   (camera_show_mode)      ,
        .select_photo_no    (select_photo_no)
    );


    display7 display7_0( 
		.clk                (sys_clk)               ,
		.led1               (sd_wr_ram_addr[3:0])   ,
		.led2               (sd_wr_ram_addr[7:4])   ,
		.led3               (sd_wr_ram_addr[11:8])  ,
		.led4               (sd_wr_ram_addr[15:12]) ,
		.led5               ({1'b0,sd_wr_ram_addr[18:16]}),
		.led6               (4'b0)                  ,
		.led7               (4'b0)                  ,
		.led8               (select_photo_no)       ,
		.ena                (seg_ena)               ,
		.ctl                (seg_ctl)
	);


    sd_ctrl sd_ctrl_0(
        .clk_ref            (clk_sd_50m)            ,
        .clk_ref_180deg     (clk_sd_50m_180deg)     ,
        .rst_n              (~sys_rst)              ,
        .sd_miso            (sd_miso)               ,
        .sd_clk             (sd_clk)                ,   
        .sd_cs              (sd_cs)                 ,
        .sd_mosi            (sd_mosi)               ,
        .wr_start_en        (wr_start_en)           ,
        .wr_sec_addr        (wr_sec_addr)           ,
        .wr_data            (wr_data)               ,
        .wr_busy            (wr_busy)               ,
        .wr_req             (wr_req)                ,
        .rd_start_en        (rd_start_en)           ,
        .rd_sec_addr        (rd_sec_addr)           ,
        .rd_busy            (rd_busy)               ,
        .rd_val_en          (rd_val_en)             ,
        .rd_val_data        (rd_val_data)           ,    
        .sd_init_done       (sd_init_done)          
    );


    sd_read_photo sd_read_photo_0(
        .clk                (clk_sd_50m)            ,
        .get_photo_mode     (get_photo_mode)        ,
        .rd_start_en        (rd_start_en)           ,
        .select_photo_no    (select_photo_no)       ,
        .rd_busy            (rd_busy)               ,
        .rd_val_en          (rd_val_en)             ,
        .sd_rd_ram_addr     (sd_rd_ram_addr)        ,
        .rd_sec_addr        (rd_sec_addr)
    );


    sd_write_photo sd_write_photo_0(
        .clk                (clk_sd_50m)            ,
        .caught_photo_mode  (caught_photo_mode)     ,
        .select_photo_no    (select_photo_no)       ,
        .wr_start_en        (wr_start_en)           ,
        .wr_sec_addr        (wr_sec_addr)           ,
        .wr_busy            (wr_busy)               ,
        .wr_req             (wr_req)                ,
        .sd_wr_ram_addr     (sd_wr_ram_addr)
    );
endmodule