error: no match for call to '(sc_core::sc_in<int>) (int)'

Status
Not open for further replies.

u24c02

Advanced Member level 1
Joined
May 8, 2012
Messages
404
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Visit site
Activity points
4,101
Please systemC help me about error:no match for call to '(sc_core::sc_in<int>)

hi.



I have met like the following error. I'm not sure what am i wrong?



simple_fifo.cpp:43: error: 'class sc_core::sc_in<int>' has no member named 'write'
simple_fifo.cpp:44: error: 'class sc_core::sc_in<int>' has no member named 'write'






here's code. i just make adder but somethings wrong.





#include <systemc.h>

SC_MODULE(adder)
{
sc_in<bool> p_clk;
sc_in<int> p_in;
sc_in<int> p_in1;
sc_out<int> p_out;

int i;

void test();

SC_CTOR(adder)
{
i=0;
//SC_METHOD(test)
SC_THREAD(test);
sensitive_pos(p_clk);
//sensitive << p_in;

}
};



void adder::test()
{
while(1) {
p_out.write(p_in.read() + p_in1.read());
wait();
}

}



int sc_main (int argc, char * argv[])
{
sc_signal<int> cval;
//sc_signal<int> p_in;
//sc_signal<int> p_in1;

sc_clock clk1("clk1", 20,SC_NS, 0.5,20,SC_NS);
adder u_adder("adder");
u_adder.p_clk(clk1);
u_adder.p_in.write(13);
u_adder.p_in1.write(4);
u_adder.p_out(cval);

sc_trace_file *tf = sc_create_vcd_trace_file("wave");
sc_trace(tf,clk1, "clock");
sc_trace(tf,u_adder.p_in, "in_clk");
sc_trace(tf,cval, "out_clk");
sc_start(500,SC_NS);
sc_stop();
sc_close_vcd_trace_file(tf);
return 0;
}





What am i do for fix to u_adder.p_in.write(13); u_adder.p_in1.write(4);
 
Last edited:

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…