<< Chapter < Page Chapter >> Page >
This module is an exercise to implement FIR filters using TI linear assembly on TMS320C62x.

Fir filter implementation in ti linear assembly

What is linear assembly?

TI's linear assembly language enables you to write an assembly-like programs without worrying about register usage, pipelining, delayslots, etc. The assembler optimizer program reads the linear assembly code to figure out the algorithm, and then it producesan optimized list of assembly code to perform the operations. The linear assembly programming lets you:

  • use symbolic names,
  • forget pipeline issues,
  • ignore putting NOPs, parallel bars, functional units, register names,
  • more efficiently use CPU resources than C.

The linear assembly files have .sa extensions. When you have a linear assembly file in your Code Composer Studio project, the assembly optimizer isinvoked automatically to generate optimized actual assembly routine. You can consider the linear assemblylanguage as a tool to describe algorithms. To effectively convey the intent of the programmer to the assemblyoptimizer for proper optimization, there are quite a few extra directives in linear assembly.

C callable linear assembly procedure

The following is an example of C callable linear assembly routine that computes the dot product of two vectors. Itimplements a C function

short dotp(short* a, short* x, int count);

If a[] and x[] are two length-40 vectors, the C function call has the form

short a[]; short x[]; short z; ... ... z = dotp(a,x,40); ...

(see below how the arguments are passed and the pointers are used.) In the following, you learn various assembler directivesused below and how the optimized assembly code is generated by the assembler optimizer.

_dotp: .cproc ap,xp,cnt .reg a,x,prod,y MVK 40,cnt loop: .trip 40 LDH *ap++,a LDH *ax++,x MPY a,x,prod ADD y,prod,y SUB cnt,1,cnt [cnt] B loop .return y .endproc

The .cproc directive starts a C callable procedure. It must be used with .endproc to end a C procedure. _dotp: is the label used to name the procedure. By using .cproc to start the procedure, the assembly optimizer performs someoperations automatically in a .cproc region in order to make the function conform to the C callingconventions and to C register usage convention. The following optional variables ( ap,xp,cnt above) represent function parameters. The variable entries are very similar to parameters declared in a C function.

The arguments to the .cproc directive can be either machine-register names or symbolic names. Whenregister names are specified, its position in the argument list must correspond to the argument passing conventionsfor C. For example, the first argument in C function must be register A4. When symbolic names are specified, theassembly optimizer ensures proper allocation and initialization (if necessary) of registers at thebeginning of the procedure. To represent a 40-bit argument, a register pair can be specified as anargument. In this lab, however, we only use 32bit values as arguments.

The .reg directive allows you to use descriptive names for values that will be stored in registers. It isvalid only within procedures only.

The .return directive functionality is equivalent to the return statement in C code. It placesthe optional argument in the appropriate register for a return value as per the C calling conventions. If noargument is specified, no value is returned, similar to a void function in C code. To perform a conditional .return , you can simply put conditional branch around a .return as:

[!cc] B around .return around:

The .trip directive specifies the value of the trip count. The trip count indicates how many times a loop will iterate. By giving this extra information to the assembler optimizer, abetter optimization is achieved for loops. The label preceding .trip directive represents the beginning of the loop. This is a required parameter.

For more information on writing C callable linear assembly procedure, refer to TMS320C6x Optimizing C Compiler User's Guide . For C6x assembly instructions, refer to TMS320C62x/C67x CPU and Instruction Set Reference Guide .

Write a C callable FIR filtering routine in linear assembly. When using different optimization levels, what is the numberof clock cycles of each FIR filtering?

Questions & Answers

where we get a research paper on Nano chemistry....?
Maira Reply
what are the products of Nano chemistry?
Maira Reply
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Preparation and Applications of Nanomaterial for Drug Delivery
Hafiz Reply
Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
Jyoti Reply
I only see partial conversation and what's the question here!
Crow Reply
what about nanotechnology for water purification
RAW Reply
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
yes that's correct
I think
Nasa has use it in the 60's, copper as water purification in the moon travel.
nanocopper obvius
what is the stm
Brian Reply
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
scanning tunneling microscope
how nano science is used for hydrophobicity
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
what is differents between GO and RGO?
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
analytical skills graphene is prepared to kill any type viruses .
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
The nanotechnology is as new science, to scale nanometric
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
where are the solutions?
where are the solutions?

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Finite impulse response. OpenStax CNX. Feb 16, 2004 Download for free at http://cnx.org/content/col10226/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Finite impulse response' conversation and receive update notifications?