Specifications
44 TMS320C6457 Fixed-Point Digital Signal Processor Silicon Errata SPRZ293A—November 2009
Appendix A—Code Examples
www.ti.com
Silicon Revisions 1.0, 1.1, 1.2, 1.3, 1.4 Submit Documentation Feedback
IDMA Channel 1 Block Copy Routine idma1_util.asm
;; ======================================================================== ;;
;; TEXAS INSTRUMENTS INC. ;;
;; ;;
;; Block Copy with IDMA Channel 1 ;;
;; ;;
;; REVISION HISTORY ;;
;; 13-Feb-2009 Initial version . . . . . . . . . . . J. Zbiciak ;;
;; ;;
;; DESCRIPTION ;;
;; The following macro functions are defined in this file: ;;
;; ;;
;; idma1_copy(void *dst, void *src, int word_count) ;;
;; idma1_wait(IDMA_PEND or IDMA_ACTV) ;;
;; ;;
;; NOTE: The last arg is WORD count, not byte count. 1 word = 4 bytes. ;;
;; ;;
;; ------------------------------------------------------------------------ ;;
;; Copyright (c) 2009 Texas Instruments, Incorporated. ;;
;; All Rights Reserved. ;;
;; ======================================================================== ;;
.asg 0x01820100, IDMA1_STATUS
.asg 0x01820108, IDMA1_SOURCE
.asg 0x0182010C, IDMA1_DEST
.asg 0x01820110, IDMA1_COUNT
.asg 0x01820100, IDMA1_BASE
.asg (IDMA1_STATUS - IDMA1_BASE), OFS_IDMA1_STATUS
.asg (IDMA1_SOURCE - IDMA1_BASE), OFS_IDMA1_SOURCE
.asg (IDMA1_DEST - IDMA1_BASE), OFS_IDMA1_DEST
.asg (IDMA1_COUNT - IDMA1_BASE), OFS_IDMA1_COUNT
;; ------------------------------------------------------------------------ ;;
;; IDMA1_COPY: Copy a block of words to dst from src with IDMA channel 1 ;;
;; ;;
;; USAGE ;;
;; idma1_copy( <dest address>, <source address>, <word count>) ;;
;; ;;
;; Both source and destination addresses must be word aligned. ;;
;; ;;
;; The IDMA gets issued at top priority. Only bits 13:0 of the word ;;
;; count are significant. ;;
;; ------------------------------------------------------------------------ ;;
.global _idma1_copy
.asmfunc
_idma1_copy:
; Point to IDMA channel 1's base
RET B3 ; return; also protect from interrupts
|| MVKL IDMA1_SOURCE, A7
MVKH IDMA1_SOURCE, A7
; Write second argument to "source" register
STW B4, *A7++(IDMA1_DEST - IDMA1_SOURCE)
; Write first argument to "destination" register
STW A4, *A7++(IDMA1_COUNT - IDMA1_DEST)
; Write last argument to "count" register.
EXTU A6, 18, 16, A6 ; truncate word count to 14 bits
STW A6, *A7
.endasmfunc
;; ------------------------------------------------------------------------ ;;
;; IDMA1_WAIT: Wait for IDMA "pend" or "actv" slot to free up. ;;
;; ;;
;; USAGE ;;
;; idma1_wait(IDMA_PEND) Waits for just PEND to be 0 ;;
;; idma1_wait(IDMA_ACTV) Waits for ACTV (and PEND) to be 0 ;;
;; ;;
;; NOTE ;;
;; IDMA_PEND = 2 ;;
;; IDMA_ACTV = 3 ;;
;; ;;
;; ------------------------------------------------------------------------ ;;
.global _idma1_wait
.asmfunc
_idma1_wait:
MVKL IDMA1_STATUS, A6
MVKH IDMA1_STATUS, A6
|| MVK 1, A0
loop?:










