A SERVICE OF

logo

www.ti.com
FIR_Config FIR;
FIR_init();
FIR_exit();
FIR_create();
FIR
firObject
Creates firObject
FIR
FIR_create();
Creates
firObject
Int length;
Int coeff[];
Int delay[];
Read-only
coefficient array
Filter input
history buffer
3.1.5Design-TimeObjectCreation
3.1.6Run-TimeObjectCreationandDeletion
InterfacesandModules
Figure3-2.ModuleObjectCreation
Figure3-3illustratesanobjectappropriateforafiniteimpulseresponsefilterimplementedbyamodule
namedFIR.
Figure3-3.ExampleModuleObject
Manyembeddedsystemsareverystaticinnature;memory,MIPS,andI/Operipheralsarestatically
partitionedamongafixedsetoffunctionsthatoperatecontinuouslyuntilpowerisremoved.Staticsystems
admitanumberofperformanceoptimizationsthatsimplyarenotpossibleindynamicsystems.For
example,thereisnoneedforamemorymanagerinastaticsystemandgeneraldatastructures,suchas
linkedlists,canbeoftenreplacedwithmuchsimplerandmoreefficientstructures,suchasfixedlength
arrays.Theseoptimizationsnotonlyreducethesystem'sCodesizerequirements;theymayalsohavea
significanteffectontheexecutionperformanceofthesystem.
Whendesigningasystemthatisverycostsensitive,mustoperatewithlimitedpower,orhaslimitedMIPS,
designerslookforportionsofthesystemthatcanbefixedatdesigntime(i.e.,madestatic).Evenifthe
entiresystemcannotbestatic,oftencertainsub-systemscanbefixedatdesigntime.Itisimportant,
therefore,thatallmodulesefficientlysupportstaticsystemdesigns.
Guideline3
Allmodulesthatsupportobjectcreationshouldsupportdesign-timeobjectcreation.
Inpractice,thissimplymeansthatallfunctionsthatareonlyrequiredforrun-timeobjectcreationbe
placedeitherinseparatecompilationunitsorseparateCOFFoutputsectionsthatcanbemanipulatedby
thelinker.Ideally,everyfunctionshouldbeinaseparatecompilationunit.Thisallowsthesystem
integratortoeliminaterun-timesupportthatisunnecessaryforastaticsystem.
Modulesmayoptionallysupportrun-timeobjectcreationanddeletion.Insomeapplications,run-time
creationanddeletionisarequirement.Forexample,withouttheabilitytoremoveunneededobjectsand
reusememory,thephysicalconstraintsofthesystemmakeitimpossibletocreaterichmulti-function
applications.
Run-timecreationofobjectsisvaluableeveninsystemsthatdonotsupportorrequirerun-timedeletionof
theseobjects.Theprecisenatureoftheobjects,thenumberofobjects,andeventhetypeofobjects
createdmaybeafunctionofparametersthatareonlyavailableatrun-time.Forexample,youmaywantto
createasingleprogramthatworksinavarietyofhardwareplatformsthatdifferintheamountofmemory
availableandthisamountisdeterminableatrun-time.
SPRU352GJune2005RevisedFebruary2007AlgorithmComponentModel29
SubmitDocumentationFeedback