===================================================================

 This confidential and proprietary software may be used only as
 authorised by a licensing agreement from ARM Limited
   (c) COPYRIGHT 1999-2010 ARM Limited
       ALL RIGHTS RESERVED
 The entire notice above must be reproduced on all authorised
 copies and copies may only be made to the extent permitted
 by a licensing agreement from ARM Limited.

===================================================================





===================================================================
  CORTEXM4  Design Simulation Model 
===================================================================



Date            : Wed Jun 30 16:11:05 BST 2010
Model           : CORTEXM4 Verilog Wrapped DSM
Part No         : AT520-MS-28010-r0p1-00rel0
Si Revision     : r0p1
Platform        : Linux-64 rhe4-os64
Verified with   : Cadence NC Verilog Simulator 
Version         : 8.20.012
Modelling Tools : DSMGen - Fastnet2007_01
VMC Version     : 2009.06
Flexlm Version  : v10.8.0.7





===================================================================
     Contents Of This File
===================================================================

This Release Note is organized into the following sections:

  * Introduction
  * Contents of the Model Directory
  * Setting up The License Server
  * Setting up The Model
  * Testing The Model Setup - CrfTester
  * Model Usage
  * Documentation
  * About simulator wrappers
  * Important Points
  * Common Warnings and Errors




===================================================================
              Introduction
===================================================================

This model package contains ARM's CORTEXM4 Design Simulation Model.
It is a protected IP model of the CORTEXM4. 
The accuracy of the DSM is the same as the original Verilog code.

The DSM includes a ModelManager, targeted for one simulator,
and a SWIFT model. 

The user will find herein the information : 
     - to setup the DSM environment
     - to test the DSM correct setup using the crftester
     - to use the DSM





===================================================================
    Contents Of The Model Directory
===================================================================

     <ARM_IP_install_area>/
      |
      |--> simulation_models/
                |
                |--> DSM/
                |     |
                |     |--> cadence_nc_verilog_Linux-64/
                |             |
                |             |--> CORTEXM4_licensed_r0p1-00rel0/
                |                       CORTEXM4/
                |                       CORTEXM4.Linux-64/
                |                       testing/
                |                       docs/
                |                       SDF_TOOLS/
                |                       README 
                |                       setup.csh
                |                       setup.sh
                |
                |--> LMC_HOME/
                |
                |--> ModelManager/
                |        MMAPI_5.1.0/
                |               Linux-64/
                |                     MM/
                |                       cadence_nc_verilog/
                |                       <lib files>
                |
                |--> flexlm/  (for licensed model only)
                         v10.8.0.7/
                                SunOS/
                                   <lm* files>
                                HP-UX/
                                   <lm* files>
                                Linux/
                                   <lm* files>

<ARM_IP_install_area> is where you choose to install ARM IP. It is 
recommended to install all ARM simulation models into this same
directory.

Contents in simulation_models/DSM/cadence_nc_verilog_Linux-64/CORTEXM4_licensed_r0p1-00rel0
(this directory is pointed by the environment variable $CORTEXM4_HOME) :

   README       - this file

   CORTEXM4        - contains all required model files
                     See paragraph "About simulator wrappers" for details.
   
   CORTEXM4.Linux-64 - contains all files required to install the SWIFT model
                     for specific platform

   testing      - contains crftester model files, one crf vector file 
                     and its associated ctrm file
      
   docs         - contains device related README_2, CRF readme file,
                     DSM User Guide and Model Manager application notes.
   
   SDF_TOOLS    - contains backannotation tools sdfgen and sdfremap

   setup.(c)sh  - setup files



===================================================================
            Setting up The License Server
===================================================================

License feature for this model : ModLib_DSM2_CORTEXM4

This model uses the Flexible License Manager (FLEXlm) from Macrovision
Corporation (previously Globetrotter Software).  You may already be
familiar with this software because many logic simulators also use it.
This section is intended as a brief introduction to setting up the
license manager for use with this model.  For more information on
FLEXlm, please contact Macrovision or visit their web site:

  http://www.macrovision.com


The license key
===============

You must have a license key to use this model.


For users with an existing ARM license file
-------------------------------------------

Your license file already contains a key for the CORTEXM4 model if:

- It contains a key beginning with "FEATURE ModLib_DSM2_CORTEXM4" ;

and

- This key contains the text "SIGN2=<key>" (where <key> is a series of
  hexadecimal numbers enclosed in quotes);

and

- The expiry date in the key has not passed.

