PULP(pulp-sdk) ubuntu18.04环境搭建

PULP = Parallel Ultra Low Power

第一个坑:切换为python为默认的python3

我这里简单粗暴的直接创建软链接 python3.6 到python

 重要参考文档:NBruschi_gvsoc_tutorial_part1.pdf

第二个坑,github,不是墙的问题,当然翻墙可以解决问题,可以参考我的配置

1. 修改.ssh/config为如下:

root@ubuntu:/opt# cat ~/.ssh/
config       id_rsa       id_rsa.pub   known_hosts  
root@ubuntu:/opt# cat ~/.ssh/config 
Host github.com
HostName ssh.github.com  #
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

 2. 在/etc/hosts中添加github.com的域名解析

root@ubuntu:/opt# cat /etc/hosts
127.0.0.1	localhost
127.0.1.1	ubuntu

20.205.243.166  github.com

修改完成后,代码下载飞快,否则,估计很多人第一步代码下载就会卡上好几天。

编译toolchain

$sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev

$git clone https://github.com/pulp-platform/pulp-riscv-gnu-toolchain
$git submodule update --init --recursive

$rm -rf riscv-dejagnu/
qiao@ubuntu:~/riscv/pulp-riscv-gnu-toolchain$ git clone https://gitee.com/mirrors/riscv-dejagnu
$rm -rf riscv-newlib
$git clone https://gitee.com/mirrors/riscv-newlib

$./configure --prefix=/opt/pulp-riscv-gnu-toolchain --with-arch=rv32imc --with-cmodel=medlow --enable-multilib
$make

 编译完成后,查看/opt/pulp-riscv-gnu-toolchain.

编译pulp-sdk

sudo apt-get install -y build-essential git libftdi-dev libftdi1 doxygen python3-pip
libsdl2-dev curl cmake libusb-1.0-0-dev scons gtkwave libsndfile1-dev rsync autoconf
automake texinfo libtool pkg-config libsdl2-ttf-dev
pip install argcomplete pyelftools six

To install the PULP-SDK follow these steps:
 $ git clone https://github.com/pulp-platform/pulp-sdk
 $ export PULP_RISCV_GCC_TOOLCHAIN=<INSTALL_DIR>
 $ cd pulp-sdk
 $ source configs/pulp-open.sh
 $ make build

test程序

qiao@ubuntu:~/riscv/pulp-sdk/tests/hello$ ls
BUILD  compile_commands.json  Makefile  test.c  test.c.bak
qiao@ubuntu:~/riscv/pulp-sdk/tests/hello$  make clean all
RM  /home/qiao/riscv/pulp-sdk/tests/hello/BUILD/PULP/GCC_RISCV/
CC  test.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/fll-v1.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/freq-domains.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/pulp/kernel/chips/pulp/soc.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pmsis/pmsis_bsp/fs/read_fs/read_fs.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pmsis/pmsis_bsp/fs/host_fs/semihost.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pmsis/pmsis_bsp/fs/host_fs/host_fs.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pmsis/pmsis_bsp/fs/fs.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pmsis/pmsis_bsp/bsp/pulp.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/lib/libc/minimal/io.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/lib/libc/minimal/fprintf.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/lib/libc/minimal/prf.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/lib/libc/minimal/sprintf.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/lib/libc/minimal/semihost.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/init.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/kernel.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/device.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/task.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/alloc.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/alloc_pool.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/irq.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/soc_event.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/log.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/time.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/pulp/drivers/uart/uart-v1.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/pulp/drivers/udma/udma-v3.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/pulp/drivers/cluster/cluster.c
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/crt0.S
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/irq_asm.S
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/task_asm.S
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/time_asm.S
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/common/kernel/soc_event_v2_itc.S
CC  /home/qiao/riscv/pulp-sdk/rtos/pulpos/pulp/drivers/cluster/pe-eu-v3.S
LD  /home/qiao/riscv/pulp-sdk/tests/hello/BUILD/PULP/GCC_RISCV//test/test
gapy --target=pulp --platform=gvsoc --work-dir=/home/qiao/riscv/pulp-sdk/tests/hello/BUILD/PULP/GCC_RISCV/ --config-opt=cluster/nb_pe=8    run --image --binary=/home/qiao/riscv/pulp-sdk/tests/hello/BUILD/PULP/GCC_RISCV//test/test 
gapy --target=pulp --platform=gvsoc --work-dir=/home/qiao/riscv/pulp-sdk/tests/hello/BUILD/PULP/GCC_RISCV/ --config-opt=cluster/nb_pe=8    run --flash --binary=/home/qiao/riscv/pulp-sdk/tests/hello/BUILD/PULP/GCC_RISCV//test/test

openocd

install openocd
$git clone https://github.com/riscv/riscv-openocd.git
$ cd riscv-openocd/
$ git clone https://github.com/syntacore/libjaylink.git
$ make
$ ./bootstrap
$./configure --prefix=$RISCV --enable-remote-bitbang --enable-jtag_vpi --disable-werror --enable-jlink
$make
$sudo make install
 run
$qiao@ubuntu:~/riscv/pulp-sdk/tests$ sudo openocd -f pulp_riscv.cfg
Open On-Chip Debugger 0.12.0+dev-01363-gc7d1f0dda (2023-10-19-01:56)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : J-Link V9 compiled May  7 2021 16:26:12
Info : Hardware version: 9.60
Info : VTarget = 3.327 V
Info : clock speed 1000 kHz
Info : JTAG tap: riscv.unknown0 tap/device found: 0x10102001 (mfg: 0x000 (<invalid>), part: 0x0102, ver: 0x1)
Info : JTAG tap: riscv.cpu tap/device found: 0x249511c3 (mfg: 0x0e1 (Wintec Industries), part: 0x4951, ver: 0x2)
Info : datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1024 harts
Info :  hart 992: XLEN=32, misa=0x40901124
Info : starting gdb server for riscv.cpu on 3333
Info : Listening on port 3333 for gdb connections
Ready for Remote Connections

 GDB debug

/opt/pulp-riscv-gnu-toolchain/bin/riscv32-unknown-elf-gdb  ./uart/loopback/BUILD/PULP/GCC_RISCV/test/test
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
warning: Target-supplied registers are not supported by the current architecture
0x1a000080 in ?? ()
(gdb) load
Loading section .data_tiny_fc, size 0x850 lma 0x1c000004
Loading section .init_array, size 0x18 lma 0x1c000854
Loading section .fini_array, size 0xc lma 0x1c00086c
Loading section .data, size 0x40 lma 0x1c001080
Loading section .vectors, size 0x9c lma 0x1c008000
Loading section .text, size 0xaf4 lma 0x1c00809c
Loading section .l2_data, size 0x388 lma 0x1c010000
Loading section .data_tiny_l1, size 0x18 lma 0x1c010388
Start address 0x1c008080, load size 6116
Transfer rate: 2 KB/sec, 764 bytes/write.
(gdb) continue
Continuing.

后续更新....

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值