Hi all,
I am working with sc_fixed point types in systemc and i tried a small code with the usage of fixedpoint types.
#define SC_INCLUDE_FX
#include "systemc.h"
#include <stdlib.h> //for srand() and rand()
SC_MODULE(rand){
sc_out<sc_ufixed<8,8,SC_TRN,SC_SAT> > output;
sc_ufixed<8,8,SC_TRN,SC_SAT> A;
void process(){
while(true)
{
wait(19, SC_NS);
A=rand() % 254 ; // range 0 to 253
output.write(A);
}
}
SC_CTOR(rand)
{
SC_THREAD(process);
}
};
The above code is just a source module which provides the rand numbers in the fixed point format to the next module. But when i compile i am getting the syntax error as "sc_ufixed symbols could not be resolved"
Even i defined locally the SC_INCLUDE_FX macro to work with the fixed point types. But i cant figure out what is the syntax problems while working with fixed point types.
when i work the same with the integers, it works fine.
Note: i am working in ubuntu 12.04 OS in eclipse C++ software.
please help me to proceed with a solution