Control hazard analyzer (abbreviated cha.py
) is toolchain for analyzing control hazards. Toolchain consists of
three steps: test generation in C, test profiling using a profiler (perf, gem5 simulator), and result collection.
- Python 3.10+
- gem5 (optional)
Clone the repository
git clone --recurse-submodules https://github.com/SE-Processor-Fuzzing/control-hazard-analyzer.git
For using gemProofiler one needs to have gem5 and library M5ops:
They can be installed manually or using thirdparty/gem5
submodule.
python3 ./scripts/install_gem5.py X86 opt ./thirdparty/gem5/build_cache
Tip
It is possible to configure ISA, build variant and build cache directory for gem5 installation.
For more information run python ./scripts/install_gem5.py --help
python3 -m pip install -r requirements.txt
- aggregate - toolchain driver
- generate - test generate
- analyze - execute and profile tests
- summarize - give statistics on analyzed files
Usage example:
python3 cha.py aggregate
Also, you can pass many options to utilities, see help for more details
To read more about aggreagte
visit Docs
python3 cha.py aggregate --help
Usage example:
python3 cha.py generate --repeats=10 --out-dir="out" --log-level DEBUG
To read more about generate
visit Docs
Usage example:
python3 cha.py analyze --test-dir="out" --out-dir="perf_result" --log-level DEBUG
To read more about analyze
visit Docs
Usage example:
python3 cha.py summarize --src-dirs="perf_result" --out-dir="summarize_result" --log-level DEBUG
To read more about summarize
visit Docs
You can pass multiple commands in a single run. This allows you to combine multiple steps into one command sequence
Usage example:
python3 cha.py generate --out-dir="tests" analyze --test-dir="tests" --out-dir="results" summarize --src-dirs="results" --out-dir="summarize_result"
python3 -m pip install -r requirements.dev.txt
pre-commit install
pre-commit run --all-files --color always --verbose
Qt Platform Plugin Error
If you encounter the following error:qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
Aborted (core dumped)
This issue can be resolved by installing the required Qt library. Run the following command:
sudo apt-get install libqt5gui5
Quick start:
- Create a branch with new feature from
main
branch (git checkout -b feat/my-feature develop
) - Commit the changes (
git commit -m "feat: Add some awesome feature"
) - Push the branch to origin (
git push origin feat/add-amazing-feature
) - Open the pull request
For more details, see CONTRIBUTING.md
This project is licensed under the terms of the MIT license. See the LICENSE for more information.