Ivan-Pokhabov / control-hazard-analyzer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Control hazard analyzer

Lint Test License: MIT GitHub all releases Code style: black GitHub commit activity (branch)

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.


Requirements

  • Python 3.10+
  • gem5 (optional)

Installation

Clone the repository

git clone --recurse-submodules https://github.com/SE-Processor-Fuzzing/control-hazard-analyzer.git

gem5

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

cha.py dependencies

python3 -m pip install -r requirements.txt

Toolchain structure

aggregate

Usage example:

python3 cha.py aggregate

Example result: example_of_output

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

generate

Usage example:

python3 cha.py generate --repeats=10 --out-dir="out" --log-level DEBUG

To read more about generate visit Docs

analyze

Usage example:

python3 cha.py analyze --test-dir="out" --out-dir="perf_result" --log-level DEBUG

To read more about analyze visit Docs

summarize

Usage example:

python3 cha.py summarize --src-dirs="perf_result" --out-dir="summarize_result" --log-level DEBUG

To read more about summarize visit Docs

Multi-command Execution

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"

Development

Requirements

python3 -m pip install -r requirements.dev.txt

Pre-commit

Install pre-commit-hooks

pre-commit install

Run manually

pre-commit run --all-files --color always --verbose

Troubleshooting

Common Problems

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

Contributing

Quick start:

  1. Create a branch with new feature from main branch (git checkout -b feat/my-feature develop)
  2. Commit the changes (git commit -m "feat: Add some awesome feature")
  3. Push the branch to origin (git push origin feat/add-amazing-feature)
  4. Open the pull request

For more details, see CONTRIBUTING.md

License

This project is licensed under the terms of the MIT license. See the LICENSE for more information.

About

License:MIT License


Languages

Language:C 97.9%Language:Python 2.1%