If the above are not true, follow the instructions below for obtaining
a license key.  Then copy the text beginning FEATURE from the new 
license file into the old one.


Obtaining a license key
-----------------------

To obtain a license key for this model:

1. Choose a computer to run your license server program from.  If you
   already have an ARM license file, choose the computer whose name and
   host ID are given in the line which begins with SERVER.

2. If you are given a serial number by ARM with this model, or 
   you are given a userID and password, then visit license.arm.com and 
   follow the on-screen instructions to obtain a license key.

3. Otherwise, ask your model provider with your computer name and hostID,
   they will provide you with a license key.


The license server program
==========================

Once you have a model license key, you must run the ARM license server
program "armlmd" and inform it about the model license.  This program
and other license utilities can be found in the directory
"simulation_models/flexlm/<version>/<platform>" in your model installation
(where <version> is the flexlm version and <platform> is the operating system 
you will run your license server on).  We will call this directory $FLEXLM_BIN 
from here on.


For users with an existing armlmd running
-----------------------------------------

You must run version 9.0 (or above) of the ARM license server for this
model.  If you already have a license server running, find out its
version using "lmver" as follows:

  $FLEXLM_BIN/lmver <existing_armlmd>

where <existing_armlmd> is the path to your existing armlmd program.
Then follow the instructions below.


a) If your existing armlmd has a version earlier than 9.0:

  1. Check that nobody is currently using ARM tools served from it, by
     running "lmstat" on the license server computer as follows:

      $FLEXLM_BIN/lmstat -S armlmd

  2. Once nobody is using the license server, stop it by running 
     "lmdown" on the license server computer in the following way:

      $FLEXLM_BIN/lmdown -c <existing_file>

     where <existing_file> is the path to your existing ARM license
     file.

  3. Follow the instructions in the later section "For users without an
     existing armlmd running".


b) If your existing armlmd is version 9.0 and you have a new key for
   this model, inform your license server about the new key by running
   "lmreread" on your license server computer:

      $FLEXLM_BIN/lmreread -c <license_file>

    where <license_file> is the path name of your ARM license file.


c) If your existing armlmd is version 9.0 or above and your ARM license
   file has not changed, you do not need to do anything else to set up
   your license server.

  
For users without an existing armlmd running
--------------------------------------------

You must start armlmd as follows:

1. Copy the $FLEXLM_BIN/armlmd program to a permanent location.

2. Make sure that the line beginning with SERVER in your license file
   gives the correct path to armlmd, including the filename.

3. Copy the ARM license file to a permanent location.

4. Start armlmd on your license server computer using the following
   command:
   
     $FLEXLM_BIN/lmgrd -c <filename>  >  <logfile>  &
   
   where <filename> is the path name of the license file and <logfile>
   is the path to a file where the license server will keep a log of
   licensing operations.
   
   If you want to start armlmd automatically at boot time, add this
   command to either /etc/rc.boot or /etc/rc.local.


Setting the license environment
===============================

Before using the model, set the environment variable ARMLMD_LICENSE_FILE
to the path to your ARM license file which contains the key for CORTEXM4.


License errors
--------------

If the model fails to start because it cannot find a license, make sure
that there are no other ARM license files specified in either your 
LM_LICENSE_FILE environment variable or in the .flexlmrc file in your 
home directory.  The .flexlmrc file is written automatically by FLEXlm,
so you might not be aware that it exists.


===================================================================
             Setting up The Model
===================================================================

1) Set the environment variable CORTEXM4_HOME to point to this model directory.

   The model directory is the directory where the current README file is, 
   and where the directory structure mentioned in the previous paragraph 
   is available.

   Go into the model directory : 
                cd <model directory>

   Set the environment variable : 

         C   shell :     setenv CORTEXM4_HOME `pwd`
      Bourne shell :     CORTEXM4_HOME=`pwd` 
                         export CORTEXM4_HOME 



2) Setup the environment, by sourcing the setup script

         C   shell :     source $CORTEXM4_HOME/setup.csh
      Bourne shell :        .   $CORTEXM4_HOME/setup.sh
 

   Note that the environment variable DIR_CORTEXM4 is created and points at 
   <model directory>/CORTEXM4, the directory where all the model files are 
   included.


   Note that the environment variable LMC_HOME is created and points to 
        <ARM_IP_install_area>/simulation_models/LMC_HOME
   and this is where your model will be installed to by default.


