diff --git a/misc/config_tools/launch_config/com.py b/misc/config_tools/launch_config/com.py index 128472864..5897bc155 100644 --- a/misc/config_tools/launch_config/com.py +++ b/misc/config_tools/launch_config/com.py @@ -411,7 +411,7 @@ def launch_end(names, args, virt_io, vmid, config): uos_launch(names, args, virt_io, vmid, config) -def set_dm_pt(names, sel, vmid, config): +def set_dm_pt(names, sel, vmid, config, dm): uos_type = names['uos_types'][vmid] @@ -449,8 +449,12 @@ def set_dm_pt(names, sel, vmid, config): print(" $boot_ipu_option \\", file=config) if sel.bdf['ethernet'][vmid] and sel.slot['ethernet'][vmid]: - print(" -s {},passthru,{}/{}/{} \\".format(sel.slot["ethernet"][vmid], sel.bdf["ethernet"][vmid][0:2], \ - sel.bdf["ethernet"][vmid][3:5], sel.bdf["ethernet"][vmid][6:7]), file=config) + if vmid in dm["enable_ptm"] and dm["enable_ptm"][vmid] == 'y': + print(" -s {},passthru,{}/{}/{},enable_ptm \\".format(sel.slot["ethernet"][vmid], sel.bdf["ethernet"][vmid][0:2], \ + sel.bdf["ethernet"][vmid][3:5], sel.bdf["ethernet"][vmid][6:7]), file=config) + else: + print(" -s {},passthru,{}/{}/{} \\".format(sel.slot["ethernet"][vmid], sel.bdf["ethernet"][vmid][0:2], \ + sel.bdf["ethernet"][vmid][3:5], sel.bdf["ethernet"][vmid][6:7]), file=config) if sel.bdf['sata'] and sel.slot["sata"][vmid]: print(" -s {},passthru,{}/{}/{} \\".format(sel.slot["sata"][vmid], sel.bdf["sata"][vmid][0:2], \ @@ -642,7 +646,7 @@ def dm_arg_set(names, sel, virt_io, dm, vmid, config): if not is_nuc_whl_linux(names, vmid): print(" -s {},wdt-i6300esb \\".format(launch_cfg_lib.virtual_dev_slot("wdt-i6300esb")), file=config) - set_dm_pt(names, sel, vmid, config) + set_dm_pt(names, sel, vmid, config, dm) if dm['console_vuart'][vmid] == "Enable": print(" -s {},uart,vuart_idx:0 \\".format(launch_cfg_lib.virtual_dev_slot("console_vuart")), file=config) diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py index ed42e6af0..8a632c3d3 100644 --- a/misc/config_tools/launch_config/launch_cfg_gen.py +++ b/misc/config_tools/launch_config/launch_cfg_gen.py @@ -52,6 +52,7 @@ def get_launch_item_values(board_info, scenario_info=None): launch_item_values['uos,vuart0'] = launch_cfg_lib.DM_VUART0 launch_item_values['uos,poweroff_channel'] = launch_cfg_lib.PM_CHANNEL launch_item_values["uos,cpu_affinity"] = board_cfg_lib.get_processor_info() + launch_item_values['uos,enable_ptm'] = launch_cfg_lib.PTM launch_cfg_lib.set_shm_regions(launch_item_values, scenario_info) launch_cfg_lib.set_pci_vuarts(launch_item_values, scenario_info) diff --git a/misc/config_tools/launch_config/launch_item.py b/misc/config_tools/launch_config/launch_item.py index 295fe2fdc..a1c046aa0 100644 --- a/misc/config_tools/launch_config/launch_item.py +++ b/misc/config_tools/launch_config/launch_item.py @@ -36,6 +36,7 @@ class AcrnDmArgs: self.args["xhci"] = common.get_leaf_tag_map(self.launch_info, "usb_xhci") self.args["communication_vuarts"] = common.get_leaf_tag_map(self.launch_info, "communication_vuarts", "communication_vuart") self.args["console_vuart"] = common.get_leaf_tag_map(self.launch_info, "console_vuart") + self.args["enable_ptm"] = common.get_leaf_tag_map(self.launch_info, "enable_ptm") def check_item(self): (rootfs, num) = board_cfg_lib.get_rootfs(self.board_info) @@ -44,12 +45,14 @@ class AcrnDmArgs: launch_cfg_lib.mem_size_check(self.args["mem_size"], "mem_size") launch_cfg_lib.args_aval_check(self.args["vbootloader"], "vbootloader", launch_cfg_lib.BOOT_TYPE) launch_cfg_lib.args_aval_check(self.args["vuart0"], "vuart0", launch_cfg_lib.DM_VUART0) + launch_cfg_lib.args_aval_check(self.args["enable_ptm"], "enable_ptm", launch_cfg_lib.PTM) cpu_affinity = launch_cfg_lib.uos_cpu_affinity(self.args["cpu_affinity"]) err_dic = scenario_cfg_lib.vm_cpu_affinity_check(self.launch_info, cpu_affinity, "pcpu_id") launch_cfg_lib.ERR_LIST.update(err_dic) launch_cfg_lib.check_shm_regions(self.args["shm_regions"], self.scenario_info) launch_cfg_lib.check_console_vuart(self.args["console_vuart"],self.args["vuart0"], self.scenario_info) launch_cfg_lib.check_communication_vuart(self.args["communication_vuarts"], self.scenario_info) + launch_cfg_lib.check_enable_ptm(self.args["enable_ptm"], self.scenario_info) class AvailablePthru(): diff --git a/misc/config_tools/library/launch_cfg_lib.py b/misc/config_tools/library/launch_cfg_lib.py index 770682acd..be2511095 100644 --- a/misc/config_tools/library/launch_cfg_lib.py +++ b/misc/config_tools/library/launch_cfg_lib.py @@ -8,11 +8,14 @@ import getopt import common import board_cfg_lib import scenario_cfg_lib +import lxml +import lxml.etree ERR_LIST = {} BOOT_TYPE = ['no', 'vsbl', 'ovmf'] RTOS_TYPE = ['no', 'Soft RT', 'Hard RT'] DM_VUART0 = ['Disable', 'Enable'] +PTM = ['y', 'n'] UOS_TYPES = ['CLEARLINUX', 'ANDROID', 'ALIOS', 'PREEMPT-RT LINUX', 'VXWORKS', 'WINDOWS', 'ZEPHYR', 'YOCTO', 'UBUNTU', 'GENERIC LINUX'] LINUX_LIKE_OS = ['CLEARLINUX', 'PREEMPT-RT LINUX', 'YOCTO', 'UBUNTU', 'GENERIC LINUX'] @@ -668,4 +671,12 @@ def check_communication_vuart(launch_communication_vuarts, scenario_info): if uos_id in vuart1_setting.keys() and vuart1_setting[uos_id]['base'] != "INVALID_COM_BASE": ERR_LIST[vuart_key] = "uos {}'s communication_vuart 1 and legacy_vuart 1 should " \ "not be configured at the same time.".format(uos_id) - return \ No newline at end of file + return + +def check_enable_ptm(launch_enable_ptm, scenario_info): + scenario_etree = lxml.etree.parse(scenario_info) + enable_ptm_vm_list = scenario_etree.xpath("//vm[PTM = 'y']/@id") + for uos_id, enable_ptm in launch_enable_ptm.items(): + key = 'uos:id={},enable_ptm'.format(uos_id) + if enable_ptm == 'y' and str(uos_id) not in enable_ptm_vm_list: + ERR_LIST[key] = "PTM of uos:{} set to 'n' in scenario xml".format(uos_id) diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd index 86bf54a32..baaa66253 100644 --- a/misc/config_tools/schema/config.xsd +++ b/misc/config_tools/schema/config.xsd @@ -420,6 +420,11 @@ its ``id`` attribute. When it is enabled, specify which target VM's vUART the cu + + + Enable and disable PTM(Precision Timing Measurement) feature. + + diff --git a/misc/config_tools/xforms/lib.xsl b/misc/config_tools/xforms/lib.xsl index 8dcf6613e..dcdb98c26 100644 --- a/misc/config_tools/xforms/lib.xsl +++ b/misc/config_tools/xforms/lib.xsl @@ -311,12 +311,25 @@ + + + + + + + + + + - + + + + diff --git a/misc/config_tools/xforms/pci_dev.c.xsl b/misc/config_tools/xforms/pci_dev.c.xsl index dbbdd56d4..d5c34aee8 100644 --- a/misc/config_tools/xforms/pci_dev.c.xsl +++ b/misc/config_tools/xforms/pci_dev.c.xsl @@ -48,6 +48,9 @@ + + + @@ -164,4 +167,15 @@ + + + { + + + + }, + + + +