URL
https://opencores.org/ocsvn/lxp32/lxp32/trunk
Subversion Repositories lxp32
[/] [lxp32/] [trunk/] [verify/] [lxp32/] [src/] [firmware/] [test015.asm] - Rev 9
Compare with Previous | Blame | View Log
/** Test unconventional interrupt handlers*/lc r100, 0x10000000 // test result output pointerlc r101, haltlc r102, 0x30000000 // coprocessor input registerlc r103, 0x30000004 // coprocessor output registerlc r104, failure// Initialize interrupt handlerslc iv2, coprocessor_handlermov cr, 4 // enable interrupts from the coprocessorlc r110, interrupt_exit@1 // '1' in the LSB is an interrupt exit flag// Initialize random generatormov r64, 1 // initial PRBS valuelc r65, 1103515245 // PRBS multiplierlc r66, 12345 // PRBS addition constantlc r67, 32767 // PRBS mask// Main looplc r32, looplc r33, randlc r34, 2000loop:call r33cjmpe r32, r0, 0 // if(r==0) continue;sw r102, r0hltinterrupt_exit:lw r1, r103mul r0, r0, 3cjmpne r104, r0, r1 // failuresub r34, r34, 1cjmpug r32, r34, 0 // loopsw r100, 1jmp r101 // haltfailure:sw r100, 2halt:hltjmp r101 // haltrand:mul r64, r64, r65add r64, r64, r66sru r0, r64, 16and r0, r0, r67retcoprocessor_handler:jmp r110 // exit to a given point, ignore irp
