ECSE436 Tutorial Assembly and Linear Assembly Laurier Boulianne.

Slides:



Advertisements
Similar presentations
Chapter 7 Linear Assembly
Advertisements

FIR Filter. C-Implementation (FIR filter) #include #include #include "coeff_ccs_16int.h" int in_buffer[300]; int out_buffer[300]; #define TRUE 1 /*Function.
Systems and Technology Group © 2006 IBM Corporation Cell Programming Tutorial - JHD24 May 2006 Cell Programming Tutorial Jeff Derby, Senior Technical Staff.
Details.L and.S units TMS320C6000 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004.
TMS320C6000 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004 Architectural Overview.
Lecture 9: MIPS Instruction Set
TMS320C6713 Assembly Language (cont’d). Module 1 Exam (solution) 1. Functional Units a. How many can perform an ADD? Name them. a. How many can perform.
Lecture 6 Programming the TMS320C6x Family of DSPs.
Superscalar and VLIW Architectures Miodrag Bolic CEG3151.
Assembly and Linear Assembly Evgeny Kirshin, 05/10/2011
TMS320C6000 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004 Architectural Overview.
1 Lecture 5: Static ILP Basics Topics: loop unrolling, VLIW (Sections 2.1 – 2.2)
Computer Architecture Lecture 7 Compiler Considerations and Optimizations.
Chapter 2 — Instructions: Language of the Computer — 1 Branching Far Away If branch target is too far to encode with 16-bit offset, assembler rewrites.
TMS320C6000 Architectural and Programming Overview.
1 Chapter 3 Jump, Loop, and Call Instructions. 2 Sections 3.1 Loop and Jump Instructions 3.2 Call Instructions 3.3 Time Delay Generation and Calculation.
Computer Architecture CSCE 350
TMS320C6000 Architectural Overview.  Describe C6000 CPU architecture.  Introduce some basic instructions.  Describe the C6000 memory map.  Provide.
The University of Adelaide, School of Computer Science
ECSE DSP architecture Review of basic computer architecture concepts C6000 architecture: VLIW Principle and Scheduling Addressing Assembly and linear.
The Little man computer
C66x CorePac: Achieving High Performance. Agenda 1.CorePac Architecture 2.Single Instruction Multiple Data (SIMD) 3.Memory Access 4.Pipeline Concept.
1 Lecture: Pipeline Wrap-Up and Static ILP Topics: multi-cycle instructions, precise exceptions, deep pipelines, compiler scheduling, loop unrolling, software.
Chapter 6 In introduction to System Software and Virtual Machine ***Assembly Language.
Computer System Overview
Choice for the rest of the semester New Plan –assembler and machine language –Operating systems Process scheduling Memory management File system Optimization.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.
© 2008 Wayne Wolf Overheads for Computers as Components 2nd ed. TI C55x instruction set C55x programming model. C55x assembly language. C55x memory organization.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Chapter 7 Linear Assembly. Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 7, Slide 2 Learning Objectives  Comparison of programming.
ECE 353 ECE 353 Fall 2007 Lab 3 Machine Simulator November 1, 2007.
9/20/6Lecture 21 -PIC Architecture1 PIC Architecture Programmers Model and Instruction Set.
CHAPTER 2 ISA Instructions (logical + procedure call)
Programmer's view on Computer Architecture by Istvan Haller.
Edited By Miss Sarwat Iqbal (FUUAST) Last updated:21/1/13
Understanding the TigerSHARC ALU pipeline Determining the speed of one stage of IIR filter – Part 3 Understanding the memory pipeline issues.
6-1 Chapter 6 - Languages and the Machine Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer.
CS 320 Assignment 1 Rewriting the MISC Osystem class to support loading machine language programs at addresses other than 0 1.
DSP Processors We have seen that the Multiply and Accumulate (MAC) operation is very prevalent in DSP computation computation of energy MA filters AR filters.
Averaging Filter Comparing performance of C++ and ‘our’ ASM Example of program development on SHARC using C++ and assembly Planned for Tuesday 7 rd October.
ajay patil 1 TMS320C6000 Assembly Language and its Rules Assignment One of the simplest operations in C is to assign a constant to a variable: One.
MICROPROCESSORS Dr. Hugh Blanton ENTC TMS320C6x INSTRUCTION SET.
Blackfin Array Handling Part 1 Making an array of Zeros void MakeZeroASM(int foo[ ], int N);
17 - Jumps & Branches. The PC PC marks next location in Fetch, Decode, Execute cycle.
Introduction to the C6713 Laurier Boulianne
© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.
ALU (Continued) Computer Architecture (Fall 2006).
A first attempt at learning about optimizing the TigerSHARC code TigerSHARC assembly syntax.
Computer Organization Instructions Language of The Computer (MIPS) 2.
The Little man computer
Computer Science 210 Computer Organization
Chapter 7 Assembly Language
Chapter 7 Linear Assembly
William Stallings Computer Organization and Architecture 8th Edition
Protection of System Resources
Overheads for Computers as Components 2nd ed.
Chapter 7 Assembly Language
Details .L and .S units TMS320C6000.
Computer Science 210 Computer Organization
Chap. 6 Programming the Basic Computer
Chapter 17 Goertzel Algorithm
EECE.3170 Microprocessor Systems Design I
EECE.3170 Microprocessor Systems Design I
Chapter 7 Assembly Language
TI C6701 VLIW MIMD.
MARIE: An Introduction to a Simple Computer
Chapter 12 Software Optimisation
Superscalar and VLIW Architectures
Overheads for Computers as Components 2nd ed.
Instruction execution and ALU
Presentation transcript:

