Jump to content

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


Rashmi11

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...