data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv
1: b'%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:18: Cannot find include file: tb.svh\n`include "tb.svh" \n         ^~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl,data/full_repos/permissive/509468557/tb.svh\n             data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl,data/full_repos/permissive/509468557/tb.svh.v\n             data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl,data/full_repos/permissive/509468557/tb.svh.sv\n             tb.svh\n             tb.svh.v\n             tb.svh.sv\n             obj_dir/tb.svh\n             obj_dir/tb.svh.v\n             obj_dir/tb.svh.sv\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:137: Cannot find include file: tb_udiv.sv\n    `include "tb_udiv.sv" \n             ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:142: Cannot find include file: tb_urem.sv\n    `include "tb_urem.sv" \n             ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:147: Cannot find include file: tb_div.sv\n    `include "tb_div.sv" \n             ^~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:152: Cannot find include file: tb_rem.sv\n    `include "tb_rem.sv" \n             ^~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:20: syntax error, unexpected IDENTIFIER, expecting PACKAGE-IDENTIFIER or STRING\nimport ariane_pkg::*;\n       ^~~~~~~~~~\n%Warning-STMTDLY: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:81: Unsupported: Ignoring delay on this delayed statement.\n      clk_i = 1; #(CLK_HI);\n                 ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:82: Unsupported: Ignoring delay on this delayed statement.\n      clk_i = 0; #(CLK_LO);\n                 ^\n%Warning-STMTDLY: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:85: Unsupported: Ignoring delay on this delayed statement.\n    clk_i = 1; #(CLK_HI);\n               ^\n%Warning-STMTDLY: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:86: Unsupported: Ignoring delay on this delayed statement.\n    clk_i = 0; #(CLK_LO);\n               ^\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:124: Define or directive not defined: \'`APPL_WAIT_CYC\'\n    `APPL_WAIT_CYC(clk_i, 100)\n    ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:124: syntax error, unexpected \',\'\n    `APPL_WAIT_CYC(clk_i, 100)\n                        ^\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:128: Define or directive not defined: \'`APPL_WAIT_CYC\'\n    `APPL_WAIT_CYC(clk_i, 100)\n    ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:128: syntax error, unexpected \',\'\n    `APPL_WAIT_CYC(clk_i, 100)\n                        ^\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:132: Define or directive not defined: \'`APPL_WAIT_CYC\'\n    `APPL_WAIT_CYC(clk_i, 100)\n    ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:132: syntax error, unexpected \',\'\n    `APPL_WAIT_CYC(clk_i, 100)\n                        ^\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:156: Define or directive not defined: \'`APPL_WAIT_CYC\'\n    `APPL_WAIT_CYC(clk_i, 400)\n    ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:176: syntax error, unexpected IDENTIFIER\n    progress status;\n             ^~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:180: Unsupported: new with arguments\n    status       = new("TB");\n                   ^~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:186: Define or directive not defined: \'`ACQ_WAIT_SIG\'\n    `ACQ_WAIT_SIG(clk_i, stim_start)\n    ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:186: syntax error, unexpected \',\'\n    `ACQ_WAIT_SIG(clk_i, stim_start)\n                       ^\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:197: Define or directive not defined: \'`ACQ_WAIT_CYC\'\n        `ACQ_WAIT_CYC(clk_i, 1)\n        ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:197: syntax error, unexpected \',\'\n        `ACQ_WAIT_CYC(clk_i, 1)\n                           ^\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:203: syntax error, unexpected end, expecting while\n      end while(acq_trig == 1\'b0);\n      ^~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:223: Define or directive not defined: \'`ACQ_WAIT_SIG\'\n        `ACQ_WAIT_SIG(clk_i, in_vld_i)\n        ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:243: Define or directive not defined: \'`ACQ_WAIT_SIG\'\n          `ACQ_WAIT_SIG(clk_i, out_vld_o)\n          ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:262: Define or directive not defined: \'`ACQ_WAIT_SIG\'\n          `ACQ_WAIT_SIG(clk_i, out_vld_o)\n          ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:276: Unsupported or unknown PLI call: $psprintf\n            if(!ok) tmpstr =  $psprintf("vector: %04d> %d %s %d = %d != %d -> error!", acqCnt, op_a_tmp, opStr, op_b_tmp, res, act);\n                              ^~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:277: Unsupported or unknown PLI call: $psprintf\n            else    tmpstr =  $psprintf("vector: %04d> %d %s %d = %d == %d "         , acqCnt, op_a_tmp, opStr, op_b_tmp, res, act);\n                              ^~~~~~~~~\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/tb/tb_serdiv/hdl/tb.sv:282: Unsupported or unknown PLI call: $psprintf\n          failingTests = $psprintf("%sTB> %s\\n", failingTests, tmpstr);\n                         ^~~~~~~~~\n%Error: Cannot continue\n'
module tb;






  timeunit 1ps;
  timeprecision 1ps;

  parameter                          VERBOSE   = 1;
  parameter                          WIDTH     = 64;
  parameter logic        [WIDTH-1:0] MAX_NUM64 = '1;
  parameter logic        [WIDTH-2:0] MAX_NUM63 = '1;
  parameter logic signed [WIDTH-1:0] MIN_NUM   = {1'b1,{WIDTH-1{1'b0}}};






  logic signed [WIDTH:0]      op_a, op_b;
  logic signed [WIDTH:0]      op_a_tmp, op_b_tmp;

  logic                       flush_i;
  logic [TRANS_ID_BITS-1:0]   id_i;
  logic [TRANS_ID_BITS-1:0]   id_o;

  logic [WIDTH-1:0]           op_a_i;
  logic [WIDTH-1:0]           op_b_i;

  logic [1:0]                 opcode_i;
  logic [1:0]                 opcode_tmp;

  logic                       in_rdy_o;
  logic                       in_vld_i;
  logic                       out_rdy_i;
  logic                       out_vld_o;
  logic [WIDTH-1:0]           res_o;





  logic   clk_i, rst_ni;
  logic   stim_start, stim_end, end_of_sim;
  longint num_stim;
  logic   acq_trig;
  string  test_name;





  always @*
  begin
    do begin
      clk_i = 1; #(CLK_HI);
      clk_i = 0; #(CLK_LO);
    end while (end_of_sim == 1'b0);

    clk_i = 1; #(CLK_HI);
    clk_i = 0; #(CLK_LO);
  end







  assign OpBIsZero_SI = ~(|op_b_i);
  serdiv #(.WIDTH(WIDTH)) i_dut (.*);





  initial begin : p_stim
    longint signed k;
    bit randBit;

    stim_start = 0;
    stim_end   = 0;
    num_stim   = 0;
    test_name  = "";
    acq_trig   = 0;

    rst_ni     = 0;

    op_a       = 0;
    op_b       = 0;

    op_a_i      = 0;
    op_b_i      = 0;
    opcode_i   = 0;
    in_vld_i    = 0;
    flush_i    = 0;
    id_i  = 0;

    `APPL_WAIT_CYC(clk_i, 100)

    rst_ni <= 1'b1;

    `APPL_WAIT_CYC(clk_i, 100)

    $display("TB> stimuli application started");
    stim_start <= 1'b1;
    `APPL_WAIT_CYC(clk_i, 100)




    `include "tb_udiv.sv"




    `include "tb_urem.sv"




    `include "tb_div.sv"




    `include "tb_rem.sv"



    `APPL_WAIT_CYC(clk_i, 400)

    stim_end <= 1;
    $display("TB> stimuli application ended");

  end







  initial begin : p_acq




    bit ok;
    string opStr;
    progress status;
    string failingTests, tmpstr;
    longint acqCnt, res, act;

    status       = new("TB");
    failingTests = "";

    out_rdy_i  = 0;
    end_of_sim = 0;

    `ACQ_WAIT_SIG(clk_i, stim_start)

    $display("TB> response acquisition started");




    repeat(4) begin


      do begin
        `ACQ_WAIT_CYC(clk_i, 1)
        if (stim_end == 1) begin
          end_of_sim <= 1;
          $display("response acquisition ended");
          $finish();
        end
      end while(acq_trig == 1'b0);

      acqCnt = 0;

      $display("");
      $display("TB> ----------------------------------------------------------------------");
      $display("TB> %s", test_name);
      $display("TB> ----------------------------------------------------------------------\n");
      $display("");

      $display("TB> checking %00d vectors",num_stim);
      $display("");
      status.reset(num_stim);

      do begin



        out_rdy_i = 1'b1;

        `ACQ_WAIT_SIG(clk_i, in_vld_i)

        opcode_tmp = opcode_i;
        op_a_tmp    = op_a;
        op_b_tmp    = op_b;



        if(opcode_i[1] == 1'b0) begin

          res = op_a_tmp/op_b_tmp;

          if((op_b_tmp == 0) && (opcode_i[0] == 0)) begin
            res = MAX_NUM64;
          end else if ((op_b_tmp == 0) && (opcode_i[0] == 1'b1)) begin
            res = -1;
          end else if ((op_a_tmp == MIN_NUM)  && (op_b_tmp == -1) && (opcode_i[0] == 1'b1)) begin
            res = MIN_NUM;
          end

          `ACQ_WAIT_SIG(clk_i, out_vld_o)


          if (opcode_tmp[0] == 1'b1)
            act = $signed(res_o);
          else
            act = $unsigned(res_o);

            opStr="/";


        end else if(opcode_i[1] == 1'b1) begin

          res = op_a_tmp % op_b_tmp;

          if((op_b_tmp == 0)) begin
            res = op_a_tmp;
          end

          `ACQ_WAIT_SIG(clk_i, out_vld_o)


          if (opcode_tmp[0] == 1'b1)
            act = $signed(res_o);
          else
            act = $unsigned(res_o);

          opStr="\%";
        end

        ok = (res==act);

        if(VERBOSE | !ok) begin
            if(!ok) tmpstr =  $psprintf("vector: %04d> %d %s %d = %d != %d -> error!", acqCnt, op_a_tmp, opStr, op_b_tmp, res, act);
            else    tmpstr =  $psprintf("vector: %04d> %d %s %d = %d == %d "         , acqCnt, op_a_tmp, opStr, op_b_tmp, res, act);
            $display("TB> %s", tmpstr);
        end

        if(!ok) begin
          failingTests = $psprintf("%sTB> %s\n", failingTests, tmpstr);
        end

        status.addRes(!ok);
        status.print();


        acqCnt++;
      end
      while (acqCnt < num_stim);
    end


    status.printToFile("summary.rep", 1);

    if(status.totErrCnt == 0) begin
        $display("TB> ----------------------------------------------------------------------");
        $display("TB> PASSED %0d VECTORS", status.totAcqCnt);
        $display("TB> ----------------------------------------------------------------------\n");
    end else begin
        $display("TB> ----------------------------------------------------------------------\n");
        $display("TB> FAILED %0d OF %0d VECTORS\n" , status.totErrCnt, status.totAcqCnt);
        $display("TB> failing tests:");
        $display("TB", failingTests);
        $display("TB> ----------------------------------------------------------------------\n");
    end

    end_of_sim <= 1;
    $finish();

  end

endmodule
module tb;







  timeunit 1ps;
  timeprecision 1ps;

  parameter                          VERBOSE   = 1;
  parameter                          WIDTH     = 64;
  parameter logic        [WIDTH-1:0] MAX_NUM64 = '1;
  parameter logic        [WIDTH-2:0] MAX_NUM63 = '1;
  parameter logic signed [WIDTH-1:0] MIN_NUM   = {1'b1,{WIDTH-1{1'b0}}};






  logic signed [WIDTH:0]      op_a, op_b;
  logic signed [WIDTH:0]      op_a_tmp, op_b_tmp;

  logic                       flush_i;
  logic [TRANS_ID_BITS-1:0]   id_i;
  logic [TRANS_ID_BITS-1:0]   id_o;

  logic [WIDTH-1:0]           op_a_i;
  logic [WIDTH-1:0]           op_b_i;

  logic [1:0]                 opcode_i;
  logic [1:0]                 opcode_tmp;

  logic                       in_rdy_o;
  logic                       in_vld_i;
  logic                       out_rdy_i;
  logic                       out_vld_o;
  logic [WIDTH-1:0]           res_o;





  logic   clk_i, rst_ni;
  logic   stim_start, stim_end, end_of_sim;
  longint num_stim;
  logic   acq_trig;
  string  test_name;





  always @*
  begin
    do begin
      clk_i = 1; #(CLK_HI);
      clk_i = 0; #(CLK_LO);
    end while (end_of_sim == 1'b0);

    clk_i = 1; #(CLK_HI);
    clk_i = 0; #(CLK_LO);
  end







  assign OpBIsZero_SI = ~(|op_b_i);
  serdiv #(.WIDTH(WIDTH)) i_dut (.*);





  initial begin : p_stim
    longint signed k;
    bit randBit;

    stim_start = 0;
    stim_end   = 0;
    num_stim   = 0;
    test_name  = "";
    acq_trig   = 0;

    rst_ni     = 0;

    op_a       = 0;
    op_b       = 0;

    op_a_i      = 0;
    op_b_i      = 0;
    opcode_i   = 0;
    in_vld_i    = 0;
    flush_i    = 0;
    id_i  = 0;

    `APPL_WAIT_CYC(clk_i, 100)

    rst_ni <= 1'b1;

    `APPL_WAIT_CYC(clk_i, 100)

    $display("TB> stimuli application started");
    stim_start <= 1'b1;
    `APPL_WAIT_CYC(clk_i, 100)




    `include "tb_udiv.sv"




    `include "tb_urem.sv"




    `include "tb_div.sv"




    `include "tb_rem.sv"



    `APPL_WAIT_CYC(clk_i, 400)

    stim_end <= 1;
    $display("TB> stimuli application ended");

  end







  initial begin : p_acq




    bit ok;
    string opStr;
    progress status;
    string failingTests, tmpstr;
    longint acqCnt, res, act;

    status       = new("TB");
    failingTests = "";

    out_rdy_i  = 0;
    end_of_sim = 0;

    `ACQ_WAIT_SIG(clk_i, stim_start)

    $display("TB> response acquisition started");




    repeat(4) begin


      do begin
        `ACQ_WAIT_CYC(clk_i, 1)
        if (stim_end == 1) begin
          end_of_sim <= 1;
          $display("response acquisition ended");
          $finish();
        end
      end while(acq_trig == 1'b0);

      acqCnt = 0;

      $display("");
      $display("TB> ----------------------------------------------------------------------");
      $display("TB> %s", test_name);
      $display("TB> ----------------------------------------------------------------------\n");
      $display("");

      $display("TB> checking %00d vectors",num_stim);
      $display("");
      status.reset(num_stim);

      do begin



        out_rdy_i = 1'b1;

        `ACQ_WAIT_SIG(clk_i, in_vld_i)

        opcode_tmp = opcode_i;
        op_a_tmp    = op_a;
        op_b_tmp    = op_b;



        if(opcode_i[1] == 1'b0) begin

          res = op_a_tmp/op_b_tmp;

          if((op_b_tmp == 0) && (opcode_i[0] == 0)) begin
            res = MAX_NUM64;
          end else if ((op_b_tmp == 0) && (opcode_i[0] == 1'b1)) begin
            res = -1;
          end else if ((op_a_tmp == MIN_NUM)  && (op_b_tmp == -1) && (opcode_i[0] == 1'b1)) begin
            res = MIN_NUM;
          end

          `ACQ_WAIT_SIG(clk_i, out_vld_o)


          if (opcode_tmp[0] == 1'b1)
            act = $signed(res_o);
          else
            act = $unsigned(res_o);

            opStr="/";


        end else if(opcode_i[1] == 1'b1) begin

          res = op_a_tmp % op_b_tmp;

          if((op_b_tmp == 0)) begin
            res = op_a_tmp;
          end

          `ACQ_WAIT_SIG(clk_i, out_vld_o)


          if (opcode_tmp[0] == 1'b1)
            act = $signed(res_o);
          else
            act = $unsigned(res_o);

          opStr="\%";
        end

        ok = (res==act);

        if(VERBOSE | !ok) begin
            if(!ok) tmpstr =  $psprintf("vector: %04d> %d %s %d = %d != %d -> error!", acqCnt, op_a_tmp, opStr, op_b_tmp, res, act);
            else    tmpstr =  $psprintf("vector: %04d> %d %s %d = %d == %d "         , acqCnt, op_a_tmp, opStr, op_b_tmp, res, act);
            $display("TB> %s", tmpstr);
        end

        if(!ok) begin
          failingTests = $psprintf("%sTB> %s\n", failingTests, tmpstr);
        end

        status.addRes(!ok);
        status.print();


        acqCnt++;
      end
      while (acqCnt < num_stim);
    end


    status.printToFile("summary.rep", 1);

    if(status.totErrCnt == 0) begin
        $display("TB> ----------------------------------------------------------------------");
        $display("TB> PASSED %0d VECTORS", status.totAcqCnt);
        $display("TB> ----------------------------------------------------------------------\n");
    end else begin
        $display("TB> ----------------------------------------------------------------------\n");
        $display("TB> FAILED %0d OF %0d VECTORS\n" , status.totErrCnt, status.totAcqCnt);
        $display("TB> failing tests:");
        $display("TB", failingTests);
        $display("TB> ----------------------------------------------------------------------\n");
    end

    end_of_sim <= 1;
    $finish();

  end

endmodule