data/full_repos/permissive/184721104/test/test_julia_calc.v
1: b'%Warning-STMTDLY: data/full_repos/permissive/184721104/test/test_julia_calc.v:34: Unsupported: Ignoring delay on this delayed statement.\n    CLK =0; #(STEP/2);\n            ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/184721104/test/test_julia_calc.v:35: Unsupported: Ignoring delay on this delayed statement.\n    CLK =1; #(STEP/2);\n            ^\n%Warning-STMTDLY: data/full_repos/permissive/184721104/test/test_julia_calc.v:48: Unsupported: Ignoring delay on this delayed statement.\n    #(STEP*10);\n    ^\n%Warning-STMTDLY: data/full_repos/permissive/184721104/test/test_julia_calc.v:50: Unsupported: Ignoring delay on this delayed statement.\n    #(STEP*10);\n    ^\n%Warning-STMTDLY: data/full_repos/permissive/184721104/test/test_julia_calc.v:59: Unsupported: Ignoring delay on this delayed statement.\n            #(STEP);\n            ^\n%Warning-STMTDLY: data/full_repos/permissive/184721104/test/test_julia_calc.v:61: Unsupported: Ignoring delay on this delayed statement.\n                #(STEP);\n                ^\n%Warning-STMTDLY: data/full_repos/permissive/184721104/test/test_julia_calc.v:69: Unsupported: Ignoring delay on this delayed statement.\n            #(STEP*1);\n            ^\n%Error: data/full_repos/permissive/184721104/test/test_julia_calc.v:18: Cannot find file containing module: \'julia_calc\'\njulia_calc julia_calc(\n^~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/184721104/test,data/full_repos/permissive/184721104/julia_calc\n             data/full_repos/permissive/184721104/test,data/full_repos/permissive/184721104/julia_calc.v\n             data/full_repos/permissive/184721104/test,data/full_repos/permissive/184721104/julia_calc.sv\n             julia_calc\n             julia_calc.v\n             julia_calc.sv\n             obj_dir/julia_calc\n             obj_dir/julia_calc.v\n             obj_dir/julia_calc.sv\n%Warning-REALCVT: data/full_repos/permissive/184721104/test/test_julia_calc.v:54: Implicit conversion of real to integer\n            ZR=(i*2-400)/400.0*mul*1;\n                                  ^\n%Warning-REALCVT: data/full_repos/permissive/184721104/test/test_julia_calc.v:55: Implicit conversion of real to integer\n            ZI=(j*2-96)/96.0*mul*1;\n                                ^\n%Warning-REALCVT: data/full_repos/permissive/184721104/test/test_julia_calc.v:56: Implicit conversion of real to integer\n            CR=-0.04*mul;\n                    ^\n%Warning-REALCVT: data/full_repos/permissive/184721104/test/test_julia_calc.v:57: Implicit conversion of real to integer\n            CI=-0.695*mul;\n                     ^\n%Error: Exiting due to 1 error(s), 11 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module test_julia_calc;

localparam STEP = 8;
localparam CLKNUM = (112*507+12000)*5;

reg CLK;
reg signed [31:0]ZR;
reg signed [31:0]ZI;
reg signed [31:0]CR;
reg signed [31:0]CI;
reg RST;

reg CALC_START;

wire signed [31:0]CALC_NUM;
wire CALC_END;

julia_calc julia_calc(
    .CLK(CLK),
    .ZR(ZR),
    .ZI(ZI),
    .CR(CR),
    .CI(CI),

    .CALC_START(CALC_START),
    .RST(RST),

    .CALC_NUM(CALC_NUM),
    .CALC_END(CALC_END)
);


always begin
    CLK =0; #(STEP/2);
    CLK =1; #(STEP/2);
end

localparam mul = 8192;

integer i,j;

integer fp;

initial begin
    fp = $fopen("img.raw","wb");

    RST=1;
    #(STEP*10);
    RST=0;
    #(STEP*10);

    for (j = 0;j<96 ;j=j+1 ) begin
        for (i = 0;i<400 ;i=i+1 ) begin
            ZR=(i*2-400)/400.0*mul*1;
            ZI=(j*2-96)/96.0*mul*1;
            CR=-0.04*mul;
            CI=-0.695*mul;
            CALC_START=1;
            #(STEP);
            while(~CALC_END)begin
                #(STEP);
            end

            $fwrite(fp,"%c",CALC_NUM[7:0]);
            $fwrite(fp,"%c",8'h00);
            $fwrite(fp,"%c",8'h00);

            CALC_START=0;
            #(STEP*1);
        end
    end
    $fclose(fp);
    $finish;
end

endmodule
module test_julia_calc;


localparam STEP = 8;
localparam CLKNUM = (112*507+12000)*5;

reg CLK;
reg signed [31:0]ZR;
reg signed [31:0]ZI;
reg signed [31:0]CR;
reg signed [31:0]CI;
reg RST;

reg CALC_START;

wire signed [31:0]CALC_NUM;
wire CALC_END;

julia_calc julia_calc(
    .CLK(CLK),
    .ZR(ZR),
    .ZI(ZI),
    .CR(CR),
    .CI(CI),

    .CALC_START(CALC_START),
    .RST(RST),

    .CALC_NUM(CALC_NUM),
    .CALC_END(CALC_END)
);


always begin
    CLK =0; #(STEP/2);
    CLK =1; #(STEP/2);
end

localparam mul = 8192;

integer i,j;

integer fp;

initial begin
    fp = $fopen("img.raw","wb");

    RST=1;
    #(STEP*10);
    RST=0;
    #(STEP*10);

    for (j = 0;j<96 ;j=j+1 ) begin
        for (i = 0;i<400 ;i=i+1 ) begin
            ZR=(i*2-400)/400.0*mul*1;
            ZI=(j*2-96)/96.0*mul*1;
            CR=-0.04*mul;
            CI=-0.695*mul;
            CALC_START=1;
            #(STEP);
            while(~CALC_END)begin
                #(STEP);
            end

            $fwrite(fp,"%c",CALC_NUM[7:0]);
            $fwrite(fp,"%c",8'h00);
            $fwrite(fp,"%c",8'h00);

            CALC_START=0;
            #(STEP*1);
        end
    end
    $fclose(fp);
    $finish;
end

endmodule