#************************************************#
# TITLE: README file for the testscript.
# Author: Krishna Atreya
# Version: 1.1
#************************************************#
# Usage: 
# These testscripts are meant for most operating systems as specified below. 
# The testscript's main intent is to test our Cadence classroom environment and is hard to setup elsewhere.
  But you could follow some certain specifications below to make it work in other environments.

# ********* REQUIREMENTS ********
# You must have perl installation 5.0 or greater in your path.
# The machine must be one of the following: Linux, Windows, or UNIX (Sun, HP, or IBM preferably).
# The following files must be present in your .test directory.
  1. utilities.pl
  2. test_engine.pl
  3. config.pl 

#** IMPORTANT REQUIREMENTS FOR THE TESTSCRIPT TO PASS. **
# You must have a .class_setup file at the level of the .test directory that contains the paths to the software tested by this testscript. Or you must atleast have all the paths declared in your environment.
# You must have all the proper licenses in your environment, and setup properly. If not, you have the option of specifying a license file.

#***************#
# Testing your lab installation.
#***************#
# To test your lab installation move to the top directory of your lab.
  cd .test
  cd ..
# Run the following command to verify your database and software:
  source ./.testscript
  OR
  ./.test/testscript.cmd
  The first execution (run) of the above command will always be the GOLDEN run and is used for directory map comparision later. 
  If you delete the following file: 
     master_directory_map
  you can generate it by executing the above command, and this new run will be the GOLDEN run of the testscripts. The Directory mapping from the GOLDEN results are then compared with the results of the later runs. The rest of the checks are independent of the GOLDEN results.

# Once the testscript passes:
  1. Create a tar file for your database using:
    tar cvf <course_abb>_<course_vs>.tar <top-level directory>
  2. Make a copy of the resulting tar file.
    cp <course_abb>_<course_vs>.tar <course_abb>_<course_vs>.copy.tar
  3. You can use different compression techniques for different platforms:
     For Solaris/HP, use:
    compress <course_abb>_<course_vs>.tar
     For Linux, move the copy of the tarred file to the proper name, and then compress it:
    gzip <course_abb>_<course_vs>.tar
  4. For Windows, use the same copy, but you can rename it from .tar to .zip for Windows purposes.
#
Make sure you have the following in your top-level directory.
 1. ./.test ( This entire directory.)
 2. .testscript (This is a link to the ./.test/testscript.cmd).
    To create the link use the following command:
    ln -s ./.test/testscript.cmd .testscript
    Make sure this is just a link. You can view it by using "ls -a".
#************************************************#
Follow the steps below to configure your labs before testing them.
#************************************************#
 1. The ".test" directory must be in your top-level directory.
    cd .test
 2. Move to the top-level directory of your labs, to run the test.
    cd ..
 3. Run the preconfiguration for the testscript to work.
    perl .test/preconfigure.pl
 4. Modify the variables in the ".test/config.pl" file to suit your labs.
     a# Enter the course name.
       $courseName = "Encounter RTL Compiler"; 
     b# Enter the Software Version intended for the course. 
       $softwareVersion = "4.2"; 
     c# Enter the version on the books.
       $courseVersion = "4.2"; 
     d# Enter the date when the course was released.
       $releaseDate = "Feb 1 2005"; 
     e# Change this only if you want your results in a different directory.
       $tempDir = "./.test";
     f# Change this only if you want to enter a different name for the report file.
       $reportFile = "$tempDir/testReport$$"; 
     g# Change this variable only if you are restricting usage to a single machine.
       $hostName = "ANY";
     h# Enter the name of the operating system it should work on. 
       $osName = "Linux"; 
        # When compressing data, use tar.gz format for Linux, tar.Z for UNIX, and keep them separate.
     i# Change this only if the database would work only on a specific version.
       $osVersion = "ANY"; 
     j# Change this only if the database would work only on a specific architecture.
       $cpuArch = "ANY";
     k# Change this only if your database would work on a specific type of machine.
       $machType = "ANY"; #For example, sparc, Sun Solaris etc.
     l# Enter the amount of physical memory your labs would require on disk.
       $physMem = "ANY";
     m# Enter the amount of swap space your labs would require.
       $totalSwap = "ANY";
         # This you can determine from your Software usually.
     n# Enter the amount of freeDisk the user OS should have.
       $freeDisk = "100";
     o# Enter the name of the license file, usually not required for internal Cadence.
       $licenseFile = "";
     p# Enter the names of the tool executable and the required versions of it.
       %toolExeAndVersion = ('rc', 'v04.20-p001_2', 'encounter', 'v04.10-p003_1');
       You can also use the following more readable format:
         %toolExeAndVersion = ('icms' => '5.10.41', 'ncsim' => '05.70');
          # You can usually get the exact version information by entering:
             toolExecutable -version
          # For example:
             rc -version 
               # would give you the following output.
       >>> Program Name: RTL Compiler (RC), Version: v04.20-p001_2
         Use only the portion that makes the version that you have tested on stand out. 
         The script searches for the string you provide.
     q# Enter the corresponding command/expression that would trigger your tool executable to give out the version in the following format.
       %toolExeAndExpr = ('toolName1' => 'toolCommandExpr1', 'toolName2' => 'toolCommandExpr2');
       Examples:
       %toolExeAndExpr = ('rc' => '-version', 'encounter' => '-cmd script1.tcl -logfile logfile1.log') ;
       %toolExeAndExpr = ('icms' => '-nograph -replay .test/script1.tcl -log .test/logfile1.log', 'ncsim' => '-version -log .test/logfile2.log');
       %toolExeAndExpr = ('icfb' => '-W', 'verilog' => '-version');
          # If you specify a logfile in your command/expression, it is important to specify the same logfile in the following variable.
     r# Enter the name of the logfile used in your command/expression. 
        %toolExeAndLogfile = ('icms' => '.test/logfile1.log', 'ncsim' => '.test/logfile2.log');
        This is optional to others. Just leave the string empty in that case.
        %toolExeAndLogfile = "";
     s# Enter any additional info you want searched in your logfiles.
        $additionalLogTestString = "Synthesis succeeded.";
        This is also optional and must be used only if you have specified a logfile, and expect the logfile to contain this information verbatim.
        Othwerwise, just leave it as an empty string.
        $additionalLogTestString = "";
     t# Enter the names of licenses corresponding to each tool executable.
       %toolExeAndLicenses = ('icms' => 'AMS_environment', 'encounter' => 'First_Encounter,SoC_Encounter');
        For multiple optional licenses of the softwares that could be used in your lab, enter more licenses in the following format.
       %toolExeAndLicenses = ('toolName1' => 'licenseName1,licenseName2', 'toolName2, 'licenseName3,licenseName4');
        You can find the name of the licenses by using lmstat on your system.
        For example, use:
             lmstat -i RTL
        and the results will show all license names containing "RTL". Sometimes "lmstat -a" could be more helpful.
        You can also use the http://demokey.cadence.com site to find license names based on your release stream.
        FYI: A lot of times the license names change from release to release on a newer product.
        You need to know what software release to use, and search the corresponding license names.
     u# Enter the number of licenses required for each tool.
       %toolExeAndNumLicenses = ('icms' => '1', 'ncsim' => '1');
#*****************************************#
# End of installation of testscripts 
#*****************************************#
