一开始只有accel的代码
这个是注册驱动后,irq中断次数(iio的bmi088挂载在spi4(fecb0000节点下面)
通过linux-header编译安装out of tree 模块
因为linux-header包里面含有/lib/modules/build
,指向header安装的根目录
所以通过一个简单的makefile
obj-m += xxxx.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
就能直接得到ko模块
macos下自定义波特率串口
Vitis HLS 2022.02 在Ubuntu2404上启动闪退
问题日志
(base) ➜ bin ./vitis_hls -showguiout
****** Vitis HLS - High-Level Synthesis from C, C++ and OpenCL v2022.2 (64-bit)
**** SW Build 3670227 on Oct 13 2022
**** IP Build 3669848 on Fri Oct 14 08:30:02 MDT 2022
** Copyright 1986-2022 Xilinx, Inc. All Rights Reserved.
source /home/ztn/Embedded/Xilinx/Vitis_HLS/2022.2/scripts/vitis_hls/hls.tcl -notrace
INFO: [HLS 200-10] Running '/home/ztn/Embedded/Xilinx/Vitis_HLS/2022.2/bin/unwrapped/lnx64.o/vitis_hls'
INFO: [HLS 200-10] For user 'ztn' on host 'ztn-Legion-Y9000P-IRX8' (Linux_x86_64 version 6.8.0-49-generic) on Tue Dec 10 15:44:46 CST 2024
INFO: [HLS 200-10] On os Ubuntu 24.04.1 LTS
INFO: [HLS 200-10] In directory '/home/ztn/Embedded/Xilinx/Vitis_HLS/2022.2/bin'
INFO: [HLS 200-10] Bringing up Vitis HLS GUI ...
HLS_GUI_DEBUG_INFO: Start loading HLS Swig Library: xv_hls_main
HLS_GUI_DEBUG_INFO: Finish loading HLS Swig Library: xv_hls_main
HLS_GUI_DEBUG_INFO: Running GuiDriver.tclInitFromJava, tclIsRunning=false
INFO: [HLS 200-10] Running '/home/ztn/Embedded/Xilinx/Vitis_HLS/2022.2/tps/lnx64/jre11.0.11_9/bin/java'
INFO: [HLS 200-10] For user 'ztn' on host 'ztn-Legion-Y9000P-IRX8' (Linux_x86_64 version 6.8.0-49-generic) on Tue Dec 10 15:44:48 CST 2024
INFO: [HLS 200-10] On os Ubuntu 24.04.1 LTS
INFO: [HLS 200-10] In directory '/home/ztn/Embedded/Xilinx/Vitis_HLS/2022.2/bin'
HLS_GUI_DEBUG_INFO: TCL was started from GUI
HLS_GUI_DEBUG_INFO: Start initializing Parts data
HLS_GUI_DEBUG_INFO: Start initializing Boards data
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
(Vitis HLS:66803): Gtk-WARNING **: 15:44:48.936: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/breeze-dark/status/16/image-missing.svg: Unable to load image-loading module: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: /home/ztn/Embedded/Xilinx/Vitis_HLS/2022.2/lib/lnx64.o/Ubuntu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libicuuc.so.74) (gdk-pixbuf-error-quark, 5)
Bail out! Gtk:ERROR:../../../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/breeze-dark/status/16/image-missing.svg: Unable to load image-loading module: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: /home/ztn/Embedded/Xilinx/Vitis_HLS/2022.2/lib/lnx64.o/Ubuntu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libicuuc.so.74) (gdk-pixbuf-error-quark, 5)
INFO: [HLS 200-112] Total CPU user time: 12.91 seconds. Total CPU system time: 0.74 seconds. Total elapsed time: 4.02 seconds; peak allocated memory: 98.949 MB.
INFO: [Common 17-206] Exiting vitis_hls at Tue Dec 10 15:44:50 2024...
(base) ➜ bin
解决方法,软连接libstdc++.so.6到系统库
(base) ➜ bin cd /home/ztn/Embedded/Xilinx/Vitis_HLS/2022.2/lib/lnx64.o/Ubuntu/
(base) ➜ Ubuntu ls
18 20 libgcc_s.so.1 libgomp.so.1 libstdc++.so libstdc++.so.6
(base) ➜ Ubuntu mv libstdc++.so.6 libstdc++.so.6.old
(base) ➜ Ubuntu ls
18 20 libgcc_s.so.1 libgomp.so.1 libstdc++.so libstdc++.so.6.old
(base) ➜ Ubuntu ln
(base) ➜ Ubuntu ls -l
total 1816
drwxr-xr-x 2 ztn ztn 4096 12月 8 23:09 18
drwxr-xr-x 2 ztn ztn 4096 12月 8 23:09 20
-rwxr-xr-x 25 ztn ztn 94000 10月 14 2022 libgcc_s.so.1
-rwxr-xr-x 25 ztn ztn 184304 10月 14 2022 libgomp.so.1
lrwxrwxrwx 1 ztn ztn 14 12月 8 23:09 libstdc++.so -> libstdc++.so.6
-rwxr-xr-x 35 ztn ztn 1570176 10月 14 2022 libstdc++.so.6.old
(base) ➜ Ubuntu ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6
(base) ➜ Ubuntu ls -l
total 1816
drwxr-xr-x 2 ztn ztn 4096 12月 8 23:09 18
drwxr-xr-x 2 ztn ztn 4096 12月 8 23:09 20
-rwxr-xr-x 25 ztn ztn 94000 10月 14 2022 libgcc_s.so.1
-rwxr-xr-x 25 ztn ztn 184304 10月 14 2022 libgomp.so.1
lrwxrwxrwx 1 ztn ztn 14 12月 8 23:09 libstdc++.so -> libstdc++.so.6
lrwxrwxrwx 1 ztn ztn 40 12月 10 15:46 libstdc++.so.6 -> /usr/lib/x86_64-linux-gnu/libstdc++.so.6
-rwxr-xr-x 35 ztn ztn 1570176 10月 14 2022 libstdc++.so.6.old
(base) ➜ Ubuntu
然后就可以启动
在Vitis HLS CSim中使用SDL2
用msvc编译后(之所以不用mingw是因为 HLS Csim用的是一个老的mingw,如果你用新的编译很麻烦)
编译完后dll丢进D:\Xilinx\Vitis_HLS\2022.2\tps\win64\msys64\mingw64\bin
然后HLS project里面设置Ldflags 为lib导入库SDL2d.lib
还有SDL2maind.lib
如果不想用SDL_main(),在include SDL2.h之前设置
define SDL_MAIN_HANDLED
ECE385Final
Touhou Resource:https://tieba.baidu.com/p/9007150098
ECE391 note
Context Switch
ra(x1) saved by _swtch,
And _swtch should act like an 'nop'
And tp is never used by compiler
The Great Gig in the Sky
"And I am not frightened of dying, any time will do, I
don't mind. Why should I be frightened of dying?
There's no reason for it, you've gotta go sometime."
"I never said I was frightened of dying."
APDFPR reg
APDFPRN-144-WOFSG-MG54V-PLN7Q-RB36C
for 5.06
Build ECE391 Env on Win64
On Msys2 MINGW64
cf. https://wiki.qemu.org/Hosts/W32
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-glib2 mingw-w64-x86_64-gettext-runtime mingw-w64-x86_64-gcc mingw-w64-x86_64-binutils mingw-w64-x86_64-pixman mingw-w64-x86_64-SDL2 mingw-w64-x86_64-gtk3 mingw-w64-x86_64-riscv64-unknown-elf-gcc mingw-w64-x86_64-gdb-multiarch git diffutils zsh vim)
Please enable Developer Mode to support soft link without Administrator permission, otherwise it prompts
Found ninja-1.12.1 at D:/msys64/usr/bin/ninja.exe
Running postconf script 'D:/ZJUI/ECE391/qemu/build/pyvenv/bin/python3.exe D:/ZJUI/ECE391/qemu/scripts/symlink-install-tree.py'
Please enable Developer Mode to support soft link without Administrator permission
error making symbolic link D:/msys64/opt/toolchains/riscv/lib/libfdt.a
Traceback (most recent call last):
File "D:/ZJUI/ECE391/qemu/scripts/symlink-install-tree.py", line 35, in <module>
raise e
File "D:/ZJUI/ECE391/qemu/scripts/symlink-install-tree.py", line 28, in <module>
os.symlink(source, bundle_dest)
OSError: [WinError 1314] 客户端没有所需的特权。: 'D:/ZJUI/ECE391/qemu/build/subprojects/dtc/libfdt/libfdt.a' -> 'qemu-bundle/msys64/opt/toolchains/riscv/lib/libfdt.a'
./configure --prefix=/opt/toolchains/riscv --target-list=riscv32-softmmu,riscv64-softmmu --enable-gtk --enable-system --disable-werror
make -j
make install
Change zsh for MINGW session https://superuser.com/questions/961699/change-default-shell-on-msys2
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Set in mingw64.ini
:
SHELL=/usr/bin/zsh
There is no PTS on windows so use telnet instead
source:https://www.uni-koeln.de/~pbogusze/posts/QEMU_serial_console.html
qemu-system-riscv64 -machine virt -bios none -kernel cp1.elf -m 8M -nographic -serial mon:stdio -serial telnet:localhost:4321,server,nowait
Add D:\msys64\mingw64\bin
to PATH of Windows
Then telnet to attach to con1
telnet localhost 4321