-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Using qbox v3.0.1. Trying to experiment with the NVMe disk in qbox but struggling to figure out how to instantiate it and connect it to the gpex so that it gets realized. Is it possible to do this with the conf.lua definition? Am I missing something obvious?
I've added the nvme_disk_0 to the conf.lua (including the default definitions IE gpex_0):
platform = {
....
gpex_0 ={
moduletype = "qemu_gpex";
args = {"&platform.qemu_inst"};
bus_master = {bind = "&router.target_socket"};
pio_iface = { address = 0x60200000, size = 0x0000100000, bind= "&router.initiator_socket"};
mmio_iface = { address = 0x60300000, size = 0x001fd00000, bind= "&router.initiator_socket" };
ecam_iface = { address = 0x43B50000, size = 0x0010000000, bind= "&router.initiator_socket" };
mmio_iface_high = { address = 0x400000000, size = 0x200000000, bind= "&router.initiator_socket" },
irq_out_0 = {bind = "&gic_0.spi_in_541"};
irq_out_1 = {bind = "&gic_0.spi_in_542"};
irq_out_2 = {bind = "&gic_0.spi_in_543"};
irq_out_3 = {bind = "&gic_0.spi_in_544"};
devices = {}
};
nvme_disk_0 = {
moduletype = "nvme_disk",
dylib_path = "nvme",
args = {"&platform.qemu_inst"},
serial = "nvme_serial_001",
blob_file=top().."fw/Artifacts/nvme_disk.img",
max_ioqpairs = 64
};
....
};
This just gives me an assert that the nvme_disk wasn't realized. I've attached the debugger and the nvme_disk does get instantiated correctly but never realized.
./build #>platforms/platforms-vp -l ../platforms/ubuntu/conf.lua
......
libname =qemu_gpex.so
libname =nvme.so
[I] [ 0 s ]SystemC : SC_START
Loading libqemu-system-aarch64.so
platforms-vp: ../../../../libqemu-src/hw/core/qdev.c:316: qdev_assert_realized_properly_cb: Assertion `dev->realized' failed.
Looking through the documentation it looks like what it's recommending is building my own platform executable that directly instantiates the gpex and nvme_disk. Then explicitly connect the nvme_disk to gpex. I was trying to see if there was some strange way of connecting the nvme_disk to the gpex in the lua definition but doesn't seem doable as I can't find any documentation on it so far. Was just hoping I could take the easy way out and do it all in lua config.
docs/extra-components/readme-local.md
* GPEX : The extra-component Gpex allow you to add devices with the method `add_device(Device &dev)`, you can add for example an NVME disk:
c++
m_gpex.add_device(m_disk1);
* NVME : This allows an NVME disk to be added. Initialise `QemuNvmeDisk` with a qemu instance from the libqbox library (see the libqbox section to initiate a qemu instance):
c++
QemuNvmeDisk m_disk1("disk1", m_qemu_inst)
The class `QemuNvmeDisk` has 3 parameters:
The constructor : `QemuNvmeDisk(const sc_core::sc_module_name &name, QemuInstance &inst)`
- "name" : name of the disk
- "inst" : instance Qemu
The parameters :
- "serial" : Serial name of the nvme disk
- "bloc-file" : Blob file to load as data storage
- "drive-id"