mohitnegi Posted October 2, 2013 Report Share Posted October 2, 2013 hello ,, i wish to use string as input data type i have used ... sc_in<unsigned char> data_in; and i am using data_in as static sensitivity ....and am getting error : ca_fifo.h: In constructor ‘fifo::fifo(sc_core::sc_module_name)’: ca_fifo.h:27:6: error: invalid static_cast from type ‘void (fifo::*)(char)’ to type ‘sc_core::SC_ENTRY_FUNC {aka void (sc_core::sc_process_host::*)()}’ please explain me the above error as i wish to sent a string literal from stimulus ... and on page 199 of 1666-2011 string literals topic ...it is written " A string literal representation may be used as the value of a SystemC numeric or vector type object." does it mean that we cannot sent a string literal directly ... thanks Mohit Negi Quote Link to comment Share on other sites More sharing options...
apfitch Posted October 2, 2013 Report Share Posted October 2, 2013 Please show more of your code, including the line where the error occurs, regards Alan P.S. I don't think the quote from the LRM is relevant. What that quote says is that you may write sc_lv<8> = "10101010"; i.e. mix vector types and string literals. Quote Link to comment Share on other sites More sharing options...
mohitnegi Posted October 3, 2013 Author Report Share Posted October 3, 2013 #include <systemc.h> SC_MODULE (fifo) { sc_in<bool> read_write_n; sc_in<unsigned char> data_in; sc_in<bool> clock; sc_in<bool> reset; sc_out<bool> output; void fifo_read(); void fifo_write(unsigned char c); void fifo_reset(); sc_event write_event,read_event; enum e{MAX=10}; char data[MAX]; int num_element,first; SC_CTOR (fifo) { SC_THREAD(fifo_read); sensitive<<read_write_n; sensitive_pos<<clock; SC_THREAD(fifo_write); sensitive<<read_write_n;//<<data_in; sensitive<<data_in; sensitive_pos<<clock; SC_THREAD(fifo_reset); sensitive<<reset; } }; error is mohit@ubuntu:~/Desktop/Untitled Folder$ g++ -I. -I$SYSTEMC_HOME/include -L. -L$SYSTEMC_HOME/lib-linux -Wl,-rpath=$SYSTEMC_HOME/lib-linux ca_fifo.h -lsystemc -lm ca_fifo.h: In constructor ‘fifo::fifo(sc_core::sc_module_name)’: ca_fifo.h:27:6: error: invalid static_cast from type ‘void (fifo::*)(unsigned char)’ to type ‘sc_core::SC_ENTRY_FUNC {aka void (sc_core::sc_process_host::*)()}’ Quote Link to comment Share on other sites More sharing options...
apfitch Posted October 3, 2013 Report Share Posted October 3, 2013 Thanks Mohit - I think the error is here: void fifo_write(unsigned char c); Static SystemC processes may not have arguments. You need to remove the argument from the function declaration, e.g. void fifo_write(); regards Alan mohitnegi 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.