[sw, dif_aes] Introduce AES unittests This change introduces a set of AES mock tests to test the public API. The aim is to validate the API implementation in terms of different use-cases. Signed-off-by: Silvestrs Timofejevs <silvestrst@lowrisc.org>
diff --git a/sw/device/tests/dif/dif_aes_test.cc b/sw/device/tests/dif/dif_aes_test.cc new file mode 100644 index 0000000..13b1f73 --- /dev/null +++ b/sw/device/tests/dif/dif_aes_test.cc
@@ -0,0 +1,24 @@ +// Copyright lowRISC contributors. +// Licensed under the Apache License, Version 2.0, see LICENSE for details. +// SPDX-License-Identifier: Apache-2.0 + +#include "sw/device/lib/dif/dif_aes.h" + +#include "gtest/gtest.h" +#include "sw/device/lib/base/mmio.h" +#include "sw/device/lib/testing/mock_mmio.h" + +extern "C" { +#include "aes_regs.h" // Generated. +} // extern "C" + +namespace dif_aes_test { +namespace { +using mock_mmio::MmioTest; +using mock_mmio::MockDevice; +using testing::Test; + +// CODE HERE + +} // namespace +} // namespace dif_aes_test
diff --git a/sw/device/tests/dif/meson.build b/sw/device/tests/dif/meson.build index 0ca0098..41c0461 100644 --- a/sw/device/tests/dif/meson.build +++ b/sw/device/tests/dif/meson.build
@@ -194,6 +194,22 @@ cpp_args: ['-DMOCK_MMIO'], )) +test('dif_aes_test', executable( + 'dif_aes_test', + sources: [ + hw_ip_aes_reg_h, + meson.source_root() / 'sw/device/lib/dif/dif_aes.c', + 'dif_aes_test.cc', + ], + dependencies: [ + sw_vendor_gtest, + sw_lib_testing_mock_mmio, + ], + native: true, + c_args: ['-DMOCK_MMIO'], + cpp_args: ['-DMOCK_MMIO'], +)) + dif_plic_smoketest_lib = declare_dependency( link_with: static_library( 'dif_plic_smoketest_lib',