mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
acrn-config: add support to parse board defconfig from configurations
Board defconfig depends on hypervisor configurations and vm configurations, add this to support to parse board defconfig from vm configuration. Tracked-On: #4634 Signed-off-by: Wei Liu <weix.w.liu@intel.com> Acked-by: Victor Sun <victor.sun@intel.com> Acked-by: Terry Zou <terry.zou@intel.com>
This commit is contained in:
238
misc/acrn-config/hv_config/board_defconfig.py
Normal file
238
misc/acrn-config/hv_config/board_defconfig.py
Normal file
@@ -0,0 +1,238 @@
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
import board_cfg_lib
|
||||
import hv_cfg_lib
|
||||
import common
|
||||
|
||||
|
||||
DESC = """# Board defconfig generated by acrn-config tool
|
||||
"""
|
||||
|
||||
VM_NUM_MAP_TOTAL_HV_RAM_SIZE = {
|
||||
# 120M
|
||||
2:0x7800000,
|
||||
# 150M
|
||||
3:0x9600000,
|
||||
# 180M
|
||||
4:0xB400000,
|
||||
# 210M
|
||||
5:0xD200000,
|
||||
# 240M
|
||||
6:0xF000000,
|
||||
# 270M
|
||||
7:0x10E00000,
|
||||
}
|
||||
|
||||
MEM_ALIGN = 2 * common.SIZE_M
|
||||
|
||||
|
||||
def find_avl_memory(ram_range, hpa_size, hv_start_offset):
|
||||
"""
|
||||
This is get hv address from System RAM as host physical size
|
||||
:param ram_range: System RAM mapping
|
||||
:param hpa_size: fixed host physical size
|
||||
:param hv_start_offset: base address of HV RAM start
|
||||
:return: start host physical address
|
||||
"""
|
||||
ret_start_addr = 0
|
||||
tmp_order_key = 0
|
||||
|
||||
tmp_order_key = sorted(ram_range)
|
||||
for start_addr in tmp_order_key:
|
||||
mem_range = ram_range[start_addr]
|
||||
if start_addr < hv_start_offset < start_addr + ram_range[start_addr]:
|
||||
# 256M address located in this start ram range
|
||||
if start_addr + mem_range - hv_start_offset > int(hpa_size, 10):
|
||||
ret_start_addr = hv_start_offset
|
||||
break
|
||||
elif start_addr > hv_start_offset:
|
||||
# above 256M address, than return the start address of this ram range
|
||||
ret_start_addr = start_addr
|
||||
break
|
||||
|
||||
return hex(ret_start_addr)
|
||||
|
||||
|
||||
def get_ram_range():
|
||||
""" Get System RAM range mapping """
|
||||
# read system ram from board_info.xml
|
||||
ram_range = {}
|
||||
|
||||
io_mem_lines = board_cfg_lib.get_info(
|
||||
common.BOARD_INFO_FILE, "<IOMEM_INFO>", "</IOMEM_INFO>")
|
||||
|
||||
for line in io_mem_lines:
|
||||
if 'System RAM' not in line:
|
||||
continue
|
||||
start_addr = int(line.split('-')[0], 16)
|
||||
end_addr = int(line.split('-')[1].split(':')[0], 16)
|
||||
mem_range = end_addr - start_addr
|
||||
ram_range[start_addr] = mem_range
|
||||
|
||||
return ram_range
|
||||
|
||||
|
||||
def get_serial_type():
|
||||
""" Get serial console type specified by user """
|
||||
ttys_type = ''
|
||||
ttys_value = ''
|
||||
|
||||
# Get ttySx information from board config file
|
||||
ttys_lines = board_cfg_lib.get_info(common.BOARD_INFO_FILE, "<TTYS_INFO>", "</TTYS_INFO>")
|
||||
|
||||
(err_dic, scenario_name) = common.get_scenario_name()
|
||||
if scenario_name == "logical_partition":
|
||||
ttyn = 'ttyS0'
|
||||
else:
|
||||
# Get ttySx from scenario config file which selected by user
|
||||
(err_dic, ttyn) = board_cfg_lib.parser_vuart_console()
|
||||
if err_dic:
|
||||
hv_cfg_lib.ERR_LIST.update(err_dic)
|
||||
|
||||
# query the serial type from board config file
|
||||
for line in ttys_lines:
|
||||
if ttyn in line:
|
||||
# line format:
|
||||
# seri:/dev/ttyS0 type:portio base:0x3F8 irq:4
|
||||
# seri:/dev/ttyS0 type:mmio base:0xB3640000 irq:4 bdf:"0:x.y"
|
||||
ttys_type = line.split()[1].split(':')[1]
|
||||
if ttys_type == "portio":
|
||||
ttys_value = line.split()[2].split(':')[1]
|
||||
elif ttys_type == "mmio":
|
||||
ttys_value = line.split()[-1].split('"')[1:-1][0]
|
||||
break
|
||||
|
||||
return (ttys_type, ttys_value)
|
||||
|
||||
|
||||
def is_rdt_supported():
|
||||
"""
|
||||
Returns True if platform supports RDT else False
|
||||
"""
|
||||
(rdt_resources, rdt_res_clos_max, _) = board_cfg_lib.clos_info_parser(common.BOARD_INFO_FILE)
|
||||
if len(rdt_resources) == 0 or len(rdt_res_clos_max) == 0:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
def get_memory(hv_info, config):
|
||||
|
||||
# this dictonary mapped with 'address start':'mem range'
|
||||
ram_range = {}
|
||||
|
||||
if common.VM_COUNT in list(VM_NUM_MAP_TOTAL_HV_RAM_SIZE.keys()):
|
||||
hv_ram_size = VM_NUM_MAP_TOTAL_HV_RAM_SIZE[common.VM_COUNT]
|
||||
else:
|
||||
common.print_red("VM num should not be greater than 8", err=True)
|
||||
err_dic["board config: total vm number error"] = "VM num should not be greater than 8"
|
||||
return err_dic
|
||||
|
||||
ram_range = get_ram_range()
|
||||
|
||||
# reseve 16M memory for hv sbuf, ramoops, etc.
|
||||
reserved_ram = 0x1000000
|
||||
# We recommend to put hv ram start address high than 0x10000000 to
|
||||
# reduce memory conflict with GRUB/SOS Kernel.
|
||||
hv_start_offset = 0x10000000
|
||||
total_size = reserved_ram + hv_ram_size
|
||||
avl_start_addr = find_avl_memory(ram_range, str(total_size), hv_start_offset)
|
||||
hv_start_addr = int(avl_start_addr, 16) + int(hex(reserved_ram), 16)
|
||||
hv_start_addr = common.round_up(hv_start_addr, MEM_ALIGN)
|
||||
|
||||
print("CONFIG_HV_RAM_START={}".format(hex(hv_start_addr)), file=config)
|
||||
print("CONFIG_HV_RAM_SIZE={}".format(hex(hv_ram_size)), file=config)
|
||||
print("CONFIG_PLATFORM_RAM_SIZE={}".format(hv_info.mem.platform_ram_size), file=config)
|
||||
print("CONFIG_LOW_RAM_SIZE={}".format(hv_info.mem.low_ram_size), file=config)
|
||||
print("CONFIG_SOS_RAM_SIZE={}".format(hv_info.mem.sos_ram_size), file=config)
|
||||
print("CONFIG_UOS_RAM_SIZE={}".format(hv_info.mem.uos_ram_size), file=config)
|
||||
print("CONFIG_STACK_SIZE={}".format(hv_info.mem.stack_size), file=config)
|
||||
|
||||
|
||||
def get_serial_console(config):
|
||||
|
||||
(serial_type, serial_value) = get_serial_type()
|
||||
if serial_type == "portio":
|
||||
print("CONFIG_SERIAL_LEGACY=y", file=config)
|
||||
print("CONFIG_SERIAL_PIO_BASE={}".format(serial_value), file=config)
|
||||
if serial_type == "mmio":
|
||||
print("CONFIG_SERIAL_PCI=y", file=config)
|
||||
print('CONFIG_SERIAL_PCI_BDF="{}"'.format(serial_value), file=config)
|
||||
|
||||
|
||||
def get_miscfg(hv_info, config):
|
||||
|
||||
print("CONFIG_GPU_SBDF={}".format(hv_info.mis.gpu_sbdf), file=config)
|
||||
print('CONFIG_UEFI_OS_LOADER_NAME="{}"'.format(hv_info.mis.uefi_os_loader_name), file=config)
|
||||
|
||||
|
||||
def get_features(hv_info, config):
|
||||
|
||||
print("CONFIG_{}=y".format(hv_info.features.scheduler), file=config)
|
||||
print("CONFIG_RELOC={}".format(hv_info.features.reloc), file=config)
|
||||
print("CONFIG_MULTIBOOT2={}".format(hv_info.features.multiboot2), file=config)
|
||||
print("CONFIG_HYPERV_ENABLED={}".format(hv_info.features.hyperv_enabled), file=config)
|
||||
print("CONFIG_IOMMU_ENFORCE_SNP={}".format(hv_info.features.iommu_enforce_snp), file=config)
|
||||
print("CONFIG_ACPI_PARSE_ENABLED={}".format(hv_info.features.acpi_parse_enabled), file=config)
|
||||
print("CONFIG_L1D_FLUSH_VMENTRY_ENABLED={}".format(hv_info.features.l1d_flush_vmentry_enabled), file=config)
|
||||
print("CONFIG_MCE_ON_PSC_WORKAROUND_DISABLED={}".format(hv_info.features.mce_on_psc_workaround_disabled), file=config)
|
||||
|
||||
|
||||
def get_capacities(hv_info, config):
|
||||
|
||||
print("CONFIG_IOMMU_BUS_NUM={}".format(hv_info.cap.iommu_bus_num), file=config)
|
||||
print("CONFIG_MAX_IOAPIC_NUM={}".format(hv_info.cap.max_ioapic_num), file=config)
|
||||
print("CONFIG_MAX_IR_ENTRIES={}".format(hv_info.cap.max_ir_entries), file=config)
|
||||
print("CONFIG_MAX_PCI_DEV_NUM={}".format(hv_info.cap.max_pci_dev_num), file=config)
|
||||
print("CONFIG_MAX_KATA_VM_NUM={}".format(hv_info.cap.max_kata_vm_num), file=config)
|
||||
print("CONFIG_MAX_IOAPIC_LINES={}".format(hv_info.cap.max_ioapic_lines), file=config)
|
||||
print("CONFIG_MAX_PT_IRQ_ENTRIES={}".format(hv_info.cap.max_pt_irq_entries), file=config)
|
||||
print("CONFIG_MAX_MSIX_TABLE_NUM={}".format(hv_info.cap.max_msix_table_num), file=config)
|
||||
print("CONFIG_MAX_EMULATED_MMIO_REGIONS={}".format(hv_info.cap.max_emu_mmio_regions), file=config)
|
||||
|
||||
|
||||
def get_log_opt(hv_info, config):
|
||||
|
||||
print("CONFIG_LOG_BUF_SIZE={}".format(hv_info.log.buf_size), file=config)
|
||||
print("CONFIG_NPK_LOGLEVEL={}".format(hv_info.log.level.npk), file=config)
|
||||
print("CONFIG_MEM_LOGLEVEL={}".format(hv_info.log.level.mem), file=config)
|
||||
print("CONFIG_LOG_DESTINATION={}".format(hv_info.log.dest), file=config)
|
||||
print("CONFIG_CONSOLE_LOGLEVEL={}".format(hv_info.log.level.console), file=config)
|
||||
|
||||
|
||||
def generate_file(hv_info, config):
|
||||
"""Start to generate board.c
|
||||
:param config: it is a file pointer of board information for writing to
|
||||
"""
|
||||
err_dic = {}
|
||||
|
||||
# add config scenario name
|
||||
(err_dic, scenario_name) = common.get_scenario_name()
|
||||
(err_dic, board_name) = common.get_board_name()
|
||||
|
||||
print("{}".format(DESC), file=config)
|
||||
if hv_info.log.release == 'y':
|
||||
print("CONFIG_RELEASE=y", file=config)
|
||||
print('CONFIG_BOARD="{}"'.format(board_name), file=config)
|
||||
print("CONFIG_{}=y".format(scenario_name.upper()), file=config)
|
||||
|
||||
get_memory(hv_info, config)
|
||||
get_miscfg(hv_info, config)
|
||||
get_features(hv_info, config)
|
||||
get_capacities(hv_info, config)
|
||||
get_serial_console(config)
|
||||
get_log_opt(hv_info, config)
|
||||
|
||||
if is_rdt_supported():
|
||||
print("CONFIG_RDT_ENABLED=y", file=config)
|
||||
else:
|
||||
print("CONFIG_RDT_ENABLED=n", file=config)
|
||||
|
||||
print("CONFIG_ENFORCE_VALIDATED_ACPI_INFO=y", file=config)
|
||||
|
||||
return err_dic
|
||||
189
misc/acrn-config/hv_config/hv_item.py
Normal file
189
misc/acrn-config/hv_config/hv_item.py
Normal file
@@ -0,0 +1,189 @@
|
||||
# Copyright (C) 2020 Intel Corporation. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
import common
|
||||
import hv_cfg_lib
|
||||
|
||||
class LogLevel:
|
||||
|
||||
def __init__(self, hv_file):
|
||||
self.hv_file = hv_file
|
||||
self.npk = 0
|
||||
self.mem = 0
|
||||
self.console = 0
|
||||
|
||||
def get_info(self):
|
||||
self.npk = common.get_hv_item_tag(self.hv_file, "DEBUG_OPTIONS", "NPK_LOGLEVEL")
|
||||
self.mem = common.get_hv_item_tag(self.hv_file, "DEBUG_OPTIONS", "MEM_LOGLEVEL")
|
||||
self.console = common.get_hv_item_tag(self.hv_file, "DEBUG_OPTIONS", "CONSOLE_LOGLEVEL")
|
||||
|
||||
def check_item(self):
|
||||
hv_cfg_lib.hv_range_check(self.npk, "DEBUG_OPTIONS", "NPK_LOGLEVEL", hv_cfg_lib.RANGE_DB['LOG_LEVEL'])
|
||||
hv_cfg_lib.hv_range_check(self.mem, "DEBUG_OPTIONS", "MEM_LOGLEVEL", hv_cfg_lib.RANGE_DB['LOG_LEVEL'])
|
||||
hv_cfg_lib.hv_range_check(self.console, "DEBUG_OPTIONS", "CONSOLE_LOGLEVEL", hv_cfg_lib.RANGE_DB['LOG_LEVEL'])
|
||||
|
||||
|
||||
class LogOpt:
|
||||
|
||||
def __init__(self, hv_file):
|
||||
self.hv_file = hv_file
|
||||
self.dest = 0
|
||||
self.release = ''
|
||||
self.buf_size = 0
|
||||
self.level = LogLevel(self.hv_file)
|
||||
|
||||
def get_info(self):
|
||||
self.release = common.get_hv_item_tag(self.hv_file, "DEBUG_OPTIONS", "RELEASE")
|
||||
self.dest = common.get_hv_item_tag(self.hv_file, "DEBUG_OPTIONS", "LOG_DESTINATION")
|
||||
self.buf_size = common.get_hv_item_tag(self.hv_file, "DEBUG_OPTIONS", "LOG_BUF_SIZE")
|
||||
self.level.get_info()
|
||||
|
||||
def check_item(self):
|
||||
hv_cfg_lib.release_check(self.release, "DEBUG_OPTIONS", "RELEASE")
|
||||
hv_cfg_lib.hv_range_check(self.dest, "DEBUG_OPTIONS", "LOG_DESTINATION", hv_cfg_lib.RANGE_DB['LOG_DESTINATION_BITMAP'])
|
||||
hv_cfg_lib.hv_size_check(self.buf_size, "DEBUG_OPTIONS", "LOG_BUF_SIZE")
|
||||
self.level.check_item()
|
||||
|
||||
|
||||
class CapHv:
|
||||
|
||||
def __init__(self, hv_file):
|
||||
self.hv_file = hv_file
|
||||
self.max_kata_vm_num = 0
|
||||
self.max_emu_mmio_regions = 0
|
||||
self.max_pt_irq_entries = 0
|
||||
self.max_ioapic_num = 0
|
||||
self.max_ioapic_lines = 0
|
||||
self.max_ir_entries = 0
|
||||
self.iommu_bus_num = 0
|
||||
self.max_pci_dev_num = 0
|
||||
self.max_msix_table_num = 0
|
||||
|
||||
def get_info(self):
|
||||
self.max_kata_vm_num = common.get_hv_item_tag(self.hv_file, "CAPACITIES", "MAX_KATA_VM_NUM")
|
||||
self.max_emu_mmio_regions = common.get_hv_item_tag(self.hv_file, "CAPACITIES", "MAX_EMULATED_MMIO")
|
||||
self.max_pt_irq_entries = common.get_hv_item_tag(self.hv_file, "CAPACITIES", "MAX_PT_IRQ_ENTRIES")
|
||||
self.max_ioapic_num = common.get_hv_item_tag(self.hv_file, "CAPACITIES", "MAX_IOAPIC_NUM")
|
||||
self.max_ioapic_lines = common.get_hv_item_tag(self.hv_file, "CAPACITIES", "MAX_IOAPIC_LINES")
|
||||
self.max_ir_entries = common.get_hv_item_tag(self.hv_file, "CAPACITIES", "MAX_IR_ENTRIES")
|
||||
self.iommu_bus_num = common.get_hv_item_tag(self.hv_file, "CAPACITIES", "IOMMU_BUS_NUM")
|
||||
self.max_pci_dev_num = common.get_hv_item_tag(self.hv_file, "CAPACITIES", "MAX_PCI_DEV_NUM")
|
||||
self.max_msix_table_num = common.get_hv_item_tag(self.hv_file, "CAPACITIES", "MAX_MSIX_TABLE_NUM")
|
||||
|
||||
def check_item(self):
|
||||
hv_cfg_lib.hv_range_check(self.max_kata_vm_num, "CAPACITIES", "MAX_KATA_VM_NUM", hv_cfg_lib.RANGE_DB['KATA_VM_NUM'])
|
||||
hv_cfg_lib.hv_range_check(self.max_emu_mmio_regions, "CAPACITIES", "MAX_EMULATED_MMIO", hv_cfg_lib.RANGE_DB['EMULATED_MMIO_REGIONS'])
|
||||
hv_cfg_lib.hv_range_check(self.max_pt_irq_entries, "CAPACITIES", "MAX_PT_IRQ_ENTRIES", hv_cfg_lib.RANGE_DB['PT_IRQ_ENTRIES'])
|
||||
hv_cfg_lib.hv_range_check(self.max_ioapic_num, "CAPACITIES", "MAX_IOAPIC_NUM", hv_cfg_lib.RANGE_DB['IOAPIC_NUM'])
|
||||
hv_cfg_lib.hv_range_check(self.max_ioapic_lines, "CAPACITIES", "MAX_IOAPIC_LINES", hv_cfg_lib.RANGE_DB['IOAPIC_LINES'])
|
||||
hv_cfg_lib.ir_entries_check(self.max_ir_entries, "CAPACITIES", "MAX_IR_ENTRIES")
|
||||
hv_cfg_lib.hv_size_check(self.iommu_bus_num, "CAPACITIES", "IOMMU_BUS_NUM")
|
||||
hv_cfg_lib.hv_range_check(self.max_pci_dev_num, "CAPACITIES", "MAX_PCI_DEV_NUM", hv_cfg_lib.RANGE_DB['PCI_DEV_NUM'])
|
||||
hv_cfg_lib.hv_range_check(self.max_msix_table_num, "CAPACITIES", "MAX_MSIX_TABLE_NUM", hv_cfg_lib.RANGE_DB['MSIX_TABLE_NUM'])
|
||||
|
||||
|
||||
class MisCfg:
|
||||
|
||||
def __init__(self, hv_file):
|
||||
self.hv_file = hv_file
|
||||
self.gpu_sbdf = 0
|
||||
self.uefi_os_loader_name = ''
|
||||
|
||||
def get_info(self):
|
||||
self.gpu_sbdf = common.get_hv_item_tag(self.hv_file, "MISC_CFG", "GPU_SBDF")
|
||||
self.uefi_os_loader_name = common.get_hv_item_tag(self.hv_file, "MISC_CFG", "UEFI_OS_LOADER_NAME")
|
||||
|
||||
def check_item(self):
|
||||
hv_cfg_lib.hv_size_check(self.gpu_sbdf, "MISC_CFG", "GPU_SBDF")
|
||||
hv_cfg_lib.uefi_load_name_check(self.uefi_os_loader_name, "MISC_CFG", "UEFI_OS_LOADER_NAME")
|
||||
|
||||
|
||||
class Features:
|
||||
def __init__(self, hv_file):
|
||||
self.hv_file = hv_file
|
||||
self.reloc = ''
|
||||
self.multiboot2 = ''
|
||||
self.scheduler = ''
|
||||
self.hyperv_enabled = ''
|
||||
self.iommu_enforce_snp = ''
|
||||
self.acpi_parse_enabled = ''
|
||||
self.l1d_flush_vmentry_enabled = ''
|
||||
self.mce_on_psc_workaround_disabled = ''
|
||||
|
||||
def get_info(self):
|
||||
self.multiboot2 = common.get_hv_item_tag(self.hv_file, "FEATURES", "MULTIBOOT2")
|
||||
self.scheduler = common.get_hv_item_tag(self.hv_file, "FEATURES", "SCHEDULER")
|
||||
self.reloc = common.get_hv_item_tag(self.hv_file, "FEATURES", "RELOC")
|
||||
self.hyperv_enabled = common.get_hv_item_tag(self.hv_file, "FEATURES", "HYPERV_ENABLED")
|
||||
self.acpi_parse_enabled = common.get_hv_item_tag(self.hv_file, "FEATURES", "ACPI_PARSE_ENABLED")
|
||||
self.l1d_flush_vmentry_enabled = common.get_hv_item_tag(self.hv_file, "FEATURES", "L1D_VMENTRY_ENABLED")
|
||||
self.mce_on_psc_workaround_disabled = common.get_hv_item_tag(self.hv_file, "FEATURES", "MCE_ON_PSC_DISABLED")
|
||||
self.iommu_enforce_snp = common.get_hv_item_tag(self.hv_file, "FEATURES", "IOMMU_ENFORCE_SNP")
|
||||
|
||||
def check_item(self):
|
||||
hv_cfg_lib.ny_support_check(self.multiboot2, "FEATURES", "MULTIBOOT2")
|
||||
hv_cfg_lib.scheduler_check(self.scheduler, "FEATURES", "SCHEDULER")
|
||||
hv_cfg_lib.ny_support_check(self.reloc, "FEATURES", "RELOC")
|
||||
hv_cfg_lib.ny_support_check(self.hyperv_enabled, "FEATURES", "HYPERV_ENABLED")
|
||||
hv_cfg_lib.ny_support_check(self.acpi_parse_enabled, "FEATURES", "ACPI_PARSE_ENABLED")
|
||||
hv_cfg_lib.ny_support_check(self.l1d_flush_vmentry_enabled, "FEATURES", "L1D_VMENTRY_ENABLED")
|
||||
hv_cfg_lib.ny_support_check(self.mce_on_psc_workaround_disabled, "FEATURES", "MCE_ON_PSC_DISABLED")
|
||||
hv_cfg_lib.ny_support_check(self.iommu_enforce_snp, "FEATURES", "IOMMU_ENFORCE_SNP")
|
||||
|
||||
|
||||
class Memory:
|
||||
|
||||
def __init__(self, hv_file):
|
||||
self.hv_file = hv_file
|
||||
self.stack_size = 0
|
||||
self.low_ram_size = 0
|
||||
self.hv_ram_start = 0
|
||||
self.hv_ram_size = 0
|
||||
self.platform_ram_size = 0
|
||||
self.sos_ram_size = 0
|
||||
self.uos_ram_size = 0
|
||||
|
||||
def get_info(self):
|
||||
self.stack_size = common.get_hv_item_tag(self.hv_file, "MEMORY", "STACK_SIZE")
|
||||
self.low_ram_size = common.get_hv_item_tag(self.hv_file, "MEMORY", "LOW_RAM_SIZE")
|
||||
self.hv_ram_size = common.get_hv_item_tag(self.hv_file, "MEMORY", "HV_RAM_SIZE")
|
||||
self.hv_ram_start = common.get_hv_item_tag(self.hv_file, "MEMORY", "HV_RAM_START")
|
||||
self.platform_ram_size = common.get_hv_item_tag(self.hv_file, "MEMORY", "PLATFORM_RAM_SIZE")
|
||||
self.sos_ram_size = common.get_hv_item_tag(self.hv_file, "MEMORY", "SOS_RAM_SIZE")
|
||||
self.uos_ram_size = common.get_hv_item_tag(self.hv_file, "MEMORY", "UOS_RAM_SIZE")
|
||||
|
||||
def check_item(self):
|
||||
hv_cfg_lib.hv_size_check(self.stack_size, "MEMORY", "STACK_SIZE")
|
||||
hv_cfg_lib.hv_size_check(self.low_ram_size, "MEMORY", "LOW_RAM_SIZE")
|
||||
hv_cfg_lib.hv_size_check(self.hv_ram_size, "MEMORY", "HV_RAM_SIZE")
|
||||
hv_cfg_lib.hv_size_check(self.hv_ram_start, "MEMORY", "HV_RAM_START")
|
||||
hv_cfg_lib.hv_size_check(self.platform_ram_size, "MEMORY", "PLATFORM_RAM_SIZE")
|
||||
hv_cfg_lib.hv_size_check(self.sos_ram_size, "MEMORY", "SOS_RAM_SIZE")
|
||||
hv_cfg_lib.hv_size_check(self.uos_ram_size, "MEMORY", "UOS_RAM_SIZE")
|
||||
|
||||
|
||||
class HvInfo:
|
||||
|
||||
def __init__(self, hv_file):
|
||||
self.hv_file = hv_file
|
||||
self.mem = Memory(self.hv_file)
|
||||
self.cap = CapHv(self.hv_file)
|
||||
self.log = LogOpt(self.hv_file)
|
||||
self.mis = MisCfg(self.hv_file)
|
||||
self.features = Features(self.hv_file)
|
||||
|
||||
def get_info(self):
|
||||
self.mem.get_info()
|
||||
self.log.get_info()
|
||||
self.cap.get_info()
|
||||
self.mis.get_info()
|
||||
self.features.get_info()
|
||||
|
||||
def check_item(self):
|
||||
self.mem.check_item()
|
||||
self.log.check_item()
|
||||
self.cap.check_item()
|
||||
self.mis.check_item()
|
||||
self.features.check_item()
|
||||
Reference in New Issue
Block a user