3) Install the SWIFT model libraries.

   If you haven't run install.csh successfully or for whatever reason
   you wish to install the SWIFT model again,  follow the instruction here.

   This step is performed just once.
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        
   i) To install the SWIFT model in the default area pointed to by 
      the LMC_HOME environment variable, run the install script :
       
         - on Linux-64 :   $CORTEXM4_HOME/CORTEXM4.Linux-64/install_swift.csh  

   ii) If you plan to run two or more different SWIFT models in the 
       simulation then they all need to be installed into the same LMC_HOME. 
       Ensure that you set LMC_HOME to be the same location before installing 
       each SWIFT model, then run the above "install_swift.csh" script.
       
 Model should be installed and the script finished  with "Install Complete".     

===================================================================
    Testing The Model Setup - CrfTester
===================================================================

The supplied crftester can be used to test the model.

0) Setup the model. See previous paragraph.

1) Setup the simulator environment.

2) Run the crftester script 

      - SDF timing : 
             $CORTEXM4_HOME/testing/crftest_timing.csh
      - NO timing : 
             $CORTEXM4_HOME/testing/crftest.csh

3) The crftester simulation should run the vector set with
   '0 vectors failed', and the following completion message should be 
   displayed : 
        
          "The CORTEXM4 DSM is correctly setup"

  An example of crftester simulation log trace is supplied :
      - SDF timing : 
          $CORTEXM4_HOME/testing/reference_crftest.log





===================================================================
            Model Usage
===================================================================

1) Setup the simulator environment.

2) Compile the HDL file.
   Two separate HDL wrappers are supplied. Select the appropriate 
   one when compiling/elaborating your design. 

      - HDL wrapper with SDF timing shell (also called SDF timing wrapper):
          CORTEXM4/timing_wrapper/CORTEXM4.v    
      - HDL wrapper without timing shell (also called no-timing wrapper):   
          CORTEXM4/CORTEXM4.v  

   Note that the SDF timing file template is available in the 
   directory "CORTEXM4". CORTEXM4.tdef file only contains example timing values 
   and are not representative of any given process or characterization.


3) The crftester simulation run when testing the setup of the DSM shows 
   an example of how to compile/elaborate and run the DSM :
      - SDF timing : 
            $CORTEXM4_HOME/testing/crftest_timing.csh
      - No timing : 
            $CORTEXM4_HOME/testing/crftest.csh





===================================================================
         Documentation
====================================================================

The following documentation is supplied with the Model in  
the directory $CORTEXM4_HOME/docs : 
       - device related documentation in the 'README_2' file (if supplied)
       - ModelManager documentation in 'MM_cadence_nc_verilog.txt' 
       - CRF vectors and the associated '.ctrm' file in 'crf_file.readme' 
       - sdfgen and sdfremap as manpages
       - DSM User Guide
 
Documentation about the SWIFT models can be found in 
        $LMC_HOME/doc/smartmodel/manuals       

Note that $CORTEXM4_HOME is the DSM installation directory and $LMC_HOME is
set when the step 'Setup The Model' is completed.


NOTE:
Documentation about setting up the appropriate timing model can be found 
also in the ModelManager documentation in 'docs/MM_cadence_nc_verilog.txt' 
(section labelled : Timing)

===================================================================
     About simulator wrappers 
===================================================================

The simulator wrapper HDL files in this model are arranged differently
to previous models. 

Previous models store the HDL wrapper with build-in timing
shell in "CORTEXM4/" directory, while the wrapper without timing 
shell in "CORTEXM4/extra_wrapper" directory.

From this release, a simulator wrapper which contains no timing shell 
is provided in "CORTEXM4/" directory.  This file can be used to run 
the model with no timing annotated.  The simulator wrapper with 
build-in timing shell can be found in "CORTEXM4/timing_wrapper" 
directory.

===================================================================
               Important Points
===================================================================

1)  This DSM does not support restart or checkpointing.
    
2)  DSMs are only intended to be used for functional and timing simulation,
    they are not designed for fault simulation or static timing analysis.
    
3)  It is imperative that you don't mix parts of the DSM with earlier 
    versions, this will lead to the DSM not working correctly!!  Only use
    the HDL wrapper file CORTEXM4.v  that was supplied 
    with the current version of the DSM, with supplied version of 
    library (for example CORTEXM4.so) and the supplied version
    of the Model Manager.
    
4)  If you have more than one DSM in a simulation and one of the DSMs is 
    older than the other, always make sure that you are using the Model
    Manager from the most recent version, otherwise the Model Manager
    will not load the most recent shared object library.
    
