test03.cpp revision 12855:588919e0e4aa
1#include "systemc.h"
2
3inline void flags_value()
4{
5	ios::fmtflags flags = cout.flags();
6	cout << hex << flags << dec << endl;
7	if ( sc_io_show_base(cout) ) cout << "showbase" << endl;
8}
9
10#define TEST(BASE) \
11{ \
12	BASE x; \
13	cout << endl << #BASE << endl; \
14	for ( i = 0; i < 256; i++ ) \
15	{ \
16		x = i; \
17		cout << "   "; \
18		cout << std::noshowbase; \
19		cout << dec << " d: " << x; \
20		cout << oct << " o: " << x; \
21		cout << hex << " x: " << x; \
22		cout << std::showbase; \
23		cout << dec << " d: " << x; \
24		cout << oct << " o: " << x; \
25		cout << hex << " x: " << x; \
26		cout << endl; \
27	} \
28}
29int sc_main(int argc, char* argv[])
30{
31	int           i;
32	sc_biguint<8> x;
33
34	TEST(sc_bigint<8>)
35	TEST(sc_biguint<8>)
36	TEST(sc_int<8>)
37	TEST(sc_uint<8>)
38	TEST(sc_lv<8>)
39	TEST(sc_bv<8>)
40	cerr << "Program completed" << endl;
41
42	return 0;
43}
44