Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase

Model Technology Inc.


Speeding up the simulation

The information provided by the Performance Analyzer can be used to speed up the simulation. Double click the pathname for store.vhd:43 and retrieve.vhd:35 and view the source code. In both cases, the source includes a loop which could have an exit.

  1. Modify the loops to include exits inside the IF statements, or compile the following files included for that purpose - store_exit.vhd and retrieve_exit.vhd.

  2. 
    vcom retrieve_exit.vhd store_exit.vhd 
    
    

    (MENU: Design > Compile)

  3. Compile the top level blocks and configuration files again to account for the lower level changes.

  4. 
    vcom ringrtl.vhd testring.vhd config_rtl.vhd 
    
    

    (MENU: Design > Compile)

  5. Reset the simulation to time zero and restart with the modified files.

  6. 
    restart -f 
    
    

  1. Run timerun.do again and note the difference in run time.

  2. 
    do timerun.do 
    
    

Run time has been cut almost in half by inserting exits in the loops.

  1. Take another look at the Performance Analyzer data.

  2. 
    view_profile 
    
    

(MENU: View > Other > Hierarchical Profile)

A lot of time is still being spent in the loops. To further reduce simulation time, these loops can be replaced by indexing an array.

  1. Remove the loops and add an array, or compile the following files with the modifications already done.

  2. 
    vcom retrieve_array.vhd store_array.vhd 
    
    

    (MENU: Design > Compile)

  3. Compile the top level blocks and configuration files again.

  4. 
    vcom ringrtl.vhd testring.vhd config_rtl.vhd 
    
    

    (MENU: Design > Compile)

  5. Restart the simulation with the modified files.

  6. 
    restart -f 
    
    

  1. Run timerun.do again and note the difference in simulation run time. Your simulation time may differ from that shown here, but the new run should be very fast - approximately ten times faster than the original simulation time.

  2. 
    do timerun.do 
    
    

  1. Look, again, at the Hierarchical Profile of simulation performance and you will see more lines showing.

  2. 
    view_profile 
    
    

(MENU: View > Other > Hierarchical Profile)


Note: You're results may look slightly different as a result of the computer you're using and different system calls that occur during the simulation.

  1. Set the Under% filter to "2" and click the Update icon. This will filter out all usage values below 2%.

  2. Take a look at the Ranked Profile view.

  3. 
    view_profile_ranked 
    
    

(MENU: View > Other > Ranked Profile)

  1. Use the report command to output a file with the profile data.

  2. 
    profile report -hierarchical -file hier.rpt -cutoff 4 
    
    

This command outputs a hierarchical profile of performance data with the file name hier.rpt.

  1. Quit the simulator.

  2. 
    quit -f 
    
    

Model Technology Inc.
Model Technology Incorporated
Voice: (503) 641-1340
Fax: (503)526-5410
www.model.com
sales@model.com
Table of Contents Previous page Next page Index

ModelSim