aboutsummaryrefslogblamecommitdiff
path: root/src/tb/tb_modexp_autogenerated.v
blob: a71670e34598a2e5f03b382a71dc6ef1b349de91 (plain) (tree)



















































                                                                        
                      


























































































































                                                                                               

                                                                                                  










































































































































































































































































                                                                                                               








































                                                                                                 


                                                                                                                                                        
                        
             






























                                                                                                 


                                                                                                                                                        
                        
             






























                                                                                                 


                                                                                                                                                        
                        
             






























                                                                                                 


                                                                                                                                                        
                        
             






























                                                                                                 


                                                                                                                                                        
                        
             






























                                                                                                 


                                                                                                                                                        
                        
             






























                                                                                                 


                                                                                                                                                        
                        
             






























                                                                                                 


                                                                                                                                                        
                        
             






























                                                                                                 


                                                                                                                                                        
                        
             






























                                                                                                 


                                                                                                                                                        
                        
             



























                                                                                                 

                                                                                                                                                        
                        
             



























                                                                                                 

                                                                                                                                                        
                        
             



























                                                                                                 

                                                                                                                                                        
                        
             



























                                                                                                 

                                                                                                                                                        
                        
             



























                                                                                                 

                                                                                                                                                        
                        
             



























                                                                                                 

                                                                                                                                                        
                        
             



























                                                                                                 

                                                                                                                                                        
                        
             



























                                                                                                 

                                                                                                                                                        
                        
             



























                                                                                                 

                                                                                                                                                        
                        
             



























                                                                                                 

                                                                                                                                                        
                        
             




































                                                                                                 




                                                                                                                                                        
                        
             




































                                                                                                 




                                                                                                                                                        
                        
             




































                                                                                                 




                                                                                                                                                        
                        
             




































                                                                                                 




                                                                                                                                                        
                        
             




































                                                                                                 




                                                                                                                                                        
                        
             




































                                                                                                 




                                                                                                                                                        
                        
             




































                                                                                                 




                                                                                                                                                        
                        
             




































                                                                                                 




                                                                                                                                                        
                        
             




































                                                                                                 




                                                                                                                                                        
                        
             




































                                                                                                 




                                                                                                                                                        
                        
             








































































                                                                                                 
















                                                                                                                                                        
                        
             








































































                                                                                                 
















                                                                                                                                                        
                        
             
























































































































                                                                                                 
































                                                                                                                                                        
                        
             
























































































































































































































                                                                                                 
































































                                                                                                                                                        
                        
             








                                                                                              





































                                                                    













                                           











                                                                        
//======================================================================
//
// tb_modexp_autogenerated.v
// -----------
// Testbench modular exponentiation core.
//
//
// Author: Joachim Strombergson, Peter Magnusson
// Copyright (c) 2015, Assured AB
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// conditions are met:
//
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in
//    the documentation and/or other materials provided with the
//    distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//======================================================================

