Code Monkey home page Code Monkey logo

hls-lab1's Introduction

HLS-lab1 | Utilities for HLS-lab1

Project Description

These utilities have not been fully tested. It may contains bugs. If you find any, please create an issue or notify me.

build

You should first download pre-built libraries of LLVM Release 14 from LLVM Releases, choose the package that suites your platform. If your are using windows, then you have to build llvm from source.

mkdir build
cd build
# Assume path_to_llvm is the installation directory of llvm
export LLVM_DIR=$path_to_llvm/lib/cmake/llvm
cmake ..
make

It will produces an executable src/checker and a shared library src/libInputGen.(so/dll). The first the verifier, the second one is used for generating input for test cases.

Input Generator

The input generator is made public for the convenience of debugging. Your can generate an input from a C/C++ source code by running

cd build
clang -S -emit-llvm -Xclang -disable-optnone -O0 /path/to/code.cpp
# An xxx.ll will be produced
opt -enable-new-pm=0 -load src/libInputGen.so -mem2reg -sroa -mem2reg -early-cse -inline -dce -input-gen -S xxx.ll -disable-output > test_case.txt

However, there are still some numbers that need to be filled manually. They are marked with #. Note: Function calls in your program need to be inlined.

Verifier

If you failed to setup an LLVM environment, you can still build the checker. Your can verify and evaluate your results by running

cd build
src/checker test_case_in.txt result.txt

If your result is valid, then it will print a positive number which is the evaluation result. Otherwise it will first print -1 and then the error messages.

Test Cases

You can find some test cases that are made open in the folder cases/. All test cases are generated using the input generator. More open test cases will be included in the near future.

Run Tests

After you build the project. There will be two executables build/src/checker and build/src/score_calc. You can run the test.sh in cases/ to test your program. You need to provide four arguments:

cd cases && chmod +x test.sh
./test.sh [ID] [/path/to/hls] [/path/to/checker] [/path/to/score_calc]

where ID is the test case number you wish to test.

Scoring

The baseline programs have not yet been finished.

Clarification

See Clarification

hls-lab1's People

Contributors

kix6lj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.