#include #include #include #include #include #include #include #include #include //#include #include "abi_functions.h" #include "rcu2_functions.h" //========================================================================================== //========================================================================================== //========================================================================================== int main(int argc, char ** argv) { unsigned int address, branch, result; unsigned int verbose = 0; // Init bus (command mode) /* rbm_init( verbose ); // ABI control for (branch=0; branch<4; branch++) { rbm_write(get_Address_ABI_SEL(branch), 0x1, verbose); } usleep(100000); unsigned int fec = 1; unsigned int altro; unsigned int channel; */ /* // DDL messages for ALTRO transaction testing branch = 0; for (altro=0; altro<2; altro++) { for (channel=0; channel<16; channel++) { printf("0x%08X\n", 1<<20 | get_Address_ABI_TX_L(branch)); // Write ALTRO TX L for branch 0 printf("0x%08X\n", altro<<4 | channel); // Some test data printf("0x%08X\n", 1<<20 | get_Address_ABI_TX_H(branch)); // Write ALTRO TX H for branch 0 printf("0x%08X\n", genAltroAddr(0, fec, altro, channel, 0x6)); //printf("0x%08X\n", genAltroAddrHwAddr(0, hwaddr, 0x6)); printf("0x%08X\n", 1<<20 | get_Address_ABI_CSR(branch)); // Write ALTRO CSR for branch 0 printf("0x%08X\n", CMD_ALTRO_WR); printf("0x%08X\n", 5<<20 | 32); // WAIT 32 clock cycles printf("0x%08X\n", 0<<20 | get_Address_ABI_CSR(branch)); // Read ALTRO CSR for branch 0 } } */ // DDL messages for DDL testing // 0) Access printf("0x%08X\n", 1<<20 | get_Address_ROLM_SEL(0)); printf("0x%08X\n", 0x1); // Get access // 1) WRITE int ctr; for (ctr=0; ctr<256; ctr++) { printf("0x%08X\n", 1<<20 | get_Address_ROLM(0)+ctr); printf("0x%08X\n", ctr); // Some test data } // 2) READ for (ctr=0; ctr<256; ctr++) { printf("0x%08X\n", 0<<20 | get_Address_ROLM(0)+ctr); } /* branch = 0; //altro_write(branch, genAltroAddr(0, fec, altro, channel, 0x6), 0x3AB, verbose); //usleep(100); for (altro=0; altro<2; altro++) { for (channel=0; channel<16; channel++) { altro_read(branch, genAltroAddr(0, fec, altro, channel, 0x6), &result, verbose); printf("FEC%02d, altro%d, channel%02d: VFPED=0x%08X\n", fec, altro, channel, result&0xfffff); } } // DONE! if (verbose > 1) printf("Give back control of the ABI to fabric ...\n"); for (branch=0; branch<4; branch++) { rbm_write(get_Address_ABI_SEL(branch), 0, verbose); } rbm_direct( verbose ); // Set RBM back to dirtect mode (for feeserver and buspoke) */ return 0; }