Remove openpower-libhei subproject dependency
Statically link to openpower-libhei rather than building it as a
subproject.
Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: Ifc1be912ef484c0c7a1157ac0c9b90a62e03d9c7
diff --git a/analyzer/analyzer_main.cpp b/analyzer/analyzer_main.cpp
index f697b4b..13da175 100644
--- a/analyzer/analyzer_main.cpp
+++ b/analyzer/analyzer_main.cpp
@@ -3,10 +3,23 @@
namespace analyzer
{
-/** @brief Analyze and isolate hardware errors */
+/** Analyze error condition using the hardware error isolator */
void analyzeHardware()
{
- return;
+ using namespace libhei;
+
+ std::vector<Chip> chipList; // data to isolator
+ IsolationData isoData{}; // data from isolator
+
+ // TEMP CODE - start
+ initialize(nullptr, 0);
+
+ chipList.emplace_back(Chip{"proc", static_cast<ChipType_t>(0xdeadbeef)});
+
+ isolate(chipList, isoData);
+
+ uninitialize();
+ // TEMP CODE - end
}
} // namespace analyzer
diff --git a/analyzer/hei_user_defines.hpp b/analyzer/hei_user_defines.hpp
deleted file mode 100644
index e45e18d..0000000
--- a/analyzer/hei_user_defines.hpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#pragma once
-
-/**
- * @file hei_user_defines.hpp
- * @brief The purpose of this file is to provide defines that are required by
- * the hardware error isolator library (libhei)
- */
-
-#include <assert.h>
-#include <inttypes.h>
-#include <stdio.h>
-
-#define HEI_INF(...) \
- { \
- printf("HWDIAGS I> " __VA_ARGS__); \
- printf("\n"); \
- }
-
-#define HEI_ERR(...) \
- { \
- printf("HWDIAGS E> " __VA_ARGS__); \
- printf("\n"); \
- }
-
-#define HEI_ASSERT(expression) assert(expression);
diff --git a/analyzer/user_interface.cpp b/analyzer/hei_user_interface.cpp
similarity index 75%
rename from analyzer/user_interface.cpp
rename to analyzer/hei_user_interface.cpp
index 29c0f93..0742d55 100644
--- a/analyzer/user_interface.cpp
+++ b/analyzer/hei_user_interface.cpp
@@ -1,8 +1,9 @@
/**
- * @file These are implementations of the user interfaces declared in
- * hei_user_interface.hpp
+ * @file These are the implementations of the user interfaces declared
+ * in hei_user_interface.hpp
*/
+#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
@@ -18,8 +19,11 @@
{
bool accessFailure = false;
- // HEI_INF("registerRead(%p,%p,%lx,%lx,%lx)", i_chip.getChip(),
- // o_buffer, io_bufSize, i_regType, i_address);
+ assert(nullptr != o_buffer);
+ assert(0 != io_bufSize);
+
+ // TODO need real register read code
+ printf("registerRead not implemented\n");
return accessFailure;
}
@@ -33,8 +37,11 @@
{
bool accessFailure = false;
- // HEI_INF("registerWrite(%p,%p,%lx,%lx,%lx)", i_chip.getChip(),
- // i_buffer, io_bufSize, i_regType, i_address);
+ assert(nullptr != i_buffer);
+ assert(0 != io_bufSize);
+
+ // TODO need real register write code
+ printf("registerWrite not implemented\n");
return accessFailure;
}
diff --git a/analyzer/meson.build b/analyzer/meson.build
index 8f19ecf..3113ce6 100644
--- a/analyzer/meson.build
+++ b/analyzer/meson.build
@@ -1,12 +1,9 @@
-# Get opennpower-libhei dependencies. If not available via package manager
-# "fallback" to using the local libhei subproject.
-libhei_dep = dependency('libhei', fallback : ['libhei', 'libhei_dep'])
-
# gather analyzer sources to be used here and elsewhere if needed
-analyzer_src = files('analyzer_main.cpp', 'user_interface.cpp')
+analyzer_src = files('analyzer_main.cpp',
+ 'hei_user_interface.cpp')
# Create hardware error analyzer library
analyzer = static_library('analyzer',
analyzer_src,
dependencies : libhei_dep,
- install : true)
+ install : false)
diff --git a/meson.build b/meson.build
index 32f2201..e4ef613 100644
--- a/meson.build
+++ b/meson.build
@@ -7,8 +7,7 @@
'cpp_args=-Wno-unused-parameter'
])
-# libhei is available as a subproject
-subproject('libhei')
+libhei_dep = dependency('hei', required : true)
incdir = include_directories('.')
diff --git a/subprojects/libhei.wrap b/subprojects/libhei.wrap
deleted file mode 100644
index a603328..0000000
--- a/subprojects/libhei.wrap
+++ /dev/null
@@ -1,3 +0,0 @@
-[wrap-git]
-url = https://github.com/openbmc/openpower-libhei
-revision = head
diff --git a/test/end2end/analyzer_main.cpp b/test/end2end/analyzer_main.cpp
deleted file mode 100644
index 03d6a8f..0000000
--- a/test/end2end/analyzer_main.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <hei_main.hpp>
-
-namespace analyzer
-{
-
-// Quick test that we can call the core libhei functions. This function
-// is called from the attention handler when a checkstop event is active.
-void analyzeHardware()
-{
- using namespace libhei;
-
- // Add some chips for error isolation
- std::vector<Chip> chipList;
- chipList.emplace_back(Chip{"proc", static_cast<ChipType_t>(0xdeadbeef)});
-
- // Isolation data that will be populated by isolator
- IsolationData isoData{};
-
- // Isolate active hardware errors in chips
- initialize(nullptr, 0);
- isolate(chipList, isoData);
- uninitialize();
-}
-
-} // namespace analyzer
diff --git a/test/end2end/hei_user_defines.hpp b/test/end2end/hei_user_defines.hpp
deleted file mode 100644
index e45e18d..0000000
--- a/test/end2end/hei_user_defines.hpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#pragma once
-
-/**
- * @file hei_user_defines.hpp
- * @brief The purpose of this file is to provide defines that are required by
- * the hardware error isolator library (libhei)
- */
-
-#include <assert.h>
-#include <inttypes.h>
-#include <stdio.h>
-
-#define HEI_INF(...) \
- { \
- printf("HWDIAGS I> " __VA_ARGS__); \
- printf("\n"); \
- }
-
-#define HEI_ERR(...) \
- { \
- printf("HWDIAGS E> " __VA_ARGS__); \
- printf("\n"); \
- }
-
-#define HEI_ASSERT(expression) assert(expression);
diff --git a/test/end2end/meson.build b/test/end2end/meson.build
index e672d98..52eda03 100644
--- a/test/end2end/meson.build
+++ b/test/end2end/meson.build
@@ -1,8 +1,10 @@
# create openpower-hw-diags executable for local testing
-executable('openpower-hw-diags-test',
+ end2end = executable('openpower-hw-diags-test',
'main.cpp', 'logging.cpp', 'bp_handler.cpp', 'ti_handler.cpp',
- 'analyzer_main.cpp', '../../cli.cpp',
+ '../../analyzer/analyzer_main.cpp', '../../cli.cpp',
link_with : [analyzer, attn],
include_directories : incdir,
dependencies : libhei_dep,
install : false)
+
+# test('openpower-hw-diags-test', end2end)
diff --git a/test/simulator/sample_data/sample.cdb b/test/simulator/sample_data/sample.cdb
deleted file mode 100644
index 2e36af5..0000000
--- a/test/simulator/sample_data/sample.cdb
+++ /dev/null
Binary files differ