View email archives for the history of this mailing list.
systemc-forum - RE: [Systemc-forum] accessing bits
- To: <systemc-forum@xxxxxxxxxxx>
- From: "Alan Fitch" <alan.fitch@xxxxxxxxxx>
- Date: Thu, 22 Jul 2004 13:38:52 +0100
- Send Email to email@example.com:
- Send new message
- Reply to this message
From: Sudheer Reddy Y [mailto:sudheerreddyy@xxxxxxxxxxxxxxx]
Sent: 22 July 2004 13:22
Subject: [Systemc-forum] accessing bits
I implemented 4:2 mux in systemC. In that I declared one in put signal
of logic vector type. The problem is I am unable to access single bit in that
vector. Can any body tell me how to access bits from a vector signal in systemC.
It's not really clear to me what you are saying. However I guess
sc_in<sc_lv<4> > input;
and then you're trying to pick out a bit, e.g.
out = input;
Generally this won't work as the bit selection operator  is defined for the
sc_lv, not for the port class sc_in<sc_lv<4> >
To fix it, use a read() method on the port, e.g.
out = input.read()
and that should (I hope!) work,
Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: alan.fitch@xxxxxxxxxx
Fax: +44 (0)1425 471573 Web:
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.