Skip to content

Commit 9ad98f4

Browse files
authored
Merge pull request #660 from ckormanyos/support_am6254_soc
Fix #655 via support am6254 soc
2 parents b97e74b + 25cb338 commit 9ad98f4

49 files changed

Lines changed: 5944 additions & 28 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/real-time-cpp.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,29 @@ jobs:
145145
./target/build/build.sh ${{ matrix.suite }} rebuild
146146
ls -la ./bin/ref_app.hex ./bin/ref_app.s19 ./bin/ref_app.map
147147
working-directory: ./ref_app/
148+
target-arm-aarch64:
149+
runs-on: ubuntu-latest
150+
defaults:
151+
run:
152+
shell: bash
153+
strategy:
154+
fail-fast: false
155+
matrix:
156+
suite: [ am6254_soc ]
157+
steps:
158+
- uses: actions/checkout@v4
159+
with:
160+
fetch-depth: '0'
161+
- name: update-tools
162+
run: |
163+
wget https://developer.arm.com/-/media/Files/downloads/gnu/14.3.rel1/binrel/arm-gnu-toolchain-14.3.rel1-x86_64-aarch64-none-elf.tar.xz
164+
tar -xf arm-gnu-toolchain-14.3.rel1-x86_64-aarch64-none-elf.tar.xz -C ${{ runner.workspace }}
165+
- name: target-arm-aarch64-${{ matrix.suite }}
166+
run: |
167+
PATH="${{ runner.workspace }}/arm-gnu-toolchain-14.3.rel1-x86_64-aarch64-none-elf/bin:$PATH"
168+
./target/build/build.sh ${{ matrix.suite }} rebuild
169+
ls -la ./bin/ref_app.hex ./bin/ref_app.s19 ./bin/ref_app.map
170+
working-directory: ./ref_app/
148171
target-arm-cmake:
149172
runs-on: ubuntu-latest
150173
defaults:

code_snippets/chapter03/chapter03_21-001_span.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <span>
1818
#include <sstream>
1919

20-
namespace
20+
namespace local
2121
{
2222
void clear_buffer(std::span<std::uint8_t> buf)
2323
{
@@ -26,7 +26,7 @@ namespace
2626
next_byte = static_cast<std::uint8_t>(UINT8_C(0));
2727
}
2828
}
29-
}
29+
} // namespace local
3030

3131
#define LEGACY_BUF_LEN 64U
3232