//------------------------------------------------------------------
// Simulator directives.
//------------------------------------------------------------------
`timescale 1ns/100ps


//------------------------------------------------------------------
// Test module.
//------------------------------------------------------------------
module tb_modexp_autogenerated();

  //----------------------------------------------------------------
  // Internal constant and parameter definitions.
  //----------------------------------------------------------------
  parameter DEBUG = 0;

  localparam CLK_HALF_PERIOD = 1;
  localparam CLK_PERIOD      = 2 * CLK_HALF_PERIOD;

  // The DUT address map.
  localparam GENERAL_PREFIX      = 4'h0;
  localparam ADDR_NAME0          = 8'h00;
  localparam ADDR_NAME1          = 8'h01;
  localparam ADDR_VERSION        = 8'h02;

  localparam ADDR_CTRL           = 8'h08;
  localparam CTRL_START_BIT      = 0;

  localparam ADDR_STATUS         = 8'h09;
  localparam STATUS_READY_BIT    = 0;

  localparam ADDR_MODULUS_LENGTH  = 8'h20;
  localparam ADDR_MESSAGE_LENGTH  = 8'h21;
  localparam ADDR_EXPONENT_LENGTH = 8'h22;

  localparam MODULUS_PREFIX      = 4'h1;
  localparam ADDR_MODULUS_START  = 8'h00;
  localparam ADDR_MODULUS_END    = 8'hff;

  localparam EXPONENT_PREFIX     = 4'h2;
  localparam ADDR_EXPONENT_START = 8'h00;
  localparam ADDR_EXPONENT_END   = 8'hff;

  localparam MESSAGE_PREFIX      = 4'h3;
  localparam MESSAGE_START       = 8'h00;
  localparam MESSAGE_END         = 8'hff;

  localparam RESULT_PREFIX       = 4'h4;
  localparam RESULT_START        = 8'h00;
  localparam RESULT_END          = 8'hff;


  //----------------------------------------------------------------
  // Register and Wire declarations.
  //----------------------------------------------------------------
  reg [31 : 0]  cycle_ctr;
  reg [31 : 0]  error_ctr;
  reg [31 : 0]  tc_ctr;

  reg [31 : 0]  read_data;
  reg [127 : 0] result_data;

  reg           tb_clk;
  reg           tb_reset_n;
  reg           tb_cs;
  reg           tb_we;
  reg [11  : 0] tb_address;
  reg [31 : 0]  tb_write_data;
  wire [31 : 0] tb_read_data;
  wire          tb_error;


  //----------------------------------------------------------------
  // Device Under Test.
  //----------------------------------------------------------------
  modexp dut(
             .clk(tb_clk),
             .reset_n(tb_reset_n),
             .cs(tb_cs),
             .we(tb_we),
             .address(tb_address),
             .write_data(tb_write_data),
             .read_data(tb_read_data)
            );


  //----------------------------------------------------------------
  // clk_gen
  //
  // Always running clock generator process.
  //----------------------------------------------------------------
  always
    begin : clk_gen
      #CLK_HALF_PERIOD;
      tb_clk = !tb_clk;
    end // clk_gen


  //----------------------------------------------------------------
  // sys_monitor()
  //
  // An always running process that creates a cycle counter and
  // conditionally displays information about the DUT.
  //----------------------------------------------------------------
  always
    begin : sys_monitor
      cycle_ctr = cycle_ctr + 1;

      #(CLK_PERIOD);

      if (DEBUG)
        begin
          dump_dut_state();
        end
    end


  //----------------------------------------------------------------
  // dump_dut_state()
  //
  // Dump the state of the dump when needed.
  //----------------------------------------------------------------
  task dump_dut_state();
    begin
      $display("cycle: 0x%016x", cycle_ctr);
      $display("State of DUT");
      $display("------------");
      $display("Inputs and outputs:");
      $display("cs   = 0x%01x, we = 0x%01x", tb_cs, tb_we);
      $display("addr = 0x%08x, read_data = 0x%08x, write_data = 0x%08x",
               tb_address, tb_read_data, tb_write_data);
      $display("");

      $display("State:");
      $display("ready_reg = 0x%01x, start_reg = 0x%01x, start_new = 0x%01x, start_we = 0x%01x",
               dut.ready_reg, dut.start_reg, dut.start_new, dut.start_we);
      $display("residue_valid = 0x%01x", dut.residue_valid_reg);
      $display("loop_counter_reg = 0x%08x", dut.loop_counter_reg);
      $display("exponent_length_reg = 0x%02x, modulus_length_reg = 0x%02x length_m1_reg = 0x%02x",
               dut.exponent_length_reg, dut.modulus_length_reg, dut.length_m1_reg);
      $display("ctrl_reg = 0x%04x", dut.modexp_ctrl_reg);
      $display("");
    end
  endtask // dump_dut_state


  //----------------------------------------------------------------
  // reset_dut()
  //
  // Toggle reset to put the DUT into a well known state.
  //----------------------------------------------------------------
  task reset_dut();
    begin
      $display("*** Toggle reset.");
      tb_reset_n = 0;

      #(2 * CLK_PERIOD);
      tb_reset_n = 1;
      $display("");
    end
  endtask // reset_dut


  //----------------------------------------------------------------
  // display_test_results()
  //
  // Display the accumulated test results.
  //----------------------------------------------------------------
  task display_test_results();
    begin
      if (error_ctr == 0)
        begin
          $display("*** All %02d test cases completed successfully", tc_ctr);
        end
      else
        begin
          $display("*** %02d tests completed - %02d test cases did not complete successfully.",
                   tc_ctr, error_ctr);
        end
    end
  endtask // display_test_results


  //----------------------------------------------------------------
  // init_sim()
  //
  // Initialize all counters and testbed functionality as well
  // as setting the DUT inputs to defined values.
  //----------------------------------------------------------------
  task init_sim();
    begin
      cycle_ctr          = 0;
      error_ctr          = 0;
      tc_ctr             = 0;

      tb_clk             = 0;
      tb_reset_n         = 1;

      tb_cs              = 0;
      tb_we              = 0;
      tb_address         = 8'h00;
      tb_write_data      = 32'h00000000;
    end
  endtask // init_sim


  //----------------------------------------------------------------
  // read_word()
  //
  // Read a data word from the given address in the DUT.
  // the word read will be available in the global variable
  // read_data.
  //----------------------------------------------------------------
  task read_word(input [11 : 0] address);
    begin
      tb_address = address;
      tb_cs = 1;
      tb_we = 0;
      #(CLK_PERIOD);
      read_data = tb_read_data;
      tb_cs = 0;

      if (DEBUG)
        begin
          $display("*** (read_word) Reading 0x%08x from 0x%02x.", read_data, address);
          $display("");
        end
    end
  endtask // read_word


  //----------------------------------------------------------------
  // write_word()
  //
  // Write the given word to the DUT using the DUT interface.
  //----------------------------------------------------------------
  task write_word(input [11 : 0] address,
                  input [31 : 0] word);
    begin
      if (DEBUG)
        begin
          $display("*** (write_word) Writing 0x%08x to 0x%02x.", word, address);
          $display("");
        end

      tb_address = address;
      tb_write_data = word;
      tb_cs = 1;
      tb_we = 1;
      #(2 * CLK_PERIOD);
      tb_cs = 0;
      tb_we = 0;
    end
  endtask // write_word


  //----------------------------------------------------------------
  // wait_ready()
  //
  // Wait until the ready flag in the core is set.
  //----------------------------------------------------------------
  task wait_ready();
    begin
      while (tb_read_data != 32'h00000001)
          read_word({GENERAL_PREFIX, ADDR_STATUS});

      if (DEBUG)
        $display("*** (wait_ready) Ready flag has been set.");
    end
  endtask // wait_ready


  //----------------------------------------------------------------
  // dump_message_mem()
  //
  // Dump the contents of the message memory.
  //----------------------------------------------------------------
  task dump_message_mem();
    reg [8 : 0] i;
    begin
      $display("Contents of the message memory:");
      for (i = 0 ; i < 256 ; i = i + 8)
        begin
          $display("message_mem[0x%02x .. 0x%02x] = 0x%08x 0x%08x 0x%08x 0x%08x  0x%08x 0x%08x 0x%08x 0x%08x",
                   i[7 : 0], (i[7 : 0] + 8'h07),
                   dut.message_mem.mem[(i[7 : 0] + 0)], dut.message_mem.mem[(i[7 : 0] + 1)],
                   dut.message_mem.mem[(i[7 : 0] + 2)], dut.message_mem.mem[(i[7 : 0] + 3)],
                   dut.message_mem.mem[(i[7 : 0] + 4)], dut.message_mem.mem[(i[7 : 0] + 5)],
                   dut.message_mem.mem[(i[7 : 0] + 6)], dut.message_mem.mem[(i[7 : 0] + 7)],
                   );
        end
      $display("");
    end
  endtask // dump_message_mem


  //----------------------------------------------------------------
  // dump_exponent_mem()
  //
  // Dump the contents of the exponent memory.
  //----------------------------------------------------------------
  task dump_exponent_mem();
    reg [8 : 0] i;
    begin
      $display("Contents of the exponent memory:");
      for (i = 0 ; i < 256 ; i = i + 8)
        begin
          $display("exponent_mem[0x%02x .. 0x%02x] = 0x%08x 0x%08x 0x%08x 0x%08x  0x%08x 0x%08x 0x%08x 0x%08x",
                   i[7 : 0], (i[7 : 0] + 8'h07),
                   dut.exponent_mem.mem[(i[7 : 0] + 0)], dut.exponent_mem.mem[(i[7 : 0] + 1)],
                   dut.exponent_mem.mem[(i[7 : 0] + 2)], dut.exponent_mem.mem[(i[7 : 0] + 3)],
                   dut.exponent_mem.mem[(i[7 : 0] + 4)], dut.exponent_mem.mem[(i[7 : 0] + 5)],
                   dut.exponent_mem.mem[(i[7 : 0] + 6)], dut.exponent_mem.mem[(i[7 : 0] + 7)],
                   );
        end
      $display("");
    end
  endtask // dump_exponent_mem


  //----------------------------------------------------------------
  // dump_modulus_mem()
  //
  // Dump the contents of the modulus memory.
  //----------------------------------------------------------------
  task dump_modulus_mem();
    reg [8 : 0] i;
    begin
      $display("Contents of the modulus memory:");
      for (i = 0 ; i < 256 ; i = i + 8)
        begin
          $display("modulus_mem[0x%02x .. 0x%02x] = 0x%08x 0x%08x 0x%08x 0x%08x  0x%08x 0x%08x 0x%08x 0x%08x",
                   i[7 : 0], (i[7 : 0] + 8'h07),
                   dut.modulus_mem.mem[(i[7 : 0] + 0)], dut.modulus_mem.mem[(i[7 : 0] + 1)],
                   dut.modulus_mem.mem[(i[7 : 0] + 2)], dut.modulus_mem.mem[(i[7 : 0] + 3)],
                   dut.modulus_mem.mem[(i[7 : 0] + 4)], dut.modulus_mem.mem[(i[7 : 0] + 5)],
                   dut.modulus_mem.mem[(i[7 : 0] + 6)], dut.modulus_mem.mem[(i[7 : 0] + 7)],
                   );
        end
      $display("");
    end
  endtask // dump_modulus_mem


  //----------------------------------------------------------------
  // dump_residue_mem()
  //
  // Dump the contents of the residue memory.
  //----------------------------------------------------------------
  task dump_residue_mem();
    reg [8 : 0] i;
    begin
      $display("Contents of the residue memory:");
      for (i = 0 ; i < 256 ; i = i + 8)
        begin
          $display("residue_mem[0x%02x .. 0x%02x] = 0x%08x 0x%08x 0x%08x 0x%08x  0x%08x 0x%08x 0x%08x 0x%08x",
                   i[7 : 0], (i[7 : 0] + 8'h07),
                   dut.residue_mem.mem[(i[7 : 0] + 0)], dut.residue_mem.mem[(i[7 : 0] + 1)],
                   dut.residue_mem.mem[(i[7 : 0] + 2)], dut.residue_mem.mem[(i[7 : 0] + 3)],
                   dut.residue_mem.mem[(i[7 : 0] + 4)], dut.residue_mem.mem[(i[7 : 0] + 5)],
                   dut.residue_mem.mem[(i[7 : 0] + 6)], dut.residue_mem.mem[(i[7 : 0] + 7)],
                   );
        end
      $display("");
    end
  endtask // dump_residue_mem


  //----------------------------------------------------------------
  // dump_result_mem()
  //
  // Dump the contents of the result memory.
  //----------------------------------------------------------------
  task dump_result_mem();
    reg [8 : 0] i;
    begin
      $display("Contents of the result memory:");
      for (i = 0 ; i < 256 ; i = i + 8)
        begin
          $display("result_mem[0x%02x .. 0x%02x] = 0x%08x 0x%08x 0x%08x 0x%08x  0x%08x 0x%08x 0x%08x 0x%08x",
                   i[7 : 0], (i[7 : 0] + 8'h07),
                   dut.result_mem.mem[(i[7 : 0] + 0)], dut.result_mem.mem[(i[7 : 0] + 1)],
                   dut.result_mem.mem[(i[7 : 0] + 2)], dut.result_mem.mem[(i[7 : 0] + 3)],
                   dut.result_mem.mem[(i[7 : 0] + 4)], dut.result_mem.mem[(i[7 : 0] + 5)],
                   dut.result_mem.mem[(i[7 : 0] + 6)], dut.result_mem.mem[(i[7 : 0] + 7)],
                   );
        end
      $display("");
    end
  endtask // dump_result_mem


  //----------------------------------------------------------------
  // dump_memories()
  //
  // Dump the contents of the memories in the dut.
  //----------------------------------------------------------------
  task dump_memories();
    begin
      dump_message_mem();
      dump_exponent_mem();
      dump_modulus_mem();
      dump_residue_mem();
      dump_result_mem();
    end
  endtask // dump_memories

  function assertEquals(
      input [31:0] expected,
      input [31:0] actual
    );
    begin
      if (expected === actual)
        begin
          assertEquals = 1; // success
        end
      else
        begin
          $display("Expected: 0x%08x, got 0x%08x", expected, actual);
          assertEquals = 0; // failure
        end
    end
  endfunction // assertEquals

  integer success;


  task autogenerated_BASIC_M4962768465676381896();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M4962768465676381896");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h946473e1); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h0e85e74f); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h70754797); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000002); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000002); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h00000000, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h7761ed4f, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M4962768465676381896 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M4962768465676381896 success.");
    end
  endtask // autogenerated_BASIC_M4962768465676381896



  task autogenerated_BASIC_8982867242010371843();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_8982867242010371843");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h6eb4ac2d); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'hbb200e41); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h27347dc3); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000002); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000002); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h00000000, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h87d16204, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_8982867242010371843 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_8982867242010371843 success.");
    end
  endtask // autogenerated_BASIC_8982867242010371843



  task autogenerated_BASIC_5090788032873075449();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_5090788032873075449");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h9e504a03); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h9bc057ef); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'hc8b53fe5); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000002); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000002); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h00000001, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'hc1a6494c, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_5090788032873075449 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_5090788032873075449 success.");
    end
  endtask // autogenerated_BASIC_5090788032873075449



  task autogenerated_BASIC_8448510918869952728();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_8448510918869952728");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h73f7b309); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h91c10f7f); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h4be322c9); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000002); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000002); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h00000000, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h9a155286, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_8448510918869952728 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_8448510918869952728 success.");
    end
  endtask // autogenerated_BASIC_8448510918869952728



  task autogenerated_BASIC_4036237668019554146();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_4036237668019554146");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'hd0f3961d); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'hcdbc9c9d); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h30367d5b); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000002); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000002); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h00000001, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h15a9c15d, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_4036237668019554146 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_4036237668019554146 success.");
    end
  endtask // autogenerated_BASIC_4036237668019554146



  task autogenerated_BASIC_M8925041444689012509();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M8925041444689012509");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h34130e17); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'hf45e52c9); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h9cb5c68d); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000002); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000002); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h00000000, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h7c129d37, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M8925041444689012509 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M8925041444689012509 success.");
    end
  endtask // autogenerated_BASIC_M8925041444689012509



  task autogenerated_BASIC_M5713608137760059379();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M5713608137760059379");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h77505dbd); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'hdb808627); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'had1fed09); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000002); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000002); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h00000001, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h842cd733, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M5713608137760059379 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M5713608137760059379 success.");
    end
  endtask // autogenerated_BASIC_M5713608137760059379



  task autogenerated_BASIC_6816968587684568101();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_6816968587684568101");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h3272b6ef); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h2cb6c09b); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'hefbc64fd); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000002); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000002); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h00000001, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h59c3b603, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_6816968587684568101 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_6816968587684568101 success.");
    end
  endtask // autogenerated_BASIC_6816968587684568101



  task autogenerated_BASIC_4168013900853404774();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_4168013900853404774");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h3c20bbcf); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'ha495d8ab); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h75ddb9ef); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000002); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000002); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h00000001, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h1413eac7, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_4168013900853404774 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_4168013900853404774 success.");
    end
  endtask // autogenerated_BASIC_4168013900853404774



  task autogenerated_BASIC_M8394821325674331878();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M8394821325674331878");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h93d3d0d3); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h43c2dfef); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h00000001); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h7443cbf1); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000002); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000002); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h00000000, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'hc2eda7c3, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M8394821325674331878 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M8394821325674331878 success.");
    end
  endtask // autogenerated_BASIC_M8394821325674331878



  task autogenerated_BASIC_M2919828800172604435();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M2919828800172604435");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h3d746ec5); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h3f7ea6d5); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h29b6675f); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000001); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h040c43d8, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M2919828800172604435 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M2919828800172604435 success.");
    end
  endtask // autogenerated_BASIC_M2919828800172604435



  task autogenerated_BASIC_4770912732078070597();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_4770912732078070597");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h200c0f45); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h24774bab); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h234ca073); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000001); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h14505436, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_4770912732078070597 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_4770912732078070597 success.");
    end
  endtask // autogenerated_BASIC_4770912732078070597



  task autogenerated_BASIC_3593487472385409519();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_3593487472385409519");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h248819d1); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h2ad2b6ed); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h269cc6bf); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000001); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h0f09d466, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_3593487472385409519 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_3593487472385409519 success.");
    end
  endtask // autogenerated_BASIC_3593487472385409519



  task autogenerated_BASIC_4981749054780354961();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_4981749054780354961");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h27bec4e7); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h36fe540f); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h25a46d61); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000001); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h0bab2269, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_4981749054780354961 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_4981749054780354961 success.");
    end
  endtask // autogenerated_BASIC_4981749054780354961



  task autogenerated_BASIC_7702189670289360961();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_7702189670289360961");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h302def29); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h25b9c233); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h33af5461); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000001); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h0229dc08, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_7702189670289360961 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_7702189670289360961 success.");
    end
  endtask // autogenerated_BASIC_7702189670289360961



  task autogenerated_BASIC_M5169634701858105792();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M5169634701858105792");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h240d8cf5); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h2a6a7381); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h3471d1e9); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000001); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h244dec19, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M5169634701858105792 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M5169634701858105792 success.");
    end
  endtask // autogenerated_BASIC_M5169634701858105792



  task autogenerated_BASIC_6469444563916025786();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_6469444563916025786");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h3cc9270b); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h27858fdd); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h21e65001); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000001); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h17200d8c, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_6469444563916025786 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_6469444563916025786 success.");
    end
  endtask // autogenerated_BASIC_6469444563916025786



  task autogenerated_BASIC_M2453278165832221565();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M2453278165832221565");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h30ca6ceb); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h212c387b); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h2e07a7bb); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000001); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h0fc15a1f, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M2453278165832221565 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M2453278165832221565 success.");
    end
  endtask // autogenerated_BASIC_M2453278165832221565



  task autogenerated_BASIC_M1847183855567461116();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M1847183855567461116");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h3d02c5a1); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h35f12b45); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h32f0b03f); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000001); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h2340f96f, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M1847183855567461116 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M1847183855567461116 success.");
    end
  endtask // autogenerated_BASIC_M1847183855567461116



  task autogenerated_BASIC_M7037130911981370263();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M7037130911981370263");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h2692d1cd); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h3b21ef8d); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h2042c76d); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000001); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h1b753aea, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M7037130911981370263 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M7037130911981370263 success.");
    end
  endtask // autogenerated_BASIC_M7037130911981370263



  task autogenerated_BASIC_5073338267670769216();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_5073338267670769216");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h3028983f); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'hdc9bdc25); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'ha3fdfeda); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'h283f4463); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h29493211); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'hc4252db0); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'h7775443d); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'h13e1d929); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h2fb9ba2f); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'ha485d5f7); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'h3c6652c9); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'h670fdbfd); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000004); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000004); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h2f45cdd6, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h23f0e6f2, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'haa4bd5d8, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'h6297da06, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_5073338267670769216 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_5073338267670769216 success.");
    end
  endtask // autogenerated_BASIC_5073338267670769216



  task autogenerated_BASIC_M1841989679506188752();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M1841989679506188752");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h29462882); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h12caa2d5); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'hb80e1c66); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'h1006807f); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h3285c343); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h2acbcb0f); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'h4d023228); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'h2ecc73db); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h267d2f2e); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h51c216a7); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'hda752ead); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'h48d22d89); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000004); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000004); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h0ddc404d, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h91600596, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'h7425a8d8, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'ha066ca56, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M1841989679506188752 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M1841989679506188752 success.");
    end
  endtask // autogenerated_BASIC_M1841989679506188752



  task autogenerated_BASIC_M3339729654500648482();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M3339729654500648482");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h2963efb9); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'hc6f5d260); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'ha2d0fe74); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'h49726b57); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h2f55c103); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'hbace4bf1); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'h2ab9fac2); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'h30aec7d3); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h376cf9ae); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'hd9e988e8); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'hbd995f5c); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'hdeec42f5); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000004); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000004); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h0ce8cff7, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h9f564e2c, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'h1b61e3d9, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'h717db9ef, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M3339729654500648482 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M3339729654500648482 success.");
    end
  endtask // autogenerated_BASIC_M3339729654500648482



  task autogenerated_BASIC_M6837928193394880512();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M6837928193394880512");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h2a9283cc); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h5999f49d); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'hf8cf6ab2); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'h5f47bf25); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h2c7564a0); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h2d1fcda1); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'h2825318a); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'hae23c271); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h32b892f9); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h096c5ada); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'h43918370); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'h8398c7e3); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000004); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000004); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h27cf8839, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h94004d82, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'ha0d69d86, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'h3f61a929, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M6837928193394880512 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M6837928193394880512 success.");
    end
  endtask // autogenerated_BASIC_M6837928193394880512



  task autogenerated_BASIC_M7333111649825079555();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M7333111649825079555");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h246fa2ec); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h405f234d); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'h39b93e77); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'hf16bcc91); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h2807eb7a); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h646df633); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'heaa95a21); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'h85252adf); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h2cdd3307); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h782e5711); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'h584f179b); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'h011087df); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000004); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000004); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h02d6e42e, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h46e2d304, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'h435170c1, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'h9f344f83, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M7333111649825079555 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M7333111649825079555 success.");
    end
  endtask // autogenerated_BASIC_M7333111649825079555



  task autogenerated_BASIC_480186175131589607();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_480186175131589607");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h300a5cf7); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h269f6369); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'h02e025cb); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'haf16fcfd); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h2cc4b1c0); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h9205a8b4); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'hbc130ee2); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'h923f1f3f); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h2cd376d5); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'hd9e3b080); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'h2533288a); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'hd4b9bb37); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000004); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000004); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h0ae9c475, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'hf4fb4c63, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'hcf2c4f56, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'h902eba0c, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_480186175131589607 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_480186175131589607 success.");
    end
  endtask // autogenerated_BASIC_480186175131589607



  task autogenerated_BASIC_M5239159917778665002();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M5239159917778665002");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h3eaed5af); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'ha287db7e); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'h4ff07fee); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'h9bbda80b); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h3c077d49); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'hf3a131ab); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'h6289042a); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'hc15083cb); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h344b8538); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'hcf4f2576); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'hd28c1c52); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'hc83a8199); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000004); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000004); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h15028046, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h5c12d235, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'h7580fd1b, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'h6bc76b24, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M5239159917778665002 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M5239159917778665002 success.");
    end
  endtask // autogenerated_BASIC_M5239159917778665002



  task autogenerated_BASIC_228752064885223799();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_228752064885223799");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h3904d7ab); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h13937a4f); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'h926856d1); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'h6bdda621); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h3d360083); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'ha50eaf0e); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'hffce2df2); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'hb1f51cef); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h2d32376f); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h205555b3); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'h2c9daf8c); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'he2b7cf81); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000004); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000004); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h08836692, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'he6398828, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'h1eeccd57, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'h2c231153, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_228752064885223799 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_228752064885223799 success.");
    end
  endtask // autogenerated_BASIC_228752064885223799



  task autogenerated_BASIC_856940511857911599();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_856940511857911599");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h23e80223); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h52b700ee); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'h6cb8a294); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'h47c6fac9); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h253cebdb); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'hcc78dcb4); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'h925682b3); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'h490c424b); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h2f2885eb); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h67987cee); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'h717298bd); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'h7a1baf7b); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000004); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000004); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h2bb0b86c, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'hc854652b, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'h2b2bce27, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'hd2595a8e, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_856940511857911599 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_856940511857911599 success.");
    end
  endtask // autogenerated_BASIC_856940511857911599



  task autogenerated_BASIC_M6501553661140603953();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M6501553661140603953");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h287e9711); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h4d346dab); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'h3ff5e6da); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'ha93edebd); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h3658192a); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h4b5fac3f); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'h9a78bc81); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'h5ac8c667); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h238cd95d); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h298ee5e1); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'h320323da); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'h0a46ec21); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000004); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000004); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h0415fef6, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h5fc81702, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'h8be83fd4, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'h4c7fbf24, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M6501553661140603953 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M6501553661140603953 success.");
    end
  endtask // autogenerated_BASIC_M6501553661140603953



  task autogenerated_BASIC_M8496483018338900149();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M8496483018338900149");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h3b4511d5); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h5f61da31); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'h4bf252e0); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'h3962f93c); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h04}, 32'h590171d0); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h05}, 32'hda31097f); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h06}, 32'h0f73fee3); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h07}, 32'h0ba1b379); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h08}, 32'h514b7d8f); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h09}, 32'h1e337cf9); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0a}, 32'h733512ac); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0b}, 32'h4f5b0b52); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0c}, 32'h40762697); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0d}, 32'hb3a30c84); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0e}, 32'h5563b4db); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0f}, 32'h59f7cef1); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h271cb7c4); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h11f07a63); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'h1df850e7); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'h8bf6df66); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h04}, 32'h7bc8fa0e); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h05}, 32'ha51002ce); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h06}, 32'hf16946c5); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h07}, 32'h96916dc7); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h08}, 32'hba1681b1); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h09}, 32'h5ca395ab); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0a}, 32'h7839780d); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0b}, 32'hc5e760c3); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0c}, 32'h578af4f9); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0d}, 32'hffbbbd8c); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0e}, 32'h8576c8fc); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0f}, 32'h518012a7); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h3c0f154d); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h7fc7750a); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'h03eb8968); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'hfbde501a); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h04}, 32'h63848fe5); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h05}, 32'hdcd7d883); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h06}, 32'h5131c9f9); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h07}, 32'ha9ca3399); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h08}, 32'hba581205); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h09}, 32'h4cf86f2a); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0a}, 32'hed928b92); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0b}, 32'h13a0e90f); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0c}, 32'h5b24c81a); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0d}, 32'hf4ac077c); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0e}, 32'h68b8ac70); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0f}, 32'hc58961fd); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000010); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000010); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h30d0a0c1, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h1be7b00f, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'h9ed921c6, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'h7a7f9a87, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h04}); read_data = tb_read_data; success = success & assertEquals(32'hb8ed7f88, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h05}); read_data = tb_read_data; success = success & assertEquals(32'hd81f20d5, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h06}); read_data = tb_read_data; success = success & assertEquals(32'hb3ba9839, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h07}); read_data = tb_read_data; success = success & assertEquals(32'h38dfdfb4, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h08}); read_data = tb_read_data; success = success & assertEquals(32'h70b1927c, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h09}); read_data = tb_read_data; success = success & assertEquals(32'ha4b9487b, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0a}); read_data = tb_read_data; success = success & assertEquals(32'h8d8d7e2c, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0b}); read_data = tb_read_data; success = success & assertEquals(32'hc706e737, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0c}); read_data = tb_read_data; success = success & assertEquals(32'h17e9c280, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0d}); read_data = tb_read_data; success = success & assertEquals(32'hbec0006a, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0e}); read_data = tb_read_data; success = success & assertEquals(32'heea7dc97, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0f}); read_data = tb_read_data; success = success & assertEquals(32'h4f5badc9, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M8496483018338900149 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M8496483018338900149 success.");
    end
  endtask // autogenerated_BASIC_M8496483018338900149



  task autogenerated_BASIC_6145567102166328515();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_6145567102166328515");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h23446522); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h9185c81e); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'h09283a50); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'h82c1f517); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h04}, 32'hd00d3159); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h05}, 32'h846c2c99); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h06}, 32'h261d1dcb); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h07}, 32'hde183d66); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h08}, 32'h98f8a990); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h09}, 32'hd295bd50); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0a}, 32'h09ef8644); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0b}, 32'hadcf9cdb); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0c}, 32'h5eec13a3); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0d}, 32'h92baa627); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0e}, 32'h18caa215); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0f}, 32'h8836480f); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h397f2b38); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'ha95cc0bc); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'hc13b26cf); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'ha20dda3c); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h04}, 32'hf8801c39); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h05}, 32'h00731abe); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h06}, 32'h2ad0afc4); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h07}, 32'hdb247141); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h08}, 32'hc29b5a2d); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h09}, 32'h9e51a3ed); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0a}, 32'hcf364a51); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0b}, 32'h90b761d5); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0c}, 32'hfa0624d3); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0d}, 32'h3a0b27c7); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0e}, 32'ha36bc66c); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0f}, 32'h6423efd3); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h3ad2464f); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h75da362c); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'h6e5c37b4); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'h432cc6b7); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h04}, 32'h6f48b57c); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h05}, 32'hebb87e14); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h06}, 32'h0a3d3f4d); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h07}, 32'hfa4c32c0); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h08}, 32'h165a5892); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h09}, 32'h742f720d); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0a}, 32'h8b4e1b43); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0b}, 32'h281d5390); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0c}, 32'hff2f77dc); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0d}, 32'h698dbc05); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0e}, 32'hdee97a68); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0f}, 32'hde2c176d); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000010); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000010); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h083aa822, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h7c70341a, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'ha2cbc9a8, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'hd116bc41, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h04}); read_data = tb_read_data; success = success & assertEquals(32'h79a81ba7, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h05}); read_data = tb_read_data; success = success & assertEquals(32'h584c91c8, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h06}); read_data = tb_read_data; success = success & assertEquals(32'h5b87c314, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h07}); read_data = tb_read_data; success = success & assertEquals(32'hc5e6f4f9, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h08}); read_data = tb_read_data; success = success & assertEquals(32'h601ebead, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h09}); read_data = tb_read_data; success = success & assertEquals(32'h054bf14b, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0a}); read_data = tb_read_data; success = success & assertEquals(32'h65b48a4a, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0b}); read_data = tb_read_data; success = success & assertEquals(32'hf8aa2700, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0c}); read_data = tb_read_data; success = success & assertEquals(32'ha765ee1d, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0d}); read_data = tb_read_data; success = success & assertEquals(32'hb6c638cd, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0e}); read_data = tb_read_data; success = success & assertEquals(32'h7e529f23, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0f}); read_data = tb_read_data; success = success & assertEquals(32'h0d4adfff, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_6145567102166328515 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_6145567102166328515 success.");
    end
  endtask // autogenerated_BASIC_6145567102166328515



  task autogenerated_BASIC_7216348574014690328();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_7216348574014690328");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h35baa860); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h4e47ad49); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'hc6c4a7c0); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'h7857335b); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h04}, 32'h9b81d24f); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h05}, 32'h7be86e34); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h06}, 32'hf84f7560); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h07}, 32'h484b20db); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h08}, 32'hb83b4f9e); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h09}, 32'h694c6987); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0a}, 32'h7d3232f5); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0b}, 32'h18ee8603); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0c}, 32'h94eca5ef); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0d}, 32'h5179ef69); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0e}, 32'hf6600efb); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0f}, 32'hfc71deab); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h10}, 32'hdb939552); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h11}, 32'h642db1e0); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h12}, 32'h78e11e39); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h13}, 32'h924f0dbd); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h14}, 32'hdb225803); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h15}, 32'h449bbb35); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h16}, 32'hfc40ee05); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h17}, 32'h9b19931c); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h18}, 32'h8b8af884); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h19}, 32'hb5f96476); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1a}, 32'hf97ad419); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1b}, 32'hcc7543f9); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1c}, 32'hce25ed83); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1d}, 32'h94da3499); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1e}, 32'h4f37f331); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1f}, 32'he64e7799); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h3a7570f2); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'h38cb0f2f); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'h2e6c8989); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'hcf7c2665); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h04}, 32'ha0fce3d0); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h05}, 32'h12c7a8eb); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h06}, 32'h40fab1ea); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h07}, 32'h39eb4809); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h08}, 32'h822fa6cc); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h09}, 32'h4ef9d604); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0a}, 32'h2ca1cd3b); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0b}, 32'ha9b23cdb); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0c}, 32'h17e823ce); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0d}, 32'h5fea5198); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0e}, 32'h1ab12946); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0f}, 32'hcec748b5); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h10}, 32'h752a3a6f); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h11}, 32'h73421a9a); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h12}, 32'h7138d7a4); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h13}, 32'ha47327c0); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h14}, 32'h17475543); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h15}, 32'he841c19a); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h16}, 32'h3085410a); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h17}, 32'h06438b4c); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h18}, 32'he0d4b918); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h19}, 32'hfeccca17); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1a}, 32'h9ed86072); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1b}, 32'h86db4a93); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1c}, 32'h60c7d437); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1d}, 32'hcdfe77e3); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1e}, 32'h2631f264); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1f}, 32'h80c9b645); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h34d90901); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'hf192009c); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'hc34f345f); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'h63f592b2); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h04}, 32'haba32d7a); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h05}, 32'h161d1510); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h06}, 32'h2c264dec); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h07}, 32'h07306f1d); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h08}, 32'h3e61c031); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h09}, 32'hacd4eba0); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0a}, 32'hff1318ff); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0b}, 32'h09a78cf4); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0c}, 32'h97bace67); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0d}, 32'hc8fcecf4); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0e}, 32'h3b3901a3); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0f}, 32'h5d447957); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h10}, 32'hc0397708); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h11}, 32'h7e7e48f9); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h12}, 32'h571db58a); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h13}, 32'h80d65921); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h14}, 32'h68a025e0); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h15}, 32'h4f85f776); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h16}, 32'haa8450c7); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h17}, 32'h15c42f52); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h18}, 32'he65507f2); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h19}, 32'hdfeed660); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1a}, 32'h0db8eddb); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1b}, 32'hb1e48d93); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1c}, 32'h7e314a2f); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1d}, 32'hea81ccb1); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1e}, 32'hbe22cc03); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1f}, 32'hf2928621); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000020); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000020); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h14c07087, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h3e92a437, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'hbfd5a5b3, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'hec017ed5, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h04}); read_data = tb_read_data; success = success & assertEquals(32'hacf23e12, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h05}); read_data = tb_read_data; success = success & assertEquals(32'h6e48a51f, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h06}); read_data = tb_read_data; success = success & assertEquals(32'he1fdbde9, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h07}); read_data = tb_read_data; success = success & assertEquals(32'h43fade6b, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h08}); read_data = tb_read_data; success = success & assertEquals(32'h98935c7a, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h09}); read_data = tb_read_data; success = success & assertEquals(32'haff9b1e5, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0a}); read_data = tb_read_data; success = success & assertEquals(32'h3adaa120, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0b}); read_data = tb_read_data; success = success & assertEquals(32'hcbaa5af5, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0c}); read_data = tb_read_data; success = success & assertEquals(32'h344fabb2, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0d}); read_data = tb_read_data; success = success & assertEquals(32'h8d2987c7, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0e}); read_data = tb_read_data; success = success & assertEquals(32'hfb83d342, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0f}); read_data = tb_read_data; success = success & assertEquals(32'h3f85bbfc, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h10}); read_data = tb_read_data; success = success & assertEquals(32'hc30e755a, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h11}); read_data = tb_read_data; success = success & assertEquals(32'h37f20fa4, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h12}); read_data = tb_read_data; success = success & assertEquals(32'h7fb5621b, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h13}); read_data = tb_read_data; success = success & assertEquals(32'hcd1cef03, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h14}); read_data = tb_read_data; success = success & assertEquals(32'h664ccb56, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h15}); read_data = tb_read_data; success = success & assertEquals(32'hce0a28b9, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h16}); read_data = tb_read_data; success = success & assertEquals(32'ha9cbdd51, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h17}); read_data = tb_read_data; success = success & assertEquals(32'had12eb24, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h18}); read_data = tb_read_data; success = success & assertEquals(32'hacc08c8d, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h19}); read_data = tb_read_data; success = success & assertEquals(32'h5d9fe7f5, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1a}); read_data = tb_read_data; success = success & assertEquals(32'h018c1e1e, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1b}); read_data = tb_read_data; success = success & assertEquals(32'h2115bba8, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1c}); read_data = tb_read_data; success = success & assertEquals(32'h22b52262, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1d}); read_data = tb_read_data; success = success & assertEquals(32'haee3bf8a, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1e}); read_data = tb_read_data; success = success & assertEquals(32'h91824a22, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1f}); read_data = tb_read_data; success = success & assertEquals(32'hde48a1f3, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_7216348574014690328 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_7216348574014690328 success.");
    end
  endtask // autogenerated_BASIC_7216348574014690328



  task autogenerated_BASIC_M5663191947183200100();
    reg [31 : 0] read_data;
    begin
      success = 32'h1;
      tc_ctr = tc_ctr + 1;
      $display("autogenerated_BASIC_M5663191947183200100");

      write_word({MESSAGE_PREFIX, 8'h00}, 32'h21558179); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h01}, 32'h3e2914b1); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h02}, 32'hefe95957); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h03}, 32'h965fdead); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h04}, 32'he766d8fc); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h05}, 32'h136eadf4); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h06}, 32'ha6106a2a); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h07}, 32'h88b2df7e); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h08}, 32'he0b0eaae); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h09}, 32'h2c17946a); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0a}, 32'h6f5b5563); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0b}, 32'h228052ae); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0c}, 32'h7fc40d80); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0d}, 32'hf81354db); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0e}, 32'hfceecd1a); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h0f}, 32'ha5e4c97d); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h10}, 32'h433ecfcd); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h11}, 32'hc20d1e4d); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h12}, 32'h2a748fe3); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h13}, 32'h1d9e63f0); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h14}, 32'hdc6c25d6); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h15}, 32'hdae5c8be); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h16}, 32'h1d8c5431); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h17}, 32'hb1d7d270); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h18}, 32'hed5b2566); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h19}, 32'h1463b0fd); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1a}, 32'ha9e26cf7); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1b}, 32'h3dd6fbd7); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1c}, 32'h1347c8f7); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1d}, 32'h76c2cc37); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1e}, 32'hf382b786); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h1f}, 32'h1d5ac517); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h20}, 32'h26b96692); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h21}, 32'h2c1fe6f8); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h22}, 32'h5852dbf8); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h23}, 32'h4bcabda2); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h24}, 32'hbedb2f5f); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h25}, 32'hbfe58158); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h26}, 32'h8cd5d15f); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h27}, 32'hac7c7f4c); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h28}, 32'hf8ba47d2); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h29}, 32'h86c6571d); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h2a}, 32'h06a4760b); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h2b}, 32'ha6afa0e1); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h2c}, 32'h7a819f62); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h2d}, 32'h5cdbfe15); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h2e}, 32'h9b2d10b5); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h2f}, 32'hf508b1fd); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h30}, 32'hb3f0462a); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h31}, 32'h92f45a64); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h32}, 32'h69b6ec58); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h33}, 32'hbfad8fab); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h34}, 32'h6799260f); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h35}, 32'h27415db5); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h36}, 32'hf6ac7832); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h37}, 32'he547826d); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h38}, 32'h6a9806a5); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h39}, 32'h36c62a88); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h3a}, 32'h98bee14d); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h3b}, 32'h9b8c2648); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h3c}, 32'habdbbd3d); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h3d}, 32'haf59eea1); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h3e}, 32'h164eacb5); //TEMPLATE_MESSAGE_VALES
      write_word({MESSAGE_PREFIX, 8'h3f}, 32'h3a18e427); //TEMPLATE_MESSAGE_VALES
      write_word({EXPONENT_PREFIX, 8'h00}, 32'h2519837b); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h01}, 32'he73a9031); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h02}, 32'he241606d); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h03}, 32'h21e70fa2); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h04}, 32'h7881f254); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h05}, 32'h4e60831d); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h06}, 32'h266f408e); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h07}, 32'h4a83e6ed); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h08}, 32'ha7741995); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h09}, 32'h32b477ba); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0a}, 32'h91bdf5d0); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0b}, 32'h4acd7a06); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0c}, 32'h51e344b9); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0d}, 32'hdf376e4e); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0e}, 32'h8494e625); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h0f}, 32'ha0cc9697); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h10}, 32'h817a0c93); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h11}, 32'h3b68cefb); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h12}, 32'h46de14c1); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h13}, 32'h52229965); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h14}, 32'h329645bd); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h15}, 32'hf4176adc); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h16}, 32'h29a8bc50); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h17}, 32'h44900fec); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h18}, 32'h1558d492); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h19}, 32'hf838a8e7); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1a}, 32'hea207abd); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1b}, 32'hcd21a28c); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1c}, 32'h91e6b02f); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1d}, 32'h2a490ea8); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1e}, 32'h5d99663b); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h1f}, 32'h87c92fb6); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h20}, 32'h0a185325); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h21}, 32'h5256a7a3); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h22}, 32'h496b7288); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h23}, 32'h6688b6c8); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h24}, 32'h650e1776); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h25}, 32'h54cd429f); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h26}, 32'h90ea3b18); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h27}, 32'h0b72ae61); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h28}, 32'hcc8651b3); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h29}, 32'ha488742d); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h2a}, 32'h93c401ef); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h2b}, 32'h5a2220ff); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h2c}, 32'haee1f257); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h2d}, 32'hf9d1e29a); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h2e}, 32'hd47151fe); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h2f}, 32'h4978342b); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h30}, 32'h0927048a); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h31}, 32'h404b0689); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h32}, 32'hdc9df8cc); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h33}, 32'hfba9845f); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h34}, 32'heb8a39b0); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h35}, 32'hd3f24ae2); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h36}, 32'h5ea9ca0a); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h37}, 32'h0c064f94); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h38}, 32'h35368ae2); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h39}, 32'heab6c035); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h3a}, 32'h9baa39c6); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h3b}, 32'h2ef6259d); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h3c}, 32'ha2577555); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h3d}, 32'h514c7d98); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h3e}, 32'h0890d44f); //TEMPLATE_EXPONENT_VALES
      write_word({EXPONENT_PREFIX, 8'h3f}, 32'hf416fbdd); //TEMPLATE_EXPONENT_VALES
      write_word({MODULUS_PREFIX, 8'h00}, 32'h2c5337a9); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h01}, 32'h3f2e1ca6); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h02}, 32'h91de65ea); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h03}, 32'hc3f9a3c2); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h04}, 32'hdc9099e0); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h05}, 32'h64ebe412); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h06}, 32'hf4583fae); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h07}, 32'h1fc8e8dd); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h08}, 32'h92dcbbfb); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h09}, 32'h9159239e); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0a}, 32'hdbbec456); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0b}, 32'h8735a660); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0c}, 32'h8248dbbc); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0d}, 32'h76f01415); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0e}, 32'h3cb8a897); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h0f}, 32'h7cc09280); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h10}, 32'h6cc6db51); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h11}, 32'h9c2544da); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h12}, 32'h316564ce); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h13}, 32'h4b6d9b3b); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h14}, 32'h3e0e123f); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h15}, 32'h942a4a3c); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h16}, 32'h1f128873); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h17}, 32'h5ad14862); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h18}, 32'hdde8e6dd); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h19}, 32'h73da31fb); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1a}, 32'h1a8a2046); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1b}, 32'hc3ff18c6); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1c}, 32'h24e31d54); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1d}, 32'h7d8a1796); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1e}, 32'h88ab346c); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h1f}, 32'h262bb321); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h20}, 32'h2cada5dc); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h21}, 32'h1fb2284c); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h22}, 32'h042375fd); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h23}, 32'hba10d309); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h24}, 32'hcda978ec); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h25}, 32'h229ee156); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h26}, 32'h8470728a); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h27}, 32'ha58017fd); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h28}, 32'h65727801); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h29}, 32'h1ea396a6); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h2a}, 32'hbd9a4bc1); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h2b}, 32'h8e97c08f); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h2c}, 32'hd7529796); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h2d}, 32'h2c8339e9); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h2e}, 32'hc5340a83); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h2f}, 32'h6f7d1f9c); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h30}, 32'hd6014fec); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h31}, 32'hdffa2265); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h32}, 32'hfa9906a9); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h33}, 32'hafbd424a); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h34}, 32'h631994ae); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h35}, 32'h73a9b3f1); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h36}, 32'h2284f999); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h37}, 32'h6f8c87f6); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h38}, 32'h93136a66); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h39}, 32'h47c81e45); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h3a}, 32'hd35f0e41); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h3b}, 32'h238d6960); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h3c}, 32'h96cf337d); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h3d}, 32'h8865e4cc); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h3e}, 32'h15039c40); //TEMPLATE_MODULUS_VALUES
      write_word({MODULUS_PREFIX, 8'h3f}, 32'h65ee7211); //TEMPLATE_MODULUS_VALUES

      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000040); //TEMPLATE_MESSAGE_LENGTH
      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000040); //TEMPLATE_MODULUS_LENGTH

      // Start processing and wait for ready.
      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
      wait_ready();

      read_word({RESULT_PREFIX, 8'h00}); read_data = tb_read_data; success = success & assertEquals(32'h24665860, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h01}); read_data = tb_read_data; success = success & assertEquals(32'h4b150493, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h02}); read_data = tb_read_data; success = success & assertEquals(32'hc0834602, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h03}); read_data = tb_read_data; success = success & assertEquals(32'hc0b99ab5, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h04}); read_data = tb_read_data; success = success & assertEquals(32'hbe649545, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h05}); read_data = tb_read_data; success = success & assertEquals(32'ha7d8b1ca, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h06}); read_data = tb_read_data; success = success & assertEquals(32'h55c1b98a, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h07}); read_data = tb_read_data; success = success & assertEquals(32'h1dce374b, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h08}); read_data = tb_read_data; success = success & assertEquals(32'h65750415, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h09}); read_data = tb_read_data; success = success & assertEquals(32'h573dfed7, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0a}); read_data = tb_read_data; success = success & assertEquals(32'h95df9943, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0b}); read_data = tb_read_data; success = success & assertEquals(32'h58a4aea0, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0c}); read_data = tb_read_data; success = success & assertEquals(32'h5fb40a92, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0d}); read_data = tb_read_data; success = success & assertEquals(32'h1408d9c2, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0e}); read_data = tb_read_data; success = success & assertEquals(32'hb5e23fc9, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h0f}); read_data = tb_read_data; success = success & assertEquals(32'h225eb60b, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h10}); read_data = tb_read_data; success = success & assertEquals(32'h41d33a41, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h11}); read_data = tb_read_data; success = success & assertEquals(32'hbf958f7f, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h12}); read_data = tb_read_data; success = success & assertEquals(32'h619f5ac1, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h13}); read_data = tb_read_data; success = success & assertEquals(32'h207647f3, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h14}); read_data = tb_read_data; success = success & assertEquals(32'h223e56f8, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h15}); read_data = tb_read_data; success = success & assertEquals(32'h26afd4ae, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h16}); read_data = tb_read_data; success = success & assertEquals(32'h6a297840, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h17}); read_data = tb_read_data; success = success & assertEquals(32'h830947db, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h18}); read_data = tb_read_data; success = success & assertEquals(32'hbc5af940, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h19}); read_data = tb_read_data; success = success & assertEquals(32'h4c97ebb1, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1a}); read_data = tb_read_data; success = success & assertEquals(32'hca38b220, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1b}); read_data = tb_read_data; success = success & assertEquals(32'h04c9a26d, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1c}); read_data = tb_read_data; success = success & assertEquals(32'h49a16b72, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1d}); read_data = tb_read_data; success = success & assertEquals(32'h0882c658, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1e}); read_data = tb_read_data; success = success & assertEquals(32'h2dbc50e0, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h1f}); read_data = tb_read_data; success = success & assertEquals(32'h67e2d057, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h20}); read_data = tb_read_data; success = success & assertEquals(32'h4b8ef356, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h21}); read_data = tb_read_data; success = success & assertEquals(32'h4ba5eac3, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h22}); read_data = tb_read_data; success = success & assertEquals(32'h17237d9f, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h23}); read_data = tb_read_data; success = success & assertEquals(32'h27c111a8, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h24}); read_data = tb_read_data; success = success & assertEquals(32'hc1b1944e, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h25}); read_data = tb_read_data; success = success & assertEquals(32'he91fd6b6, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h26}); read_data = tb_read_data; success = success & assertEquals(32'ha78d9747, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h27}); read_data = tb_read_data; success = success & assertEquals(32'h61e946d3, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h28}); read_data = tb_read_data; success = success & assertEquals(32'h0078fe23, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h29}); read_data = tb_read_data; success = success & assertEquals(32'h7770a088, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h2a}); read_data = tb_read_data; success = success & assertEquals(32'h6d5762af, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h2b}); read_data = tb_read_data; success = success & assertEquals(32'h435ac5f9, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h2c}); read_data = tb_read_data; success = success & assertEquals(32'h36cde9d5, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h2d}); read_data = tb_read_data; success = success & assertEquals(32'hc313804d, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h2e}); read_data = tb_read_data; success = success & assertEquals(32'ha4623760, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h2f}); read_data = tb_read_data; success = success & assertEquals(32'hb1c37572, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h30}); read_data = tb_read_data; success = success & assertEquals(32'h2b22486d, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h31}); read_data = tb_read_data; success = success & assertEquals(32'h8af131e3, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h32}); read_data = tb_read_data; success = success & assertEquals(32'h3e5fc3ea, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h33}); read_data = tb_read_data; success = success & assertEquals(32'h0d9c9ba0, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h34}); read_data = tb_read_data; success = success & assertEquals(32'h218bcc8f, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h35}); read_data = tb_read_data; success = success & assertEquals(32'h8bcdfea2, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h36}); read_data = tb_read_data; success = success & assertEquals(32'hcf55a599, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h37}); read_data = tb_read_data; success = success & assertEquals(32'h57b9fcbc, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h38}); read_data = tb_read_data; success = success & assertEquals(32'h5c087f62, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h39}); read_data = tb_read_data; success = success & assertEquals(32'hec130a15, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h3a}); read_data = tb_read_data; success = success & assertEquals(32'h7e8bd1f5, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h3b}); read_data = tb_read_data; success = success & assertEquals(32'h60eaaa51, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h3c}); read_data = tb_read_data; success = success & assertEquals(32'h020dd89b, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h3d}); read_data = tb_read_data; success = success & assertEquals(32'h890cc6ea, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h3e}); read_data = tb_read_data; success = success & assertEquals(32'h042d0054, read_data); //TEMPLATE_EXPECTED_VALUES
      read_word({RESULT_PREFIX, 8'h3f}); read_data = tb_read_data; success = success & assertEquals(32'h74055863, read_data); //TEMPLATE_EXPECTED_VALUES

      if (success !== 1)
        begin
          $display("*** ERROR: autogenerated_BASIC_M5663191947183200100 was NOT successful.");
          error_ctr = error_ctr + 1;
        end
      else
        $display("*** autogenerated_BASIC_M5663191947183200100 success.");
    end
  endtask // autogenerated_BASIC_M5663191947183200100



  //----------------------------------------------------------------
  // main
  //
  // The main test functionality.
  //----------------------------------------------------------------
  initial
    begin : main

      $display("   -= Testbench for modexp started =-");
      $display("    =================================");
      $display("");

      init_sim();
      dump_dut_state();
      reset_dut();
      dump_dut_state();

autogenerated_BASIC_M4962768465676381896();
autogenerated_BASIC_8982867242010371843();
autogenerated_BASIC_5090788032873075449();
autogenerated_BASIC_8448510918869952728();
autogenerated_BASIC_4036237668019554146();
autogenerated_BASIC_M8925041444689012509();
autogenerated_BASIC_M5713608137760059379();
autogenerated_BASIC_6816968587684568101();
autogenerated_BASIC_4168013900853404774();
autogenerated_BASIC_M8394821325674331878();
autogenerated_BASIC_M2919828800172604435();
autogenerated_BASIC_4770912732078070597();
autogenerated_BASIC_3593487472385409519();
autogenerated_BASIC_4981749054780354961();
autogenerated_BASIC_7702189670289360961();
autogenerated_BASIC_M5169634701858105792();
autogenerated_BASIC_6469444563916025786();
autogenerated_BASIC_M2453278165832221565();
autogenerated_BASIC_M1847183855567461116();
autogenerated_BASIC_M7037130911981370263();
autogenerated_BASIC_5073338267670769216();
autogenerated_BASIC_M1841989679506188752();
autogenerated_BASIC_M3339729654500648482();
autogenerated_BASIC_M6837928193394880512();
autogenerated_BASIC_M7333111649825079555();
autogenerated_BASIC_480186175131589607();
autogenerated_BASIC_M5239159917778665002();
autogenerated_BASIC_228752064885223799();
autogenerated_BASIC_856940511857911599();
autogenerated_BASIC_M6501553661140603953();
autogenerated_BASIC_M8496483018338900149();
autogenerated_BASIC_6145567102166328515();
autogenerated_BASIC_7216348574014690328();
autogenerated_BASIC_M5663191947183200100();

      display_test_results();

      $display("");
      $display("*** modexp simulation done. ***");
      $finish;
    end // main
endmodule // tb_modexp

//======================================================================
// EOF tb_modexp.v
//======================================================================