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] accessing bits Message Thread: Previous | Next
  • To: <systemc-forum@xxxxxxxxxxx>
  • From: "Alan Fitch" <alan.fitch@xxxxxxxxxx>
  • Date: Thu, 22 Jul 2004 13:38:52 +0100
Send Email to
Send new message
Reply to this message
-----Original Message-----
From: Sudheer Reddy Y [mailto:sudheerreddyy@xxxxxxxxxxxxxxx]
Sent: 22 July 2004 13:22
To: systemc-forum@xxxxxxxxxxx
Subject: [Systemc-forum] accessing bits

Hi all,
        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.
Hi Sudheer,
              It's not really clear to me what you are saying. However I guess 
you have
   sc_in<sc_lv<4> > input;
and then you're trying to pick out a bit, e.g.
    out = input[0];
Generally this won't work as the bit selection operator [] is defined for the 
data type
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 =[0]
and that should (I hope!) work,
Alan Fitch

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.

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

  Mail converted by the most-excellent MHonArc 2.6.10