Added corebmk experiment.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14521 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2021-06-09 10:15:13 +00:00
parent 09ed00f52b
commit 2033af9d94
10 changed files with 394 additions and 118 deletions

View File

@ -1,13 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<SPC5-Config version="1.0.0"> <instance locked="false"
<application name="ChibiOS/NIL Test Suite" version="1.0.0" standalone="true" locked="false"> id="org.chibios.spc5.components.portable.chibios_unitary_tests_engine">
<description>Test Specification for ChibiOS/NIL.</description>
<component id="org.chibios.spc5.components.portable.generic_startup">
<component id="org.chibios.spc5.components.portable.chibios_unitary_tests_engine" />
</component>
<instances>
<instance locked="false" id="org.chibios.spc5.components.portable.generic_startup" />
<instance locked="false" id="org.chibios.spc5.components.portable.chibios_unitary_tests_engine">
<description> <description>
<brief> <brief>
<value>ChibiOS/NIL Test Suite.</value> <value>ChibiOS/NIL Test Suite.</value>
@ -30,12 +23,15 @@
*/]]></value> */]]></value>
</copyright> </copyright>
<introduction> <introduction>
<value>Test suite for core benchmarks. The purpose of this suite is to perform general benchmarks in order to assess performance of cores and/or compilers.</value> <value>Test suite for core benchmarks. The purpose of this suite
is to perform general benchmarks in order to assess
performance of cores and/or compilers.
</value>
</introduction> </introduction>
</description> </description>
<global_data_and_code> <global_data_and_code>
<code_prefix> <code_prefix>
<value>corebmk</value> <value>corebmk_</value>
</code_prefix> </code_prefix>
<global_definitions> <global_definitions>
<value><![CDATA[ <value><![CDATA[
@ -57,7 +53,9 @@
<value>Information.</value> <value>Information.</value>
</brief> </brief>
<description> <description>
<value>This sequence reports configuration and version information about execution environment.</value> <value>This sequence reports configuration and version
information about execution environment.
</value>
</description> </description>
<condition> <condition>
<value /> <value />
@ -139,7 +137,3 @@ test_println("");
</sequence> </sequence>
</sequences> </sequences>
</instance> </instance>
</instances>
<exportedFeatures />
</application>
</SPC5-Config>

View File

@ -0,0 +1,64 @@
/*
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @mainpage Test Suite Specification
* Test suite for core benchmarks. The purpose of this suite is to
* perform general benchmarks in order to assess performance of cores
* and/or compilers.
*
* <h2>Test Sequences</h2>
* - @subpage corebmk_test_sequence_001
* .
*/
/**
* @file corebmk_test_root.c
* @brief Test Suite root structures code.
*/
#include "hal.h"
#include "corebmk_test_root.h"
#if !defined(__DOXYGEN__)
/*===========================================================================*/
/* Module exported variables. */
/*===========================================================================*/
/**
* @brief Array of test sequences.
*/
const testsequence_t * const corebmk_test_suite_array[] = {
&corebmk_test_sequence_001,
NULL
};
/**
* @brief Test suite root structure.
*/
const testsuite_t corebmk_test_suite = {
"ChibiOS/NIL Test Suite",
corebmk_test_suite_array
};
/*===========================================================================*/
/* Shared code. */
/*===========================================================================*/
/**/
#endif /* !defined(__DOXYGEN__) */

View File

@ -0,0 +1,52 @@
/*
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @file corebmk_test_root.h
* @brief Test Suite root structures header.
*/
#ifndef COREBMK_TEST_ROOT_H
#define COREBMK_TEST_ROOT_H
#include "ch_test.h"
#include "corebmk_test_sequence_001.h"
#if !defined(__DOXYGEN__)
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
extern const testsuite_t corebmk_test_suite;
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
/*===========================================================================*/
/* Shared definitions. */
/*===========================================================================*/
/**/
#endif /* !defined(__DOXYGEN__) */
#endif /* COREBMK_TEST_ROOT_H */

View File

@ -0,0 +1,123 @@
/*
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "hal.h"
#include "corebmk_test_root.h"
/**
* @file corebmk_test_sequence_001.c
* @brief Test Sequence 001 code.
*
* @page corebmk_test_sequence_001 [1] Information
*
* File: @ref corebmk_test_sequence_001.c
*
* <h2>Description</h2>
* This sequence reports configuration and version information about
* execution environment.
*
* <h2>Test Cases</h2>
* - @subpage corebmk_test_001_001
* .
*/
/****************************************************************************
* Shared code.
****************************************************************************/
#include "ch.h"
/****************************************************************************
* Test cases.
****************************************************************************/
/**
* @page corebmk_test_001_001 [1.1] Environment Info
*
* <h2>Description</h2>
* Environment-related info are reported.
*
* <h2>Test Steps</h2>
* - [1.1.1] Architecture and Compiler information.
* .
*/
static void corebmk_test_001_001_execute(void) {
/* [1.1.1] Architecture and Compiler information.*/
test_set_step(1);
{
#if defined(PORT_ARCHITECTURE_NAME)
test_print("--- Architecture: ");
test_println(PORT_ARCHITECTURE_NAME);
#endif
#if defined(PORT_CORE_VARIANT_NAME)
test_print("--- Core Variant: ");
test_println(PORT_CORE_VARIANT_NAME);
#endif
#if defined(PORT_COMPILER_NAME)
test_print("--- Compiler: ");
test_println(PORT_COMPILER_NAME);
#endif
#if defined(PORT_INFO)
test_print("--- Port Info: ");
test_println(PORT_INFO);
#endif
#if defined(PORT_NATURAL_ALIGN)
test_print("--- Natural alignment: ");
test_printn(PORT_NATURAL_ALIGN);
test_println("");
#endif
#if defined(PORT_STACK_ALIGN)
test_print("--- Stack alignment: ");
test_printn(PORT_STACK_ALIGN);
test_println("");
#endif
#if defined(PORT_WORKING_AREA_ALIGN)
test_print("--- Working area alignment: ");
test_printn(PORT_WORKING_AREA_ALIGN);
test_println("");
#endif
}
test_end_step(1);
}
static const testcase_t corebmk_test_001_001 = {
"Environment Info",
NULL,
NULL,
corebmk_test_001_001_execute
};
/****************************************************************************
* Exported data.
****************************************************************************/
/**
* @brief Array of test cases.
*/
const testcase_t * const corebmk_test_sequence_001_array[] = {
&corebmk_test_001_001,
NULL
};
/**
* @brief Information.
*/
const testsequence_t corebmk_test_sequence_001 = {
"Information",
corebmk_test_sequence_001_array
};

View File

@ -0,0 +1,27 @@
/*
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @file corebmk_test_sequence_001.h
* @brief Test Sequence 001 header.
*/
#ifndef COREBMK_TEST_SEQUENCE_001_H
#define COREBMK_TEST_SEQUENCE_001_H
extern const testsequence_t corebmk_test_sequence_001;
#endif /* COREBMK_TEST_SEQUENCE_001_H */

View File

@ -15,12 +15,16 @@
limitations under the License. limitations under the License.
--] --]
[#import "/@ftllibs/libutils.ftl" as utils /] [#import "/@ftllibs/libutils.ftl" as utils /]
[#if xml.instance[0]??]
[#assign instance = xml.instance /]
[#else]
[#list xml.*.application.instances.instance as inst] [#list xml.*.application.instances.instance as inst]
[#if inst.@id?string == "org.chibios.spc5.components.portable.chibios_unitary_tests_engine"] [#if inst.@id?string == "org.chibios.spc5.components.portable.chibios_unitary_tests_engine"]
[#assign instance = inst /] [#assign instance = inst /]
[#break] [#break]
[/#if] [/#if]
[/#list] [/#list]
[/#if]
[#assign conf = {"instance":instance} /] [#assign conf = {"instance":instance} /]
[#assign prefix_lower = conf.instance.global_data_and_code.code_prefix.value[0]?trim?lower_case /] [#assign prefix_lower = conf.instance.global_data_and_code.code_prefix.value[0]?trim?lower_case /]
[#assign prefix_upper = conf.instance.global_data_and_code.code_prefix.value[0]?trim?upper_case /] [#assign prefix_upper = conf.instance.global_data_and_code.code_prefix.value[0]?trim?upper_case /]

View File

@ -15,12 +15,16 @@
limitations under the License. limitations under the License.
--] --]
[#import "/@ftllibs/libutils.ftl" as utils /] [#import "/@ftllibs/libutils.ftl" as utils /]
[#if xml.instance[0]??]
[#assign instance = xml.instance /]
[#else]
[#list xml.*.application.instances.instance as inst] [#list xml.*.application.instances.instance as inst]
[#if inst.@id?string == "org.chibios.spc5.components.portable.chibios_unitary_tests_engine"] [#if inst.@id?string == "org.chibios.spc5.components.portable.chibios_unitary_tests_engine"]
[#assign instance = inst /] [#assign instance = inst /]
[#break] [#break]
[/#if] [/#if]
[/#list] [/#list]
[/#if]
[#assign conf = {"instance":instance} /] [#assign conf = {"instance":instance} /]
[#assign prefix_lower = conf.instance.global_data_and_code.code_prefix.value[0]?trim?lower_case /] [#assign prefix_lower = conf.instance.global_data_and_code.code_prefix.value[0]?trim?lower_case /]
[#assign prefix_upper = conf.instance.global_data_and_code.code_prefix.value[0]?trim?upper_case /] [#assign prefix_upper = conf.instance.global_data_and_code.code_prefix.value[0]?trim?upper_case /]

View File

@ -16,12 +16,16 @@
--] --]
[#import "/@ftllibs/libutils.ftl" as utils /] [#import "/@ftllibs/libutils.ftl" as utils /]
[@pp.dropOutputFile /] [@pp.dropOutputFile /]
[#if xml.instance[0]??]
[#assign instance = xml.instance /]
[#else]
[#list xml.*.application.instances.instance as inst] [#list xml.*.application.instances.instance as inst]
[#if inst.@id?string == "org.chibios.spc5.components.portable.chibios_unitary_tests_engine"] [#if inst.@id?string == "org.chibios.spc5.components.portable.chibios_unitary_tests_engine"]
[#assign instance = inst /] [#assign instance = inst /]
[#break] [#break]
[/#if] [/#if]
[/#list] [/#list]
[/#if]
[#assign conf = {"instance":instance} /] [#assign conf = {"instance":instance} /]
[#assign prefix_lower = conf.instance.global_data_and_code.code_prefix.value[0]?trim?lower_case /] [#assign prefix_lower = conf.instance.global_data_and_code.code_prefix.value[0]?trim?lower_case /]
[#assign prefix_upper = conf.instance.global_data_and_code.code_prefix.value[0]?trim?upper_case /] [#assign prefix_upper = conf.instance.global_data_and_code.code_prefix.value[0]?trim?upper_case /]

View File

@ -16,12 +16,16 @@
--] --]
[#import "/@ftllibs/libutils.ftl" as utils /] [#import "/@ftllibs/libutils.ftl" as utils /]
[@pp.dropOutputFile /] [@pp.dropOutputFile /]
[#if xml.instance[0]??]
[#assign instance = xml.instance /]
[#else]
[#list xml.*.application.instances.instance as inst] [#list xml.*.application.instances.instance as inst]
[#if inst.@id?string == "org.chibios.spc5.components.portable.chibios_unitary_tests_engine"] [#if inst.@id?string == "org.chibios.spc5.components.portable.chibios_unitary_tests_engine"]
[#assign instance = inst /] [#assign instance = inst /]
[#break] [#break]
[/#if] [/#if]
[/#list] [/#list]
[/#if]
[#assign conf = {"instance":instance} /] [#assign conf = {"instance":instance} /]
[#assign prefix_lower = conf.instance.global_data_and_code.code_prefix.value[0]?trim?lower_case /] [#assign prefix_lower = conf.instance.global_data_and_code.code_prefix.value[0]?trim?lower_case /]
[#assign prefix_upper =conf. instance.global_data_and_code.code_prefix.value[0]?trim?upper_case /] [#assign prefix_upper =conf. instance.global_data_and_code.code_prefix.value[0]?trim?upper_case /]