Intel® Accelerator Functional Unit (AFU) Simulation Environment (ASE) Quick Start User Guide

ID 683159
Date 4/11/2018
Public

1.4. Simulating the hello_afu AFU using the ASE (Client-Server Mode)

Client-server mode is used for interactive development and debug. Use the setup_sim.sh and run_app.sh scripts, located in $DCP_LOC/hw/common/scripts, to set up the simulation and run the application. You may run the application multiple times once the simulator is up and running.
  1. Change directory to:
    $ cd $DCP_LOC/hw/common/scripts
  2. General command syntax:
    $ sh setup_sim.sh -a <afu dir> -s <vcs|modelsim|questa> -b <opae base dir> [-r <rtl simulation dir>] [-m <EMIF_MODEL_BASIC|EMIF_MODEL_ADVANCED> memory model]
    To run the simulation using Modelsim:
    $ sh setup_sim.sh -a $DCP_LOC/hw/samples/hello_afu -s modelsim -b $OPAE_LOC
    Table 2.  Flag Descriptions
    Flag Description Legal Values Default Required
    -a Path to AFU source Example: $DCP_LOC/hw/samples/hello_afu - Yes
    -s Simulator type vcs, modelsim, questa - Yes
    -b $OPAE_LOC $OPAE_LOC - Yes
    -r Optional directory to build the simulation.

    If specified, AFU source and ASE work directory is copied here. If not, simulation is built in $OPAE_LOC/rtl_sim

    - $OPAE_LOC/rtl_sim No
    -m Local Memory Model: selects the simulation model for FPGA private memory. Supported values are EMIF_MODEL_BASIC and EMIF_MODEL_ADVANCED.

    EMIF_MODEL_BASIC uses a simple system-verilog array to model dual banks of DRAM.

    EMIF_MODEL_ADVANCED uses an advanced cycle accurate model of the EMIF memory controller.

    EMIF_MODEL_BASIC is recommended for faster simulations.

    EMIF_MODEL_BASIC, EMIF_MODEL_ADVANCED EMIF_MODEL_BASIC No

    Sample output:

    Figure 5. Messages from Simulation Environment Initialization
  3. Open a new terminal to run simulation of your application using the $run_app.sh script.
  4. Set $DCP_LOC and $OPAE_LOC environment variables in new terminal.
  5. Change directory to:
    $ cd $DCP_LOC/hw/common/scripts
  6. General command syntax::
    $ sh run_app.sh -a <afu dir> -b <opae base dir> [-i <opae install path>] [-r <rtl simulation dir>]
    To run the simulation using Modelsim:
    $ sh run_app.sh -a $DCP_LOC/hw/samples/hello_afu -b $OPAE_LOC
    Table 3.  Flag Descriptions
    Flag Description Legal Values Default Required
    -a Path to AFU source Example: $DCP_LOC/hw/samples/hello_afu - Yes
    -b $OPAE_LOC $OPAE_LOC - Yes
    -r Optional directory to build the simulation.

    If specified, AFU source, log files (including waveforms), and ASE work directory are copied here. If not, simulation is built in $OPAE_LOC/rtl_sim

    Note: If you specified -r in setup_sim.sh, you must specify -r in run_app.sh
    - $OPAE_LOC/rtl_sim No
    -i Optional path to OPAE installation1. You must specify the install path if you don’t use the RPM flow. If you are using the RPM flow, the install path is not required. <custom opae_loc directory>

    Example: /home/john/opaeinstall

    - No

    Sample output:

    Figure 6. Print Statements from the hello_afu Simulation
  7. Type CTRL-C from the Simulation Environment Initialization terminal window to close the simulation. You can run the application multiple times while the simulator is still running.
  8. You can stop the simulation using command $ pkill ase_simv.
1 If you built OPAE from the source instructed in Building the OPAE Software section of Intel Acceleration Stack Quick Start Guide for , provide the installation path. For example:/home/john/opaeinstall