<< 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

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.
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
sciencedirect big data base
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
what is biological synthesis of nanoparticles
Sanket Reply
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?