I am newbie to system c and i am trying to work on system c data type's conversions.
I have a inport which a system c ufixed type and i need to change it to a bool type on the outport.
i tried the following code.
SC_MODULE(convert)
{
sc_in<sc_ufixed < 1, 1, SC_TRN, SC_SAT > > din;
sc_out<bool> dout;
bool i;
void conversion1() {
i = din.to_bool();
dout.write(i);
}
SC_CTOR(convert)
{
SC_METHOD(conversion);
sensitive<< din;
}
};
Is the above code correct? do i need to use the process method to convert the inport type to a another datatype on the outport?
And Could you please refer me some good reference for system c data type conversions.
Thank you very much