PROCESSEUR DE TRAITEMENT NUMERIQUE DU SIGNAL DIGITAL SIGNAL PROCESSOR Département de Physique Faculté des Sciences Option : InfoTronique Email:[email protected] Plan du cours Chapitre 1. INTRODUCTION ET GENERALITES SUR LES DSP Chapitre 2. ARITHMETIQUE EN PRECISION FINIE FORMAT FIXE OU FORMAT FLOTTANT Chapitre 3. ARCHITECTURE DE LA FAMILLE TMS320C54X Chapitre 4. LES PÉRIPHÉRIQUES Chapitre 5. ASSEMBLEUR Chapitre 6. MÉTHODOLOGIE ET OUTILS DE DÉVELOPPEMENT D’APPLICATION SUR DSP Syntaxe de l’Assembleur Un programme exécuté par la CPU est un ensemble de lignes d’instructions stocké en mémoire Îensemble de ces codes binaires le code machine. code d’opération + opérandes OpCode opérandes 1 ou 2 W Syntaxe de l’Assembleur opérandes adresses en mémoires contenant des données à manipuler, registres internes du CPU, des constantes… Syntaxe de l’Assembleur Jeu d'instruction L'ensemble des instructions que la CPU peut exécuter Syntaxe de l’Assembleur Langage Assembleur Mnémoniques Représentation textuelle du code opération Langage machine Code machine Représentation binaire physique en mémoire Assembleur Syntaxe de l’Assembleur Format d’une ligne d’instruction Étiquette: instruction arg1, arg2 [,…] ;commentaire Syntaxe de l’Assembleur Designation des arguments Src dst ARx ASM C CC [D] DAB EAB Dmad DP FRCT Lk Kn Lmem MMR MMRx, MMRy OVA,OVB PA PC Pmad Pmem [R] Sind Smem SP Cond Mem,<add> Xmem,Ymem Exemple1: Code filtre y0 = a0x0 + a1x1 + a2x2 + a3x3 MAC y = a0x0 + a1x1 + a2x2 + a3x3 FIR.asm fir: math: MAC *AR2+,*AR3+,A Deux méthode pour calculer Y : 1. Multiplier , ensuite additionner MPY *AR2+, *AR3+, B ADD B,A ... 2. Multipler/Accumuler MAC *AR2+, *AR3+, A ... done: Adressage indirect, double opérandes Sauvegarde en MMR FIR.asm fir: Initialisation des pointeurs STM #a,AR2 STM #x,AR3 STM math: MAC *AR2+,*AR3+,A done: sauvegarder #valeur dans les MMR Chargement FIR.asm fir: Initialisation accumulateur STM #a,AR2 STM #x,AR3 LD math: MAC *AR2+,*AR3+,A LD #0,A done: Sauvegarder le résultat en mémoire FIR.asm fir: Sauvegarde du résultat STM #a,AR2 STM #x,AR3 STL math: MAC *AR2+,*AR3+,A LD #0,A STL A, *(y) done: Sauvegarder le résultat en mémoire Exécuter l’ instruction suivante n+1 fois FIR.asm fir: STM #a,AR2 STM #x,AR3 RPT #3 math: MAC *AR2+,*AR3+,A LD #0,A 1. RPT #n 2. RPT Smem 3. RPTZ src, #n RC:compteur de repetition ! Non interruptible STL A, *(y) ! RPTZ : ACC=0 avant la répétition MVDM MVKD MACD MVMD MVDK MACP MVDP MVPD READA WRITA FIRS done: Déplacement de mémoire en memoire FIR.asm fir: STM #a, AR2 RPT #3 MVPD #table,*AR2+ STM #a,AR2 STM #x,AR3 Copie d’une case mémoire a une autre RPT #3 math: MAC *AR2+,*AR3+,A LD #0,A STL A, *(y) MVPD #pmad, Smem PC=? Appel Appel a la subroutines FIR.asm fir: STM #a, AR2 RPT #3 MVPD #table,*AR2+ STM #a,AR2 STM #x,AR3 RPT #3 math: MAC *AR2+,*AR3+,A LD #0,A STL A, *(y) CALL fir RET Autres instructions B next BACC src CALA src BC next,cnd, CC next,cnd, RC cnd, done: RET Cnd: EQ,NEQ,LEQ,GEQ,LT,GT,OV,NOV La pile *.ASM size .set 100h stack .usect "STK",size .sect “code” STM #stack+size,SP *.CMD MEMORY { PAGE 1: STKRAM: org=3F00h len=0100h } SECTIONS { STK :> STKRAM PAGE 1 }