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] Single step assignment of .range() width > 64 bits t Message Thread: Previous | Next
  • To: alan.fitch@xxxxxxxxxx
  • From: Bernard Deadman <bdeadman@xxxxxxxxxx>
  • Date: Mon, 20 Feb 2012 09:00:52 -0600
  • Cc: "systemc-forum@xxxxxxxxxxxxxxxxxxx" <systemc-forum@xxxxxxxxxxxxxxxxxxx>
Send Email to systemc-forum@lists.accellera.org:
Send new message
Reply to this message

Hi Alan,

It's actually sc_bv - I missed that when sanitizing the example!

Thanks - that seems to work. I'd tried casting to the type of the LHS but that doesn't work as it's still ambiguous, but it hadn't occurred to me to try casting to a signal of the correct width!

Thanks again,

Bernard



On 2/20/2012 8:50 AM, alan.fitch@xxxxxxxxxx wrote:
Hi Bernard,
  I guess your signal declaration should be


sc_signal<sc_lv<256> > my_signal;// sc_lv??


In that case you could use

 my_variable = sc_lv<128>(my_signal.read().range(191,64));

The trick is to cast the result of the slice to sc_lv or sc_bv - then the overloaded = is unambiguous and can do its work.

regards
Alan

--
Alan Fitch
Senior Consultant

Doulos - Developing Design Know-how
VHDL * Verilog * SystemVerilog * SystemC * PSL * Perl * Tcl/Tk * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: + 44 (0)1425 471223 Email: alan.fitch@xxxxxxxxxx
Fax:  +44 (0)1425 471573 http://www.doulos.com ;<http://www.doulos.com/>

--------------------------------------------------------------------------------
Doulos Ltd is registered in England and Wales with company no. 3723454
Its registered office is 4 Brackley Close, Bournemouth International Airport,
Christchurch, BH23 6SE, UK.

This message (and associated files) may contain information that is confidential,
proprietary, privileged, or subject to copyright. It is intended solely for the use
of the individual to whom it is addressed and others authorised to receive it. If
you have received this email in error, please notify the sender and delete all
copies. This message may contain personal views which are not the views of
Doulos, unless specifically stated.



From:   Bernard Deadman <bdeadman@xxxxxxxxxx>
To: "systemc-forum@xxxxxxxxxxxxxxxxxxx" <systemc-forum@xxxxxxxxxxxxxxxxxxx>
Date:   20/02/2012 14:42
Subject: [systemc-forum] Single step assignment of .range() width > 64 bits to sc_biguint<W> ?
Sent by:        <systemc-forum@xxxxxxxxxxxxxxxxxxx>


------------------------------------------------------------------------




Does anyone have any ideas how to make this assignment in a single line?


sc_signal<256> my_signal;

sc_biguint<128> my_variable;

my_variable = my_signal.read().range(191,64):


If I try to compile that using Visual Studio (I have SystemC 2.2) I get:

1>.........cpp(57) : error C2593: 'operator =' is ambiguous
1>
c:\working\systemc\systemc-2.2.0\src\sysc\datatypes\int\sc_biguint.h(238):
could be 'sc_dt::sc_biguint<W> &sc_dt::sc_biguint<W>::operator =(const
sc_dt::sc_lv_base &)'
1>        with
1>        [
1>            W=128
1>        ]
1>
c:\working\systemc\systemc-2.2.0\src\sysc\datatypes\int\sc_biguint.h(235):
or 'sc_dt::sc_biguint<W> &sc_dt::sc_biguint<W>::operator =(const
sc_dt::sc_bv_base &)'
1>        with
1>        [
1>            W=128
1>        ]
1>        while trying to match the argument list
'(sc_dt::sc_biguint<W>, sc_dt::sc_subref_r<X>)'
1>        with
1>        [
1>            W=128
1>        ]
1>        and
1>        [
1>            X=sc_dt::sc_bv_base
1>        ]


I also looked at the .to_xyz() conversion methods but there's nothing
that supports values > 64 bits.   I guess I could make several slices
however that will be awkward if the range values are variables.

Has anyone any ideas for simple ways to do this?

Thanks,

Bernard





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