Function simics::api::simulator::configuration::set_configuration

source ·
pub fn set_configuration(conf: AttrValue) -> Result<()>
Expand description

Set the current configuration from a value Note: It is recommended that the add_configuration function is used instead of set_configuration. This function is an alternative to reading the configuration from a file. A configuration is an attr_value_t which should have the following structure.

(("name", "class", ("attr_name", attr_val) ... ), ... )

That is a list of object specifiers containing name, class, and a list of attribute specifiers. An attribute specifier is a list of length 2 containing the attribute name and its value. set_configuration allows an easy way of parameterizing the configuration, especially if called from Python.

The argument value may be modified, but the caller is still responsible for freeing it. Neither point applies when the function is called from Python.

EXAMPLE

The following is a Python example:

  from configuration import OBJ
  from simics import SIM_set_configuration

  SIM_set_configuration([
   ["cpu0", "x86",
    ["queue", OBJ("cpu0")],
    ["freq_mhz", 20],
    ["physical_memory", OBJ("phys_mem0")]],

   ["phys_mem0", "memory-space",
    ["map",  [[0xa0000,    OBJ("vga0"),    1, 0, 0x20000],
              [0x00000,    OBJ("mem0"),    0, 0x00000, 0xA0000],
              [0xc0000,    OBJ("mem0"),    0, 0xc0000, 0x8000],
              [0xc8000,    OBJ("setmem0"), 0, 0, 0x28000],
              [0xf0000,    OBJ("mem0"),    0, 0xf0000, 0x10000],
              [0x100000,   OBJ("mem0"),    0, 0x100000, 0x3ff00000],
              [0xfee00000, OBJ("apic0"),   0, 0, 0x4000]]]],
      ... ])

§Context

Global Context