data/full_repos/permissive/142990562/FPGA Image Process.v/GrayOperator3x3.v
'utf-8' codec can't decode byte 0xcf in position 86: invalid continuation byte
1: b'%Error: Cannot find file containing module: Image\n        ... Looked in:\n             data/full_repos/permissive/142990562/FPGA/Image\n             data/full_repos/permissive/142990562/FPGA/Image.v\n             data/full_repos/permissive/142990562/FPGA/Image.sv\n             Image\n             Image.v\n             Image.sv\n             obj_dir/Image\n             obj_dir/Image.v\n             obj_dir/Image.sv\n%Error: Cannot find file containing module: Process.v,data/full_repos/permissive/142990562\n%Error: Cannot find file containing module: data/full_repos/permissive/142990562/FPGA\n%Error: Cannot find file containing module: Process.v/GrayOperator3x3.v\n%Error: Exiting due to 4 error(s)\n'
module GrayOperator3x3(
    input                       clk      ,

    input                       DataEn   ,                                 
    input [`DATA_WIDTH - 1 : 0] PixelData,                                 
    output                      DataOutEn
    );
    
    wire [`OPERATOR_HEIGHT * `DATA_WIDTH - 1 : 0] OperatorData           ;
    reg  [`DATA_WIDTH - 1                    : 0] GaussianBlur           ; 
    reg  [`DATA_WIDTH + 1                    : 0] Gx,Gy                  ; 
    wire [`DATA_WIDTH + 1                    : 0] Left,Right,Up,Down     ;
    reg  [`DATA_WIDTH - 1                    : 0] Array00,Array01,Array02,
                                                  Array10,Array11,Array12,
                                                  Array20,Array21,Array22;    
    




    always@(posedge clk)
    begin
    	GaussianBlur <= (Array00 >> 4) + (Array01 >> 3) + (Array02 >> 4) +  
    	                (Array10 >> 3) + (Array11 >> 2) + (Array12 >> 3) +
    	                (Array20 >> 4) + (Array21 >> 3) + (Array22 >> 4);
    	                
    	Gx           <= Right >= Left ? Right - Left : Left - Right;
    	Gy           <= Up    >= Down ? Up    - Down : Down - Up   ;
    end
    
    assign Left  = Array00 + {Array10,1'b0} + Array20,
           Right = Array02 + {Array12,1'b0} + Array22,
           Up    = Array00 + {Array01,1'b0} + Array02,
           Down  = Array20 + {Array21,1'b0} + Array22;
    
    assign Sobel = Gx + Gy >= 400;
    
    reg    [2:0] DataEnReg;
    assign DataOutEn = DataEnReg[2];

        
    always@(posedge clk)
    begin 
    	Array00 <= Array01; Array01 <= Array02;
    	Array10 <= Array11; Array11 <= Array12;
    	Array20 <= Array21; Array21 <= Array22;
    	{Array22,Array12,Array02} <= OperatorData;
    	DataEnReg[0]   <=  OperatorDataEn;
    	DataEnReg[2:1] <=  DataEnReg[1:0];
    end
     


    wire [`ADDR_WIDTH - 1                          : 0] addra,addrb;
    wire [(`OPERATOR_HEIGHT - 1) * `DATA_WIDTH - 1 : 0] douta, dinb;
    LineBuffer
    #(
      .DATA_WIDTH     (`DATA_WIDTH     ),
      .ADDR_WIDTH     (`ADDR_WIDTH     ),
      .OPERATOR_HEIGHT(`OPERATOR_HEIGHT)
    )
    i3LineBuffer
    (
      .clk           (clk           ),
      .DataEn        (DataEn        ),
      .PixelData     (PixelData     ),               
      .addra         (addra         ),
      .douta         (douta         ),
      .web           (web           ),
      .addrb         (addrb         ),
      .dinb          (dinb          ),                    
      .OperatorDataEn(OperatorDataEn),
      .OperatorData  (OperatorData  )    
    );
    





    BlockRam18x2048 iBlockRam18x2048 (
      .clka (clk  ),
      .wea  (0    ),
      .addra(addra),
      .dina (0    ),
      .douta(douta),
      .clkb (clk  ),
      .web  (web  ),
      .addrb(addrb),
      .dinb (dinb ),
      .doutb(     )
    );
endmodule
module GrayOperator3x3(
    input                       clk      ,

    input                       DataEn   ,                                 
    input [`DATA_WIDTH - 1 : 0] PixelData,                                 
    output                      DataOutEn
    );

    
    wire [`OPERATOR_HEIGHT * `DATA_WIDTH - 1 : 0] OperatorData           ;
    reg  [`DATA_WIDTH - 1                    : 0] GaussianBlur           ; 
    reg  [`DATA_WIDTH + 1                    : 0] Gx,Gy                  ; 
    wire [`DATA_WIDTH + 1                    : 0] Left,Right,Up,Down     ;
    reg  [`DATA_WIDTH - 1                    : 0] Array00,Array01,Array02,
                                                  Array10,Array11,Array12,
                                                  Array20,Array21,Array22;    
    




    always@(posedge clk)
    begin
    	GaussianBlur <= (Array00 >> 4) + (Array01 >> 3) + (Array02 >> 4) +  
    	                (Array10 >> 3) + (Array11 >> 2) + (Array12 >> 3) +
    	                (Array20 >> 4) + (Array21 >> 3) + (Array22 >> 4);
    	                
    	Gx           <= Right >= Left ? Right - Left : Left - Right;
    	Gy           <= Up    >= Down ? Up    - Down : Down - Up   ;
    end
    
    assign Left  = Array00 + {Array10,1'b0} + Array20,
           Right = Array02 + {Array12,1'b0} + Array22,
           Up    = Array00 + {Array01,1'b0} + Array02,
           Down  = Array20 + {Array21,1'b0} + Array22;
    
    assign Sobel = Gx + Gy >= 400;
    
    reg    [2:0] DataEnReg;
    assign DataOutEn = DataEnReg[2];

        
    always@(posedge clk)
    begin 
    	Array00 <= Array01; Array01 <= Array02;
    	Array10 <= Array11; Array11 <= Array12;
    	Array20 <= Array21; Array21 <= Array22;
    	{Array22,Array12,Array02} <= OperatorData;
    	DataEnReg[0]   <=  OperatorDataEn;
    	DataEnReg[2:1] <=  DataEnReg[1:0];
    end
     


    wire [`ADDR_WIDTH - 1                          : 0] addra,addrb;
    wire [(`OPERATOR_HEIGHT - 1) * `DATA_WIDTH - 1 : 0] douta, dinb;
    LineBuffer
    #(
      .DATA_WIDTH     (`DATA_WIDTH     ),
      .ADDR_WIDTH     (`ADDR_WIDTH     ),
      .OPERATOR_HEIGHT(`OPERATOR_HEIGHT)
    )
    i3LineBuffer
    (
      .clk           (clk           ),
      .DataEn        (DataEn        ),
      .PixelData     (PixelData     ),               
      .addra         (addra         ),
      .douta         (douta         ),
      .web           (web           ),
      .addrb         (addrb         ),
      .dinb          (dinb          ),                    
      .OperatorDataEn(OperatorDataEn),
      .OperatorData  (OperatorData  )    
    );
    





    BlockRam18x2048 iBlockRam18x2048 (
      .clka (clk  ),
      .wea  (0    ),
      .addra(addra),
      .dina (0    ),
      .douta(douta),
      .clkb (clk  ),
      .web  (web  ),
      .addrb(addrb),
      .dinb (dinb ),
      .doutb(     )
    );
endmodule