19 cci::cci_param<uint32_t> p_lun;
20 cci::cci_param<std::string> blkdev_str;
23 std::string blkdev_id;
26 ufs_lu(
const sc_core::sc_module_name& name, sc_core::sc_object* o, sc_core::sc_object* t)
27 : ufs_lu(name, *(
dynamic_cast<QemuInstance*
>(o)),
dynamic_cast<ufs*
>(t))
30 ufs_lu(
const sc_core::sc_module_name& n,
QemuInstance& inst, ufs* _ufs)
32 , p_lun(
"lun", 0,
"LU number")
33 , blkdev_str(
"blkdev_str",
"",
"blkdev string for QEMU (do not specify ID)")
34 , blkdev_id(std::string(name()) +
"-id")
36 std::stringstream opts;
37 opts << blkdev_str.get_value();
38 opts <<
",id=" << blkdev_id;
39 m_inst.add_arg(
"-drive");
40 m_inst.add_arg(opts.str().c_str());
42 set_dev_props = [
this]() ->
void {
43 m_dev.set_prop_uint(
"lun", p_lun.get_value());
44 m_dev.set_prop_parse(
"drive", blkdev_id.c_str());
47 _ufs->add_device(*
this);