Modifications to matchstiq_z1 SD card to run OCPI hello world app

MR
Munro, Robert M.
Tue, Nov 6, 2018 8:29 PM

I am currently working with the release_1.4 branch to run example code on a Matchstiq_Z1 target and saw some issues after bringing up the target and attempting to run the OCPI hello world app.  I've noted below the changes that needed to be made to get the environment to come up and the application to run properly.

-Robert Munro

After running writeOpenCPIZynqSD.sh, copying necessary support files to SD card, and booting matchstiq_z1:

give ethernet interface IP address

--> ifconfig eth0 192.168.0.8

call setup script to bring up OCPI environment

-->source /mnt/card/opencpi/mysetup.sh

-sh: ocpidriver: command not found

add path to ocpidriver to PATH so system can find it

--> export PATH=$PATH:/mnt/card/opencpi/bin

error about /mnt/card/opencpi/applications directory

-sh: cd: /mnt/card/opencpi/applications: No such file or directory

--> create /mnt/card/opencpi/applications directory

error from OCPI code about OCPI_CDK_DIR

Exiting for exception: OCPI_CDK_DIR set to "/mnt/card/opencpi", but "/mnt/card/opencpi" is not a valid OpenCPI CDK

--> create /mnt/card/opencpi/cdk and /mnt/card/opencpi/cdk/scripts directories
--> copy cdk/scripts from host OCPI environment into /BOOT/opencpi/scripts/

this is done to match what is being looked for in opencpi/runtime/util/misc/src/OcpiUtilMisc.cxx function getCDK()

error from OCPI code about OCPI_CDK_DIR

This ocpidriver script requires OCPI_CDK_DIR to be valid and it is not.

--> modify /mnt/card/opencpi/zynq_setup.sh to make OCPI_CDK_DIR == opencpi/cdk
--> export OCPI_CDK_DIR=/mnt/card/opencpi/cdk

doesn't find xilinx13_4/lib directory

Discovering available containers...
Exiting for exception: Error processing system configuration file "/mnt/card/opencpi/system.xml": when loading the "rcc" "container" driver, directory "/media/card/opencpi/cdk/xilinx13_4/lib" does not exist

create directory opencpi/cdk/xilinx13_4/lib and move contents of opencpi/lib/xilinx13_4 to opencpi/cdk/xilinx13_4/lib

source ./mysetup.sh works

root@zynq:/mnt/card/opencpi# source ./mysetup.sh
Discovering available containers...
Available containers:

Model Platform      OS    OS-Version  Arch    Name

0  hdl  zed                                        PL:0
1  rcc  xilinx13_4    linux  x13_4      arm      rcc0

attempt to run ocpirun hello.xml fails

% ocpirun hello.xml
Exiting for exception: No acceptable implementations found in any libraries for "ocpi.core.hello_world".  Use log level 8 for more detail.
% ocpirun -l8 hello.xml
....
OCPI( 8:127.0204): Searching directory /mnt/card/opencpi/xilinx13_4/artifacts recursively, from OCPI_LIBRARY_PATH
OCPI( 8:127.0204): Library path pathname "/mnt/card/opencpi/xilinx13_4/artifacts" is invalid or nonexistent, and ignored
....

create directory opencpi/xilinx13_4/artifacts and move contents of opencpi/artifacts to opencpi/xilinx13_4/artifacts

hello.xml application runs successfully

% pwd
/mnt/card/opencpi/cdk/applications
% ocpirun ./hello.xml
Hello World!

BOOT partition file tree:

