data/full_repos/permissive/126216465/gen_big_buffer.v
[Errno 2] No such file or directory: 'preprocess.output'
1: b"%Error: data/full_repos/permissive/126216465/gen_big_buffer.v:54: Cannot find file containing module: 'aes_genkey'\n  aes_genkey genkey(.clk(clk), .rstn(rstn), .input0( hs1[(0+1)*128-1:0*128] ), .input1( hs1[(1+1)*128-1:1*128] ), .keygen_done(keygen_done),\n  ^~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/126216465,data/full_repos/permissive/126216465/aes_genkey\n             data/full_repos/permissive/126216465,data/full_repos/permissive/126216465/aes_genkey.v\n             data/full_repos/permissive/126216465,data/full_repos/permissive/126216465/aes_genkey.sv\n             aes_genkey\n             aes_genkey.v\n             aes_genkey.sv\n             obj_dir/aes_genkey\n             obj_dir/aes_genkey.v\n             obj_dir/aes_genkey.sv\n%Error: data/full_repos/permissive/126216465/gen_big_buffer.v:57: Cannot find file containing module: 'aes_round'\n  aes_round round0(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin0_r), .k0(k0), .k1(k1), .k2(k2),\n  ^~~~~~~~~\n%Error: data/full_repos/permissive/126216465/gen_big_buffer.v:59: Cannot find file containing module: 'aes_round'\n  aes_round round1(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin1_r), .k0(k0), .k1(k1), .k2(k2),\n  ^~~~~~~~~\n%Error: data/full_repos/permissive/126216465/gen_big_buffer.v:61: Cannot find file containing module: 'aes_round'\n  aes_round round2(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin2_r), .k0(k0), .k1(k1), .k2(k2),\n  ^~~~~~~~~\n%Error: data/full_repos/permissive/126216465/gen_big_buffer.v:63: Cannot find file containing module: 'aes_round'\n  aes_round round3(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin3_r), .k0(k0), .k1(k1), .k2(k2),\n  ^~~~~~~~~\n%Error: data/full_repos/permissive/126216465/gen_big_buffer.v:65: Cannot find file containing module: 'aes_round'\n  aes_round round4(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin4_r), .k0(k0), .k1(k1), .k2(k2),\n  ^~~~~~~~~\n%Error: data/full_repos/permissive/126216465/gen_big_buffer.v:67: Cannot find file containing module: 'aes_round'\n  aes_round round5(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin5_r), .k0(k0), .k1(k1), .k2(k2),\n  ^~~~~~~~~\n%Error: data/full_repos/permissive/126216465/gen_big_buffer.v:69: Cannot find file containing module: 'aes_round'\n  aes_round round6(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin6_r), .k0(k0), .k1(k1), .k2(k2),\n  ^~~~~~~~~\n%Error: data/full_repos/permissive/126216465/gen_big_buffer.v:71: Cannot find file containing module: 'aes_round'\n  aes_round round7(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin7_r), .k0(k0), .k1(k1), .k2(k2),\n  ^~~~~~~~~\n%Error: Exiting due to 9 error(s)\n"
module gen_big_buffer #
  (
        parameter NUM_ROUNDS = 'h020
  )
  (input clk, input rstn, input [31:0] start_mem_offset, input write_done, input [255:0] hs1, input [1023:0] hs3,
  output [3:0] start_write, output reg [31:0] mem_offset, output reg buf_done,
  output [127:0] gen0, output [127:0] gen1, output [127:0] gen2, output [127:0] gen3,
  output [127:0] gen4, output [127:0] gen5, output [127:0] gen6, output [127:0] gen7);

  localparam nrounds = NUM_ROUNDS;

  wire keygen_done;
  wire aes_round_done0;
  wire aes_round_done1;
  wire aes_round_done2;
  wire aes_round_done3;
  wire aes_round_done4;
  wire aes_round_done5;
  wire aes_round_done6;
  wire aes_round_done7;

  (* keep = "true" *) reg [clogb2(NUM_ROUNDS*8-1)-1:0] total;
  (* keep = "true" *) reg [3:0] wcounter;
  
  wire [127:0] k0, k1, k2, k3, k4, k5, k6, k7, k8, k9;
  reg start_round;
  reg [127:0] xin0_r, xin1_r, xin2_r, xin3_r, xin4_r, xin5_r, xin6_r, xin7_r;
  wire [127:0] xout0_w, xout1_w, xout2_w, xout3_w, xout4_w, xout5_w, xout6_w, xout7_w;
  
  aes_genkey genkey(.clk(clk), .rstn(rstn), .input0( `h(hs1,0) ), .input1( `h(hs1,1) ), .keygen_done(keygen_done),
   .k0(k0), .k1(k1), .k2(k2), .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9));

  aes_round round0(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin0_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done0), .xout(xout0_w));
  aes_round round1(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin1_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done1), .xout(xout1_w));
  aes_round round2(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin2_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done2), .xout(xout2_w));
  aes_round round3(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin3_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done3), .xout(xout3_w));
  aes_round round4(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin4_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done4), .xout(xout4_w));
  aes_round round5(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin5_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done5), .xout(xout5_w));
  aes_round round6(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin6_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done6), .xout(xout6_w));
  aes_round round7(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin7_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done7), .xout(xout7_w));

  assign gen0 = (aes_round_done0)? xout0_w : 0;
  assign gen1 = (aes_round_done0)? xout1_w : 0;
  assign gen2 = (aes_round_done0)? xout2_w : 0;
  assign gen3 = (aes_round_done0)? xout3_w : 0;
  assign gen4 = (aes_round_done0)? xout4_w : 0;
  assign gen5 = (aes_round_done0)? xout5_w : 0;
  assign gen6 = (aes_round_done0)? xout6_w : 0;
  assign gen7 = (aes_round_done0)? xout7_w : 0;
  
  assign start_write = wcounter;

  
  function integer clogb2;
    input integer depth;
      for (clogb2=0; depth>0; clogb2=clogb2+1)
        depth = depth >> 1;
  endfunction
  
  initial begin
    total <= 0;
    buf_done = 0;
    wcounter <= 0;
    mem_offset <= 0;
    start_round <= 0;

  end

  always @(posedge clk)
  begin
    if (rstn == 0)
    begin
        mem_offset = 0;
    end
    else if (total == 0)
    begin
        mem_offset <= start_mem_offset;
    end
    else if (write_done && wcounter == 0 && total != 0 && total < nrounds)
    begin
        mem_offset <= mem_offset + 16*8;
    end
  end
  
  always @(posedge clk)
  begin
    if (rstn == 0)
    begin
      total <= 0;
      buf_done <= 0;
    end
    else if (aes_round_done0  && wcounter == 8 && total < nrounds)
    begin
      total <= total + 1;
    end
    else if (aes_round_done0 && total == nrounds)
    begin
      buf_done <= 1;
    end
    
  end

  always @(posedge clk)
  begin
    if (rstn == 0 || (wcounter == 0 && total==0))
    begin
      xin0_r <= `h(hs3,0);
      xin1_r <= `h(hs3,1);
      xin2_r <= `h(hs3,2);
      xin3_r <= `h(hs3,3);
      xin4_r <= `h(hs3,4);
      xin5_r <= `h(hs3,5);
      xin6_r <= `h(hs3,6);
      xin7_r <= `h(hs3,7);

    end
    else if (keygen_done && wcounter == 8 && aes_round_done0)
    begin
      xin0_r <= xout0_w;
      xin1_r <= xout1_w;
      xin2_r <= xout2_w;
      xin3_r <= xout3_w;
      xin4_r <= xout4_w;
      xin5_r <= xout5_w;
      xin6_r <= xout6_w;
      xin7_r <= xout7_w;
    end
  end
  
  always @(posedge clk)
  begin
    if (rstn == 0)
    begin
      start_round <= 0;
    end
    else if (keygen_done && (write_done || wcounter==8))
    begin
        start_round <= 0;
    end
    else if (keygen_done && wcounter == 0 && buf_done == 0)
    begin
        start_round <= 1;
    end
  end
  
  always @(posedge clk)
  begin
    if (rstn == 0)
    begin
      wcounter <= 0;
    end
    else if (aes_round_done0 && write_done == 0 && total < nrounds)
    begin
        if (wcounter != 8)
        begin
            wcounter = wcounter + 1;
        end
        else
         begin
            wcounter <= 0;
        end
    end
  end
  
