Skip to content
Snippets Groups Projects
README.md 3.02 KiB
Newer Older
  • Learn to ignore specific revisions
  • Pascal Pieper's avatar
    Pascal Pieper committed
    RISC-V based Data Flow Analysis (RISCV-DFA)
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    ==============================
    
    
    Pascal Pieper's avatar
    Pascal Pieper committed
    The RISC-V based Data Flow Analysis Tool is a fork of the original [Virtual Prototype](https://github.com/agra-uni-bremen/riscv-vp).
    It extends the existing RISC-V RV32IM core and peripherals to track guest memory even in CPU and peripherals and enforce a given security policy, defined by a lattice.
    
    The main differences to existing DFA-Tools are:
    1. The dynamic analysis in an embedded system down to machine code
    2. Our model includes peripherals common to embedded systems such as DMA, Interrupts and UARTs
    3. The tainting mechanism supports an arbitrary amount of security classes, including (but not limited to) integrity and confidentiality models.
    
    
    Pascal Pieper's avatar
    Pascal Pieper committed
    
    The VP is designed as extensible and configurable platform with a generic bus system and implemented in standard-compliant SystemC and TLM-2.0.
    For more information please visit http://www.systemc-verification.org/ or contact <riscv@systemc-verification.org>.
    In the following we provide build instructions and how to compile and run software on the VP.
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    1) Build the RISC-V GNU Toolchain:
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    ----------------------------------
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    (Cross-)Compiling the software examples, in order to run them on the VP, requires the RISC-V GNU toolchain to be available in PATH. Several standard packages are required to build the toolchain. On Ubuntu the required packages can be installed as follows:
    
    ```bash
    sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
    ```
    
    
    On Fedora, following actions are required:
    ```bash
    sudo dnf install autoconf automake curl libmpc-devel mpfr-devel gmp-devel gawk bison flex texinfo gperf libtool patchutils bc zlib-devel expat-devel cmake boost-devel
    sudo dnf groupinstall "C Development Tools and Libraries"
    
    Pascal Pieper's avatar
    Pascal Pieper committed
    #optional debuginfo
    sudo dnf debuginfo-install boost-iostreams boost-program-options boost-regex bzip2-libs glibc libgcc libicu libstdc++ zlib
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    For more information on prerequisites for the RISC-V GNU toolchain visit https://github.com/riscv/riscv-gnu-toolchain. With the packages installed, the toolchain can be build as follows:
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    
    ```bash
    git clone https://github.com/riscv/riscv-gnu-toolchain.git
    cd riscv-gnu-toolchain
    git submodule update --init --recursive
    
    ./configure --prefix=$(pwd)/../riscv-gnu-toolchain-dist-rv32g-ilp32d --with-arch=rv32g --with-abi=ilp32d
    
    make
    ```
    
    
    2) Build this RISC-V Virtual Prototype:
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    ---------------------------------------
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    
    
    Pascal Pieper's avatar
    Pascal Pieper committed
    i) in root folder, run `make`. This will download and build systemC-2.4.2 and the main executable.
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    
    3) Compile and run some Software:
    ---------------------------------
    
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    In *sw*:
    
    ```bash
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    cd simple-sensor                        # can be replaced with different example
    make                                    # (requires RISC-V GNU toolchain in PATH)
    ../../vp/build/lib/riscv-vp main        # shows final simulation time as well as register and pc contents
    
    Vladimir Herdt's avatar
    Vladimir Herdt committed
    ```
    
    Add the *riscv-vp* executable to PATH to simplify execution of SW examples.