Jump to content

no match for ‘operator=’ in ‘((sync_fifo*)this)->sync_fifo::wptr = 0’


Recommended Posts

Hi All ,

I am new to SytemC  and I am designing a FIFO . When I run the make file I am getting an error " no match for ‘operator=’ in ‘((sync_fifo*)this)->sync_fifo::wptr = 0’ " .  I guess this has do with the sensitivity list  of wptr and rptr but I am not sure how to fix it.I have highlighted the lines where I am getting error . It will be really helpful if someone could explain this .  Thank you :)

 

#include <systemc.h>  

 
SC_MODULE (sync_fifo){
sc_in_clk clk;
sc_in<bool> rst;
sc_in<bool> rd_wr;
sc_out<bool> full;
sc_out<bool> empty;
sc_in < sc_uint<8> > data_in;
sc_in < sc_uint<4> > wptr;
sc_in < sc_uint <4> > rptr;
sc_out < sc_uint<8> > data_out;
 
sc_uint<8> ram_data[256];
 
 
void read_write() {
if(rst == 1)
{
wptr=0;rptr=0;data_out=0;
}
else
if(rd_wr == 1 && !full)
{
ram_data[wptr.read()]=data_in;
wptr=wptr+1;
}
else
if(rd_wr == 0 && !full)
{
data_out=ram_data[rptr.read()];
rptr=rptr+1;
}
}
 
void emp_ful(){
if(rst == 1)
{
full=0;
empty=0;
}
else
{
if(wptr == rptr )
{
empty=1;
}
else if((wptr - rptr) == 15)
{
full=1;
}
    else
{
full=empty=0;
}
}
}
 
 
 
SC_CTOR(sync_fifo)
{
SC_METHOD(read_write);
sensitive << clk.pos() << rst ;
sensitive << wptr ;
sensitive << rptr;
 
SC_METHOD(emp_ful);
sensitive << clk.pos() << rst ;
sensitive << wptr ;
sensitive << rptr ;
}
};
 
 
 
 
 
 
 
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...