@@ -36,7 +36,7 @@ void do_something()
3636
{
3737
std::span<std::uint8_t> buf_span(legacy_buffer);
3838

39-
// First off, fill the legacy buffer with a pattern.
39+
// Fill the legacy buffer with a pattern.
4040
std::fill(buf_span.begin(), buf_span.end(), UINT8_C(0x5A));
4141

4242
std::stringstream strm { };
@@ -45,7 +45,7 @@ void do_something()
4545
strm << "filled: " << std::hex << std::uppercase << std::setw(std::streamsize { 2 }) << std::setfill('0') << unsigned(buf_span.back());
4646

4747
// Now clear the buffer and the buffer has been cleared to 0.
48-
clear_buffer(buf_span);
48+
local::clear_buffer(buf_span);
4949

5050
strm << "\ncleared: " << std::hex << std::uppercase << std::setw(std::streamsize { 2 }) << std::setfill('0') << unsigned(buf_span.back());
5151

readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ The reference application supports the following targets (in alpha-numeric order
7171
| Target name (as used in build command) | Target Description | *(breadboard) |
7272
| -------------------------------------- | ----------------------------------------------------------- | ------------- |
7373
| `am335x` | BeagleBone with Texas Instruments(R) AM335x ARM(R) A8 | |
74+
| `am6254_soc_` | PocketBeagle2 with multicore Texas Instruments(R) AM6254 | |
7475
| `atmega2560` | MICROCHIP(R) [former ATMEL(R)] AVR(R) ATmega2560 | |
7576
| `atmega4809` | MICROCHIP(R) [former ATMEL(R)] AVR(R) ATmegax4809 | X |
7677
| `avr` (as used in the book) | MICROCHIP(R) [former ATMEL(R)] AVR(R) ATmega328P | X |
@@ -377,6 +378,18 @@ from SD-card into RAM memory and subsequently executed. When switching on
377378
the BeagleBone black, the boot button (S2) must be pressed while powering
378379
up the board. The program toggles the first user LED (LED1 on `port1.21`).
379380

381+
The 64-bit multi-core ARM(R) `target am6254_soc` runs on the PocketBeagle2.
382+
This exciting development launches the `ref_app` into the 64-bit microcontroller world.
383+
The inspiration for this project, again, comes from the unbelievably
384+
creative workspaces of
385+
[`github.com/Chalandi`](https://github.com/Chalandi)
386+
with the repo
387+
[`Chalandi/Baremetal_TI_AM6254_multicore_nosdk`](https://github.com/Chalandi/Baremetal_TI_AM6254_multicore_nosdk).
388+
In his work, he has modified the SBL and also undertaken and various non-trivial adaptions to the core startups in
389+
order to take this chip down the path of full bare-metal
390+
control - with no use of the SDK.
391+
TBD: Add the modified SBL and its links and copyright info.
392+
380393
The MICROCHIP(R) [former ATMEL(R)] AVR(R) configuration
381394
called `target atmega2560` runs
382395
on the ARDUINO(R) MEGA compatible board.

ref_app/ref_app.sln

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Global
4747
Debug|x64 = Debug|x64
4848
Release|x64 = Release|x64
4949
target am335x|x64 = target am335x|x64
50+
target am6254_soc|x64 = target am6254_soc|x64
5051
target atmega2560|x64 = target atmega2560|x64
5152
target atmega4809|x64 = target atmega4809|x64
5253
target avr|x64 = target avr|x64
@@ -80,6 +81,7 @@ Global
8081
{C8B59726-9319-45C3-8F11-F9F388FB6A2C}.Release|x64.ActiveCfg = Release|x64
8182
{C8B59726-9319-45C3-8F11-F9F388FB6A2C}.Release|x64.Build.0 = Release|x64
8283
{C8B59726-9319-45C3-8F11-F9F388FB6A2C}.target am335x|x64.ActiveCfg = Release|x64
84+
{C8B59726-9319-45C3-8F11-F9F388FB6A2C}.target am6254_soc|x64.ActiveCfg = Release|x64
8385
{C8B59726-9319-45C3-8F11-F9F388FB6A2C}.target atmega2560|x64.ActiveCfg = Release|x64
8486
{C8B59726-9319-45C3-8F11-F9F388FB6A2C}.target atmega4809|x64.ActiveCfg = Release|x64
8587
{C8B59726-9319-45C3-8F11-F9F388FB6A2C}.target avr|x64.ActiveCfg = Release|x64
@@ -106,10 +108,12 @@ Global
106108
{C8B59726-9319-45C3-8F11-F9F388FB6A2C}.target xtensa_esp32_s3_riscv_cop|x64.ActiveCfg = Release|x64
107109
{C8B59726-9319-45C3-8F11-F9F388FB6A2C}.target xtensa_esp32_s3|x64.ActiveCfg = Release|x64
108110
{C8B59726-9319-45C3-8F11-F9F388FB6A2C}.target xtensa32|x64.ActiveCfg = Release|x64
109-
{30CE370B-40F3-4BCD-8986-64AAFF8971BD}.Debug|x64.ActiveCfg = target avr|x64
110-
{30CE370B-40F3-4BCD-8986-64AAFF8971BD}.Release|x64.ActiveCfg = target avr|x64
111+
{30CE370B-40F3-4BCD-8986-64AAFF8971BD}.Debug|x64.ActiveCfg = target xtensa32|x64
112+
{30CE370B-40F3-4BCD-8986-64AAFF8971BD}.Release|x64.ActiveCfg = target xtensa32|x64
111113
{30CE370B-40F3-4BCD-8986-64AAFF8971BD}.target am335x|x64.ActiveCfg = target am335x|x64
112114
{30CE370B-40F3-4BCD-8986-64AAFF8971BD}.target am335x|x64.Build.0 = target am335x|x64
115+
{30CE370B-40F3-4BCD-8986-64AAFF8971BD}.target am6254_soc|x64.ActiveCfg = target am6254_soc|x64
116+
{30CE370B-40F3-4BCD-8986-64AAFF8971BD}.target am6254_soc|x64.Build.0 = target am6254_soc|x64
113117
{30CE370B-40F3-4BCD-8986-64AAFF8971BD}.target atmega2560|x64.ActiveCfg = target atmega2560|x64
114118
{30CE370B-40F3-4BCD-8986-64AAFF8971BD}.target atmega2560|x64.Build.0 = target atmega2560|x64
115119
{30CE370B-40F3-4BCD-8986-64AAFF8971BD}.target atmega4809|x64.ActiveCfg = target atmega4809|x64

ref_app/ref_app.vcxproj

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,14 @@
261261
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
262262
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
263263
</ClCompile>
264+
<ClCompile Include="src\mcal\am6254_soc\mcal_gpt.cpp">
265+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
266+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
267+
</ClCompile>
268+
<ClCompile Include="src\mcal\am6254_soc\mcal_led.cpp">
269+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
270+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
271+
</ClCompile>
264272
<ClCompile Include="src\mcal\atmega2560\mcal_cpu.cpp">
265273
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
266274
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
@@ -1480,6 +1488,58 @@
14801488
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
14811489
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
14821490
</ClInclude>
1491+
<ClInclude Include="src\mcal\am6254_soc\mcal_benchmark.h">
1492+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1493+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1494+
</ClInclude>
1495+
<ClInclude Include="src\mcal\am6254_soc\mcal_cpu.h">
1496+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1497+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1498+
</ClInclude>
1499+
<ClInclude Include="src\mcal\am6254_soc\mcal_eep.h">
1500+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1501+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1502+
</ClInclude>
1503+
<ClInclude Include="src\mcal\am6254_soc\mcal_gpt.h">
1504+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1505+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1506+
</ClInclude>
1507+
<ClInclude Include="src\mcal\am6254_soc\mcal_irq.h">
1508+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1509+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1510+
</ClInclude>
1511+
<ClInclude Include="src\mcal\am6254_soc\mcal_led.h">
1512+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1513+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1514+
</ClInclude>
1515+
<ClInclude Include="src\mcal\am6254_soc\mcal_led_am6254_soc.h">
1516+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1517+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1518+
</ClInclude>
1519+
<ClInclude Include="src\mcal\am6254_soc\mcal_memory_progmem.h">
1520+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1521+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1522+
</ClInclude>
1523+
<ClInclude Include="src\mcal\am6254_soc\mcal_port.h">
1524+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1525+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1526+
</ClInclude>
1527+
<ClInclude Include="src\mcal\am6254_soc\mcal_pwm.h">
1528+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1529+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1530+
</ClInclude>
1531+
<ClInclude Include="src\mcal\am6254_soc\mcal_ser.h">
1532+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1533+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1534+
</ClInclude>
1535+
<ClInclude Include="src\mcal\am6254_soc\mcal_spi.h">
1536+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1537+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1538+
</ClInclude>
1539+
<ClInclude Include="src\mcal\am6254_soc\mcal_wdg.h">
1540+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
1541+
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
1542+
</ClInclude>
14831543
<ClInclude Include="src\mcal\atmega2560\mcal_benchmark.h">
14841544
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
14851545
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>

ref_app/ref_app.vcxproj.filters

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@
278278
<Filter Include="tools\Util\msys64\usr\bin">
279279
<UniqueIdentifier>{5bc6b64f-d4f9-43b5-87be-420c3017a4bc}</UniqueIdentifier>
280280
</Filter>
281+
<Filter Include="src\mcal\am6254_soc">
282+
<UniqueIdentifier>{74714130-9ba7-45a5-a860-74f8cb6eae22}</UniqueIdentifier>
283+
</Filter>
281284
</ItemGroup>
282285
<ItemGroup>
283286
<ClCompile Include="src\app\led\app_led.cpp">
@@ -1267,6 +1270,12 @@
12671270
<ClCompile Include="src\mcal\xtensa_esp32_s3_riscv_cop\mcal_eep.cpp">
12681271
<Filter>src\mcal\xtensa_esp32_s3_riscv_cop</Filter>
12691272
</ClCompile>
1273+
<ClCompile Include="src\mcal\am6254_soc\mcal_gpt.cpp">
1274+
<Filter>src\mcal\am6254_soc</Filter>
1275+
</ClCompile>
1276+
<ClCompile Include="src\mcal\am6254_soc\mcal_led.cpp">
1277+
<Filter>src\mcal\am6254_soc</Filter>
1278+
</ClCompile>
12701279
</ItemGroup>
12711280
<ItemGroup>
12721281
<ClInclude Include="src\math\calculus\derivative.h">
@@ -2871,6 +2880,45 @@
28712880
<ClInclude Include="src\mcal\xtensa_esp32_s3_riscv_cop\mcal_eep.h">
28722881
<Filter>src\mcal\xtensa_esp32_s3_riscv_cop</Filter>
28732882
</ClInclude>
2883+
<ClInclude Include="src\mcal\am6254_soc\mcal_gpt.h">
2884+
<Filter>src\mcal\am6254_soc</Filter>
2885+
</ClInclude>
2886+
<ClInclude Include="src\mcal\am6254_soc\mcal_wdg.h">
2887+
<Filter>src\mcal\am6254_soc</Filter>
2888+
</ClInclude>
2889+
<ClInclude Include="src\mcal\am6254_soc\mcal_cpu.h">
2890+
<Filter>src\mcal\am6254_soc</Filter>
2891+
</ClInclude>
2892+
<ClInclude Include="src\mcal\am6254_soc\mcal_led.h">
2893+
<Filter>src\mcal\am6254_soc</Filter>
2894+
</ClInclude>
2895+
<ClInclude Include="src\mcal\am6254_soc\mcal_led_am6254_soc.h">
2896+
<Filter>src\mcal\am6254_soc</Filter>
2897+
</ClInclude>
2898+
<ClInclude Include="src\mcal\am6254_soc\mcal_spi.h">
2899+
<Filter>src\mcal\am6254_soc</Filter>
2900+
</ClInclude>
2901+
<ClInclude Include="src\mcal\am6254_soc\mcal_eep.h">
2902+
<Filter>src\mcal\am6254_soc</Filter>
2903+
</ClInclude>
2904+
<ClInclude Include="src\mcal\am6254_soc\mcal_irq.h">
2905+
<Filter>src\mcal\am6254_soc</Filter>
2906+
</ClInclude>
2907+
<ClInclude Include="src\mcal\am6254_soc\mcal_port.h">
2908+
<Filter>src\mcal\am6254_soc</Filter>
2909+
</ClInclude>
2910+
<ClInclude Include="src\mcal\am6254_soc\mcal_pwm.h">
2911+
<Filter>src\mcal\am6254_soc</Filter>
2912+
</ClInclude>
2913+
<ClInclude Include="src\mcal\am6254_soc\mcal_ser.h">
2914+
<Filter>src\mcal\am6254_soc</Filter>
2915+
</ClInclude>
2916+
<ClInclude Include="src\mcal\am6254_soc\mcal_benchmark.h">
2917+
<Filter>src\mcal\am6254_soc</Filter>
2918+
</ClInclude>
2919+
<ClInclude Include="src\mcal\am6254_soc\mcal_memory_progmem.h">
2920+
<Filter>src\mcal\am6254_soc</Filter>
2921+
</ClInclude>
28742922
</ItemGroup>
28752923
<ItemGroup>
28762924
<None Include="src\util\STL\algorithm">

ref_app/src/app/benchmark/app_benchmark_boost_multiprecision_cbrt.cpp

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#if (defined(APP_BENCHMARK_TYPE) && (APP_BENCHMARK_TYPE == APP_BENCHMARK_TYPE_BOOST_MULTIPRECISION_CBRT))
1212

13-
//#define APP_BENCHMARK_TYPE_BOOST_BOOST_MULTIPRECISION_CBRT_USE_BIN_FLOAT
13+
//#define APP_BENCHMARK_TYPE_BOOST_MP_CBRT_USE_BIN_FLOAT
1414

1515
#if !defined(BOOST_MP_STANDALONE)
1616
#define BOOST_MP_STANDALONE
@@ -41,49 +41,54 @@
4141
#endif
4242

4343
#include <boost/math/special_functions/cbrt.hpp>
44-
#if defined(APP_BENCHMARK_TYPE_BOOST_BOOST_MULTIPRECISION_CBRT_USE_BIN_FLOAT)
44+
#if defined(APP_BENCHMARK_TYPE_BOOST_MP_CBRT_USE_BIN_FLOAT)
4545
#include <boost/multiprecision/cpp_bin_float.hpp>
4646
#else
4747
#include <boost/multiprecision/cpp_dec_float.hpp>
4848
#endif
4949

50-
auto app::benchmark::run_boost_multiprecision_cbrt() -> bool
50+
namespace local
5151
{
52-
using big_float_backend_type =
53-
#if defined(APP_BENCHMARK_TYPE_BOOST_BOOST_MULTIPRECISION_CBRT_USE_BIN_FLOAT)
54-
boost::multiprecision::cpp_bin_float<101, boost::multiprecision::backends::digit_base_10, void, std::int32_t>;
52+
constexpr unsigned app_benchmark_backend_digits10 { 201U };
53+
54+
using app_benchmark_big_float_backend_type =
55+
#if defined(APP_BENCHMARK_TYPE_BOOST_MP_CBRT_USE_BIN_FLOAT)
56+
boost::multiprecision::cpp_bin_float<app_benchmark_backend_digits10, boost::multiprecision::backends::digit_base_10, void, std::int32_t>;
5557
#else
56-
boost::multiprecision::cpp_dec_float<101, std::int32_t, void>;
58+
boost::multiprecision::cpp_dec_float<app_benchmark_backend_digits10, std::int32_t, void>;
5759
#endif
5860

59-
using big_float_type =
60-
boost::multiprecision::number<big_float_backend_type, boost::multiprecision::et_off>;
61+
using app_benchmark_big_float_type =
62+
boost::multiprecision::number<app_benchmark_big_float_backend_type, boost::multiprecision::et_off>;
6163

62-
static const big_float_type
63-
big_float_arg
64+
// N[(123456/100)^(1/3), 211]
65+
// 10.7276369432283170454869317373527647801772956394047834686224956433128028534945259441672192774907629718402457465
66+
const app_benchmark_big_float_type
67+
app_benchmark_big_float_ctrl
6468
{
65-
big_float_type(UINT32_C(123456)) / 100U
69+
"10.72763694322831704548693173735276478017729563940478346862249564331280285349452594416721927749076297184024574654480528769322221647332343140726593804683287639579165427122149453895093234587007864784138965614715829"
6670
};
6771

68-
// N[(123456/100)^(1/3), 111]
69-
// 10.7276369432283170454869317373527647801772956394047834686224956433128028534945259441672192774907629718402457465
70-
static const big_float_type
71-
big_float_ctrl
72+
const app_benchmark_big_float_type
73+
app_benchmark_big_float_arg
7274
{
73-
"10.7276369432283170454869317373527647801772956394047834686224956433128028534945259441672192774907629718402457465"
75+
app_benchmark_big_float_type(UINT32_C(123456)) / 100U
7476
};
77+
} // namespace local
7578

79+
auto app::benchmark::run_boost_multiprecision_cbrt() -> bool
80+
{
7681
using std::cbrt;
7782
using boost::math::cbrt;
7883

7984
// Compute the cube root value.
80-
const big_float_type big_float_result { cbrt(big_float_arg) };
85+
const local::app_benchmark_big_float_type local_big_float_result { cbrt(local::app_benchmark_big_float_arg) };
8186

8287
// Compare the calculated result with the known control value.
8388
const bool
8489
app_benchmark_result_is_ok
8590
{
86-
detail::is_close_fraction(big_float_result, big_float_ctrl)
91+
detail::is_close_fraction(local_big_float_result, local::app_benchmark_big_float_ctrl)
8792
};
8893

8994
return app_benchmark_result_is_ok;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
// Copyright Christopher Kormanyos 2014 - 2025.
3+
// Distributed under the Boost Software License,
4+
// Version 1.0. (See accompanying file LICENSE_1_0.txt
5+
// or copy at http://www.boost.org/LICENSE_1_0.txt)
6+
//
7+
8+
#ifndef MCAL_BENCHMARK_2014_04_16_H
9+
#define MCAL_BENCHMARK_2014_04_16_H
10+
11+
#include <cstdint>
12+
#include <mcal_port.h>
13+
14+
namespace mcal
15+
{
16+
namespace benchmark
17+
{
18+
typedef mcal::port::port_pin<2U> benchmark_port_type;
19+
}
20+
}
21+
22+
#endif // MCAL_BENCHMARK_2014_04_16_H
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
// Copyright Christopher Kormanyos 2007 - 2025.
3+
// Distributed under the Boost Software License,
4+
// Version 1.0. (See accompanying file LICENSE_1_0.txt
5+
// or copy at http://www.boost.org/LICENSE_1_0.txt)
6+
//
7+
8+
#ifndef MCAL_CPU_2009_02_14_H
9+
#define MCAL_CPU_2009_02_14_H
10+
11+
#include <cstdint>
12+
13+
namespace mcal
14+
{
15+
namespace cpu
16+
{
17+
void init();
18+
19+
inline auto post_init() -> void { }
20+
21+
inline auto nop() noexcept -> void { asm volatile("nop"); }
22+
}
23+
}
24+
25+
#endif // MCAL_CPU_2009_02_14_H

0 commit comments

Comments
 (0)