endmodule
module gen_big_buffer #
  (
        parameter NUM_ROUNDS = 'h020
  )
  (input clk, input rstn, input [31:0] start_mem_offset, input write_done, input [255:0] hs1, input [1023:0] hs3,
  output [3:0] start_write, output reg [31:0] mem_offset, output reg buf_done,
  output [127:0] gen0, output [127:0] gen1, output [127:0] gen2, output [127:0] gen3,
  output [127:0] gen4, output [127:0] gen5, output [127:0] gen6, output [127:0] gen7);


  localparam nrounds = NUM_ROUNDS;

  wire keygen_done;
  wire aes_round_done0;
  wire aes_round_done1;
  wire aes_round_done2;
  wire aes_round_done3;
  wire aes_round_done4;
  wire aes_round_done5;
  wire aes_round_done6;
  wire aes_round_done7;

  (* keep = "true" *) reg [clogb2(NUM_ROUNDS*8-1)-1:0] total;
  (* keep = "true" *) reg [3:0] wcounter;
  
  wire [127:0] k0, k1, k2, k3, k4, k5, k6, k7, k8, k9;
  reg start_round;
  reg [127:0] xin0_r, xin1_r, xin2_r, xin3_r, xin4_r, xin5_r, xin6_r, xin7_r;
  wire [127:0] xout0_w, xout1_w, xout2_w, xout3_w, xout4_w, xout5_w, xout6_w, xout7_w;
  
  aes_genkey genkey(.clk(clk), .rstn(rstn), .input0( `h(hs1,0) ), .input1( `h(hs1,1) ), .keygen_done(keygen_done),
   .k0(k0), .k1(k1), .k2(k2), .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9));

  aes_round round0(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin0_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done0), .xout(xout0_w));
  aes_round round1(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin1_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done1), .xout(xout1_w));
  aes_round round2(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin2_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done2), .xout(xout2_w));
  aes_round round3(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin3_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done3), .xout(xout3_w));
  aes_round round4(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin4_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done4), .xout(xout4_w));
  aes_round round5(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin5_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done5), .xout(xout5_w));
  aes_round round6(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin6_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done6), .xout(xout6_w));
  aes_round round7(.clk(clk), .rstn(rstn), .start_round(start_round), .xin(xin7_r), .k0(k0), .k1(k1), .k2(k2),
    .k3(k3), .k4(k4), .k5(k5), .k6(k6), .k7(k7), .k8(k8), .k9(k9), .aes_round_done(aes_round_done7), .xout(xout7_w));

  assign gen0 = (aes_round_done0)? xout0_w : 0;
  assign gen1 = (aes_round_done0)? xout1_w : 0;
  assign gen2 = (aes_round_done0)? xout2_w : 0;
  assign gen3 = (aes_round_done0)? xout3_w : 0;
  assign gen4 = (aes_round_done0)? xout4_w : 0;
  assign gen5 = (aes_round_done0)? xout5_w : 0;
  assign gen6 = (aes_round_done0)? xout6_w : 0;
  assign gen7 = (aes_round_done0)? xout7_w : 0;
  
  assign start_write = wcounter;

  
  function integer clogb2;
    input integer depth;
      for (clogb2=0; depth>0; clogb2=clogb2+1)
        depth = depth >> 1;
  endfunction
  
  initial begin
    total <= 0;
    buf_done = 0;
    wcounter <= 0;
    mem_offset <= 0;
    start_round <= 0;

  end

  always @(posedge clk)
  begin
    if (rstn == 0)
    begin
        mem_offset = 0;
    end
    else if (total == 0)
    begin
        mem_offset <= start_mem_offset;
    end
    else if (write_done && wcounter == 0 && total != 0 && total < nrounds)
    begin
        mem_offset <= mem_offset + 16*8;
    end
  end
  
  always @(posedge clk)
  begin
    if (rstn == 0)
    begin
      total <= 0;
      buf_done <= 0;
    end
    else if (aes_round_done0  && wcounter == 8 && total < nrounds)
    begin
      total <= total + 1;
    end
    else if (aes_round_done0 && total == nrounds)
    begin
      buf_done <= 1;
    end
    
  end

  always @(posedge clk)
  begin
    if (rstn == 0 || (wcounter == 0 && total==0))
    begin
      xin0_r <= `h(hs3,0);
      xin1_r <= `h(hs3,1);
      xin2_r <= `h(hs3,2);
      xin3_r <= `h(hs3,3);
      xin4_r <= `h(hs3,4);
      xin5_r <= `h(hs3,5);
      xin6_r <= `h(hs3,6);
      xin7_r <= `h(hs3,7);

    end
    else if (keygen_done && wcounter == 8 && aes_round_done0)
    begin
      xin0_r <= xout0_w;
      xin1_r <= xout1_w;
      xin2_r <= xout2_w;
      xin3_r <= xout3_w;
      xin4_r <= xout4_w;
      xin5_r <= xout5_w;
      xin6_r <= xout6_w;
      xin7_r <= xout7_w;
    end
  end
  
  always @(posedge clk)
  begin
    if (rstn == 0)
    begin
      start_round <= 0;
    end
    else if (keygen_done && (write_done || wcounter==8))
    begin
        start_round <= 0;
    end
    else if (keygen_done && wcounter == 0 && buf_done == 0)
    begin
        start_round <= 1;
    end
  end
  
  always @(posedge clk)
  begin
    if (rstn == 0)
    begin
      wcounter <= 0;
    end
    else if (aes_round_done0 && write_done == 0 && total < nrounds)
    begin
        if (wcounter != 8)
        begin
            wcounter = wcounter + 1;
        end
        else
         begin
            wcounter <= 0;
        end
    end
  end
  
endmodule