• 2 replies
  • Latest Post - ‏2016-06-27T15:29:01Z by e_shannon
2 Posts

Pinned topic CAPI Memcopy Demo Kit

‏2015-12-09T16:10:33Z |


Link to the CAPI Memcopy Demo Kit folder can be found in the Bookmark section or in the Files (Folder) section.

Here are links to the latest doc and kit pair.


CAPIDemoKi​t-final.pd​f Document.  This doc replaces the "Memcopy Demo Kit Documentation.docx".



Updated on 2015-12-09T16:11:17Z at 2015-12-09T16:11:17Z by Doan_Trinh
  • LuYong
    2 Posts

    Re: CAPI Memcopy Demo Kit


    Running Simulation in VCS:

    0. Download pslse to the same (parallel) directory to capi-memcpy.

    git clone

    1. set environment variables for VCS ($VCS_HOME and license info)

    setenv VCS_HOME $CTEPATH/tools/synopsys/vcs-mx/J-2014.12-SP2 
    if (-e ${VCS_HOME}/bin/environ.csh) then    
        source ${VCS_HOME}/bin/environ.csh

    setenv LM_LICENSE_FILE ......

    2. set VPI_USER_H_DIR in "pslse/afu_driver/src/Makefile"

    ifdef VCS_HOME

    Then "make" pslse/afu_driver/src, pslse/pslse, pslse/libcxl,  consider BIT32=y if needed (refer to above post.)

    3. create a "vcs" directory, enter it, and make a "" like this:

    vcs -sverilog -PP -timescale=1ns/1ns -debug_all -l vcs.log +vpi \
    -file ../pslse/vcs_include ../pslse/afu_driver/src/afu_driver.c ../pslse/common/psl_interface.c \
    -f filelist

    4. "filelist" contains all AFU RTL files, plus "pslse/afu_driver/verilog/top.v" (see last line)


    5. Modify "pslse/vcs_include"

    -CFLAGS '-I[absolute path to /pslse/common]'
    -CFLAGS '-I$VCS_HOME/`vcs -platform`/lib'
    -P ./pslse/afu_driver/verilog/

    6. If you want to generate waveform (optional), add something in pslse/afu_driver/verilog/top.v:

           $vcdpluson (0, top.a0);

    7. go to directory "capi-memcpy", compile the application. You may have to include following in the Makefile for SIMULATION. (Different to running on real Power + FPGA hardware).

    -I../pslse/common -I../pslse/libcxl

    8. Open a terminal, go to directory "vcs", execute ""

    9. If compiling succeed, execute "./simv"  (which was generated by

    10. Open another terminal, go to directory "pslse/pslse", execute "./pslse"

    11. Open the third terminal, go to directory "capi-memcpy", execute the application. Make sure "pslse_server.dat" is there (Content may be just "localhost:16384". ) And Application can be executed multiple times. Every time pslse will send a reset to AFU. 

    12. Ctrl-C to terminate "pslse" in the second terminal. "exit" to terminate vcs in the first terminal. Then you can use "dve" to open the waveform "vcdplus.vpd". For other VCS related options, please refer to Synopsys document.

    Updated on 2016-05-11T04:22:32Z at 2016-05-11T04:22:32Z by LuYong
  • e_shannon
    1 Post

    Ask help for the CAPI Memcopy Demo Kit!


    Ask help for the CAPI Memcopy Demo Kit!
    Hi experts,
       I meet one big issue when run the CAPI Memcopy Demo Kit you offered in this site.
       The PSLSE is downloaded from the and the branch is master
       The event simulator is modelsim (questa 64bit 10.3.1).
       I change the localhost to my hostname in pslse_server.dat & shim_host.dat file.
    However the demo run unsuccessfully,It seems that the client disconnect while AFU is running to copy data.
    Do you meet the issue and know the root cause? It cost me too much time.

    First step I run the modelsim, source afu_questa_start.tcl ,sim successfully and then run -all to wait the pslse running.
    Below is error log .

    [root@CentOS7-64 pslse]# ./pslse
    INFO:PSLSE version 1.002 compiled @ Jun 27 2016 15:27:18
    INFO:PSLSE parm values:
        Seed     = 1461247482
        Timeout  = 10 seconds
        Response = 16%
        Paged    = 0%
        Reorder  = 90%
        Buffer   = 86%
    INFO:Attempting to connect AFU: afu0.0 @ CentOS7-64:32768
    PSL_SOCKET: Using PSL protocol level : 0.9908.1
    INFO:Clocking afu0.0
    INFO:Started PSLSE server, listening on CentOS7-64:16384
    INFO:Stopping clocks to afu0.0

    //noted by me: following is shown when run ./capi_memcpy -a -c 2 -t 1200 --v

    INFO:Connection from
    INFO: connected
    INFO:Attached client context 0: current attached clients = 1: client type = d

    INFO:Clocking afu0.0
    WARNING:get_bytes_silent:Socket disconnect on recv!
    INFO: client disconnect from afu0.0 context 0
    INFO:Detatched a client: current attached clients = 0

    INFO:Sending reset to AFU
    INFO:Stopping clocks to afu0.0

    [root@CentOS7-64 capi-memcpy]# ./capi_memcpy -a -c 2 -t 1200 --v
    INFO:Connecting to host 'CentOS7-64' port 16384
    expected vendor id: 4144, actual vendor id: 4144
    expected device id: 4445, actual device id: 4445
    Allocated memory at 0x0000000000923780:WED
    Allocated WED memory @ 0x0000000000923780
    Allocated memory at 0x0000000000923780:From
    Allocated From memory @ 0x0000000000923880
    Allocated memory at 0x0000000000923780:To
    Allocated To memory @ 0x0000000000925900
    Using seed 1467032376
    Starting copy of 8192 bytes from 0x0000000000923880 to 0x0000000000925900
    Mapping AFU registers...
    Trace Options register is 0000000081234567 after attach. Waiting for bit 32 to be a 1 (not including this read).
    Pre mmio state bit is 00000001
    Writing bit 0 of trace options register to 1 to end pre mmio stage
    AFU has started, waiting for AFU to finish...
    Trace Options register is 8000000001234567 shortly after start
    Post mmio state bit is 00000000
    ERROR! Trace options post mmio start bit still isn't set!


    2)In addtion there is another little issue.
     when run -all in modelsim, sometimes it don't show as below until ./pslse run:
     AFU Server is waiting for connection on CentOS7-64:32768
     But sometimes it can show even the ./pslse doesn't run.

     I also tar all the files in the attachment.


    Updated on 2016-06-27T15:43:20Z at 2016-06-27T15:43:20Z by e_shannon