13#define TRG_SHORT_NAMES
19#include "trg/trg/Utilities.h"
25#define NAME "MergerViewer"
26#define VERSION "version 0.00"
29main(
int argc,
const char* argv[])
32 cout << NAME <<
" ... " << VERSION << endl;
33 const string tab =
" ";
37 cout << NAME <<
" !!! arguments not good" << endl;
38 cout << tab <<
" 1 : Merger COE data file" << endl;
43 string inname = argv[1];
44 ifstream infile(inname.c_str(), ios::in);
46 cout << NAME <<
" !!! can not open file" << endl
47 <<
" " << inname << endl;
52 while (! infile.eof()) {
53 infile.getline(b, 800);
65 if (l.find(
"memory") != string::npos)
69 bitset<5> cc(l.substr(0, 5));
70 cout <<
"--- " << cc.to_ulong();
73 if (l.substr(5, 11) !=
"00000000000")
74 cout <<
" something wrong with reserved bits ";
77 bitset<9> rcc(l.substr(11 + 5, 9));
78 cout <<
" " << rcc.to_ulong();
81 bitset<80> hm(l.substr(5 + 16 * 11, 16 * 5));
83 cout << endl <<
"-" << endl;
85 cout <<
" : " << hm.count() <<
" hit(s)" << endl;
86 for (
unsigned j = 0; j < 5; j++) {
87 unsigned left = 256 + 5 - (4 - j) * 16;
88 if (j % 2) cout <<
" ";
89 for (
unsigned i = 0; i < 16; i++) {
90 cout << l[left - (16 - i)] <<
" ";
98 cout << NAME <<
" ... terminated" << endl;
Abstract base class for different kinds of events.