data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv
1: b'%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:116: Operator MODDIV expects 64 bits on the RHS, but RHS\'s VARREF \'i\' generates 32 bits.\n                                                                                                                                          : ... In instance sub_per_hash\n          index = rand_number % i;\n                              ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:120: Bit extraction of array[10:0] requires 4 bit index, not 64 bits.\n                                                                                                                                          : ... In instance sub_per_hash\n          perm_array[r][i]     = perm_array[r][index];\n                                              ^\n%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:121: Bit extraction of array[10:0] requires 4 bit index, not 64 bits.\n                                                                                                                                          : ... In instance sub_per_hash\n          perm_array[r][index] = indices[r][i];\n                       ^\n%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:119: Operator NEQ expects 64 bits on the LHS, but LHS\'s VARREF \'i\' generates 32 bits.\n                                                                                                                                          : ... In instance sub_per_hash\n        if (i != index) begin\n              ^~\n%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:126: Operator MODDIV expects 64 bits on the RHS, but RHS\'s VARREF \'NoRounds\' generates 32 bits.\n                                                                                                                                          : ... In instance sub_per_hash\n      advance     = rand_number % NoRounds;\n                                ^\n%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:127: Operator LT expects 64 bits on the LHS, but LHS\'s VARREF \'i\' generates 32 bits.\n                                                                                                                                          : ... In instance sub_per_hash\n      for (int unsigned i = 0; i < advance; i++) begin\n                                 ^\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:54: Expecting expression to be constant, but can\'t determine constant for FUNCREF \'get_permutations\'\n                                                                                                                                 : ... In instance sub_per_hash\n        data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:109: ... Location of non-constant ASSIGN: Array select LHS isn\'t simple variable\n        data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:54: ... Called from get_permutations() with parameters:\n           seed = 32\'h11d2e881\n  localparam perm_lists_t PERMUTATIONS = get_permutations(PermuteKey);\n                                         ^~~~~~~~~~~~~~~~\n%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:160: Operator MODDIV expects 64 bits on the RHS, but RHS\'s VARREF \'InpWidth\' generates 32 bits.\n                                                                                                                                          : ... In instance sub_per_hash\n          index = rand_number % InpWidth;\n                              ^\n%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:161: Operator ASSIGN expects 32 bits on the Assign RHS, but Assign RHS\'s VARREF \'index\' generates 64 bits.\n                                                                                                                                          : ... In instance sub_per_hash\n          xor_array[r][i][j] = index;\n                             ^\n%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:166: Operator MODDIV expects 64 bits on the RHS, but RHS\'s VARREF \'NoRounds\' generates 32 bits.\n                                                                                                                                          : ... In instance sub_per_hash\n      advance     = rand_number % NoRounds;\n                                ^\n%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:167: Operator LT expects 64 bits on the LHS, but LHS\'s VARREF \'i\' generates 32 bits.\n                                                                                                                                          : ... In instance sub_per_hash\n      for (int unsigned i = 0; i < advance; i++) begin\n                                 ^\n%Error: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:59: Expecting expression to be constant, but can\'t determine constant for FUNCREF \'get_xor_stages\'\n                                                                                                                                 : ... In instance sub_per_hash\n        data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:161: ... Location of non-constant ASSIGN: Array select LHS isn\'t simple variable\n        data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/src/common_cells/src/sub_per_hash.sv:59: ... Called from get_xor_stages() with parameters:\n           seed = 32\'h3e7b72\n  localparam xor_stages_t XOR_STAGES = get_xor_stages(XorKey);\n                                       ^~~~~~~~~~~~~~\n%Error: Exiting due to 2 error(s), 10 warning(s)\n'
function automatic perm_lists_t get_permutations(input int unsigned seed);
    perm_lists_t indices;
    perm_lists_t perm_array;
    longint unsigned A = 2147483629;
    longint unsigned C = 2147483587;
    longint unsigned M = 2**31 - 1;
    longint unsigned index   = 0;
    longint unsigned advance = 0;
    longint unsigned rand_number = (A * seed + C) % M;


    for (int unsigned r = 0; r < NoRounds; r++) begin

      for (int unsigned i = 0; i < InpWidth; i++) begin
        indices[r][i] = i;
      end

      for (int unsigned i = 0; i < InpWidth; i++) begin

        if (i > 0) begin
          rand_number = (A * rand_number + C) % M;
          index = rand_number % i;
        end

        if (i != index) begin
          perm_array[r][i]     = perm_array[r][index];
          perm_array[r][index] = indices[r][i];
        end
      end

      rand_number = (A * rand_number + C) % M;
      advance     = rand_number % NoRounds;
      for (int unsigned i = 0; i < advance; i++) begin
        rand_number = (A * rand_number + C) % M;
      end
    end
    return perm_array;
  endfunction
function automatic perm_lists_t get_permutations(input int unsigned seed);

    perm_lists_t indices;
    perm_lists_t perm_array;
    longint unsigned A = 2147483629;
    longint unsigned C = 2147483587;
    longint unsigned M = 2**31 - 1;
    longint unsigned index   = 0;
    longint unsigned advance = 0;
    longint unsigned rand_number = (A * seed + C) % M;


    for (int unsigned r = 0; r < NoRounds; r++) begin

      for (int unsigned i = 0; i < InpWidth; i++) begin
        indices[r][i] = i;
      end

      for (int unsigned i = 0; i < InpWidth; i++) begin

        if (i > 0) begin
          rand_number = (A * rand_number + C) % M;
          index = rand_number % i;
        end

        if (i != index) begin
          perm_array[r][i]     = perm_array[r][index];
          perm_array[r][index] = indices[r][i];
        end
      end

      rand_number = (A * rand_number + C) % M;
      advance     = rand_number % NoRounds;
      for (int unsigned i = 0; i < advance; i++) begin
        rand_number = (A * rand_number + C) % M;
      end
    end
    return perm_array;
  endfunction