Skip to content

Commit

Permalink
Merge pull request #2 from byuccl/prepRelease_1_4
Browse files Browse the repository at this point in the history
Prepare for release 1.4
  • Loading branch information
james-ben authored Aug 5, 2020
2 parents cc96fe9 + 41c141a commit 98d1565
Show file tree
Hide file tree
Showing 76 changed files with 8,121 additions and 1,555 deletions.
3 changes: 3 additions & 0 deletions .github/.travis/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

cd projects/build && cmake .. && make
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "llvm-project"]
path = llvm-project
url = https://github.com/llvm/llvm-project.git
41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
language: c
os: linux

dist: bionic
addons:
apt:
packages:
- clang-7
- llvm-7
- libc++-dev
- libc++abi-dev
- gcc-arm-none-eabi
- libnewlib-arm-none-eabi

git:
submodules: false

jobs:
include:
- stage: build
name: build
script:
- .github/.travis/build.sh

- stage: test
name: test_fast
script:
- .github/.travis/build.sh
- make test_fast

- stage: test
name: test_full
script:
- .github/.travis/build.sh
- make test_full

- stage: test
name: regression_test
script:
- .github/.travis/build.sh
- make test_regression
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

build:
cd projects/build && cmake .. && make

test_fast:
python3 unittest/unittest.py unittest/cfg/fast.yml

test_full_tmr:
python3 unittest/unittest.py unittest/cfg/full_tmr.yml

test_full:
python3 unittest/unittest.py unittest/cfg/full.yml

# runs COAST on the unit tests
test_regression:
python3 unittest/pyDriver.py unittest/cfg/regression.yml

.PHONY: build
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# Welcome to the COAST Repository

[![Build Status](https://travis-ci.com/byuccl/coast.svg?branch=master)](https://travis-ci.com/byuccl/coast)
[![Documentation Status](https://readthedocs.org/projects/coast-compiler/badge/?version=latest)](https://coast-compiler.readthedocs.io/en/latest/?badge=latest)


Welcome to the repository for COAST (COmpiler-Assisted Software fault Tolerance), BYU's tool for automated software mitigation! To get started, please refer to our [documentation pages](https://coast-compiler.readthedocs.io/en/latest/).


## Dependencies

See [the build folder](build/README.md) for instructions on installation and dependencies.


## Cloning

If you plan to build LLVM from source, use the following commands to clone this repository:

```
git clone --recursive -j2 [email protected]:byuccl/coast-private.git
```
Expand Down
31 changes: 28 additions & 3 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
Build LLVM by using CMAKE to create the Makefile:
# Install LLVM

This project depends on LLVM and `clang` v7.0.0.

No support is offered for other versions.

## Option 1: System Packages

#### Ubuntu 18.04 and up:

```
sudo apt install llvm-7
sudo apt install clang-7
```

#### Other systems:

Check the package manager for the system you're on.

## Option 2: Official Releases

Check the [Official Releases page](https://github.com/llvm/llvm-project/releases) for downloads.

## Option 3: Build from Source

Build LLVM and `clang` by using CMAKE to create the Makefile. In this directory, run:

```
cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=On ../llvm-project/llvm/
```

To build with the RISC-V backend enabled, add the flag `-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=RISCV`

Then run make. Make sure to do a parallel build, otherwise it will take a long time:
Then run `make`. Make sure to do a parallel build, otherwise it will take a long time:

```
make -j4
```

Not enabling debug or assertions will make the compile time faster. However, if you are developing passes, having debug enabled is well worth the wait.
Not enabling debug or assertions will make the compile time faster. However, if you are developing passes, having debug enabled is well worth the wait. In fact, developing passes is probably the only reason you'd want to build from source. Otherwise, just use the package.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/build
.vscode

2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# -- Project information -----------------------------------------------------

project = 'COAST'
copyright = '2019, Jeffrey Goeders, Benjamin James'
copyright = '2020, Jeffrey Goeders, Benjamin James'
author = 'Jeffrey Goeders, Benjamin James, Matthew Bohman'


Expand Down
34 changes: 29 additions & 5 deletions docs/source/eclipse.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
.. guide to using Eclipse with LLVM
Using an IDE to aid LLVM development
*************************************

We have used both Eclipse and Visual Studio Code in the development of COAST. This is very helpful because it allows code completion hints that inform you what methods are available for specific classes.

Using Eclipse with LLVM
************************
=========================

You can write your code in a plain text editor, or you can use Eclipse to help you manage all of the classes and methods. This guide was written for Eclipse 4.10.0 using the CDT.
This guide was written for Eclipse 4.10.0 using the CDT.

Setting up the project
=========================
-------------------------

1. Select "File -> New -> Makefile Project with Existing Code".
2. Enter ``projects`` as the project name.
Expand All @@ -19,7 +24,7 @@ Setting up the project
9. When you click on the "Build" button the projects will be compiled.

Building the projects
==========================
-------------------------

1. Right click on the ``projects/build`` subdirectory, then "Make Targets -> Create".
2. Call the target name ``all`` and click OK.
Expand All @@ -28,7 +33,7 @@ Building the projects


Fixing the CDT settings
========================
-------------------------

The default settings of the project are not sufficient to allow the Eclipse CDT indexer to work correctly. While not necessary to fix the CDT settings, it allows you to use the auotcomplete functionality of Eclipse.

Expand All @@ -49,3 +54,22 @@ The default settings of the project are not sufficient to allow the Eclipse CDT
#. Under the "Discovery" tab select "CDT GCC Built-in Compiler Settings"
#. Edit the "Command to get compiler specs" the same as before
#. Select "Apply and Close"


Using VS Code with LLVM
=========================

1. Open VS Code
#. File -> Open Folder
#. Select the directory that contains the files for the pass you want to develop
#. On the bottom ribbon at the right there will be a button next to the language configuration (ours says "Linux")
#. Hovering over this button says "C/C++ Configuration". Click on it
#. You will be taken to a page that allows you to set up a specific configuration for this directory.
#. Click the button "Add Configuration" and give it a name
#. Add the path to the LLVM include files in the section "Include path"
#. For example, because I built LLVM from source, I added the following:

.. code-block:: bash
/home/$USER/coast/llvm-project/llvm/include
/home/$USER/coast/build/include
15 changes: 9 additions & 6 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,26 @@ COAST

setup
make_system
eclipse
passes
repl_scope
troubleshooting
cfcss
release_notes
eclipse
cfcss


Folder guide
==============

build
boards
---------

This folder contains instructions on how to build LLVM, and when built will contain the binaries needed to compile source code.
This folder has support files needed for the various target architectures we have used in testing COAST.

llvm
build
---------

The source code for LLVM and associated tools.
This folder contains instructions on how to build LLVM, and when built will contain the binaries needed to compile source code. Note: building LLVM from source is optional.

projects
---------
Expand All @@ -43,6 +45,7 @@ tests

Benchmarks we use to validate the correct operation of COAST.


Results
========

Expand Down
Loading

0 comments on commit 98d1565

Please sign in to comment.