#include "AltroCommandCoder.h" #include "BoardControllerCommandCoder.h" #include "RCUCommandCoder.h" int main( int argc, char** argv ) { long long res; cout.setf( ios::hex, ios::basefield ); AltroCommandCoder *altro = new AltroCommandCoder(); BoardControlerCommandCoder *bc = new BoardControlerCommandCoder(); RCUCommandCoder *rcu = new RCUCommandCoder(); cout << "=======================================" << endl; res = rcu->sendAltroInstruction(altro->sendTRCFG(altro->codeTRCFG(0, 1000))); cout << "0x" << (res>>32) << endl; cout << "0x" << (res&0xFFFFFFFF) << endl; res = rcu->sendAltroInstruction(altro->sendZSTHR(altro->codeZSTHR(0, 3))); cout << "0x" << (res>>32) << endl; cout << "0x" << (res&0xFFFFFFFF) << endl; res = rcu->sendAltroInstruction(altro->sendDPCFG(altro->codeDPCFG(altro->codeZS_CFG(0, 0, 0, 1), altro->codeBC2_CFG(0, 0, 0), altro->codeBC1_CFG(0, 0) ) ) ); cout << "0x" << (res>>32) << endl; cout << "0x" << (res&0xFFFFFFFF) << endl; cout << "0x" << rcu->sendAltroReadInstruction(altro->receiveK1(1,11,7,15)) << endl; cout << "0x" << rcu->sendAltroReadInstruction(altro->receiveL3(1,11,7,15)) << endl; cout << "0x" << rcu->sendEND() << endl; cout << "0x" << rcu->codeALTROIF(1, 3, 1, 1000) << endl; delete rcu; rcu = new RCUCommandCoder(); cout << "=======================================" << endl; res = rcu->sendAltroInstruction(altro->sendTRCFG(altro->codeTRCFG(0, 1000))); cout << "0x" << (res>>32) << endl; cout << "0x" << (res&0xFFFFFFFF) << endl; res = rcu->sendAltroInstruction(altro->sendZSTHR(altro->codeZSTHR(0, 3))); cout << "0x" << (res>>32) << endl; cout << "0x" << (res&0xFFFFFFFF) << endl; res = rcu->sendAltroInstruction(altro->sendDPCFG(altro->codeDPCFG(altro->codeZS_CFG(0, 0, 0, 1), altro->codeBC2_CFG(0, 0, 0), altro->codeBC1_CFG(0, 0) ))); cout << "0x" << (res>>32) << endl; cout << "0x" << (res&0xFFFFFFFF) << endl; cout << "0x" << rcu->sendAltroReadInstruction(altro->receiveK1(1,11,7,15)) << endl; cout << "0x" << rcu->sendAltroReadInstruction(altro->receiveL3(1,11,7,15)) << endl; cout << "0x" << rcu->sendEND() << endl; cout << "0x" << rcu->codeALTROIF(1, 3, 1, 1000) << endl; cout << "0x" << rcu->codeTRGCONF(2) << endl; cout << "0x" << rcu->codeRDOMOD(0, 1, 0) << endl; cout << "=======================================" << endl; res = rcu->sendBoardControllerInstruction(bc->sendCSR1(1, 2, 0xaa)); cout << "0x" << (res>>32) << endl; cout << "0x" << (res&0xFFFFFFFF) << endl; delete rcu; rcu = 0; delete altro; altro = 0; delete bc; bc = 0; }