Skip to content

Commit ff88740

Browse files
committed
Merge remote-tracking branch 'origin/master' into bug/GateLibraryManager
2 parents 19f2703 + d248b0a commit ff88740

File tree

1,083 files changed

+2662909
-210727
lines changed

Some content is hidden

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

1,083 files changed

+2662909
-210727
lines changed

.clang-format

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ BraceWrapping:
3232
BeforeCatch: true
3333
BeforeElse: true
3434
IndentBraces: false
35+
InsertBraces: true
3536
BreakBeforeBinaryOperators: NonAssignment
3637
BreakBeforeBraces: Custom
3738
# BreakBeforeInheritanceComma: false
@@ -90,7 +91,7 @@ SpacesInContainerLiterals: false
9091
SpacesInCStyleCastParentheses: false
9192
SpacesInParentheses: false
9293
SpacesInSquareBrackets: false
93-
Standard: Cpp11
94+
Standard: c++17
9495
TabWidth: 4
9596
UseTab: Never
9697
...

.github/email-address-image.gif

1.37 KB
Loading

.github/workflows/macOS.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,18 @@ jobs:
8989
run: |
9090
mkdir -p build
9191
cd build
92-
export PATH="/usr/local/opt/qt@5/bin:$PATH"
93-
ls ..
94-
cmake -G Ninja .. -DQt5_DIR=/usr/local/opt/qt@5/lib/cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_ALL_PLUGINS=ON -DBUILD_TESTS=ON -DPL_GUI=ON -DCMAKE_C_COMPILER=/usr/local/opt/llvm@14/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@14/bin/clang++
92+
export PATH="$(brew --prefix qt@5)/bin:$PATH"
93+
brew ls llvm@14
94+
brew --prefix llvm@14
95+
ls -l /usr/local
96+
ls -l /opt/homebrew/opt
97+
ls -l /opt/homebrew/opt/llvm@14
98+
ls -l /opt/homebrew/opt/llvm@14/bin
99+
ls -l /opt/homebrew/opt/llvm@14/bin/clang
100+
cmake -G Ninja .. -DQt5_DIR="$(brew --prefix qt@5)/lib/cmake" -DCMAKE_BUILD_TYPE=Debug -DBUILD_ALL_PLUGINS=ON -DBUILD_TESTS=ON -DPL_GUI=ON -DCMAKE_C_COMPILER=$(brew --prefix llvm@14)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm@14)/bin/clang++
95101
env:
96-
LDFLAGS: "-L/usr/local/opt/qt@5/lib -L/usr/local/opt/llvm@14/lib -Wl,-rpath,/usr/local/opt/llvm@14/lib"
97-
CPPFLAGS: "-I/usr/local/opt/llvm@14/include"
102+
LDFLAGS: "-L$(brew --prefix qt@5)/lib -L$(brew --prefix llvm@14)/lib -Wl,-rpath,$(brew --prefix llvm@14)/lib"
103+
CPPFLAGS: "-I$(brew --prefix llvm@14)/include"
98104
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
99105
CCACHE_DIR: ${{runner.workspace}}/.ccache
100106
CCACHE_COMPRESS: true
@@ -107,12 +113,12 @@ jobs:
107113
# Execute the build. You can specify a specific target with "--target <NAME>"
108114
run: |
109115
cd build
110-
export PATH="/usr/local/opt/qt/bin:$PATH"
116+
export PATH="$(brew --prefix qt@5)/bin:$PATH"
111117
export BUILD_TYPE=Debug
112118
cmake --build . --target all --clean-first --config $BUILD_TYPE
113119
env:
114-
LDFLAGS: "-L/usr/local/opt/qt@5/lib -L/usr/local/opt/llvm@14/lib -Wl,-rpath,/usr/local/opt/llvm@14/lib"
115-
CPPFLAGS: "-I/usr/local/opt/llvm@14/include"
120+
LDFLAGS: "-L$(brew --prefix qt@5)/lib -L$(brew --prefix llvm@14)/lib -Wl,-rpath,$(brew --prefix llvm@14)/lib"
121+
CPPFLAGS: "-I$(brew --prefix llvm@14)/include"
116122
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
117123
CCACHE_DIR: ${{runner.workspace}}/.ccache
118124
CCACHE_COMPRESS: true
@@ -133,8 +139,8 @@ jobs:
133139
# ninja -v hal_coverage
134140
# bash <(curl -s https://codecov.io/bash) -f hal_coverage.info.cleaned || echo "Codecov did not collect coverage reports"
135141
env:
136-
LDFLAGS: "-L/usr/local/opt/qt@5/lib -L/usr/local/opt/llvm@14/lib -Wl,-rpath,/usr/local/opt/llvm@14/lib"
137-
CPPFLAGS: "-I/usr/local/opt/llvm@14/include"
142+
LDFLAGS: "-L$(brew --prefix qt@5)/lib -L$(brew --prefix llvm@14)/lib -Wl,-rpath,$(brew --prefix llvm@14)/lib"
143+
CPPFLAGS: "-I$(brew --prefix llvm@14)/include"
138144
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
139145
CCACHE_DIR: ${{runner.workspace}}/.ccache
140146
CCACHE_COMPRESS: true