ECSE436 Tutorial Assembly and Linear Assembly Laurier Boulianne

L. Boulianne Questions

L. Boulianne Outline Introduction to Assembly Linear Assembly AMR Reading

L. Boulianne TMS320 Assemby Language

L. Boulianne C6000 ISA

L. Boulianne Instruction Packing

L. Boulianne Sample Instructions

L. Boulianne Sample Instruction

L. Boulianne Instruction List

L. Boulianne Instruction List

L. Boulianne C program calling and ASM function

L. Boulianne C program calling and ASM function -Values passed to the assembly functions using registers : A4,B4,A6,B6 and so on -Only registers A1,A2,B0,B1,B2 can be used as conditional registers -B3 contain the return address -A4 is the return value -Need to take into account the NOP

L. Boulianne Linear Assembly To effectively program a DSP using assembly language, you need to do the scheduling by hand! Need to account for the number of clock cycles each functional unit takes, etc… Difficult, so TI has linear assembly –you don’t have to schedule it, the compiler does it for you –can use CPU resources without worrying about scheduling, register allocation, etc…

L. Boulianne What is Linear Assembly ? Enables you write assembly-like programs Do not have to worry about : Register usage Pipelining Delay slots etc.

L. Boulianne What is Linear Assembly ? C code TI Linear Assembly Assembly Efficiency Ease of use

L. Boulianne What is Linear Assembly ? It is a cross between C and Assembly It lets you : use symbolic names forget pipeline issues ignore putting NOPs parallel bars functional units register names more efficiently use CPU resources than C

L. Boulianne Linear Assembly Extension in c is.c Extension in linear assembly is.sa

L. Boulianne Example Dot Product From Chassaing //DOTPclasm.c short dotp4clasmfunc(short *a, short *b, short ncount); #include #define count 4 short x[count] = {0,1,2,3}; short y[count] = {100, -20, 30, -20}; volatile int result = 0; main() { result = dotp4clasmfunc(x,y,count); printf("result = %d decimal \n", result); } Function written in LASM

L. Boulianne.def_dotp4clasmfunc _dotp4clasmfunc:.cproc ap, bp, count.reg a, b, prod, sum zero sum loop:ldh *ap++,a ldh*bp++,b mpya,b,prod addprod,sum,sum subcount,1,count [count]bloop.returnsum.endproc The LASM code Example Dot Product From Chassaing

L. Boulianne.def_dotp4clasmfunc Define and ASM function called from C Start a section of Linear assembly _dotp4clasmfunc:.cproc ap, bp, count Name of the function Arguments of the function Set up your variables (similar to C).reg a, b, prod, sum Example Dot Product From Chassaing

L. Boulianne zero sum Initialize your sum to zero Load the value from memory pointed by ap, copy it to register a and increment the pointer by 1 ldh *ap++,a Do the same thing with b ldh*bp++,b ldh stands for load half word (a short in C) Example Dot Product From Chassaing

L. Boulianne Multiply a and b and write the result to prod mpya,b,prod Add sum and prod and write the result to sum addprod,sum,sum Decrement count by 1 subcount,1,count Example Dot Product From Chassaing

L. Boulianne If count is different than 0, branch to loop Return sum as the output of your function (exactly Like the return command in C) End linear assembly function.endproc [count]bloop.returnsum Example Dot Product From Chassaing

L. Boulianne Circular Addressing

L. Boulianne AMR Addressing mode register Read Chassaing at pages : 82-83

L. Boulianne AMR Addressing mode register

L. Boulianne AMR Addressing mode register How to modify the AMR ? MVKL.S20x0004,B2 MVKH.S20x0005,B2 MVC.S2B2,AMR MVC is the only function which can modify the content of a control register Be sure to reset the AMR at the end of your function Also, do the same inside your interrupt routine, check SPRU 187 to know how to modify the AMR from C There is a good example on how AMR works in SPRU189 at page 97-98

L. Boulianne For more Information Read Chaissaing at pages : and Read Kuo and Gan at pages : Read TMS320C6000 Optimizing Compiler User's Guide : Chapter 4 (SPRU187) It contains the description of the directives (.trip,.cprog,.reg, etc.) Read TMS320C6000 CPU and Instruction Set Reference Guide (SPRU189) It contains the description of the instruction set (add, mpy, sub, mv, etc.)

L. Boulianne Questions ?