Jump to content
ruwan2

Where is declared SC_OFF?

Recommended Posts

Hi,

 

After I define fixed point, the last line 

 

  d(SC_OFF);

 

of

 
#define SC_INCLUDE_FX 
#include <systemc.h>
#include "fir_data.h"
 
void fir_data::entry()
{
  int state;
  sc_int<8> sample_tmp;
  sc_ufixed<16,16> d;        
  d(SC_OFF);
 
 

is complained by compiler:

 

# fir_data.cpp:44: error: no match for call to '(sc_dt::sc_ufixed<16, 16, SC_TRN, SC_WRAP, 0>) (sc_dt::sc_switch)'
# C:\modeltech_10.1c\include\systemc/sc_fxnum.h:3372: note: candidates are: const sc_dt::sc_fxnum_subref sc_dt::sc_fxnum::operator()(int, int) const
# C:\modeltech_10.1c\include\systemc/sc_fxnum.h:3383: note:                 sc_dt::sc_fxnum_subref sc_dt::sc_fxnum::operator()(int, int)
# C:\modeltech_10.1c\include\systemc/sc_fxnum.h:3415: note:                 const sc_dt::sc_fxnum_subref sc_dt::sc_fxnum::operator()() const
# C:\modeltech_10.1c\include\systemc/sc_fxnum.h:3422: note:                 sc_dt::sc_fxnum_subref sc_dt::sc_fxnum::operator()()
# ** Error: (sccom-6142) Compilation failed.
# ** Error: C:/modeltech_10.1c/win32/sccom failed.
# Error in macro C:\Users\Jeff\modelsim_systemC\fir_clk\run0.do line 25

 

What is wrong with my code?

 

Thanks,

Share this post


Link to post
Share on other sites

SC_ON, SC_OFF are related to "floating-point cast switches". You likely don't need to worry about these, if you don't know what problems these intend to address.  Otherwise, please refer to Sections 7.10.7, 711.5 of IEEE 1666-2011.

 

Syntaxwise, you currently try to invoke the function call operator on the sc_ufixed variable d (with an incompatible parameter).
What do you intend to achieve?  Do you want to assign a value?

 

/Philipp

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...