.github/workflows/releaseDoc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
# runs-on: [ ubuntu-20.04, macOS-latest]
16-
runs-on: [ ubuntu-20.04 ]
16+
runs-on: [ ubuntu-22.04 ]
1717
fail-fast: false
1818

1919
runs-on: ${{ matrix.runs-on }}

.github/workflows/ubuntu20.04.yml .github/workflows/ubuntu24.04.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Ubuntu 20.04
1+
name: Ubuntu 24.04
22

33
on:
44
push:
@@ -7,13 +7,13 @@ on:
77
# - v*
88

99
jobs:
10-
build_ubuntu_20_04:
11-
name: Build and Test on Ubuntu 20.04
10+
build_ubuntu_24_04:
11+
name: Build and Test on Ubuntu 24.04
1212

1313
strategy:
1414
matrix:
15-
# runs-on: [ ubuntu-20.04, macOS-latest]
16-
runs-on: [ ubuntu-20.04 ]
15+
# runs-on: [ ubuntu-22.04, macOS-latest]
16+
runs-on: [ ubuntu-24.04 ]
1717
fail-fast: false
1818

1919
runs-on: ${{ matrix.runs-on }}

CHANGELOG.md

+324-10
Large diffs are not rendered by default.

CMakeLists.txt

+13-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ option(HAL_VERSION_MAJOR "Pass major version via cmake options" "")
6262
option(HAL_VERSION_MINOR "Pass minor version via cmake options" "")
6363
option(HAL_VERSION_PATCH "Pass patch version via cmake options" "")
6464
option(USE_LIBCXX "Force the use of LIBCXX for e.g. gcc" FALSE)
65+
option(USE_VENDORED_PYBIND11 "Use vendored 'pybind11' Python library" ON)
66+
option(USE_VENDORED_SPDLOG "Use vendored 'spdlog' library" ON)
67+
option(USE_VENDORED_QUAZIP "Use vendored 'quazip' library" ON)
68+
option(USE_VENDORED_IGRAPH "Use vendored 'igraph' library" ON)
69+
option(USE_VENDORED_NLOHMANN_JSON "Use vendored 'nlohmann_json' library" ON)
6570
option(BUILD_ALL_PLUGINS "Build all available plugins" OFF)
6671
option(BUILD_TESTS "Enable test builds" OFF)
6772
option(BUILD_COVERAGE "Enable code coverage build" OFF)
@@ -325,8 +330,14 @@ install(FILES tools/genversion.py
325330
GROUP_EXECUTE
326331
WORLD_READ
327332
WORLD_EXECUTE)
328-
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deps/pybind11 DESTINATION ${HAL_CMAKECONFIG_INSTALL_DIR})
329-
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deps/spdlog-1.5.0 DESTINATION ${HAL_CMAKECONFIG_INSTALL_DIR})
333+
if(USE_VENDORED_PYBIND11)
334+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deps/pybind11 DESTINATION ${HAL_CMAKECONFIG_INSTALL_DIR})
335+
endif()
336+
if(USE_VENDORED_SPDLOG)
337+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deps/spdlog-${spdlog_VERSION} DESTINATION ${HAL_CMAKECONFIG_INSTALL_DIR})
338+
endif()
339+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deps/subprocess DESTINATION ${HAL_CMAKECONFIG_INSTALL_DIR})
340+
330341