.
|-- iveia-atlas-i-z7e.dtb
|-- opencpi
|  |-- bin
|  |  |-- ocpibootstrap.sh
|  |  |-- ocpidriver
|  |  |-- ocpihdl
|  |  |-- ocpi_linux_driver
|  |  |-- ocpirun
|  |  |-- ocpiserve
|  |  |-- ocpixml
|  |  -- ocpizynq | |-- cdk | | |-- applications | | | -- hello.xml
|  |  |-- scripts
|  |  |  |-- clean-env.sh
|  |  |  |-- findJtagByESN_xilinx
|  |  |  |-- freeze_project.sh
|  |  |  |-- genProjMetaData.py
|  |  |  |-- getESNfromUSB_xilinx
|  |  |  |-- getHdlPlatform.sh
|  |  |  |-- getPlatform.sh
|  |  |  |-- hdltargets.py
|  |  |  |-- loadBitStream
|  |  |  |-- loadFlash_altera
|  |  |  |-- loadFlash_xilinx
|  |  |  |-- makeProjectExports.sh
|  |  |  |-- makeStaticWorker.sh
|  |  |  |-- maybeExport.sh
|  |  |  |-- ocpiassets.py
|  |  |  |-- ocpibootstrap.sh
|  |  |  |-- ocpi-copy-projects
|  |  |  |-- ocpidev
|  |  |  |-- ocpidev_bash_complete
|  |  |  |-- ocpidev_run.py
|  |  |  |-- ocpidriver
|  |  |  |-- ocpi_linux_driver
|  |  |  |-- ocpisetup.sh
|  |  |  |-- ocpishow.py
|  |  |  |-- ocpisudo
|  |  |  |-- ocpitarget.sh
|  |  |  |-- ocpiutil.py
|  |  |  |-- probeJtag_altera
|  |  |  |-- probeJtag_xilinx
|  |  |  |-- setsid.py
|  |  |  |-- setup-prereq-dirs.sh
|  |  |  |-- setup-prerequisite.sh
|  |  |  |-- testrunprep.sh
|  |  |  |-- testrunremote.sh
|  |  |  |-- testrun.sh
|  |  |  |-- testutil.sh
|  |  |  |-- thaw_project.sh
|  |  |  |-- upgradeApp_v1_3.py
|  |  |  -- util.sh | | -- xilinx13_4
|  |      -- lib | | |-- libocpi_datagram_s.so | | |-- libocpi_dma_s.so | | |-- libocpi_hdl_s.so | | |-- libocpi_ocl_s.so | | |-- libocpi_ofed_s.so | | |-- libocpi_pio_s.so | | |-- libocpi_rcc_s.so | | |-- libocpi_remote_s.so | | |-- libocpi_socket_s.so | | |-- mdev-opencpi.rules | | -- opencpi-3.12.0-xilinx-dirty-v2013.4.ko
|  |-- mysetup.sh
|  |-- system.xml
|  |-- xilinx13_4
|  |  -- artifacts | | |-- 000-backpressure.so | | |-- 001-bias_cc.so | | |-- 002-biasFGM_cc.so | | |-- 003-bias_param.so | | |-- 004-bias_param.so | | |-- 005-bias_param.so | | |-- 006-bias.so | | |-- 007-bias_spcm.so | | |-- 008-file_read.so | | |-- 009-file_write.so | | |-- 010-hello_world_cc.so | | |-- 011-hello_world.so | | |-- 012-metadata_stressor.so | | |-- 013-nothing.so | | |-- 014-proxy_hdl.so | | |-- 015-proxy.so | | -- 016-testzc.so
|  |-- xml
|  |  |-- bias.xml
|  |  |-- copy.xml
|  |  |-- file-bias-capture.xml
|  |  |-- hello.xml
|  |  |-- nothing.xml
|  |  |-- pattern-bias-file.xml
|  |  |-- pattern.xml
|  |  |-- proxybias.xml
|  |  |-- ptest.xml
|  |  |-- tb_bias_file.xml
|  |  |-- tb_bias.xml
|  |  |-- testbias2.xml
|  |  |-- testbias5.xml
|  |  |-- testbias.xml
|  |  -- test.input | |-- zynq_net_setup.sh | -- zynq_setup.sh
|-- u-boot.bin
|-- uImage
`-- uramdisk.image.gz

I am currently working with the release_1.4 branch to run example code on a Matchstiq_Z1 target and saw some issues after bringing up the target and attempting to run the OCPI hello world app. I've noted below the changes that needed to be made to get the environment to come up and the application to run properly. -Robert Munro After running writeOpenCPIZynqSD.sh, copying necessary support files to SD card, and booting matchstiq_z1: # give ethernet interface IP address --> ifconfig eth0 192.168.0.8 # call setup script to bring up OCPI environment -->source /mnt/card/opencpi/mysetup.sh >> -sh: ocpidriver: command not found # add path to ocpidriver to PATH so system can find it --> export PATH=$PATH:/mnt/card/opencpi/bin # error about /mnt/card/opencpi/applications directory >> -sh: cd: /mnt/card/opencpi/applications: No such file or directory --> create /mnt/card/opencpi/applications directory # error from OCPI code about OCPI_CDK_DIR >> Exiting for exception: OCPI_CDK_DIR set to "/mnt/card/opencpi", but "/mnt/card/opencpi" is not a valid OpenCPI CDK --> create /mnt/card/opencpi/cdk and /mnt/card/opencpi/cdk/scripts directories --> copy cdk/scripts from host OCPI environment into /BOOT/opencpi/scripts/ # this is done to match what is being looked for in opencpi/runtime/util/misc/src/OcpiUtilMisc.cxx function getCDK() # error from OCPI code about OCPI_CDK_DIR >> This ocpidriver script requires OCPI_CDK_DIR to be valid and it is not. --> modify /mnt/card/opencpi/zynq_setup.sh to make OCPI_CDK_DIR == opencpi/cdk --> export OCPI_CDK_DIR=/mnt/card/opencpi/cdk # doesn't find xilinx13_4/lib directory >> Discovering available containers... >> Exiting for exception: Error processing system configuration file "/mnt/card/opencpi/system.xml": when loading the "rcc" "container" driver, directory "/media/card/opencpi/cdk/xilinx13_4/lib" does not exist # create directory opencpi/cdk/xilinx13_4/lib and move contents of opencpi/lib/xilinx13_4 to opencpi/cdk/xilinx13_4/lib # source ./mysetup.sh works >> root@zynq:/mnt/card/opencpi# source ./mysetup.sh >> Discovering available containers... >> Available containers: >> # Model Platform OS OS-Version Arch Name >> 0 hdl zed PL:0 >> 1 rcc xilinx13_4 linux x13_4 arm rcc0 # attempt to run ocpirun hello.xml fails >> % ocpirun hello.xml >> Exiting for exception: No acceptable implementations found in any libraries for "ocpi.core.hello_world". Use log level 8 for more detail. >> % ocpirun -l8 hello.xml >> .... >> OCPI( 8:127.0204): Searching directory /mnt/card/opencpi/xilinx13_4/artifacts recursively, from OCPI_LIBRARY_PATH >> OCPI( 8:127.0204): Library path pathname "/mnt/card/opencpi/xilinx13_4/artifacts" is invalid or nonexistent, and ignored >> .... # create directory opencpi/xilinx13_4/artifacts and move contents of opencpi/artifacts to opencpi/xilinx13_4/artifacts # hello.xml application runs successfully >> % pwd >> /mnt/card/opencpi/cdk/applications >> % ocpirun ./hello.xml >> Hello World! # BOOT partition file tree: . |-- iveia-atlas-i-z7e.dtb |-- opencpi | |-- bin | | |-- ocpibootstrap.sh | | |-- ocpidriver | | |-- ocpihdl | | |-- ocpi_linux_driver | | |-- ocpirun | | |-- ocpiserve | | |-- ocpixml | | `-- ocpizynq | |-- cdk | | |-- applications | | | `-- hello.xml | | |-- scripts | | | |-- clean-env.sh | | | |-- findJtagByESN_xilinx | | | |-- freeze_project.sh | | | |-- genProjMetaData.py | | | |-- getESNfromUSB_xilinx | | | |-- getHdlPlatform.sh | | | |-- getPlatform.sh | | | |-- hdltargets.py | | | |-- loadBitStream | | | |-- loadFlash_altera | | | |-- loadFlash_xilinx | | | |-- makeProjectExports.sh | | | |-- makeStaticWorker.sh | | | |-- maybeExport.sh | | | |-- ocpiassets.py | | | |-- ocpibootstrap.sh | | | |-- ocpi-copy-projects | | | |-- ocpidev | | | |-- ocpidev_bash_complete | | | |-- ocpidev_run.py | | | |-- ocpidriver | | | |-- ocpi_linux_driver | | | |-- ocpisetup.sh | | | |-- ocpishow.py | | | |-- ocpisudo | | | |-- ocpitarget.sh | | | |-- ocpiutil.py | | | |-- probeJtag_altera | | | |-- probeJtag_xilinx | | | |-- setsid.py | | | |-- setup-prereq-dirs.sh | | | |-- setup-prerequisite.sh | | | |-- testrunprep.sh | | | |-- testrunremote.sh | | | |-- testrun.sh | | | |-- testutil.sh | | | |-- thaw_project.sh | | | |-- upgradeApp_v1_3.py | | | `-- util.sh | | `-- xilinx13_4 | | `-- lib | | |-- libocpi_datagram_s.so | | |-- libocpi_dma_s.so | | |-- libocpi_hdl_s.so | | |-- libocpi_ocl_s.so | | |-- libocpi_ofed_s.so | | |-- libocpi_pio_s.so | | |-- libocpi_rcc_s.so | | |-- libocpi_remote_s.so | | |-- libocpi_socket_s.so | | |-- mdev-opencpi.rules | | `-- opencpi-3.12.0-xilinx-dirty-v2013.4.ko | |-- mysetup.sh | |-- system.xml | |-- xilinx13_4 | | `-- artifacts | | |-- 000-backpressure.so | | |-- 001-bias_cc.so | | |-- 002-biasFGM_cc.so | | |-- 003-bias_param.so | | |-- 004-bias_param.so | | |-- 005-bias_param.so | | |-- 006-bias.so | | |-- 007-bias_spcm.so | | |-- 008-file_read.so | | |-- 009-file_write.so | | |-- 010-hello_world_cc.so | | |-- 011-hello_world.so | | |-- 012-metadata_stressor.so | | |-- 013-nothing.so | | |-- 014-proxy_hdl.so | | |-- 015-proxy.so | | `-- 016-testzc.so | |-- xml | | |-- bias.xml | | |-- copy.xml | | |-- file-bias-capture.xml | | |-- hello.xml | | |-- nothing.xml | | |-- pattern-bias-file.xml | | |-- pattern.xml | | |-- proxybias.xml | | |-- ptest.xml | | |-- tb_bias_file.xml | | |-- tb_bias.xml | | |-- testbias2.xml | | |-- testbias5.xml | | |-- testbias.xml | | `-- test.input | |-- zynq_net_setup.sh | `-- zynq_setup.sh |-- u-boot.bin |-- uImage `-- uramdisk.image.gz