Skip Nav
Home » Forums » SystemC Forum

Icon - KMLM List KMLM List

View email archives for the history of this mailing list.

List Home All Archives Dates Threads Authors Subjects
systemc-forum - RE: [Systemc-forum] Signal port problem in SystemC 2.0.1 with Visual C++ Message Thread: Previous | Next
  • To: "David Long" <david.long@xxxxxxxxxx>, <systemc-forum@xxxxxxxxxxx>
  • From: "Stuart Swan" <stuart@xxxxxxxxxxx>
  • Date: Mon, 29 Apr 2002 13:25:13 -0700
Send Email to systemc-forum@osci.kavi.com:
Send new message
Reply to this message
David-

Assuming it works, a cleaner solution would be to
use "P2.read()" rather than "sc_logic(P2)". In fact, I think
its a good rule to always use ".read()" or "->read()" when
reading values from ports because of issues with implicit conversion.

Not sure which compiler is right in the example below. Experience
has shown that when there's a difference, GNU is usually right
and VC++ is usually wrong.

Stuart

____________________________________________
Stuart Swan, Senior Architect
System Design Verification Group
Cadence Design Systems
Building 11
2670 Seely Avenue
San Jose, CA 95134
Phone +1 408 895 4579
Email stuart@xxxxxxxxxxx
___________________________________________



> -----Original Message-----
> From: David Long [mailto:david.long@xxxxxxxxxx]
> Sent: Monday, April 29, 2002 5:07 AM
> To: systemc-forum@xxxxxxxxxxx
> Subject: [Systemc-forum] Signal port problem in SystemC 2.0.1 with
> Visual C++
> 
> 
> Hi,
> 
> Putting the SystemC data types into their own namespace seems 
> to cause a
> problem for Microsoft Visual C++ V6.0
> 
> The following code works OK in SystemC2.0 with both VC6.0 and 
> gcc 2.95.2
> and with SystemC2.0.1 and gcc 2.95.2
> 
> SC_MODULE(foo)
> {
>   sc_in<bool> P1;
>   sc_in<sc_logic> > P2;
> 
> ...
>   void do_proc() {
>     cout << "P1 = " << P1 << endl;
>     cout << "P2 = " << P2 << endl;
> ...
> 
> For the stream output statements, Visual C++6.0 correctly calls the
> sc_in shortcut method for P1 (using a C++ type) but gives the 
> following
> compiler error for P2 (using a SystemC type in the sc_dt namespace)
> 
> error C2679: binary '<<' : no operator defined which takes a 
> right-hand
> operand of type 'class sc_in<class sc_dt::sc_logic>' (or there is no
> acceptable conversion)
> 
> You can overcome this by using a type cast, although I don't 
> think this
> is a very elegant solution e.g.
> 
>   cout << "P2 = " << sc_logic(P2) << endl;
> 
> I guess this is probably due to a difference of opinion between
> microsoft and gcc about how namespaces should work? Does anyone know a
> better solution?
> 
> Dave
> 
> -- 
> Dr David Long
> DOULOS Ltd.
> Church Hatch, 22 Market Place, Ringwood, Hampshire BH24 1AW, 
> United Kingdom
> Tel: +44 1425 471223                           Email: 
> david.long@xxxxxxxxxx
> Fax: +44 1425 471573                             Web: 
http://www.doulos.com

                   **********************************
                   **  Developing design know-how  **
                   **********************************

This e-mail and any  attachments are  confidential and Doulos Ltd. reserves
all rights of privilege in  respect thereof. It is intended for the  use of
the addressee only. If you are not the intended  recipient please delete it
from  your  system, any  use, disclosure, or copying  of this  document  is
unauthorised. The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.




_______________________________________________
Systemc-forum mailing list
Systemc-forum@xxxxxxxxxxxxxxxxxxx
https://server2.systemc.org/mailman/listinfo/systemc-forum



By Date: Previous | Next Current Thread By Thread: Previous | Next


  Mail converted by the most-excellent MHonArc 2.6.10