331342
if(NOT(CMAKE_VERSION VERSION_LESS 3.0))
332343
install(EXPORT hal

CURRENT_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.1
1+
4.4.1

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN apt-get update -y && \
1414
apt-get install -y lsb-release
1515

1616
COPY . .
17-
RUN ./install_dependencies.sh
17+
RUN HAL_DOCKER=1 ./install_dependencies.sh
1818

1919
RUN mkdir build
2020
WORKDIR ${hal_path}/build/

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Welcome to HAL!
2-
[![Ubuntu 20.04](https://github.com/emsec/hal/actions/workflows/ubuntu20.04.yml/badge.svg)](https://github.com/emsec/hal/actions/workflows/ubuntu20.04.yml) [![Ubuntu 22.04](https://github.com/emsec/hal/actions/workflows/ubuntu22.04.yml/badge.svg)](https://github.com/emsec/hal/actions/workflows/ubuntu22.04.yml) [![macOS](https://github.com/emsec/hal/actions/workflows/macOS.yml/badge.svg)](https://github.com/emsec/hal/actions/workflows/macOS.yml) [![Deploy Documentation](https://github.com/emsec/hal/actions/workflows/releaseDoc.yml/badge.svg)](https://github.com/emsec/hal/actions/workflows/releaseDoc.yml) [![Doc: C++](https://img.shields.io/badge/doc-c%2B%2B-orange)](https://emsec.github.io/hal/doc/) [![Doc: Python](https://img.shields.io/badge/doc-python-red)](https://emsec.github.io/hal/pydoc/)
2+
[![Ubuntu 22.04](https://github.com/emsec/hal/actions/workflows/ubuntu22.04.yml/badge.svg)](https://github.com/emsec/hal/actions/workflows/ubuntu22.04.yml) [![Ubuntu 24.04](https://github.com/emsec/hal/actions/workflows/ubuntu24.04.yml/badge.svg)](https://github.com/emsec/hal/actions/workflows/ubuntu24.04.yml) [![macOS](https://github.com/emsec/hal/actions/workflows/macOS.yml/badge.svg)](https://github.com/emsec/hal/actions/workflows/macOS.yml) [![Deploy Documentation](https://github.com/emsec/hal/actions/workflows/releaseDoc.yml/badge.svg)](https://github.com/emsec/hal/actions/workflows/releaseDoc.yml) [![Doc: C++](https://img.shields.io/badge/doc-c%2B%2B-orange)](https://emsec.github.io/hal/doc/) [![Doc: Python](https://img.shields.io/badge/doc-python-red)](https://emsec.github.io/hal/pydoc/)
33

44

55
HAL \[/hel/\] is a comprehensive netlist reverse engineering and manipulation framework.
@@ -15,6 +15,9 @@ HAL \[/hel/\] is a comprehensive netlist reverse engineering and manipulation fr
1515
3. [Quickstart Guide](#quickstart)
1616
4. [Academic Context](#academic-context)
1717

18+
<a name="introduction"></a>
19+
# Introduction
20+
1821
## What the hell is HAL?
1922
Virtually all available research on netlist analysis operates on a graph-based representation of the netlist under inspection.
2023
At its core, HAL provides exactly that: A framework to parse netlists of arbitrary sources, e.g., FPGAs or ASICs, into a graph-based netlist representation and to provide the necessary built-in tools for traversal and analysis of the included gates and nets.
@@ -27,7 +30,7 @@ We want HAL to enable a common baseline for researchers and analysts to improve
2730
- **Stability** is ensured via a rich test suite
2831

2932
HAL is actively developed by the Embedded Security group of the [Max Planck Institute for Security and Privacy](https://www.mpi-sp.org).
30-
Apart from multiple research projects, it is also used in our university lecture [Introduction to Hardware Reverse Engineering](https://www.ei.ruhr-uni-bochum.de/studium/lehrveranstaltungen/832/).
33+
Apart from multiple research projects, it is also used in our university lecture "Einführung ins Hardware Reverse Engineering" (Introduction to Hardware Reverse Engineering) at Ruhr University Bochum (RUB).
3134

3235
Note that we also have a set of **modern** state-of-the-art benchmark circuits for the evaluation of netlist reverse engineering techniques available in a seperate [repository](https://github.com/emsec/hal-benchmarks).
3336

@@ -51,9 +54,6 @@ This repository contains a selection of curated plugins:
5154
## Documentation
5255
A comprehensive documentation of HAL's features from a user perspective is available in our [Wiki](https://github.com/emsec/hal/wiki). In addition, we provide a full [C++ API](https://emsec.github.io/hal/doc/) and [Python API](https://emsec.github.io/hal/pydoc/) documentation.
5356

54-
## Slack, Contact and Support
55-
For all kinds of inquiries, please contact us using our dedicated e-mail address: [[email protected]](mailto:[email protected]). To receive an invite to our dedicated hal-support Slack workspace, please write us an e-mail as well.
56-
5757
<a name="build-instructions"></a>
5858
# Build Instructions
5959

app/main.cpp

+31-7
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#include "hal_core/netlist/persistent/netlist_serializer.h"
88
#include "hal_core/netlist/project_manager.h"
99
#include "hal_core/plugin_system/plugin_interface_base.h"
10-
#include "hal_core/plugin_system/plugin_interface_cli.h"
1110
#include "hal_core/plugin_system/plugin_interface_ui.h"
11+
#include "hal_core/plugin_system/cli_extension_interface.h"
1212
#include "hal_core/plugin_system/plugin_manager.h"
1313
#include "hal_core/utilities/log.h"
1414
#include "hal_core/utilities/program_arguments.h"
@@ -102,8 +102,24 @@ int main(int argc, const char* argv[])
102102
lm->deactivate_all_channels();
103103
}
104104

105-
if (!plugin_manager::load_all_plugins())
105+
plugin_manager::load("hal_gui");
106+
// We need to check at an early stage (before CLI options are parsed) whether GUI will take control over HAL.
107+
// if yes : User determines which plugins get loaded
108+
// if no : Need to load all plugins to have full range of CLI options available
109+
bool guictrl = false;
110+
auto ui_plugin_flags = plugin_manager::get_ui_plugin_flags();
111+
for (int i=1; i<argc; i++)
106112
{
113+
std::string option(argv[i]);
114+
auto it = ui_plugin_flags.find(option);
115+
if (it != ui_plugin_flags.end()) {
116+
guictrl = true;
117+
break;
118+
}
119+
}
120+
if (!guictrl && !plugin_manager::load_all_plugins())
121+
{
122+
// error loading all plugins
107123
return cleanup(ERROR);
108124
}
109125

@@ -176,7 +192,9 @@ int main(int argc, const char* argv[])
176192

177193
ProgramArguments plugin_args;
178194

179-
for (const auto& option : plugin->get_cli_options().get_options())
195+
CliExtensionInterface* ceif = plugin->get_first_extension<CliExtensionInterface>();
196+
if (ceif)
197+
for (const auto& option : ceif->get_cli_options().get_options())
180198
{
181199
auto flags = std::get<0>(option);
182200
auto first_flag = *flags.begin();
@@ -333,15 +351,21 @@ int main(int argc, const char* argv[])
333351
bool plugins_successful = true;
334352
for (const auto& plugin_name : plugins_to_execute)
335353
{
336-
auto plugin = plugin_manager::get_plugin_instance<CLIPluginInterface>(plugin_name);
337-
if (plugin == nullptr)
354+
BasePluginInterface* plugin = plugin_manager::get_plugin_instance(plugin_name);
355+
if (!plugin)
356+
{
357+
return cleanup(ERROR);
358+
}
359+
360+
CliExtensionInterface* ceif = plugin_manager::get_first_extension<CliExtensionInterface>(plugin_name);
361+
if (!ceif)
338362
{
339363
return cleanup(ERROR);
340364
}
341365

342366
ProgramArguments plugin_args;
343367

344-
for (const auto& option : plugin->get_cli_options().get_options())
368+
for (const auto& option : ceif->get_cli_options().get_options())
345369
{
346370
auto flags = std::get<0>(option);
347371
auto first_flag = *flags.begin();
@@ -357,7 +381,7 @@ int main(int argc, const char* argv[])
357381
log_info("core", " '{}': {}", option, utils::join(",", plugin_args.get_parameters(option)));
358382
}
359383

360-
if (!plugin->handle_cli_call(netlist.get(), plugin_args))
384+
if (!ceif->handle_cli_call(netlist.get(), plugin_args))
361385
{
362386
plugins_successful = false;
363387
break;

cmake/FindIGraph.cmake

-75
This file was deleted.

0 commit comments

Comments
 (0)