[Roccc-discussion] compilation problems with C-code

Mareike Schmidtobreick mareike.schmidtobreick at student.kit.edu
Wed Feb 3 02:50:29 PST 2010


Hi!

I'm student at Karlsruhe Institute for Technology (KIT, Germany) writing 
my diploma thesis under supervision of Prof. Dr. Heuveline. My subject 
is about testing C-to-VHDL-compilers for numerical computations.

I'm pretty new to the subject of FPGAs so I'm not sure what's going 
wrong with my code as I don't think that I'm violating any of the 
constraints given in the UsersManual.

Hope this is the right place to ask :-)

I'm trying to implement a Matrix-Vector multiplication but compilation 
(using the scripts, not the GUI) fails in the second phase 
(compile_llvmtovhdl.sh).

Any ideas what I'm doing wrong in this code?

-------------------------------------------------------------------------------------

/* System Code to multiply a matrix with a vector
    depends on MultVec (-> Sum, Mult)     */

#include "roccc-library.h"

void MatVecMult() {
   
    int i, j, solution, interResult;
    int zero = 0;

    int matA[20][20];
    int vecB[20];
    int vecC[20];  // matA * vecB = vecC
   
    for (i=0; i<20; ++i) {    //for each row

        solution = zero;

        for (j=0; j<20; ++j) {
                          
            //multiply matA*vecB
            
                    // MULT(in 32, in 32, out 32); module implementing a 
simple multiplication
                    MULT(matA[i][j], vecB[j], interResult);
               
                    // SUM(in 32, in 32, out 32); module implementing a 
simple multiplication
                    SUM(interResult, solution, solution);        
        }
       
        vecC[i] = solution;  
       
    }
}
------------------------------------------------------------------------------
compilation-error:
~/roccc/roccc-0.4-distribution/src/systems/MatMult$compile_llvmtovhdl.sh 
hi_cirrf.c
INTERNAL ERROR - UndefDetectionPass.cpp: Detected undef in     call void 
(i32, ...)* @ROCCCSize( i32 32, i32 undef ) nounwind

opt: UndefDetectionPass.cpp:62: virtual bool 
llvm::UndefDetectionPass::runOnFunction(llvm::Function&): Assertion `0 
and "Undef found!"' failed.
/home/keke/roccc/roccc-0.4-distribution/Install/roccc-compiler/src/../bin/compile_llvmtovhdl.sh: 
line 4:  2438 Aborted                 
/home/keke/roccc/roccc-0.4-distribution/Install/roccc-compiler/src/llvm-2.3//Release/bin/opt 
-load 
/home/keke/roccc/roccc-0.4-distribution/Install/roccc-compiler/src/llvm-2.3//Release/lib/FloatPass.so.0 
-load 
/home/keke/roccc/roccc-0.4-distribution/Install/roccc-compiler/src/llvm-2.3//Release/lib/PipelinePass.so.0 
-load 
/home/keke/roccc/roccc-0.4-distribution/Install/roccc-compiler/src/llvm-2.3//Release/lib/VHDLOutput.so.0 
-load 
/home/keke/roccc/roccc-0.4-distribution/Install/roccc-compiler/src/llvm-2.3//Release/lib/RocccIntrinsic.so.0 
-renameMem -mem2reg -ROCCCfloat -undefDetect -rocccCFGtoDFG -pipeline 
-insertCopy -loadRemoval -arrayNorm -vhdl -f -o /dev/null < $1.bc

I'd be glad for any help!

 - Mareike Schmidtobreick


More information about the Roccc-discussion mailing list