Commit ac0817ae authored by Bruno Gomes's avatar Bruno Gomes

Merge branch 'master' into air5-dev

refs #201957
parents 268b226e fd49d550
[submodule "air/pos/rtems48i"]
path = air/pos/rtems48i
url = https://spass-git-ext.gmv.com/AIR/rtems48i.git
[submodule "air/pos/rtems5"]
path = air/pos/rtems5
url = https://spass-git-ext.gmv.com/AIR/rtems5.git
......@@ -4,7 +4,7 @@ AIR has a user manual at https://gmvdrive.gmv.com/index.php/s/eScXCAybbecmT9b
To install AIR after cloning from git, you should do the following:
1) Install RTEMS toolchain for RTEMS 5
## 1 - Install RTEMS toolchain for RTEMS 5
Execute the following:
......@@ -16,36 +16,74 @@ $ ./source-builder/sb-check
$ cd rtems
$ ../source-builder/sb-set-builder --prefix=/opt/rtems/5 5/rtems-sparc
2) Configure and build AIR
## 2 - Configure and build AIR
AIR configure requires python-mako, if not installed execute (in case of Debian)
Add the air_repo/air to the PATH env variable, we recommend doing the following way in .bashrc file:
sudo apt-get install python-mako
- export AIR=/home/taste/work/air/air
- export PATH=$PATH:$AIR
Clone AIR repo for example in */home/taste/work/*
git clone https://spass-git-ext.gmv.com/AIR/AIR.git
AIR configure requires python-mako, if not installed execute (in case of Debian)
- sudo apt-get install python-mako
Add the *air_repo/air* to the PATH env variable, we recommend doing the following way in .bashrc file:
export AIR=/home/taste/work/air/air
export PATH=$PATH:$AIR
AIR supports the following paravirtualized RTOS versions
- RTEMS 4.8i
- RTEMS 5
AIR paravirtualized RTOS are obtained via git submodules. For example to use AIR
RTEMS 5 version please execute in *air_repo/air*
git submodule init air/pos/rtems5
git submodule update
### Using AIR configurator tool
On *air_repo/air* execute
Go to the folder air_repo/air”
Run “configure” and set the following options (for SPARC LEON4 with FPU enable)
./configure
Configurator interface will enquire the user for options (architecture, BSP, FPU, Cache, Debugger, RTOS). For example
Press 0 for sparc
Press 2 for leon4
Press 0 for fpu enabled
Then write “make clean” then next do a “make all”.
...
A) To build an example ready to run on a target board
After configurator finishes execute
make
### To build an example ready to run on a target board
Then go to any example inside *air_repo/air/examples*
Execute
../../configure
This generate the makefiles taking as input the XML configuration file.
Then go to any example inside air/example.
Run “configure” on the example and it will generate the makefiles taking as input the XML configuration file.
It generates a parent makefile and then a makefile per partition inside the respective partition folder.
Running make all at the example will create the respective binary.
Executing
make all
will create the respective binary in the created *executables* folder.
B) Support
## Support
Email to dtms@gmv.com or raise issue at our Gitlab
## Updating AIR repo to AIR v5.3 and configurator v4.2
Since configurator v4.2 the RTOS paravirtualized versions are obtained via git submodules.
Pulling new AIR content into old AIR repo will generate conflicts. To get a new clean
AIR repo please execute (please backup any working folder)
git fetch
git reset origin/master --hard
rtems48i @ a6f1578a
Subproject commit a6f1578a2097f57250defe9582daae917b31785f
rtems5 @ 3cb386c0
Subproject commit 3cb386c0e805ddbd9adf8df0d5beff68606203f9
......@@ -19,7 +19,6 @@ import subprocess
__OS_CONFIG_FILE__ = os.path.join(air.ROOT_DIRECTORY, '.air_config')
AIR_POS = os.path.join(air.CONFIGURATOR_DIRECTORY, 'air', 'pos')
AIR_TARGETS = os.path.join(air.CONFIGURATOR_DIRECTORY, 'air', 'targets')
AIR_LIBRARIES = os.path.join(air.CONFIGURATOR_DIRECTORY, 'air', 'libraries')
......@@ -88,35 +87,8 @@ def get_available_libraries():
return libs
def get_available_pos():
pos = {}
# Prompt to install RTOS
#opts = ['No', 'Yes']
#promptx = 'Install All RTOS ?'
#all_rtos = terminalutils.promptActions(promptx, opts)
pos_names = [x for x in os.listdir(AIR_POS)
if os.path.isdir(os.path.join(AIR_POS, x)) and x != 'shared']
for pos_name in pos_names:
try:
#i = 0
#if all_rtos == 0:
# promptx = 'Install ' + pos_name + '?'
# i = terminalutils.promptActions(promptx, opts)
#if i == 1 or all_rtos == 1:
pos_path = os.path.join(AIR_POS, pos_name, 'config.py')
module = imp.load_source(pos_name, pos_path)
module.path = pos_path
pos[module.name.lower()] = module
except IOError:
logging.warning ('Missing AIR POS : %s, name: %s', pos_path, pos_name)
pass
return pos
supported_architectures = {}
available_libraries = {}
available_pos = {}
##
# @brief Class to hold the AIR OS current configuration
......@@ -127,7 +99,7 @@ class Configuration(object):
# @param self object pointer
# @param arch target architecture
# @param bsp target board support package
def __init__(self, arch, bsp, fpu_enabled, cache_init):
def __init__(self, arch, bsp, fpu_enabled, cache_init, pos_select):
self.arch = arch.lower()
self.bsp = bsp.lower()
......@@ -138,16 +110,17 @@ class Configuration(object):
# get supported pos
self.supported_pos = {}
for pos in available_pos:
pos = available_pos[pos]
if not hasattr(pos, 'supported_libraries'):
pos.supported_libraries = []
if self.arch in pos.source_files and \
self.arch in pos.private_header_files and self.arch in pos.public_header_files:
self.supported_pos[pos.name.lower()] = pos
if pos.alias is not None:
for alias in pos.alias:
self.supported_pos[alias.lower()] = pos
for pos in pos_select:
pos_path = os.path.join(air.POS_DIRECTORY, pos, 'config.py')
module = imp.load_source(pos, pos_path)
if not hasattr(module, 'supported_libraries'):
module.supported_libraries = []
if self.arch in module.source_files and \
self.arch in module.private_header_files and self.arch in module.public_header_files:
self.supported_pos[pos] = module
if module.alias is not None:
for alias in module.alias:
self.supported_pos[alias.lower()] = module
# get supported libraries
self.supported_libraries = {}
......@@ -157,16 +130,16 @@ class Configuration(object):
if lib.requires_pos is not None:
for pos_name in lib.requires_pos:
try:
pos = self.supported_pos[pos_name]
pos.supported_libraries.append(lib.name)
module = self.supported_pos[pos_name]
module.supported_libraries.append(lib.name)
supported = True
except Exception:
logging.warning ('the library: %s is not installed because %s is missing', lib.name, pos_name)
pass
else:
for pos_name in self.supported_pos:
pos = self.supported_pos[pos_name]
self.supported_pos[pos_name].supported_libraries.append(lib.name)
module = self.supported_pos[pos_name]
module.supported_libraries.append(lib.name)
supported = True
if supported:
......@@ -174,9 +147,9 @@ class Configuration(object):
# clear duplicates in partition library list
for pos_name in self.supported_pos:
pos = self.supported_pos[pos_name]
if pos.alias is None or pos_name not in pos.alias:
pos.supported_libraries = list(set(pos.supported_libraries))
module = self.supported_pos[pos_name]
if module.alias is None or pos_name not in module.alias:
module.supported_libraries = list(set(module.supported_libraries))
##
# @brief Check if a POS is supported
......@@ -563,10 +536,14 @@ class Configuration(object):
# @param os_configuration OS configuration object pointer
# @param logger logger to report errors
def save_configuration(os_configuration, logger):
#save only the pos names
savepos = []
for pos in os_configuration.supported_pos:
savepos.append(os_configuration.supported_pos[pos].name.lower())
try:
fd = open(__OS_CONFIG_FILE__, 'w+')
pickle.dump((os_configuration.arch, os_configuration.bsp, os_configuration.fpu_enabled, os_configuration.cache_init), fd)
pickle.dump((os_configuration.arch, os_configuration.bsp, os_configuration.fpu_enabled, os_configuration.cache_init, savepos), fd)
fd.close()
except Exception, why:
......@@ -576,17 +553,17 @@ def save_configuration(os_configuration, logger):
# @brief Loads the OS configuration from the build directory
# @param logger logger to report errors
# @return OS configuration object pointer
def load_configuration(logger):
def load_configuration(logger, config=__OS_CONFIG_FILE__):
# sanity check
if not os.path.isfile(__OS_CONFIG_FILE__):
logger.error("Error POS config file is missing ", __OS_CONFIG_FILE__)
if not os.path.isfile(config):
logger.error("Error POS config file is missing ", config)
return None
# try to load the configuration
try:
fd = open(__OS_CONFIG_FILE__, 'r')
arch, bsp, fpu_enabled, cache_init = pickle.load(fd)
os_configuration = Configuration(arch, bsp, fpu_enabled, cache_init)
fd = open(config, 'r')
arch, bsp, fpu_enabled, cache_init, pos_select = pickle.load(fd)
os_configuration = Configuration(arch, bsp, fpu_enabled, cache_init, pos_select)
fd.close()
return os_configuration
except:
......
......@@ -17,7 +17,7 @@ name = "posixrtems5"
description = "POSIXRTEMS-5"
# @brief OS alias
alias = ['rtems5']
alias = ['posixrtems5']
# @brief Supported git checkout id
git_id = "6bb9b3df7b5ea97e151d39654092c060d2175045"
......
......@@ -29,6 +29,9 @@ PGM=$(EXEC)
# IO Manager = io
MANAGERS=sem rtmon msg timer io
MODULES := $(sort $(dir $(wildcard ./*/*.c)))
BUILD_DIR := $(addprefix o-optimize/,$(MODULES))
# C source code and headers filenames used in the example
CSRCS=$(shell find ./ -type f -name '*.c')
CHDRS=$(shell find ./ -type f -name '*.h')
......@@ -55,7 +58,7 @@ $(AIR_PMK)/pmk.a
# The RTEMS_MAKEFILE_PATH is defined by the user for the specific CPU and BSP
RTEMS_MAKEFILE_PATH=$(AIR_POS)/${os.path.join('rtems5', 'rtems5-install', 'sparc-rtems5', 'leon3')}
# These includes should not be modified by the user.
# These includes should not be modified by the user.
include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
include $(RTEMS_CUSTOM)
include $(PROJECT_ROOT)/make/leaf.cfg
......@@ -79,7 +82,10 @@ LDFLAGS += -Wl,--gc-sections -Wl,--wrap=printf -Wl,--wrap=puts -Wl,--wrap=putcha
OBJS = $(COBJS) $(ASOBJS)
all: $(ARCH) $(PGM)
all: $(ARCH) $(BUILD_DIR) $(PGM)
$(PGM): $(OBJS) $(CHDRS)
${'\t'}$(make-exe)
$(BUILD_DIR):
${'\t'}@mkdir -p $@
#!/usr/bin/python
# =============================================================================
# Copyright (C) GMVIS Skysoft S.A., 2014
# Copyright (C) GMVIS Skysoft S.A., 2014-2019
# =============================================================================
# This file is part of the AIR Operating System configuration sub-system.
# The license and distribution terms for this file may be found in the file
......@@ -22,8 +22,7 @@ from utils.logger import Logger
from localization.common import *
from argparse import ArgumentParser, RawTextHelpFormatter
__version__ = '4.1'
__copyright__ = 'Copyright (C) GMVIS Skysoft S.A., 2018'
__version__ = '4.2'
__author__ = 'dtms, llgg, gmvs, lumm, pfnf'
__app__ = os.path.basename(__file__)
......@@ -48,7 +47,6 @@ if __name__ == "__main__":
# get available architectures
air_configuration.supported_architectures = air_configuration.get_available_targets()
air_configuration.available_libraries = air_configuration.get_available_libraries()
air_configuration.available_pos = air_configuration.get_available_pos()
# check if we are configuring AIR or a partition
if air.WORKING_DIRECTORY == air.ROOT_DIRECTORY:
......
AIR_CONFIG_WELCOME = [ ' AIR Configurator v{0}', ' Copyright (C) GMVIS Skysoft S.A., 2018' ]
AIR_CONFIG_WELCOME = [ ' AIR Configurator v{0}', ' Copyright (C) GMVIS Skysoft S.A., 2019' ]
IOP_CONFIG_WELCOME = [ ' IOP Configurator v{0}', ' Copyright (C) GMVIS Skysoft S.A., 2017' ]
AIR_DESCRIPTION = 'Tool to configure an AIR application'
......@@ -70,4 +70,4 @@ AIR_ERROR_NO_FILES = 'No AIR configuration file found in the current directo
AIR_ERROR_MANY_FILES = 'Multiple AIR configuration files found in the current directory'
IOP_ERROR_NO_FILES = 'No IOP configuration file found in the current directory'
IOP_ERROR_MANY_FILES = 'Multiple IOP configuration files found in the current directory'
\ No newline at end of file
IOP_ERROR_MANY_FILES = 'Multiple IOP configuration files found in the current directory'
......@@ -20,8 +20,8 @@ def InputArgs(arg_parser, logger):
arg_parser.add_argument('-i', '--info', dest='info', action='store_const', const=True,
default=False, help='Installation information')
arg_parser.add_argument('-t', '--target', dest='target', default=None,
help='Deployment target')
arg_parser.add_argument('-f', '--cfg', dest='config', default=None,
help='Insert .air_config file')
arg_parser.add_argument('-d', '--dev', dest='dev', action='store_const',
const=True, default=False, help='Development symbols')
return arg_parser.parse_args()
......@@ -53,16 +53,15 @@ def Run(args, logger):
fileutils.setHardcodedFiles()
# parse input args or prompt the user for configuration
if args.target is None:
arch, bsp, fpu_enabled, cache_init = prompt_configuration(logger)
if args.config is None:
arch, bsp, fpu_enabled, cache_init, pos = prompt_configuration(logger)
# create the OS configuration object
os_configuration = air_configuration.Configuration(arch, bsp, fpu_enabled, cache_init, pos)
else:
arch, bsp, fpu_enabled, cache_init = input_configuration(args.target, logger)
# create the OS configuration object
os_configuration = air_configuration.Configuration(arch, bsp, fpu_enabled, cache_init)
os_configuration = input_configuration(logger, args.config)
logger.event(0, 'Configuring AIR OS:')
logger.information(1, 'Target: {0} - {1}\n'.format(arch.upper(), bsp))
logger.information(1, 'Target: {0} - {1}\n'.format(os_configuration.arch.upper(), os_configuration.bsp))
# template lookup directories
template_includes = \
......@@ -191,39 +190,36 @@ def prompt_configuration(logger):
else:
cache_init = 0
return arch, bsp, fpu_enabled, cache_init
def input_configuration(target, logger):
try:
# get the current target
args = target.split('-', 1)
arch = args[0]; bsp = args[1]; fpu_flag = args[2];
# check if target is supported
if arch not in air_configuration.supported_architectures.keys() or \
bsp not in air_configuration.supported_architectures[arch].keys():
logger.error("Unsupported target: '{0}'", target)
arch = bsp = None
except:
logger.logger.exception("Exception, See details below")
# error
logger.error("Unsupported target: '{0}'", target)
arch = bsp = None
# present list of supported targets if an error occurred
if arch is None or bsp is None:
# check if arch is supported
logger.event(0, "Supported targets:")
for arch in air_configuration.supported_architectures.keys():
for bsp in air_configuration.supported_architectures[arch].keys():
logger.information(1, '{0}-{1}', arch, bsp)
pos = []
# Prompt to install RTOS
opts = ['No', 'Yes']
promptx = 'Install All RTOS ?'
all_rtos = terminalutils.promptActions(promptx, opts)
pos_names = [x for x in os.listdir(air.POS_DIRECTORY)
if os.path.isdir(os.path.join(air.POS_DIRECTORY, x)) and x != 'shared']
for pos_name in pos_names:
try:
i = 0
if all_rtos == 0:
promptx = 'Install ' + pos_name + '?'
i = terminalutils.promptActions(promptx, opts)
if i == 1 or all_rtos == 1:
pos.append(pos_name)
except IOError:
logging.warning ('Missing AIR POS : %s, name: %s', pos_path, pos_name)
pass
return arch, bsp, fpu_enabled, cache_init, pos
def input_configuration(logger, config):
__CONFIG_FILE__ = os.path.join(air.ROOT_DIRECTORY, config)
if not os.path.isfile(__CONFIG_FILE__):
logger.error("Error config file is missing ", __CONFIG_FILE__)
sys.exit(-1)
return arch, bsp, fpu_flag
os_configuration = air_configuration.load_configuration(logger, __CONFIG_FILE__)
return os_configuration
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment