Accelerator Functional Unit Developer Guide: Intel FPGA Programmable Acceleration Card N3000 Variants

ID 683190
Date 7/15/2022
Public
Document Table of Contents

4.5.3.2. Using the Initial Shell Design as a Shell

The Intel® N3000 Acceleration Stack for Development provides the Initial_Shell_Design as a starting point for your created designs. The Initial_Shell_Design is used as a shell for inclusion of the HLS AFU example.

  1. Copy the provided Initial_Shell_Design to a new directory for your tutorial work.
    $ mkdir hls_example
    $ cd hls_example
    $ cp -R $N3000_EXAMPLE_ROOT/Initial_Shell_AFU/*
    
  2. Copy the Intel® provided HLS AFU example .tar file to your hls_example/hw directory and untar
    $ cp  <Download directory>/hls_afu_2019-04-30.tar hls_example/hw/.
    $ cd hls_example/hw
    $ tar xf hls_afu_2019-04-30.tar
    $ cd hls_afu/hw/rtl/hls
    
  3. Build and emulate the design using x86 instructions and run these commands:
    $ make test-x86-64
    i++ src/hls_afu.cpp src/test.cpp   --fp-relaxed -ghdl  -march=x86-64 -o test-x86-64
    +--------------------------------------------+
    | Run ./test-x86-64 <n> to execute the test. |
    | <n> is 0, 1, or 2 depending on desired     |
    | test behavior:                             |
    |         <n> | effect                       |
    |       ------+--------------------          |
    |          0  | test both (default)          |
    |          1  | test ac_int only             |
    |          2  | test float only              |
    +--------------------------------------------+
     
    $ ./test-x86-64 
    Control which component gets tested by passing an integer!
    arg   | effect              
    ------+-------------------- 
       0  | test both (default) 
       1  | test ac_int only    
       2  | test float only     
    test AC_INT version and FLOAT version
     
    AC_INT COMPONENT - 81 ELEMENTS
    ac_inc:
    sizeof(uint512) = 64 (64)
    number of 512 bit (64-byte) numbers: 6
    PASS
     
    FLOATING-POINT COMPONENT - 81 ELEMENTS
    fp_inc:
    PASS
    OVERALL:
    PASSED
    
  4. Generate RTL and simulate the generated RTL with the ModelSim simulator:
    $ make test-fpga
    $ ./test-fpga
    Control which component gets tested by passing an integer!
    arg   | effect              
    ------+-------------------- 
       0  | test both (default) 
       1  | test ac_int only    
       2  | test float only     
    test AC_INT version and FLOAT version
     
    AC_INT COMPONENT - 81 ELEMENTS
    ac_inc:
    sizeof(uint512) = 64 (64)
    number of 512 bit (64-byte) numbers: 6
    PASS
     
    FLOATING-POINT COMPONENT - 81 ELEMENTS
    fp_inc:
    PASS
    OVERALL:
    PASSED
    
  5. Confirm that the outputs from the test-x86-64 command and the test-fpga command match.

    The test-x86-64 command runs C++ code on the processor, while the test-fpga command compiles the C++ source to Verilog RTL and then simulates the generated RTL using the testbench defined in the code.

    For instructions about how to view the waveforms for this component, see the Intel® High Level Synthesis Compiler User Guide.

  6. Navigate to the qsys directory and open the system using Platform Designer.
    $ cd ../qsys
    $ qsys-edit hls_afu_container.qsys
    
    In the Open System dialog box, select None for the Quartus project dropdown.
    Figure 39. Open System GUI
    Note: You can safely ignore the device part number for this example.
  7. Click Open.
  8. Click Close on the Open System Completed pop up.
  9. To reload the system and ensure that all search paths are correct, click on Validate System Integrity at the bottom of the Platform Designer window.
  10. After Validate System Integrity successfully completes, click Close. Investigate connectivity of Platform Designer components.
    Figure 40. System View GUI
  11. Generate HDL by clicking Generate HDL, then in Generation pop up, click Generate and Save Changes. You may safely ignore warnings. Click Close.
    Figure 41. Generate Completed GUI
  12. Exit Platform Designer and change directory to the hw/hls_afu/hw/rtl directory and verify contents:
    $ cd ..
    $ ls
    afu.sv  BBB_cci_mpf  BBB_ccip_avmm  cci-if  ccip_interface_reg.sv  ccip_std_afu.sv  filelist.txt  hls  hls_afu.json  pcie  qsys
    

    The N3000 does not support Intel® AFU Simulation Environment (ASE) for co-simulation of AFU RTL and host software.