mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-11 21:59:26 +00:00
The dynamic enum mechanism today only allows specifying the enum values using XPATH. While this is sufficient from functionality point of view, it may not provide the best experience as users have to understand the raw data used internally. The typical way to present more informational labels of enum values to users is enum names which cannot be supported by the current XML schema to JSONSchema converter. This patch allows the XML schema to specify dynamic enum names by adding an `acrn:option-names` attribute to an element. The attribute is interpreted as an XPATH which evaluates to a sequence of the same length of `acrn-options`. The element at index i in that sequence is considered the enum name of the enum value at index i of the results of `acrn:options`. This mechanism is first applied to the `pcpu_id` element to indicate whether a physical CPU is P-core or E-core. Tracked-On: #8050 Signed-off-by: Junjie Mao <junjie.mao@intel.com>
ACRN Configurator WASM Python Module
Every file must set __package__ = 'configurator.pyodide'
before import,
set this magic var can resolve python relative import error when we direct run it.
Function define
Every python script need a test function and a main function.
test
run script will call this function, so please set script default params in this function
main
in js side will use this function. like:
// after pyodide install all dependices
var launch_cfg_gen = pyodide.pyimport("configurator.pyodide.launch_cfg_gen").main;
var board_xml = this.readFile('xxxx/board.xml');
var scenario_xml = this.readFile('xxx/scenario.xml');
var launch_scripts = launch_cfg_gen(board_xml, scenario_xml);
console.log(launch_scripts)