test10.cpp revision 12855:588919e0e4aa
1/*****************************************************************************
2
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements.  See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License.  You may obtain a copy of the License at
9
10    http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied.  See the License for the specific language governing
16  permissions and limitations under the License.
17
18 *****************************************************************************/
19
20/*****************************************************************************
21
22  test10.cpp -- Test that low order word of negative sc_signed value is
23                properly masked when used in sc_signed::concat_get_data()
24
25  Original Author: Andy Goodrich, Forte Design Systems, 29 April 2008
26
27 *****************************************************************************/
28
29/*****************************************************************************
30
31  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
32  changes you are making here.
33
34      Name, Affiliation, Date:
35  Description of Modification:
36
37 *****************************************************************************/
38
39#include "systemc.h"
40
41int sc_main(int argc, char* argv[])
42{
43
44    sc_bigint<65> hi;
45    hi[64] = 1; hi(63,32) = 0xffffe47b;
46    hi[64] = 1; hi(63,32) = 0xffffe47b;
47    sc_bigint<31> lo(1);
48    sc_bigint<96> x;
49    cout << "x = " << x.to_string(SC_BIN) << endl << endl;
50    x = (hi,lo);
51    cout  << hex << "hi = " << hi << endl
52          << "lo = " << lo << endl
53          << "x = " << x << endl;
54    cout  << dec << "hi = " << hi.to_string(SC_BIN) << endl
55          << "lo = " << lo.to_string(SC_BIN) << endl
56          << "x = " << x.to_string(SC_BIN) << endl;
57    cout << "Program completed" << endl;
58    return 0;
59}
60