SDSoC使用体验
本文作者:卜居
转载请保留作者信息。原文网址(http://blog.csdn.net/kkk584520/article/details/47220575)。
本文project可到我的资源下载(http://download.csdn.net/detail/kkk584520/8978623)。
Xilinx 7月20号公布了SDSoC 2015.2软件。这是具有里程碑意义的FPGA(或者更准确说是ARM + FPGA SoC系统)集成开发工具,加快了应用公布的速度。
直接通过网页从官网下载速度超慢并且easy中断,尝试了几次不成功。于是改用阿里云主机下载,这个速度超快(有时能达到1MB/s),然后从云主机通过OSS方式下载到本地,解压安装(系统为Windows8 64bit)。安装前要确认你的系统也是64位的。硬盘容量空出15GB左右,装起来比較快,看了下安装文件夹。SDSoC文件夹结构例如以下:
可见内置了Vivado ,Vivado_HLS,SDK三个开发工具,无需另外安装。另外也包括了arm-xilinx-linux-gnueabi交叉编译工具。可完毕Linux下的应用开发。
可參考这篇EETOP文章来安装license。
安装完毕,双击桌面上的SDSoC图标:
启动画面:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
Welcome界面(假设未显示。则点击菜单 Help -> Welcome进行显示:
点击Create SDSoC Project,创建一个SDSoCproject,弹出对话框例如以下:
输入project名字test,project路径默认。硬件平台选zed,操作系统选Linux,其余都不做改动,点Next:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
这里选矩阵乘加的样例,点Finish,进入主界面例如以下:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
用过Vivado HLS的能看出,二者project界面基本布局相差不大。
直接点击Project -> Build All,经过几分钟,完毕了编译、综合、生成bitstream、打包,在project文件夹下能够看到生成的SD卡镜像文件:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
将这些文件拷入空白的FAT32文件系统的SD卡就可以查看执行情况。
从上面步骤看出。使用SDSoC开发Zynq应用。相当于使用IDE进行软件开发,再也不用在多个软件、工具之间来回跳转,仅仅要一个集成开发环境就能完毕全部必须的开发工作,从而提高了开发效率。
后面会深入研究怎样进行程序优化,将PS上较为耗时的软件模块offload到PL中实现加速。
--------------------------------------------------------------------------------------------------------------------------------------------
2015-8-8加入
--------------------------------------------------------------------------------------------------------------------------------------------
几天前试验,将SDDebug/sd_card/下的文件复制到SD卡,插入ZED Board后无法启动,一直怀疑是开发过程有问题。今天又尝试了下曾经的旧镜像,竟然也无法启动。看来是SD卡有问题。想起来之前安装Fedora 21时用这个SD卡做的镜像,有可能在起始扇区增加了一些不该有的东西。想到这里,就迅速切到Linux系统。用Disks工具对SD卡运行了低级格式化。将全部扇区都擦写了一遍。然后格式化为FAT文件系统,拷贝SDSoC镜像,插入板卡。竟然启动成功了。。。
启动信息例如以下:
U-Boot 2014.07-00004-g19e1bb2 (Nov 19 2014 - 09:35:12) Board: Xilinx Zynq
I2C: ready
DRAM: ECC disabled 512 MiB
MMC: zynq_sdhci: 0
spi_setup_slave: No QSPI device detected based on MIO settings
SF: Failed to set up slave
*** Warning - spi_flash_probe() failed, using default environment In: serial
Out: serial
Err: serial
Net: Gem.e000b000
Hit any key to stop autoboot: 0
Device: zynq_sdhci
Manufacturer ID: 12
OEM: 3456
Name: F0F0F
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 4-bit
reading uEnv.txt
** Unable to read file uEnv.txt **
Copying Linux from SD to RAM...
reading uImage
3488184 bytes read in 308 ms (10.8 MiB/s)
reading devicetree.dtb
9283 bytes read in 16 ms (566.4 KiB/s)
reading uramdisk.image.gz
5044192 bytes read in 442 ms (10.9 MiB/s)
## Booting kernel from Legacy Image at 02080000 ...
Image Name: Linux-3.19.0-xilinx-apf
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3488120 Bytes = 3.3 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 04000000 ...
Image Name:
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 5044128 Bytes = 4.8 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
Booting using the fdt blob at 0x2000000
Loading Kernel Image ... OK
Loading Ramdisk to 1e855000, end 1ed247a0 ... OK
Loading Device Tree to 1e84f000, end 1e854442 ... OK Starting kernel ... Booting Linux on physical CPU 0x0
Linux version 3.19.0-xilinx-apf (yogeshc@xsjpsgv105) (gcc version 4.9.1 (Sourcery CodeBench Lite 2014.11-30) ) #22 SMP PREEMPT Mon Jul 6 17:59:10 PDT 2015
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Zynq Zed Development Board
cma: Reserved 256 MiB at 0x0e800000
Memory policy: Data cache writealloc
PERCPU: Embedded 9 pages/cpu @5fb5c000 s8128 r8192 d20544 u36864
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
Kernel command line: console=ttyPS0,115200 root=/dev/ram rw earlyprintk
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 244952K/524288K available (4708K kernel code, 251K rwdata, 1644K rodata, 220K init, 250K bss, 17192K reserved, 262144K cma-reserved, 0K highmem)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0x60800000 - 0xff000000 (2536 MB)
lowmem : 0x40000000 - 0x60000000 ( 512 MB)
pkmap : 0x3fe00000 - 0x40000000 ( 2 MB)
modules : 0x3f000000 - 0x3fe00000 ( 14 MB)
.text : 0x40008000 - 0x4063c614 (6354 kB)
.init : 0x4063d000 - 0x40674000 ( 220 kB)
.data : 0x40674000 - 0x406b2f20 ( 252 kB)
.bss : 0x406b2f20 - 0x406f1ab8 ( 251 kB)
Preemptible hierarchical RCU implementation.
RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76360001
slcr mapped to 60804000
zynq_clock_init: clkc starts at 60804100
Zynq clock init
sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 3298534883328ns
timer #0 at 60806000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x475660 - 0x4756b8
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (2664.03 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0x60880000
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
phy0 supply vcc not found, using dummy regulator
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 4928K (5e855000 - 5ed25000)
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 142, base_baud = 3125000) is a xuartps
console [ttyPS0] enabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to 6086c000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
m25p80 spi0.0: unrecognized JEDEC id bytes: 00, 0, 0
CAN device driver interface
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 144 (00:0a:35:00:01:22)
macb e000b000.ethernet eth0: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)
e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
e1000e: Copyright(c) 1999 - 2014 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
e0002000.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
zynq-edac f8006000.memory-controller: ecc not enabled
Xilinx Zynq CpuIdle Driver started
Driver 'mmcblk' needs updating - please use bus_type methods
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-arasan e0100000.sdhci: No vmmc regulator found
sdhci-arasan e0100000.sdhci: No vqmmc regulator found
mmc0: Invalid maximum block size, assuming 512 bytes
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
xlnk major 245
xlnk driver loaded
xlnk_pdev is not null
TCP: cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
ALSA device list:
No soundcards found.
Freeing unused kernel memory: 220K (4063d000 - 40674000)
INIT: mmc0: new high speed SDHC card at address b368
mmcblk0: mmc0:b368 F0F0F 3.71 GiB
mmcblk0: p1
version 2.88 booting
mkdir: can't create directory '/run/media/mmcblk0p1': No such file or directory
mount: mounting /dev/mmcblk0p1 on /run/media/mmcblk0p1 failed: No such file or directory
Creating /dev/flash/* device nodes
random: dd urandom read with 1 bits of entropy available
starting Busybox inet Daemon: inetd... done.
update-rc.d: /etc/init.d/run-postinsts exists during rc.d purge (continuing)
Removing any system startup links for run-postinsts ...
/etc/rcS.d/S99run-postinsts
INIT: Entering runlevel: 5
Configuring network interfaces... udhcpc (v1.23.1) started
Sending discover...
Sending discover...
Sending discover...
No lease, forking to background
done.
Starting Dropbear SSH server: Generating key, this may take a while...
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC018PRFi//28KVSia0kIY6/NyjxpooJLA8lHweuq8cpXl/1c7mbC+9bc2mBnT5GUJEno/hb/AlYjsD+8YDahmVWgQlk+knOFW8/J2hg7foJHUeUuSBryfcw7lNcdWMld1iSMXpyHig68WQX2UpkGBLAhuWNFQWJGAJfj3XYHdqowmSIV1U3qb5V/7xv1uuP+pVc6z4gQDvC7Mwvs1dD+AzB6wjaVDAUlJs4KOkwZu/GerhGT0lWSLFHqZ0gEBKAp2nM2Q8dHhSXUdIBO1yfQl1ILipwoAhMIXmNyf/4qN47DOFVAwfyARJ4hdyY89a+Ht43d3T5BgMS6K+c4c1Qhi5 root@bsp
Fingerprint: md5 8c:7a:47:88:3a:ae:9b:cd:0a:bb:80:74:4a:ca:17:6b
dropbear.
Starting tcf-agent: OK sh-4.3# ls
bin dev home lib mnt root sbin tmp var
boot etc init media proc run sys usr
进入/mnt 文件夹。执行test.elf,输出例如以下:
sh-4.3# cd /mnt
sh-4.3# ls
BOOT.BIN _sds test.elf uramdisk.image.gz
README.txt boot.bif test.elf.bit.bin
Xilinx_XPS_uLinux devicetree.dtb uImage
sh-4.3# chmod 755 test.elf
sh-4.3# ls
BOOT.BIN _sds test.elf uramdisk.image.gz
README.txt boot.bif test.elf.bit.bin
Xilinx_XPS_uLinux devicetree.dtb uImage
sh-4.3# ./test.elf
Testing with A_NROWS = A_NCOLS = B_NCOLS = B_NROWS = 32
Testing mmult ..
Average SW cycles: 975045
Average HW cycles: 1246660
TEST PASSED
硬件加速效果不好。有待优化。
SDSoC使用体验的更多相关文章
- Android UI体验之全屏沉浸式透明状态栏效果
前言: Android 4.4之后谷歌提供了沉浸式全屏体验, 在沉浸式全屏模式下, 状态栏. 虚拟按键动态隐藏, 应用可以使用完整的屏幕空间, 按照 Google 的说法, 给用户一种 身临其境 的体 ...
- 移动端之Android开发的几种方式的初步体验
目前越来越多的移动端混合开发方式,下面列举的大多数我都略微的尝试过,就初步的认识写个简单的心得: 开发方式 开发环境 是否需要AndroidSDK 支持跨平台 开发语言&技能 MUI Win+ ...
- TODO:小程序开发过程之体验者
TODO:小程序开发过程之体验者 1. 小程序开发过程,先下载开发者并安装开发者工具,现在腾讯开放测试了,普通用户也可以登录开发者工具,如图普通用户登录为调试类型,但是只能建立无AppID的项目 如果 ...
- 微信小程序体验(2):驴妈妈景区门票即买即游
驴妈妈因为出色的运营能力,被腾讯选为首批小程序内测单位.驴妈妈的技术开发团队在很短的时间内完成了开发任务,并积极参与到张小龙团队的内测问题反馈.驴妈妈认为,移动互联网时代,微信是巨大的流量入口,也是旅 ...
- 一起学微软Power BI系列-使用技巧(3)Power BI安卓手机版安装与体验
Power BI有手机版,目前支持安卓,苹果和WP,不过没有WP手机,苹果在国内还不能用,要FQ和用就不测试了.安卓的我也也是费了九牛二虎之力才把app下载下来,把方法分享给大家. FQ太麻烦,所以建 ...
- .NET平台开源项目速览(15)文档数据库RavenDB-介绍与初体验
不知不觉,“.NET平台开源项目速览“系列文章已经15篇了,每一篇都非常受欢迎,可能技术水平不高,但足够入门了.虽然工作很忙,但还是会抽空把自己知道的,已经平时遇到的好的开源项目分享出来.今天就给大家 ...
- Xamarin+Prism开发详解四:简单Mac OS 虚拟机安装方法与Visual Studio for Mac 初体验
Mac OS 虚拟机安装方法 最近把自己的电脑升级了一下SSD固态硬盘,总算是有容量安装Mac 虚拟机了!经过心碎的安装探索,尝试了国内外的各种安装方法,最后在youtube上找到了一个好方法. 简单 ...
- Xamarin+Prism开发详解三:Visual studio 2017 RC初体验
Visual studio 2017 RC出来一段时间了,最近有时间就想安装试试,随带分享一下安装使用体验. 1,卸载visual studio 2015 虽然可以同时安装visual studio ...
- Spring之初体验
Spring之初体验 Spring是一个轻量级的Java Web开发框架,以IoC(Inverse of Control 控制反转)和 ...
随机推荐
- thread.h
https://github.com/wookayin/pintos/blob/master/src/threads/thread.h #ifndef THREADS_THREAD_H #defi ...
- NodeJS学习笔记 (5)网络服务-http-req(ok)
原文:https://github.com/chyingp/nodejs-learning-guide 自己敲代码: 概览 本文的重点会放在req这个对象上.前面已经提到,它其实是http.Incom ...
- textarea统计字数
开发项目中经常会用到,textarea统计字数 源码如下: <!DOCTYPE html><html lang="en"><head> < ...
- luogu P1630 求和(枚举暴力)
题意 题解 可以发现当a=10001时, 和1是等价的. 所以这题就水了. #include<iostream> #include<cstring> #include<c ...
- SpringBoot实战(一)HelloWorld
一:环境准备: JDK:1.8版本 Maven:3.5版本(如果觉得下载速度慢,可以切换为阿里镜向地址) Intellij:2018.2.1版本 二:实际操作: 1.在Intellij中创建一个新的S ...
- python字典对象的update()方法
使用字典对象的update()方法,如A.update(B),将B字典的键值对一次性全部添加到A字典对象,当A字典为空时,相当于深复制,非常方便.如果两个字典中存在相同的键,则进行值的更新. A={} ...
- ubuntu下安装宋体simsun
sudo cp simsun.ttc /usr/share/fonts cd /usr/share/fontssudo chmod 644 simsun.ttc 更新字体缓存: 代码: sudo m ...
- ios面试题1
iOS面试题 1.写一个NSString类的实现 + (id)initWithCString:(c*****t char *)nullTerminatedCString encoding:(NSS ...
- 死锁的Dump文件
死锁的Dump文件 package com.stono.thread; public class DeadLockDemo { private static String A = "A&qu ...
- android:Activity启动模式之singleTask(一)
先看一下standard启动模式的说明: 仅仅有一个实例.在同一个应用程序中启动他的时候.若不存在此Activity实例.则会在当前栈顶创建一个新的实例.若存在,则会把栈中在其上的其他Activity ...