5)  When using LD_LIBRARY_PATH (or SHLIB_PATH) environment variable and 
    this variable is already set up, it is important to make sure that
    the path of the Model Manager appears as the first item in the path.
    
6)  For Modelsim VHDL DSM, if you want to run with the 64-bit version 
    of the simulator, make sure that you have the 64-bit version of the 
    DSM.  This will be indicated in the version information at the top
    of the README file, eg, 
    
    Platform :  SunOS-64
    
    If this just says SunOS, then this model is only intended to be used
    with the 32-bit version of the simulator.  The 32-bit version of the 
    DSM will not run under the 64-bit version of vsim.
    
7)  For Modelsim VHDL DSM, when compiling with VHDL/SDF wrapper, make
    sure you use
        vcom -novitalcheck
    otherwise the wrapper won't compile correctly.
    
8)  The DSM ARM produced should run on Solaris 2.5.1, 2.6, 7 or 8 in 32-bit
    mode.  We don't support 64-bit mode except for Modelsim VHDL on 
    Solaris 8.  It's also worth noting that not all simulators support all 
    of these Solaris versions.  For example. newer Synopsys simulators
    don't support 2.5.1 or 2.6,  and newer Cadence simulators don't support
    2.5.1.
    
9)  Do not modify the HDL wrapper (eg CORTEXM4.v) at all.  Doing so might
    result in the model failing in a subtle way.  We cannot support the DSM 
    when the wrappers have been modified. Please ref to 
       $CORTEXM4_HOME/docs/README_2 
    regarding how to modify the model's generics/defparam.
    
10) Do not try and enable the Built-In Timing shell when using the HDL/SDF
    wrapper.  In other words, do not set the MG_ENABLE_BUILTIN_TIMING = 1
    within the HDL/SDF wrapper file, otherwise the DSM will not work 
    correctly.  Always make sure this parameter/generics is set to 0 when
    using this type of wrapper.


===================================================================
          Common Warnings and Errors
===================================================================

1)  When Installing the Models
    
    > ERROR: ARM7TDMI_sdf.vhd(1053): VITAL timing generic size does not match
    > product of associated port sizes ( 32 /= 32 * 32 ) 
    > (1076.4 section 4.3.2.1.2)
    > ERROR: ARM7TDMI_sdf.vhd(1248): VHDL Compiler exiting 
    
    This error is produced when compiling with vcom using the Modelsim HDL/SDF
    wrapper file without the -novitalcheck switch. To correct this:
    
     vcom -novitalcheck CORTEXM4.vhd

2)  When Simulating the Models 

    When simulating Swift/VhMC/VMC based DSMs there will be lots of warning 
    messages at time 0 when the model starts up. In general all warning 
    messages at time 0 until the model has been properly reset can be ignored. 

    For example :
    
    > Warning! 0 fs - ARM7TDMICRFTESTERTOP.theARM7TDMI.thetiming.theinout:
    > 
    > Assertion WARNING at 0 PS in design unit XXXX from process XXXX: 
    > [MG_Model-MGWARNING] "/arm/chips/dsm/gwang/work/ARM7TDMIr3_vhmc/
    >    ModelGen/collated/r3/ve...
    
    These type of warning messages arise from the Swift/VhMC/VMC component 
    within the DSM which hasn't initialized properly.

    
    > " To_Integer --- 'X' encountered in the input vector. Returning zero result."
    > " To_Integer --- 'X' encountered in the input vector. Returning zero result."

    At time 0 those can also be safely ignored. These type of warning messages 
    arise from the Swift/VhMC/VMC component within the DSM when the model is 
    initializing at time 0.

    > # Output violation on nEXEC
    > # ModelGen Warning, Time 74376852 ps, Instance

    Output violation messages are only associated with the Built-In timing 
    shell, they won't be produced when using the HDL/SDF timing shell.
    These messages occur when the timing shell for the model fails
    to match an output transition with an input causal event and therefore
    can't assign an appropriate time to the output. This could arise 
    due to two possible reasons, these are:

      i) The model hasn't been reset properly. Or
      ii) A timing path is missing in the timing shell for the model.
    
      In this situation the  Built-In timing shell can't find a delay 
      value to annotate and the default value is used for the output. In 
      practice this means the output has zero delay.

    For ARM7TDMI DSM, it is important to properly reset the core at the 
    start of the simulation.  This is done by pulsing nTRST signal low 
    and then high as well as the nRESET signal. 
