ispras / qdt Goto Github PK
View Code? Open in Web Editor NEWQEMU Development Toolkit
License: Other
QEMU Development Toolkit
License: Other
На данный момент QDT позволяет сгенерировать заготовки перефирийных устройств, при этом реализация поведенческого аспекта ложится на пользователя.
У меня возникла необходимость в автоматической генерации некоторых моделей периферийных устройств. При этом часть поведеньческой функциональности, в моем случае, может быть так же сгенерированна автоматически.
В настоящий момент я использую инструмент QDT для генерации заготовок периферийных устройств. Затем мне приходится парсить сгенерированные QDT .h и .c файлы и добавлять в них функциональность.
Было бы здорово, если бы QDT представлял возможность пользователю интегрироваться в процесс кодогенерации, для добавления в заготовки необходимой функциональности.
В частности, если в текущей версии QDT позволяет мне сгенерировать следующий .h файл:
/* uart2.h */
#ifndef INCLUDE_UART2_H
#define INCLUDE_UART2_H
#include "chardev/char-fe.h"
#include "hw/sysbus.h"
//INSERT POS 1
#define TYPE_UART2 "uart2"
#define UART2(obj) OBJECT_CHECK(UART2State, (obj), TYPE_UART2)
#define UART2_CHR "chr"
//INSERT POS 2
typedef struct UART2State {
SysBusDevice parent_obj;
MemoryRegion mmio;
CharBackend chr;
//INSERT POS 3
} UART2State;
//INSERT POS 4
#endif /* INCLUDE_UART2_H */
То я бы хотел иметь возможность предоставить QDT набор функций (callback-ов), через которые бы был сгенерирован произвольный код на месте комментариев "INSERT POS".
По аналогии с .h файлом для .c файла хотелось бы иметь возможность генерировать произвольный код для добавления #include файлов, описания пользовательских функций, и предоставления осмысленной реализации функциям, генерируемым QDT.
В дальнейшем аналогичная функциональность понадобилась бы и для генерации платформ.
qemu_device_creator.py fails with qemu v4.0.0
$> qdt/qemu_device_creator.py -b ./build basic-device.py
Qemu version is 4.0.0
Loading QVC from ./build/qvc_131b9a05705636086699df15d4a6d328bb2585e8.py
Build QEMU Git graph ...
QEMU Git graph was built
Propagation params in graph of commit's description ...
Params in graph of commit's description were propagated
QVD loading failed
Traceback (most recent call last):
File "qdt/qemu_device_creator.py", line 100, in main
qvd = qvd_load_with_cache(qemu_build_path, version = version)
File "/home/chert/tools/qemu/qdt/qemu/version_description.py", line 167, in qvd_load_with_cache
qvd.init_cache()
File "/home/chert/tools/qemu/qdt/qemu/version_description.py", line 564, in init_cache
callco(self.co_init_cache())
File "/home/chert/tools/qemu/qdt/common/co_dispatcher.py", line 480, in callco
raise CoStackFailure(shadow_tb)
CoStackFailure: Coroutine stack failure happened:
Traceback (most recent call last):
File "/home/chert/tools/qemu/qdt/common/co_dispatcher.py", line 440, in callco
ret = next(co)
File "/home/chert/tools/qemu/qdt/qemu/version_description.py", line 669, in co_init_cache
new_targets = self.softmmu_targets - dt.arches
AttributeError: 'list' object has no attribute 'arches'
Qemu commit: 131b9a05705636086699df15d4a6d328bb2585e8
QDT commit: 1557a7e
File basic-device.py :
uart_desc = SysBusDeviceDescription(
# name =
"UART_try4",
# directory =
"char"
)
p = QProject([uart_desc])
Hi, thanks for helping me with my previous issue, and would like to report another one.
I am trying to generate board that uses cortex-m4 which is defined in "hw/arm/armv7m.h"
and function that shortens included headers is actually removing too much of the folders in relative path. If I comment out header_paths_shortening call then I have a correct path generated.
I have attached sample project that illustrates the issue.
PS. additionally to make it build for version of Qemu I used 7.1.94
I have to replace softmmu_ss to arm_ss like so
Hi, I am having issue with generating machine that has MemoryAliasNode. I have attached compressed project.py. I am using QEMU 5.0.1
generation fails then checking for Type.exists, node.allias_offset is assigned to CINT object that is not string
I am able to fix this in my case by adding this check
but I am not sure that this is the right way.
BR. Oleksiy
I found this problem while working on this issue #20
Output of QDT launch is cluttered with messages like:
Task co_gen consumed 0.062391 sec during iteration between lines .../tools/qemu/qdt/qemu/project.py:162 and 181
Total number of lines printed during QDT launch: 6656
Number of lines of the specified type: 2738
Probably messages of this type should be displayed only when specifying a special flag that enables debug printing.
QDT SHA: a58ade1
Qemu SHA: 131b9a05705636086699df15d4a6d328bb2585e8
Qemu configuration command:
../src/configure --target-list=riscv64-softmmu --enable-debug --target-list=riscv64-softmmu --disable-pie
Qemu build command:
make
Qdt launch command:
python3 qdt/qemu_device_creator.py -b ./build basic-device.py
basic-device.py file:
uart_desc = SysBusDeviceDescription(
# name =
"UART_try",
# directory =
"char"
)
p = QProject([uart_desc])
Current implementation of software driven debugging API based on GDB RSP (debug
package) only supports DWARF in ELF.
A recent QDT launch ended with following message about device tree creation:
Creating Device Tree for riscv64...
Device Tree for riscv64 isn't created: [Errno 2] No such file or directory: '/usr/local/bin/qemu-system-riscv64'
Making known targets set...
Known targets set was made
Build QEMU Git graph ...
QEMU Git graph was built
Propagation params in graph of commit's description ...
Params in graph of commit's description were propagated
Right now i have following folder organization for my additional qemu repository:
/home/user/qemu_top/qemu_build //qemu build dirrectory
/home/user/qemu_top/qemu_src //qemu git repository
/home/user/qemu_top/qdt //qdt git repository
QDT did not build the device tree for riscv64 because it was looking for qemu-system-riscv64 in '/usr/local/bin/'.
May be it should also look for it in build directory.
(right now it is in the /home/user/qemu_top/qemu_build/riscv64-softmmu/qemu-system-riscv64)
QDT version: 1557a7e
Global SKIP_GLOBAL_HEADERS
should be default.
I found this problem while working on this issue #20
In some cases if the device tree is not successfully built, the files from qdt work remain in the tmp folder.
There will be folder in tmp directory with name similar to
qdt-qemu-131b9a05705636086699df15d4a6d328bb2585e8-aybrz14l
the size of which can exceed one gigabyte.
It seems like you need to make some kind of a callback that will clear the qdt files of the tmp folder in case of a crash.
I could not find a complete description of the generation parameters contained in the scripts for qemu_device_creator.py.
Does it exist?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.