项目作者: PrincetonUniversity

项目描述 :
ILA template-based Synthesis
高级语言: C++
项目地址: git://github.com/PrincetonUniversity/ItSy.git
创建时间: 2018-05-03T19:58:47Z
项目社区:https://github.com/PrincetonUniversity/ItSy

开源协议:MIT License

下载


Build Status
Build status
Build Status
Codacy Badge
Language grade: C/C++
Documentation

About

This is an implementation of the templated-based Instruction-Level Abstraction (ILA) synthesis based on TCAD18.

Dependencies

  • z3 4.4.0 or above.
  • boost 1.50.0 or above.

For Debian-based UNIX, you can install by running

  1. apt-get install libboost-all-dev z3 libz3-dev

For OSX, you can install by running

  1. brew install boost boost-python z3

Building

The ILA synthesis engine support build using Boost bjam and CMake.
Currently, unit tests are available in the Boost build only.

Boost for Python API

  1. cd /root/of/this/repo
  2. bjam -j$(nproc)

CMake for Cpp Projects

  1. cd /root/of/this/repo
  2. mkdir -p build
  3. cd build
  4. cmake ..
  5. make -j$(nproc)

Python API

You need to first export the library.

  1. # bash
  2. export PYTHONPATH=$(pwd)/build:$PYTHONPATH
  1. # Python
  2. import ila
  3. abs = ila.Abstraction("test")

CMake Integration

You can use the ilasynth::ilasynth interface target in CMake.
This target populates the appropriate usage requirements for include directories, linked libraries, and compile features.

  1. #include <ilasynth/abstraction.hpp>
  2. void foo () {
  3. auto m = ilasynth::Abstraction("new_abstraction");
  4. }

External

To use the library from a CMake project, you can locate it directly with find_package() and use the namespaced imported target from the generated package configuration:

  1. # CMakeLists.txt
  2. find_package(ilasynth REQUIRED)
  3. ...
  4. add_library(my_proj ...)
  5. ...
  6. target_link_libraries(my_proj PRIVATE ilasynth::ilasynth)

Embedded

It also supports embedded build, but is not recommended due to its size.
To embed the library directly into an existing CMake project, place the entire source tree in a subdirectory and call add_subdirectory() in your CMakeLists.txt file:

  1. add_subdirectory(ilasynth)
  2. ...
  3. add_library(my_proj ...)
  4. ...
  5. target_link_libraries(my_proj PRIVATE ilasynth::ilasynth)

Supporting Both

To allow your project to support either an externally installed or an embedded library, you can use the following pattern:

  1. # Top level CMakeLists.txt
  2. project(MY_PROJ)
  3. ...
  4. option(MY_PROJ_USE_EXTERNAL_ILASYNYH "Use an external library" OFF)
  5. ...
  6. add_subdirectory(externals)
  7. ...
  8. add_library(my_proj ...)
  9. ...
  10. target_link_libraries(my_proj PRIVATE ilasynth::ilasynth)
  1. # externals/CMakeLists.txt
  2. ...
  3. if(MY_PROJ_USE_EXTERNAL_ILASYNTH)
  4. find_package(ilasynth REQUIRED)
  5. else()
  6. add_subdirectory(ilasynth)
  7. endif()
  8. ...

externals/ilasynth is then a complete copy of this source tree, if enabled.

Contributors