Skip to content

DFCxx kernel instantiation #99

DFCxx kernel instantiation

DFCxx kernel instantiation #99

Workflow file for this run

name: main
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
env:
CIRCT_VERSION: 1.72.0
CIRCT_ARCHIVE: "circt-full-shared-linux-x64.tar.gz"
DEPENDENCIES_DIR: "deps"
MLIR_TARGETS_PATH: "lib/cmake/mlir/MLIRTargets.cmake"
BUILD_DIR: "build"
TESTS_EXECUTABLE: test/utest
COV_INFO_DIR: "lcoverage.dir"
jobs:
build-and-test:
strategy:
matrix:
compiler: [g++, clang++]
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Download APT dependencies
run: |
sudo apt update
sudo apt install build-essential clang cmake g++ gcc liblpsolve55-dev lld make ninja-build libctemplate-dev lcov
- name: Download and configure CIRCT & LLVM
env:
CIRCT_SOURCE: "https://github.com/llvm/circt/releases/download/firtool-${{env.CIRCT_VERSION}}/${{env.CIRCT_ARCHIVE}}"
CIRCT_DIR: "firtool-${{env.CIRCT_VERSION}}"
run: |
mkdir "${{env.DEPENDENCIES_DIR}}"
cd "${{env.DEPENDENCIES_DIR}}"
wget "${{env.CIRCT_SOURCE}}"
tar -xvf "${{env.CIRCT_ARCHIVE}}"
sed -i 's'/\
'foreach(_target "LLVMSupport" "LLVMCore" "LLVMMC" "LLVMTarget" "LLVMAsmParser" "LLVMBinaryFormat" '\
'"LLVMBitReader" "LLVMBitWriter" "LLVMFrontendOpenMP" "LLVMTransformUtils" "LLVMTargetParser" "LLVMIRReader" '\
'"LLVMipo" "LLVMLinker" "LLVMPasses" "LLVMMCParser" "LLVMLineEditor" "LLVMTableGen" "LLVMCoroutines" "LLVMExecutionEngine" '\
'"LLVMObject" "LLVMOrcJIT" "LLVMJITLink" "LLVMAnalysis" "LLVMAggressiveInstCombine" "LLVMInstCombine" "LLVMScalarOpts" '\
'"LLVMVectorize" "LLVMX86CodeGen" "LLVMX86Desc" "LLVMX86Info" "LLVMX86AsmParser" "LLVMX86Disassembler" "CIRCTAffineToLoopSchedule" '\
'"CIRCTArcToLLVM" "CIRCTCalyxToFSM" "CIRCTCalyxToHW" "CIRCTCalyxNative" "CIRCTCombToArith" "CIRCTCombToLLVM" "CIRCTCombToSMT" '\
'"CIRCTConvertToArcs" "CIRCTDCToHW" "CIRCTExportChiselInterface" "CIRCTExportVerilog" "CIRCTFIRRTLToHW" "CIRCTFSMToSV" '\
'"CIRCTHandshakeToDC" "CIRCTHandshakeToHW" "CIRCTHWArithToHW" "CIRCTHWToLLHD" "CIRCTHWToLLVM" "CIRCTHWToBTOR2" "CIRCTHWToSMT" '\
'"CIRCTHWToSV" "CIRCTHWToSystemC" "CIRCTLLHDToLLVM" "CIRCTLoopScheduleToCalyx" "CIRCTMooreToCore" "CIRCTPipelineToHW" "CIRCTSCFToCalyx" '\
'"CIRCTSeqToSV" "CIRCTSimToSV" "CIRCTCFToHandshake" "CIRCTVerifToSMT" "CIRCTVerifToSV" "CIRCTExportFIRRTL" "CIRCTComb" '\
'"CIRCTCombTransforms" "CIRCTDebug" "CIRCTESI" "CIRCTFIRRTL" "CIRCTImportFIRFile" "CIRCTMSFT" "CIRCTMSFTTransforms" "CIRCTHW" '\
'"CIRCTLLHD" "CIRCTMoore" "CIRCTOM" "CIRCTOMEvaluator" "CIRCTSeq" "CIRCTSeqTransforms" "CIRCTSV" "CIRCTSVTransforms" "CIRCTFSM" '\
'"CIRCTFSMTransforms" "CIRCTHandshake" "CIRCTHandshakeTransforms" "CIRCTHWArith" "CIRCTVerif" "CIRCTLTL" "CIRCTEmit" "CIRCTFirtool" )'\
/\
'foreach(_target "LLVMSupport" "LLVMCore" "LLVMMC" "LLVMTarget" "LLVMAsmParser" "LLVMBinaryFormat" "LLVMBitReader" "LLVMBitWriter" '\
'"LLVMFrontendOpenMP" "LLVMTransformUtils" "LLVMTargetParser" "LLVMIRReader" "LLVMipo" "LLVMLinker" "LLVMPasses" "LLVMMCParser" '\
'"LLVMLineEditor" "LLVMTableGen" "LLVMCoroutines" "LLVMExecutionEngine" "LLVMObject" "LLVMOrcJIT" "LLVMJITLink" "LLVMAnalysis" '\
'"LLVMAggressiveInstCombine" "LLVMInstCombine" "LLVMScalarOpts" "LLVMVectorize" "LLVMX86CodeGen" "LLVMX86Desc" "LLVMX86Info" '\
'"LLVMX86AsmParser" "LLVMX86Disassembler")/' "${{env.CIRCT_DIR}}/${{env.MLIR_TARGETS_PATH}}"
cd "${{github.workspace}}"
- name: Configure Utopia HLS build (with coverage info)
env:
CIRCT_DIR: "firtool-${{env.CIRCT_VERSION}}"
run: |
cmake -S . -B "${{env.BUILD_DIR}}" -G Ninja -DCMAKE_CXX_COMPILER="${{matrix.compiler}}" \
-DCMAKE_PREFIX_PATH="${{github.workspace}}/${{env.DEPENDENCIES_DIR}}/${{env.CIRCT_DIR}}" \
-DSRC_FILES="${{github.workspace}}/examples/polynomial2/polynomial2.cpp" -DBUILD_TESTS=ON -DCMAKE_CXX_FLAGS="--coverage"
- name: Build Utopia HLS
run: |
cmake --build "${{env.BUILD_DIR}}"
- name: Run tests
run: |
"${{env.BUILD_DIR}}/${{env.TESTS_EXECUTABLE}}"
- name: Gather coverage info
if: ${{ matrix.compiler == 'g++' }}
env:
COV_INFO_FILE: "lcoverage.info"
run: |
lcov --capture --directory "${{github.workspace}}" -o ${{env.COV_INFO_FILE}}
lcov --remove ${{env.COV_INFO_FILE}} "${{github.workspace}}/${{env.BUILD_DIR}}/*" "${{github.workspace}}/lib/*" \
"${{github.workspace}}/${{env.DEPENDENCIES_DIR}}" -o ${{env.COV_INFO_FILE}}
genhtml "${{env.COV_INFO_FILE}}" -o "${{env.COV_INFO_DIR}}"
- name: Archive code coverage results
if: ${{ matrix.compiler == 'g++' }}
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: "${{env.COV_INFO_DIR}}"