test.cpp revision 12855:588919e0e4aa
16019Shines@cs.fsu.edu/*****************************************************************************
26019Shines@cs.fsu.edu
312763Sgiacomo.travaglini@arm.com  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
47101Sgblack@eecs.umich.edu  more contributor license agreements.  See the NOTICE file distributed
57101Sgblack@eecs.umich.edu  with this work for additional information regarding copyright ownership.
67101Sgblack@eecs.umich.edu  Accellera licenses this file to you under the Apache License, Version 2.0
77101Sgblack@eecs.umich.edu  (the "License"); you may not use this file except in compliance with the
87101Sgblack@eecs.umich.edu  License.  You may obtain a copy of the License at
97101Sgblack@eecs.umich.edu
107101Sgblack@eecs.umich.edu    http://www.apache.org/licenses/LICENSE-2.0
117101Sgblack@eecs.umich.edu
127101Sgblack@eecs.umich.edu  Unless required by applicable law or agreed to in writing, software
137101Sgblack@eecs.umich.edu  distributed under the License is distributed on an "AS IS" BASIS,
147101Sgblack@eecs.umich.edu  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
156019Shines@cs.fsu.edu  implied.  See the License for the specific language governing
166019Shines@cs.fsu.edu  permissions and limitations under the License.
176019Shines@cs.fsu.edu
186019Shines@cs.fsu.edu *****************************************************************************/
196019Shines@cs.fsu.edu
206019Shines@cs.fsu.edu/*****************************************************************************
216019Shines@cs.fsu.edu
226019Shines@cs.fsu.edu  test.cpp --
236019Shines@cs.fsu.edu
246019Shines@cs.fsu.edu  Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
256019Shines@cs.fsu.edu
266019Shines@cs.fsu.edu *****************************************************************************/
276019Shines@cs.fsu.edu
286019Shines@cs.fsu.edu/*****************************************************************************
296019Shines@cs.fsu.edu
306019Shines@cs.fsu.edu  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
316019Shines@cs.fsu.edu  changes you are making here.
326019Shines@cs.fsu.edu
336019Shines@cs.fsu.edu      Name, Affiliation, Date:
346019Shines@cs.fsu.edu  Description of Modification:
356019Shines@cs.fsu.edu
366019Shines@cs.fsu.edu *****************************************************************************/
376019Shines@cs.fsu.edu
386019Shines@cs.fsu.edu/*
396019Shines@cs.fsu.eduDec/5/00 ulrich
406019Shines@cs.fsu.edu
416019Shines@cs.fsu.eduThe constructor of an sc_biguint with an sc_bv as an argument does not
426019Shines@cs.fsu.educompile. That happens with SystemC 1.0.1 on Solaris with both SC5.0
436019Shines@cs.fsu.eduand gcc.
446019Shines@cs.fsu.edu*/
456019Shines@cs.fsu.edu
466019Shines@cs.fsu.edu#include <systemc.h>
476019Shines@cs.fsu.edu
486019Shines@cs.fsu.eduint sc_main(int argc, char* arg[])
4910611SAndreas.Sandberg@ARM.com{
5012763Sgiacomo.travaglini@arm.com    sc_bv<10>      bv10 = "0000111100";
5110611SAndreas.Sandberg@ARM.com    sc_bigint<10>  bi10;
526268Sgblack@eecs.umich.edu    sc_biguint<10> bu10;
536251Sgblack@eecs.umich.edu
546269Sgblack@eecs.umich.edu    // works fine
556269Sgblack@eecs.umich.edu    bi10 = sc_bigint<10> (bv10);
566749Sgblack@eecs.umich.edu
577105Sgblack@eecs.umich.edu    // causes errors on g++, SC5.0 :
587161Sgblack@eecs.umich.edu    // g++ :
596251Sgblack@eecs.umich.edu    //   .../include/numeric_bit/sc_biguint.h:
606251Sgblack@eecs.umich.edu    //   In method `sc_biguint<10>::sc_biguint(const sc_bv_ns::sc_bv<10> &)':
616251Sgblack@eecs.umich.edu    //   str.cc:10:   instantiated from here
627105Sgblack@eecs.umich.edu    //   .../include/numeric_bit/sc_biguint.h:186: type `sc_signed'
637105Sgblack@eecs.umich.edu    //   is not a base type for type `sc_biguint<10>'
647105Sgblack@eecs.umich.edu    //   .../include/numeric_bit/sc_unsigned.h:1365:
657105Sgblack@eecs.umich.edu    //   `sc_unsigned::sc_unsigned()' is private
666251Sgblack@eecs.umich.edu    //   .../include/numeric_bit/sc_biguint.h:186: within this context
677105Sgblack@eecs.umich.edu    // SC5.0:
686268Sgblack@eecs.umich.edu    //   ".../include/numeric_bit/sc_biguint.h", line 186:
6911320Ssteve.reinhardt@amd.com    //   Error: sc_signed is not a direct base class of sc_biguint<10>.
706251Sgblack@eecs.umich.edu    //   ".../include/numeric_bit/sc_biguint.h", line 187:
717105Sgblack@eecs.umich.edu    //    Error: sc_unsigned::sc_unsigned() is not accessible from .
726251Sgblack@eecs.umich.edu
736019Shines@cs.fsu.edu    bu10 = sc_biguint<10>(bv10);
746267Sgblack@eecs.umich.edu
756267Sgblack@eecs.umich.edu
766267Sgblack@eecs.umich.edu    cout << bv10.to_string() << endl;
777101Sgblack@eecs.umich.edu    cout << bi10.to_string(SC_BIN) << endl;
787101Sgblack@eecs.umich.edu    cout << bu10.to_string(SC_BIN) << endl;
7910037SARM gem5 Developers
807101Sgblack@eecs.umich.edu    return 0;
816019Shines@cs.fsu.edu}
826251Sgblack@eecs.umich.edu