Open main menu

DAVE Developer's Wiki β

Changes

BELK-TN-005: Running PYNQ on Bora

14,767 bytes added, 11:13, 22 November 2021
no edit summary
{{Applies To Bora}}
{{Applies To BoraX}}
{{AppliesToBORA_TN}}
{{AppliesToBORA_Xpress_TN}}
{{InfoBoxBottom}}
|-
|1.1.0
|October November 2018|Moved to PYNQ 2.3<br>Added sections about FIR filter implementation and testing
|}
This Technical Note shows hot to run PYNQ on Bora platform. It is worth remembering that, even though the procedure was tested on Bora, it should work on BoraX as well without any modification.
To see PYN PYNQ in action, please see [https://www.youtube.com/watch?v=LoLCtSzj9BU this clip].
==Testbed's hardware Hardware and software configurationSoftware Configuration==
As stated before, the procedure was tested on Bora/BoraEVB hardware platform.
With regard to the software configuration, the following versions were used:
*[[BELK/BXELK_software_components#Kits.27_composition|U-Boot 20142018.07 released with 1 (at the time of this writing, '''this version was not officially supported by any BELK 2.1.0]]release yet''')*Linux kernel 4.14.0 (at the time of this writing, '''this version was not officially supported by any BELK release yet''')*root file systemRoot filesystem: extracted from [http://files.digilent.com/Products/PYNQ/pynq_z1_v2.3.zip Pynq-Z1 v2.3 image] and mounted from microSD card.
Original root file system included several kernel drivers built as modules. The Linux kernel used for this test was different than the kernel released along with the PYNQ's root file system, however. Consequently, these modules were not compatible with the kernel running on Bora. To overcome this issue, these drivers were linked statically into the kernel image.
==Setting up Up the boardBoard==U-Boot environment was configured in order to retrieve the kernel image and the device tree blob via TFTP protocolfrom the microSD card. Also, it was configured to make the kernel to mount the root file system over NFSfrom a partition of the microSD card.
The following box shows the full boot process (clock on the "Expand" box):
<pre class="workstation-terminal mw-collapsible mw-collapsed">
U-Boot 20142018.07-0496701-g7b885e100022-dirty g322f20f (Feb 20 2015 Aug 28 2018 - 1711:0120:2719 +0200) [belk-2.1.0]
Model: BoraBoard: BORAXilinx ZynqSilicon: v3.1
I2C: ready
DRAM: ECC disabled 1 GiB
Relocating to 3ff22000, new gd at 3eae1ee8, sp at 3eae1ec0
NAND: 1024 MiB
MMC: zynq_sdhcisdhci@e0100000: 0(SD)SF: Detected S25FL256S_64K s25fl256s_64k with page size 256 Bytes, erase size 64 KiB, total 32 MiB3BIn: serial@e0001000Out: serial@e0001000Err: serial@e0001000NetSF: Gem.e000b000Detected s25fl256s_64k with page size 256 Bytes, erase size 64 KiB, total 3BHit any key to stop autobootSF: 0 Detected s25fl256s_64k with page size 256 Bytes, erase size 64 KiB, total 3BGem.e000b000 Waiting for PHY auto negotiation to complete...... doneSOM ConfigID#: 00000001Using Gem.e000b000 deviceSOM UniqueID#: 01234567:89abcdefTFTP from server 192.168.2.10; our IP address is 192.168.2.11ds2431_readmem(): error in chip resetFilename 'bora/uImage'.ds2431_readmem(): error in reading bufferLoad addressds2431_readmem(): 0x2080000error in chip resetLoadingds2431_readmem(): error in reading bufferCB ConfigID CRC mismatch for 0x00000000 (was 0x00000000, expected 0x2144df1c) atCB ConfigID#: ffffffffCB UniqueID################################################################: 00000000:00000000 #################################################################Net: ZYNQ GEM: e000b000, phyaddr 7, interface rgmii-id #################################################################eth0: ethernet@e000b000 #################################################################Hit ENTER within 3 seconds to stop autoboot ###################reading uImage 64140752 bytes read in 239 ms (16.8 5 MiB/sdoneBytes transferred = 4082664 (3e4be8 hex)Using Gem.e000b000 deviceTFTP from server 192.168.2.10; our IP address is 192.168.2.11Filename 'bora/reading bora.dtb'.Load address: 0x2000000Loading: # 310678 bytes read in 13 ms (801.4 MiB8 KiB/sdoneBytes transferred = 10634 (298a hex)Unknown command FDT: property som_configid FDT: override 'configidsom_configid' - try with 'help00000001'FDT: property cb_configid does not match
## Booting kernel from Legacy Image at 02080000 ...
Image Name: Linux-4.14.0-xilinx-0000800009-ge79ecg30fab
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4082600 4140688 Bytes = 3.9 MiB
Load Address: 00008000
Entry Point: 00008000
Booting using the fdt blob at 0x2000000
Loading Kernel Image ... OK
Loading Device Tree to 1effa000, end 1efff989 1efff9b5 ... OK
Switching to NAND storage before starting Linux
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.0-xilinx-0000800009-ge79ecefg30fabf3-dirty (sysadmin@stage-OptiPlex-7010) (gcc version 7.2.1 20171011 (Linaro G8stage8
[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cacheinstructie
[ 0.000000] OF: fdt: Machine model: Bora
[ 0.000000] bootconsole [earlycon0] enabled
[ 0.000000] cma: Reserved 16 MiB at 0x3f000000
[ 0.000000] On node 0 totalpages: 262144
[ 0.000000] free_area_init_node: node 0, pgdat c0a3d840c0a3e2c0, node_mem_map ef6f7000ef6f700
[ 0.000000] Normal zone: 1728 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] HighMem zone: 65536 pages, LIFO batch:15
[ 0.000000] random: fast init done
[ 0.000000] percpu: Embedded 16 pages/cpu @ef6cd000 s35340 r8192 d22004 u65536u6556
[ 0.000000] pcpu-alloc: s35340 r8192 d22004 u65536 alloc=16*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 260416
[ 0.000000] Kernel command line: root=/dev/nfs mmcblk0p2 rootwait rw nfsrootconsole=192.168.2.10:/home/sysadmin/nfs_server,tcp ip=192.168.2.11:192.168.2.10tty)
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 1011672K1011668K/1048576K available (6144K kernel code, 298K rwdata, 1616K rodata, 1024K init, 255K bss, 20520K reser301K rwd)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] .text : 0xc0008000 - 0xc0700000 (7136 kB)
[ 0.000000] .init : 0xc0900000 - 0xc0a00000 (1024 kB)
[ 0.000000] .data : 0xc0a00000 - 0xc0a4aa40 0xc0a4b730 ( 299 302 kB)[ 0.000000] .bss : 0xc0a506d4 0xc0a51640 - 0xc0a904ec 0xc0a9156c ( 256 kB)
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[ 0.000000] efuse mapped to f0802000
[ 0.000000] slcr mapped to f0804000
[ 0.000000] L2C: platform modifies aux control register: 0x72360000 0x02060000 -> 0x727600000x3240[ 0.000000] L2C: DT/platform modifies aux control register: 0x72360000 0x02060000 -> 0x727600000x0
[ 0.000000] L2C-310 erratum 769419 enabled
[ 0.000000] L2C-310 enabling early BRESP for Cortex-A9
[ 0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[ 0.000000] L2C-310 ID prefetch enabled, offset 1 lines
[ 0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[ 0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[ 0.000000] L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x767600010x46460001
[ 0.000000] zynq_clock_init: clkc starts at f0804100
[ 0.000000] Zynq clock init
[ 0.000000] ps_clk frequency not specified, using 33 MHz.
[ 0.000011000012] sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns4398s[ 0.007864007869] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 nsmax_cycls[ 0.018882018887] Switching to timer-based delay loop, resolution 3ns[ 0.024887024890] clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 nsms[ 0.033938033942] timer #0 at f080c000, irq=17[ 0.038270038284] Console: colour dummy device 80x30[ 0.042606042621] Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333f)[ 0.053110053124] pid_max: default: 32768 minimum: 301[ 0.057905057934] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)[ 0.064395064426] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)[ 0.072131072195] CPU: Testing write buffer coherency: ok[ 0.077108077177] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000[ 0.118017118018] Setting up static identity map for 0x100000 - 0x100060[ 0.124196124192] Hierarchical SRCU implementation.[ 0.167975167977] smp: Bringing up secondary CPUs ...[ 0.218351218359] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001[ 0.218477218485] smp: Brought up 1 node, 2 CPUs[ 0.228179228186] SMP: Total of 2 processors activated (1333.33 BogoMIPS).[ 0.234489234494] CPU: All CPU(s) started in SVC mode.[ 0.240198240192] devtmpfs: initialized[ 0.246231246309] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4[ 0.254021254104] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 nsms[ 0.263716263796] futex hash table entries: 512 (order: 3, 32768 bytes)[ 0.270996271171] pinctrl core: initialized pinctrl subsystem[ 0.277617277724] NET: Registered protocol family 16[ 0.290120290094] DMA: preallocated 256 KiB pool for atomic coherent allocations[ 0.298475298458] cpuidle: using governor ladder[ 0.302483302469] cpuidle: using governor menu[ 0.313247] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.[ 0.321201321146] hw-breakpoint: maximum watchpoint size is 4 bytes.[ 0.327075327068] zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xf0880000[ 0.334026334169] zynq-pinctrl 700.pinctrl: zynq pinctrl initialized[ 0.340275340355] e0000000.serial: ttyPS1 at MMIO 0xe0000000 (irq = 27, base_baud = 3125000) is a xuartpss[ 0.349721349793] e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 28, base_baud = 3125000s`+$$$$&i???????????????m???AM?u????????5) is a xuartpsm???????58813] console [ttyPS0] enable[ 0.358739365860] console bootconsole [ttyPS0earlycon0] enableddisabled[ 0.365786365860] bootconsole [earlycon0] disabled[ 0.391897391828] vgaarb: loaded[ 0.394904394848] SCSI subsystem initialized[ 0.399005398856] usbcore: registered new interface driver usbfs[ 0.404474404322] usbcore: registered new interface driver hub[ 0.410962409684] usbcore: registered new device driver usb[ 0.416144414850] pps_core: LinuxPPS API ver. 1 registered[ 0.421071421049] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>Giom>[ 0.430215430186] PTP clock support registered[ 0.439206438162] FPGA manager framework[ 0.441748] fpga-region fpga-full: FPGA Region probed[ 0.447818] clocksource: Switched to clocksource arm_global_timer[ 0.456406464385] NET: Registered protocol family 2[ 0.461666469379] TCP established hash table entries: 8192 (order: 3, 32768 bytes)[ 0.468746476433] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)[ 0.475282482972] TCP: Hash tables configured (established 8192 bind 8192)[ 0.482089489406] UDP hash table entries: 512 (order: 2, 16384 bytes)[ 0.487962495287] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)[ 0.494500501835] NET: Registered protocol family 1[ 0.499167506513] RPC: Registered named UNIX socket transport module.[ 0.505054512397] RPC: Registered udp transport module.[ 0.509716517038] RPC: Registered tcp transport module.[ 0.514377521756] RPC: Registered tcp NFSv4.1 backchannel transport module.[ 0.520846528176] PCI: CLS 0 bytes, default 64[ 0.525293532666] hw perfevents: no interrupt-affinity property for /pmu@f8891000, guessing.[ 0.533370540745] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters availablecountee[ 0.542975550340] workingset: timestamp_bits=14 max_order=18 bucket_order=4[ 0.550214557518] jffs2: version 2.2. (NAND) (SUMMARY) © ?? 2001-2006 Red Hat, Inc.[ 0.558624566071] bounce: pool size: 64 pages[ 0.562560569999] io scheduler noop registered[ 0.566398573841] io scheduler deadline registered[ 0.570771578319] io scheduler cfq registered (default)[ 0.575391582938] io scheduler mq-deadline registered[ 0.579931587451] io scheduler kyber registered[ 0.585789593500] dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330[ 0.592466600167] dma-pl330 f8003000.dmac: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16Nu6[ 0.611411619150] brd: module loaded[ 0.622226630120] loop: module loaded[ 0.626772634849] libphy: Fixed MDIO Bus: probed[ 0.632104640197] CAN device driver interface[ 0.638058646007] libphy: MACB_mii_bus: probed[ 0.739956748568] macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 30 (00:50:c2:1e:af:b20xe00)[ 0.749735758351] Micrel KSZ9031 Gigabit PHY e000b000.ethernet-ffffffff:07: attached PHY driver attach)[Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=e000b000.ethernet-ffffffff:07, irq=POLL)[ 0.765859774459] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k[ 0.771636780234] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.[ 0.778467787046] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver[ 0.784968793549] ehci-pci: EHCI PCI platform driver[ 0.789502798084] usbcore: registered new interface driver usb-storage[ 0.795672804265] chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulatorr[ 0.804778813361] ULPI transceiver vendor/product ID 0x0424/0x0006[ 0.810376818966] Found SMSC USB331x ULPI transceiver.[ 0.814957823545] ULPI integrity check: passed.[ 0.830928829554] i2c /dev entries driver[ 0.838363834590] rtc-ds3232 0-0068: oscillator discontinuity flagged, time unrelie[ 0.844360] rtc-ds3232 0-0068: rtc core: registered ds3232 as rtc0[ 0.844584850581] cdns-i2c e0004000.i2c: 100 kHz mmio e0004000 irq 24[ 0.850741856711] IR NEC protocol handler initialized[ 0.855190861182] IR RC5(x/sz) protocol handler initialized[ 0.860245866191] IR RC6 protocol handler initialized[ 0.864737870729] IR JVC protocol handler initialized[ 0.869320875218] IR Sony protocol handler initialized[ 0.873851879885] IR SANYO protocol handler initialized[ 0.878538884506] IR Sharp protocol handler initialized[ 0.883246889221] IR MCE Keyboard/mouse protocol handler initialized[ 0.889040895008] IR XMP protocol handler initialized[ 0.894822900782] ina2xx 0-0041: power monitor ina226 (Rshunt = 10000 uOhm)[ 0.902946908903] cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer at f098f000 with timeout 10swis[ 0.911449917362] Xilinx Zynq CpuIdle Driver started[ 0.916232922177] sdhci: Secure Digital Host Controller Interface driver[ 0.922353928301] sdhci: Copyright(c) Pierre Ossman[ 0.926669932611] sdhci-pltfm: SDHCI platform and OF driver helper[ 0.999271997882] mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMAA[ 1.008137005617] usbcore: registered new interface driver usbhid[ 1.015697011141] usbhid: USB HID core driver[ 1.020813015101] nandxlnk xlnk: Major 246[ 1.021504] xlnk xlnk: xlnk driver loaded[ 1.025455] xlnk xlnk: xlnk_pdev is not null[ 1.031043] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xd3[ 1.027139037334] nand: AMD/Spansion S34ML08G1[ 1.031052041248] nand: 1024 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64s4[ 1.042261052658] Bad block table found at page 524224, version 0x01[ 1.049007059763] Bad block table found at page 524160, version 0x01[ 1.055488066390] 8 ofpart partitions found on MTD device pl35x-nand[ 1.061255072164] Creating 8 MTD partitions on "pl35x-nand":[ 1.066363077262] 0x000000000000-0x000000040000 : "nand-SPL"[ 1.072821083630] 0x000000040000-0x000000100000 : "nand-uboot"[ 1.079178090029] 0x000000100000-0x000000140000 : "nand-uboot-env1"[ 1.086061096879] 0x000000140000-0x000000180000 : "nand-uboot-env2"[ 1.091854103695] mmc00x000000180000-0x000000780000 : new SDHC card at address 0001"nand-bitstream"[ 1.096784110419] mmcblk00x000000780000-0x000000800000 : mmc0:0001 SD16G 14.6 GiB "nand-device-tree"[ 1.098576117252] mmcblk00x000000800000-0x000001000000 : p1 p2"nand-linux"[ 1.105146123684] 0x0000001800000x000001000000-0x000000780000 0x000020000000 : "nand-bitstreamrootfs"[ 1.111979129119] 0x000000780000-0x000000800000 mmc0: "nand-device-tree"new high speed SDHC card at address 59b4[ 1.118790135058] 0x000000800000-0x000001000000 mmcblk0: mmc0: "nand-linux"59b4 USDU1 7.51 GiB [ 1.125199140519] 0x000001000000-0x000020000000 mmcblk0: "nand-rootfs"p1 p2[ 1.136702141949] fpga_manager fpga0: Xilinx Zynq FPGA Manager registered[ 1.142637] NET: Registered protocol family 17[ 1.141185142656] can: controller area network core (rev 20170425 abi 9)[ 1.147347142727] NET: Registered protocol family 29[ 1.151750142745] can: raw protocol (rev 20170425)[ 1.155961142751] can: broadcast manager protocol (rev 20170425 t)[ 1.161799142761] can: netlink gateway (rev 20170425) max_hops=1[ 1.167598143201] Registering SWP/SWPB emulation handler[ 1.178968150741] rtc-ds3232 0-0068: hctosys: unable to read the hardware clock[ 51.319523194018] macb e000b000.ethernet eth0: link up EXT4-fs (1000/Fullmmcblk0p2): couldn't mount as ext3 due to feature incoms[ 51.379226401631] IPEXT4-Config: Completefs (mmcblk0p2):recovery complete[ 51.382373408763] device=eth0, hwaddr=00EXT4-fs (mmcblk0p2):50mounted filesystem with ordered data mode. )[ 1.416811] VFS:c2:1e:afMounted root (ext4 filesystem) on device 179:b2, ipaddr=192.168.2.11, mask=255[ 1.255.255.0, gw=192.168.2.254424413] devtmpfs: mounted[ 51.392632430489] host=bora, domain=, nis-domain=(none)Freeing unused kernel memory: 1024K[ 51.397730962437] bootserver=192.168.2.10systemd[1]: System time before build time, rootserver=192.168advancing clock.2.10, rootpath=[ 52.421541053678] systemd[1] VFS: Mounted root (nfs filesystemsystemd 237 running in system mode. (+PAM +AUDIT +SE) on device 0:12.[ 52.427672075084] systemd[1] devtmpfs: mountedNo virtualization found in DMI[ 52.433737080193] systemd[1] Freeing unused kernel memory: 1024KNo virtualization found in CPUID[ 52.589676085472] systemd[1]: System time before build timeVirtualization XEN not found, advancing clock./proc/xen does not exit[ 52.634991092904] systemd[1]: Mounting cgroup to No virtualization found in /sysproc/fsdevice-tree/cgroup/debug of type cgroup with options debug.*[ 52.644893099533] systemd[1]: Mounting cgroup to No virtualization found in /sysproc/fs/cgroup/cpu,cpuacct of type cgroup with options cpu,cpuacct.cpuinfo.[ 52.655853105561] systemd[1]: Mounting cgroup to /sys/fsThis platform does not support /cgroupproc/net_cls,net_prio of type cgroup with options net_cls,net_prio.sysinfo[ 52.667567111936] systemd[1]: Mounting cgroup to /sys/fs/cgroup/pids of type cgroup with options pids.Found VM virtualization none[ 52.677166116853] systemd[1]: Mounting cgroup to /sys/fs/cgroup/memory of type cgroup with options memoryDetected architecture arm.[ 52.687181129403] systemd[1]: Mounting cgroup to /sys/fs/cgroup/blkio cpuset of type cgroup with options blkiocgr.[ Welcome to PynqLinux, based on Ubuntu 18.04! [ 52.697090327802] systemd-gpt-auto-generator[1713]: Mounting cgroup to /sysdev/fsmmcblk0p2: root device /cgroup/cpuset of type cgroup with options cpusetde.[ 52.707072347055] systemd[1-fstab-generator[711]: Mounting cgroup to Parsing /sysetc/fs/cgroup/devices of type cgroup with options devices.fstab[ 52.717153367721] systemd-getty-generator[1712]: Mounting cgroup to /sys/fs/cgroup/perf_event of type cgroup with options perf_event.Automatically adding serial getty .[ 52.727750383535] systemd-fstab-generator[1711]: Mounting cgroup to Found entry what=/sysvar/fs/cgroup/rdma of type cgroup with options rdma.swap where=no[ 52.830891394393] systemd-gettyfstab-generator[691711]: Automatically adding serial getty for /dev/ttyPS0Swap not supported, ignoring fstab.[ 52.849188396033] systemd-rc-localsysv-generator[692717]: Automatically adding rcNative unit for binfmt-localsupport.serviceserv.[ 52.859815404927] systemd-gpt-autosysv-generator[698717]: Neither root nor /usr file system are on a (single) block deviceNative unit for dbus.service alread.[ 52.881532405867] systemd-fstabsysv-generator[699717]: Parsing /etc/fstabNative unit for 2ping.service alrea.[ 52.892952422705] systemd-fstabsysv-generator[699717]: Found entry what=/var/swap where=none type=swap nofail=no noauto=no[ Native unit for ssh.service already.[ 52.899832439590] systemd-sysv-generator[690717]: Looking Native unit for unit files in (higher priority first):resolvconf.service .[ 52.899847449886] systemd-sysv-generator[690717]: /etc/systemd/systemNative unit for rsync.service alrea.[ 52.899858466783] systemd-sysv-generator[690717]: /run/systemd/systemNative unit for hwclock.service alr.[ 52.899869477732] systemd-sysv-generator[690717]: /usr/local/lib/systemd/systemNative unit for udev.service alread.[ 52.899879486743] systemd-sysv-generator[690717]: /lib/systemd/systemCannot find unit cpufrequtils.servi.[ 52.899888495013] systemd-sysv-generator[690717]: /usr/lib/systemd/systemNative unit for rsyslog.service alr.[ 52.900359612620] systemd-sysvgpt-auto-generator[690713]: Looking for SysV init scripts in:No suitable partition table fou.[ 52.900373632294] systemd-sysv-generator[690]ge: /etc/init.d72 output lines suppressed due to ratelimiting[ 5 OK ] Created slice User and Session Slice.900553[ OK ] systemd-sysv-generatorCreated slice System Slice.[690 OK ]: Looking for SysV rcNListening on Syslog Socket.d links in:[ 5 OK ] Reached target System Time Synchronized.900566] systemd-sysv-generator[690 OK ]: Listening on /dev/etcinitctl Compatibility Named Pipe.[ 5 OK ] Listening on udev Control Socket.964211[ OK ] systemdCreated slice system-fstab-generator[699]: Swap not supported, ignoring fstab swap entry for /var/swapgetty.slice.[ 5 OK ] Listening on udev Kernel Socket.998886] systemd-sysv-ge: 132 output lines suppressed due to ratelimiting[ 6.797327 OK ] Started ntp-systemd-journaldnetif.path.[705 OK ]: Fixed min_use=1Listening on Journal Socket.0M max_use=50 Starting Restore / save the current clock... Mounting Kernel Debug File System...[ OK ] Listening on Journal Socket (/dev/log).2M max_size=6 Starting Journal Service.2M min_size=512.0K keep_free=75.3M n_max_files=100[ 63.821668407066] systemd-journald[705727]: Reserving 11434 entries in hash table.Operating on architecture: arm[ 63.830624414031] systemd-journald[705727]: Vacuuming...Operating on architecture: arm[ 63.835181419607] systemd-journald[705727]: Vacuuming done, freed 0B of archived journals Operating on disk.architecture: arm[ 63.844639425049] systemd-journald[705727]: Flushing /dev/kmsg..Restricting namespace to: .[ 63.849977430138] systemd-journald[705727]: systemd-journald running as pid 705Operating on architecture: arm[ 63.866614435508] systemd-journald[705727]: Compressed data object 537 -> 288 using XZBlocking cgroup. Starting Create Static Device Nodes in /dev...[ 63.910862439657] systemd-journald[705[727]: Sent READY=1 notificationBlocking ipc.[ 63.916579448528] systemd-journald[705727]: Sent WATCHDOG=1 notificationBlocking net.[ 63.927315452384] systemd-journald[705727]: Successfully sent stream file descriptor to service managerBlocking mnt.[ 10 3.657105456241] systemd[1727]: Accepted new private connectionBlocking pid.[ 10 3.686808460181] systemd[1727]: Got disconnect on private connectionBlocking user.[ 10 3.719384464128] systemd[1727]: sysinitBlocking uts.target changed dead -> active[ 10 3.779432468467] systemd[1727]: paths.target changed dead -> activeOperating on architecture: arm[ 10 3.832142473876] systemd[1727]: systemdFailed to add rule for system call mpx() / -tmpfiles-clean.timer: Changed dead -> waiting10030,n[ 11 3.657192484747] systemd[727] random: crng init doneFailed to add rule for system call security() / -1n[ 12 3.688449496026] systemd[727]: Failed to add rule for system call tuxcall() / -journald10n[ 3.507233] systemd[705727]: Successfully sent stream file descriptor Failed to service manageradd rule for system call get_kernel_symsn[ 3.519123] systemd[727]: Failed to add rule for system call kexec_file_loadn[ 3.531046] systemd[727]: Failed to add rule for system call spu_run() / -10n[ OK [ 3.542268] systemd[727]: Failed to add rule for system call iopl() /n[ 3.554737] systemd[727]: Failed to add rule for system call putpmsg() / -10n[ 3.565922] systemd[727]: Failed to add rule for system call rtas() / -10187n] [ 3.576844] systemd[727]: Failed to add rule for system call prof() / -100nStarted Dispatch Password Requests to Console Directory Watch.[ 3.587946] systemd[727]: Failed to add rule for system call break() / -1000n[ 3.604337] systemd[727]: Failed to add rule for system call modify_ldt() / n[ 3.615755] systemd[727]: Failed to add rule for system call s390_pci_mmio_wn[ 3.627969] systemd[727]: Failed to add rule for system call profil() / -100n[ 3.639044] systemd[727]: Failed to add rule for system call vm86old() / -10n[ 3.650184] systemd[727]: Failed to add rule for system call ssetmask() / -1n[ 3.661428] systemd[727]: Failed to add rule for system call stty() / -10065n[[ 3.672357] systemd[727]: Failed to add rule for system call umount() / -10n OK ] Created slice system-serial\x2dgetty.slice.[ 3.683529] systemd[727]: Failed to add rule for system call idle() / -10023n[ 3.699932] systemd[727]: Failed to add rule for system call sgetmask() / -1n[ 3.711182] systemd[727]: Failed to add rule for system call switch_endian()n[ 3.722844] systemd[727]: Failed to add rule for system call stime() / -1006n[ 3.733813] systemd[727]: Failed to add rule for system call afs_syscall() /n[ 3.745317] systemd[727]: Failed to add rule for system call ulimit() / -100n[ OK [ 3.756411] systemd[727]: Failed to add rule for system call gtty() /n] Reached target Swap.[ 3.768851] systemd[727]: Failed to add rule for system call s390_pci_mmio_rn[ 3.782994] systemd[727]: Failed to add rule for system call query_module() n[ 3.794602] systemd[727]: Failed to add rule for system call vm86() / -10071n[ 3.805488] systemd[727]: Failed to add rule for system call ftime() / -1001n[ 3.816452] systemd[727]: Failed to add rule for system call ioperm() / -100n[ 3.827506] systemd[727]: Failed to add rule for system call create_module()n[ 3.839168] systemd[727]: Failed to add rule for system call lock() / -10027n[ OK [ 3.850068] systemd[727]: Failed to add rule for system call getpmsg(n] Reached target Slices.[ 3.862759] systemd[727]: Failed to add rule for system call s390_runtime_inn Starting Remount Root and Kernel File Systems...[ 3.909061] systemd-journald[727]: Found cgroup2 on /sys/fs/cgroup/unified, r[ 3.922659] systemd-journald[727]: Fixed min_use=1.0M max_use=50.2M max_size0[ 3.940166] systemd-journald[727]: Reserving 11434 entries in hash table.[ 3.947461] systemd-journald[727]: Vacuuming...[ 3.952153] systemd-journald[727]: Vacuuming done, freed 0B of archived jour.[ 3.964548] systemd-journald[727]: Flushing /dev/kmsg... Starting Nameserver information manager...[ 3.969888] systemd-journ7[ 3.982554] systemd-journald[727]: /dev/kmsg buffer overrun, some messages l.  Starting udev Coldplug all Devices...[ 4.045414] systemd-journald[727]: Sent READY=1 notification.[ 4.051488] systemd-journald[727]: Sent WATCHDOG=1 notification.[ OK ] Started Forward Password Requests to Wall Directory Watch.[ OK ] Reached target Local Encrypted Volumes. Starting Load Kernel Modules...[ OK ] Reached target Remote File Systems. Mounting POSIX Message Queue File System...[ OK ] Started Journal Service.[ OK ] Started Restore / save the current clock.[ OK ] Mounted Kernel Debug File System.[ OK ] Started Create Static Device Nodes in /dev.[ OK ] Started Remount Root and Kernel File Systems.[ OK ] Started Load Kernel Modules.[ OK ] Mounted POSIX Message Queue File System.[ OK ] Started Nameserver information manager.[ OK ] Reached target Network (Pre). Starting Apply Kernel Variables... Mounting Kernel Configuration File System... Starting Load/Save Random Seed...[ OK ] Reached target Local File Systems (Pre).[ OK ] Reached target Local File Systems. Starting Enable support for additional executable binary formats... Starting udev Kernel Device Manager... Starting Flush Journal to Persistent Storage...[ OK ] Started udev Coldplug all Devices.[ OK ] Started Apply Kernel Variables.[ OK ] Mounted Kernel Configuration File System.[ OK ] Started udev Kernel Device Manager.[ OK ] Started Load/Save Random Seed.[ OK ] Started Enable support for additional executable binary formats. Starting Raise network interfaces...[ OK ] Found device /dev/ttyPS0.[ OK ] Started Flush Journal to Persistent Storage. Starting Create Volatile Files and Directories...[ OK ] Found device /sys/subsystem/net/devices/eth0.[ OK ] Started ifup for eth0.[ OK ] Started Create Volatile Files and Directories. Starting Network Time Synchronization... Starting Update UTMP about System Boot/Shutdown... Starting Network Name Resolution...[ OK ] Started Update UTMP about System Boot/Shutdown.[ OK ] Started Network Time Synchronization.[ OK ] Reached target System Initialization.[ OK ] Started Discard unused blocks once a week.[ OK ] Started Message of the Day.[ OK ] Started resolvconf-pull-resolved.path.[ OK ] Reached target Paths.[ OK ] Started Daily Cleanup of Temporary Directories.[ OK ] Started Daily apt download activities.[ OK ] Started Daily apt upgrade and clean activities.[ OK ] Reached target Timers.[ OK ] Listening on D-Bus System Message Bus Socket.[ OK ] Reached target Sockets.[ OK ] Reached target Basic System.[ OK ] Started ntp-systemd-netif.service. Starting Resize Filesystem on SD card... Starting PYNQ PL Server... Starting Login Service... Starting resolvconf-pull-resolved.service...[ OK ] Started Regular background program processing daemon. Starting System Logging Service...[ OK ] Started Set the CPU Frequency Scaling governor. Starting Jupyter Notebook Server... Starting LSB: Load kernel modules needed to enable cpufreq scaling...[ OK ] Started D-Bus System Message Bus.[ OK ] Started Login Service. Starting WPA supplicant...[ OK ] Started Network Name Resolution.[ OK ] Started System Logging Service.[ OK ] Started Resize Filesystem on SD card.[ OK ] Started PYNQ PL Server.[ OK ] Started resolvconf-pull-resolved.service.[ OK ] Started WPA supplicant.[ OK ] Reached target Host and Network Name Lookups.[ OK ] Started LSB: Load kernel modules needed to enable cpufreq scaling. Starting LSB: set CPUFreq kernel parameters...[ OK ] Started LSB: set CPUFreq kernel parameters. Stopping Network Name Resolution...[ OK ] Stopped Network Name Resolution. Starting Network Name Resolution...[ OK ] Started Network Name Resolution. Starting resolvconf-pull-resolved.service...[ OK ] Started resolvconf-pull-resolved.service.[ OK ] Started Raise network interfaces.[ OK ] Reached target Network. Starting OpenBSD Secure Shell server...[ OK ] Started Unattended Upgrades Shutdown. Starting Permit User Sessions...[ OK ] Reached target Network is Online.[ OK ] Started ISC DHCP IPv6 server. Starting Samba NMB Daemon...[ OK ] Started ISC DHCP IPv4 server.[ OK ] Started Permit User Sessions.[ OK ] Started Serial Getty on ttyPS0.[ OK ] Started Getty on tty1.[ OK ] Reached target Login Prompts. PYNQ Linux, based on Ubuntu 18.04 pynq ttyPS0 pynq login: xilinx (automatic login) Last login: Fri Oct 5 19:21:09 UTC 2018 from 192.168.2.10 on pts/0Welcome to PYNQ Linux, based on Ubuntu 18.04 (GNU/Linux 4.14.0-xilinx-00009-g30) xilinx@pynq:~$ 
</pre>
==Testing the PYNQ frameworkFramework==
The following image shows the PYNQ processes running.
 
[[File:PYNQ-htop1.png|thumb|center|600px|Running processes ordered by memory occupation]]
 
 
To test the whole framework, the following testbed was used.
 
 
[[File:BELK-TN-005-block-diagram1.png|thumb|center|600px|Testbed block diagram]]
 
 
The test consisted of the following steps:
*First, a software implementation of an FIR filter was created
*A hardware implementation of the same FIR filter was generated using the [https://www.xilinx.com/products/intellectual-property/fir_compiler.html FIR Compiler] provided by Vivado.
*The resulting IP was instantiated in Programmable Logic (PL).
*Using Jupyter Notebooks, a simple Python test code was edited and run to exercise the filter.
**Two different approaches were used: generic driver and IP-specific driver.
 
This example was inspired by [http://www.fpgadeveloper.com/2018/03/how-to-accelerate-a-python-function-with-pynq.html this tutorial].
 
===Basic Operations===
*In order to open the Jupyter Notebook web dashboard, do the following steps:
**Open the browser (only Google Chrome is supported)
**Go to http://<IP address>:9090 if your board is connected to a computer via static IP address or to <nowiki>http://pynq:9090</nowiki> if your host can resolve the target's hostname
**Log in with username <code>xilinx</code> and password <code>xilinx</code>.
 
 
[[File:PYNQ-jupyter-welcome.png|thumb|center|600px|Jupyter Notebook web dashboard]]
 
 
*To move files to/from Jupyter Notebook it is convenient to share the home directory of the target's <code>xilinx</code> user. For instance, to access the Pynq home area as a network drive via Samba protocol:
*Open a file browser and click "Go" > "Enter Location"
*Insert location <code>smb://192.168.2.99/xilinx</code>
*Log as <code>xilinx</code> with password <code>xilinx</code>.
 
===Editing and executing Python functions===
Before implementing the FIR filter in PL, we created a software implementation with the [https://www.scipy.org/ SciPy] library. To verify it, we applied it to a noisy signal.
 
In essence we
* created a new notebook by clicking on the ''New'' button at the top and select ''Python 3''
[[File:PYNQ-jupyter-new-file.png|thumb|center|600px|Creating a new notebook]]
 
 
*selected ''Code'' on the top bar and write some Python code
[[File:PYNQ-jupyter-start-writing-python.png|thumb|center|600px|Writing Python code]]
 
 
* clicked ''Run'' on the top bar to run code on a kernel.
 
 
The following image shows the noisy and the filtered signals.
 
 
[[File:PYNQ-jupyter-FIR-result.png|thumb|center|600px|Input and output signals]]
 
 
For more details, please refer to the section [http://www.fpgadeveloper.com/2018/03/how-to-accelerate-a-python-function-with-pynq.html ''Software FIR filter using SciPy''].
 
===Implementing a Hardware-Accelerated Version of the FIR Filter in PL===
To access an hardware-accelerated function from Python, PYNQ requires to load a custom overlay. Overlays are built with Vivado and are composed by:
*an FPGA bitstream (.bit file)
*a block design (.tcl file)
 
====Creating and Running a New Custom Overlay: Approach #1====
We created a custom overlay associated with the hardware implementation of the FIR filter. This first approach made use of the FIR Compiler tool provided by Vivado.
 
The fundamental steps required to do this are:
*Opening a new Vivado project, selecting ''RTL project'' and ''Bora SOM'' as the target board
*Creating your block design
**Adding ''FIR compiler'' block (included in Vivado default IP) and setting it up
**Adding ''AXI direct memory access'' block and setting it up
**On ''ZYNQ7 Processing System'' block, enabling a ''High-Performance AXI 32b/64b Slave Ports'' on interface HP0
**Connecting AXIS_DATA bus of AXI and FIR block
**''Runnin Connection Automation'' to complete wiring
*Creating Hierarchy of AXI and FIR block named <code>filter</code>
*Exporting bitstream file running ''Generate Bitstream''
*Exporting block design using Tcl console command <code>write_bd_tcl </path/name>.tcl</code>
*Renaming generated files as <code>overlay_name>.bit</code> and <code><overlay_name>.tcl</code>
*Creating a folder named <code><overlay_name></code> and inserting generated files
*Copying the folder to the target's filesystem in <code>pynq/overlays/</code> direcrtory.
 
The overlay is ready to be used in the PYNQ Python console.
 
 
[[File:PYNQ-jupyter-vivado-filter.png|thumb|center|600px|The resulting design]]
 
 
=====Running Custom Overlays with Generic Driver =====
To access the overlay with the generic driver:
*Load <code>Overlay</code> and <code>Xlnx</code> modules from <code>pynq</code> and <code>pynq.lib.dma</code>.
*Create <code>Overlay</code> and <code>Xlnk</code> objects
These steps allows you to communicate directly through a DMA buffer.
 
 
For more details, please refer to the section [http://www.fpgadeveloper.com/2018/03/how-to-accelerate-a-python-function-with-pynq.html ''Hardware FIR Implementation''].
 
=====Running Custom Overlays with IP-Specific Driver =====
To access the overlay with a specific driver:
*Import <code>DefaultHierarchy</code> from <code>pynq</code>
*create a new class for FIR filter with a method to communicate directly thorough a DMA buffer
*create a <code>checkhierarchy</code> method to check the IP contained under ''filter'' hierarchy
 
 
For more details, please refer to the section [http://www.fpgadeveloper.com/2018/03/how-to-accelerate-a-python-function-with-pynq.html ''Driver for FIR accelerator''].
 
====Creating and Running a New Custom Overlay: Approach #2====
This approach makes use of a different method to implement the filter. In this case, the filter was written in C++ and implemented by using [https://www.xilinx.com/products/design-tools/vivado/integration/esl-design.html Vivado High-Level Synthesis (HLS)].
 
The fundamental steps required to do this are:
*Opening a new Vivado HLS project, selecting Bora SOM as the target board
*Creating a new C++ source file
*Writing C++ code of FIR custom IP
**Creating AXI Stream interfaces for input and output
**Defining FIR coefficients and normalizing their values
**Using some #pragmas to optimize the execution of the algorithm
*Synthesizing new IP running ''Run C synthesis''
*Exporting new IP running ''Export RTL''
*Opening a new Vivado project, selecting RTL project and Bora SOM as the target board
*Adding the new IP in IP list
**Opening ''IP Catalog''
**Adding repository of the custom IP
 
To complete the procedure and export the Vivado project, the same steps described previously have to be done.
 
 
The data flows are implemented as AXI streams. The following images show the input and the output to/from the filter respectively.
 
 
[[File:PYNQ-Custom-IP-AxiS-input.png|thumb|center|600px|Input stream]]
 
 
[[File:PYNQ-Custom-IP-AxiS-output.png|thumb|center|600px|Output stream]]
8,226
edits