23 cci::cci_param<std::string> p_serial;
24 cci::cci_param<std::string> p_blob_file;
25 cci::cci_param<uint32_t> max_ioqpairs;
26 std::string m_drive_id;
29 nvme_disk(
const sc_core::sc_module_name& name, sc_core::sc_object*
o)
35 , p_serial(
"serial",
basename(),
"Serial name of the nvme disk")
36 , p_blob_file(
"blob_file",
"",
"Blob file to load as data storage")
37 , max_ioqpairs(
"max_ioqpairs", 64,
"Passed through to QEMU max_ioqpairs")
40 m_drive_id +=
"_drive";
41 std::string
file = p_blob_file;
43 std::stringstream
opts;
44 opts <<
"if=sd,id=" << m_drive_id <<
",file=" <<
file <<
",format=raw";
49 void before_end_of_elaboration()
override
51 qemu_gpex::Device::before_end_of_elaboration();
53 std::string
serial = p_serial;
54 m_dev.set_prop_str(
"serial",
serial.c_str());
55 m_dev.set_prop_parse(
"drive", m_drive_id.c_str());
56 m_dev.set_prop_int(
"max_ioqpairs", max_ioqpairs);
59 void gpex_realize(
qemu::Bus&
bus)
override { qemu_gpex::Device::gpex_realize(
bus); }
void add_arg(const char *arg)
Add a command line argument to the qemu instance.
Definition qemu-instance.h:329