YUGE at Northwestern University

This page documents procedures for setting up firmware and software on the YUGE board at Northwestern University. While some of the steps listed below will be specific to our set up, we hope this provides some useful guidance for others pursuing similar tasks.

uHAL on ZYNQ

Our uHAL set up is largely based on the procedures described at http://gauss.bu.edu/svn/common-atca-blade.software/ipbus/trunk/ipbus-zynq-2019-05-03/ (E. Hazen et al. at BU)

Image of the Petalinux file system on the YUGE

This is needed for the cross-compilation of the IPbus software suite. The image is created from the rootfs.tgz file.

cp /root/YUGEboot/for_kh/rootfs.tgz ./
mkdir rootfs
tar -xf rootfs.tgz -C rootfs/
dd if=/dev/zero of=rootfs.ext4  bs=4k count=60000
mkfs.ext4 rootfs.ext4
tune2fs -c0 -i0 rootfs.ext4

Cross-compile Boost C++ library

Boost 1.64.0 is cross-compiled for the YUGE Petalinux. (details?)

Check out the IPbus software package

For cross-compilation, we need to checkout a specific commit of the IPbus software repository, and then apply a patch (ipbus.diff) that can be found here.

git clone https://github.com/ipbus/ipbus-software.git
cd ipbus-software/
git checkout 24db2eb4c1bffe587011eb662bbf2ad9e231657f
git apply < ../ipbus.diff

Building the IPbus software suite

Mount the Petalinux file system image.

mount -o loop rootfs.ext4 /mnt/zynq_root
ZYNQROOT=/mnt/zynq_root

Several environment variables are declared for later convenience.

BOOSTDIR=/scratch/boost_cxx
export PATH=/scratch/python2.7/bin:${PATH}
export PYTHONPATH=/scratch/python2.7/lib
export PATH=/scratch/tar_1_24/bin:${PATH}
export PATH=/scratch/socat_2_0_0/bin:${PATH}
PLNXDIR=/scratch/petalinux-v2017.2
source ${PLNXDIR}/settings.sh

A couple library files need to be added to the Petalinux filesystem. Also, a few soft-links need to be defined.

cp ${PLNXDIR}/tools/linux-i386/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/libc/usr/lib/crti.o ${ZYNQROOT}/lib/
cp ${PLNXDIR}/tools/linux-i386/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/libc/usr/lib/crtn.o ${ZYNQROOT}/lib/
cd ${ZYNQROOT}/lib
ln -s libpthread-2.23.so ./libpthread.so
ln -s libm-2.23.so ./libm.so
ln -s libc-2.23.so ./libc.so
cd -

Compile.

cd ipbus-software
make -j8 CXX=arm-linux-gnueabihf-c++ LD=arm-linux-gnueabihf-c++ LDFLAGS="--sysroot=${ZYNQROOT} -L${ZYNQROOT}/lib -L${BOOSTDIR}/lib" CXXFLAGS="-isystem ${ZYNQROOT} -I${BOOSTDIR}/include/  -g -O2 -std=c++11 -Wall -fPIC -DDISABLE_PACKET_COUNTER_HACK" Set=uhal BUILD_PUGIXML=1 UHAL_NO_TESTS=1 UHAL_NO_PYTHON=1

Copy the uHAL libraries to the ZYNQ on the YUGE.

scp extern/pugixml/RPMBUILD/SOURCES/lib/libpugixml.so uhal/*/lib/* yuge:/usr/lib/

uHAL example

Download the code from here. Before cross-compiling, a couple more libraries need to be copied to the Petalinux file system. The main source code for the example is ipbus_test/src/common/test.cxx. The example reads in the value at a register, performs a write to that register the given input at run time, and reads out the register again.

cp ${PLNXDIR}/tools/linux-i386/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/libc/usr/lib/crt1.o ${ZYNQROOT}/lib/
cp ${PLNXDIR}/tools/linux-i386/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/libc/usr/lib/libc_nonshared.a ${ZYNQROOT}/usr/lib/
cd ../ipbus_test
make CXX=arm-linux-gnueabihf-c++ LDFLAGS="--sysroot=${ZYNQROOT} -L${BOOSTDIR}/lib" CXXFLAGS="-I${BOOSTDIR}/include/"

Copy the address mapping XML files and the executable to the ZYNQ on the YUGE.

scp *.xml build/bin/ipbus_test yuge:

  • If needed, set up the Xilinx Virtual Cable on the YUGE

/etc/init.d/xvcServer-init stop
cat system_top_6089_101_revA_reset.bit > /dev/xdevcfg
/etc/init.d/xvcServer-init start

  • If needed, load IPbus firmware on the KU 115. The bit file can be found here. Open the Hardware Manager in Vivado 2018.2 and program the KU 115. Note the IP address of the KU 115 is 192.168.200.16.

source /home/xilinx/Vivado/2018.2/settings64.sh
vivado

Log in to the ZYNQ via minicom. Set the ZYNQ to be on the 192.168.200.* subnet and run the ipbus_test executable.

minicom
ifconfig eth0 192.168.200.7
./ipbus_test 0xdeadbeef

  • Restore the IP address of the ZYNQ by simply disabling and enabling the eth0 interface

ifdown eth0
ifup eth0

Chip-to-chip example with EMP framework

Firmware

Software

-- KevinSung - 2019-07-15

Edit | Attach | Watch | Print version | History: r11 | r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r7 - 2019-09-03 - KevinSung
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback