KMLM List
View email archives for the history of this mailing list.
|
|
|
|
systemc-forum - Re: [systemc-forum] Error during simulation
|
Message Thread:
Previous |
Next
|
- To: <systemc-forum@xxxxxxxxxxxxxxxxx>
- From: "Timothy Fanelli" <tfanelli@xxxxxxxxxxxx>
- Date: Mon, 14 Dec 2009 10:08:49 -0500
- Send Email to systemc-forum@lists.systemc.org:
- Send new message
- Reply to this message
|
Suriya,
The error you are seeing is that there is no overloaded stream-insertion
operator for your user-defined data type: packet_type. To use a user-defined
data type as the template parameter for an sc_signal, you must overload this
stream insertion operator, like so:
public ostream& operator << ( ostream& out, const packet_type& packet )
{
// Do something here, like write out the members of the packet variable to
the ostream "out".
}
Once you have done that, you can then pass variables of type packet_type to
output streams, such as "cout".
You must also implement the sc_trace method to handle packet_type variables as
well, as follows:
void sc_trace( sc_trace_file* tf, const packet_type& packet, const std::string&
name )
{
// Do something here, like write out the members of the packet variable to
the trace file "tf"
}
It may also be helpful, then, to declare these two methods as friends of your
packet_type class, though this isn't strictly necessary.
Hope that helps!
Thanks,
Timothy C. Fanelli
Instructor, PhD Student
Software Engineering
Department of Electrical and Computer Engineering
Clarkson University, Potsdam, NY 13699
On Dec 13, 2009, at 11:55 PM, Suriya Prakash J wrote:
Hi all,
I was trying to simulate an transmission-reception module. I have faced a error
as provided below:
/home/suriya/SystemC/systemc-2.2.0/include/sysc/communication/sc_signal.h:242:
error: no match for ?operator<<? in ?std::operator<< [with _Traits =
std::char_traits<char>](((std::basic_ostream<char, std::char_traits<char>
>&)((std::basic_ostream<char, std::char_traits<char> >*)os)), ((const
char*)"new value = ")) << ((const
sc_core::sc_signal<packet_type>*)this)->sc_core::sc_signal<packet_type>::m_new_val?
:: packet_type is a user defined data type created and provided as a sc_signal
to the module.
What modifications shall I make?
Pass on any ideas you might have :-)
Suriya
|
|
By Date:
Previous |
Next
|
Current Thread
|
By Thread:
Previous |
Next
|
- Re: [systemc-forum] Error during simulation, Timothy Fanelli (you are here)
|
|