KMLM List
View email archives for the history of this mailing list.
|
|
|
|
systemc-forum - Re : [systemc-forum] problems with functions: read() and write()
|
Message Thread:
Previous |
Next
|
- To: Mike Lewis <Mike.Lewis@xxxxxxxxxxxxxxxxx>, "systemc-forum@xxxxxxxxxxxxxxxxx" <systemc-forum@xxxxxxxxxxxxxxxxx>
- From: KEDIDI DHEKRA <k_dhekra@xxxxxxxx>
- Date: Tue, 1 Dec 2009 13:24:35 +0000 (GMT)
- Send Email to systemc-forum@lists.systemc.org:
- Send new message
- Reply to this message
|
That's right!
It works now and thank a lot for the explanation...
regards
________________________________
De : Mike Lewis <Mike.Lewis@xxxxxxxxxxxxxxxxx>
À : KEDIDI DHEKRA <k_dhekra@xxxxxxxx>; "systemc-forum@xxxxxxxxxxxxxxxxx"
<systemc-forum@xxxxxxxxxxxxxxxxx>
Envoyé le : Mar 1 Décembre 2009, 14 h 18 min 09 s
Objet : RE: [systemc-forum] problems with functions: read() and write()
Hi,
The read() and write() functions to which you refer belong to the sc_signal<>
class – but your objects Q1, Q2, U1, U2 are of type “float”.
I think what you need to do is define them as
sc_signal<float>Q_1, Q_2, U_1, U_2;
This defines them as sc_signal objects, specialised for carrying the datatype
“float”.
Best regards,
Mike
From:KEDIDI DHEKRA [mailto:k_dhekra@xxxxxxxx]
Sent: 01 December 2009 12:23
To: systemc-forum@xxxxxxxxxxxxxxxxx
Subject: [systemc-forum] problems with functions: read() and write()
Hi all,
As SystemC beginner; I have this problem with both functions read() and
write(), my code is there:
voidSC::connexion()
{
floatQ_1, Q_2, U_1, U_2;
Q_1=20;
Q_2=10;
U_1=C1*Q_1;
if(switchC1_0.read()==1 & switchC1_2.read()==1 & switchC2_1.read()==1)
{cout<<"mode de fonctionnement est addition des charges\n";
Q_2.write( Q_2.read()+ Q_1.read() ) ;}
and errors after compiling are:
.cpp(19) : error C2228: la partie gauche de '.write' doit avoir un
class/struct/union
.cpp(19) : error C2228: la partie gauche de '.read' doit avoir un
class/struct/union
.cpp(19) : error C2228: la partie gauche de '.read' doit avoir un
class/struct/union
(19) is the line of: Q_2.write( Q_2.read()+ Q_1.read() ) ;}
I don't understand why it doesn't accept read() and write() functions in this
line...
thanks for your help
Regards
________________________________
Windows Live: Keep your friends up to date with what you do online.
CONFIDENTIALITY NOTICE: This message (including any attached files) is intended
only for the designated recipient(s). It may contain confidential and/or
proprietary information and should be deemed as being subject to applicable
confidentiality protections. If you are not a designated recipient, you may not
review, use, copy or distribute this message. If you receive this message in
error, please notify the sender by reply e-mail and then delete this message.
Thank you.
Axell Wireless Limited, Registered Office: Aerial House, Asheridge Road,
Chesham, Buckinghamshire, HP5 2QD, United Kingdom, Registered No. 4042808
(England)
|
|