Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).
|
hi, Im working on adsp-2181 using VDSP++ 3.0. To get data from a file we can use .var d1[10]="coeff.dat"; when programming in assembly. I would like to do the same in C. previous versions used the format int dm d1[10]={ #include "coeff.dat" }; but the compiler is giving errors. ANY ideas? |
|
|
|
Hi,
The syntax is the same but u have to make the coeff file in
the following format
1,2,3,4,5,6,7
instead of the usual newline terminated format
1
2
3
4
5
6
7
Regards,
Ali Irfan Ahmed.
|
|
Try to insert this line in your C code as an Assembly line with the "asm" command: asm(".var d1[10]="coeff.dat"); ----- Original Message ----- From: <> To: <> Sent: Friday, January 17, 2003 9:58 AM Subject: [adsp] help on adsp-2181 needed > hi, > Im working on adsp-2181 using VDSP++ 3.0. > To get data from a file we can use > .var d1[10]="coeff.dat"; > > when programming in assembly. I would like to do the same in C. > > previous versions used the format > > int dm d1[10]={ > #include "coeff.dat" > }; > but the compiler is giving errors. > > ANY ideas? > > > _____________________________________ > /groups.php3 |
|
Hi, I am just adding more to this solution. Doing so will not make ur variable visible to "C" code. the correct way to do so will be asm(".global _d1; .var _d1[10]="coeff.dat"); Now to access this variable in any C file declare it as .extern int d1[]; and access the array as usual and in assembly file as .extern _d1. and access the variable as _d1. the leading underscore in the name of the variable is usual way for ANSI C compiler to mangle the name of global variable. C++ compiler uses a different type of mangaling. So it will be better if u use the other format int d1[10] = { "#include coeff.dat;" }; with comma delimited file for coeff.dat as this will keep ur code compatible to C and C++ compiler. Regards, Ali Irfan Ahmed. ----- Original Message ----- From: Federico Zandanel To: ; Sent: Saturday, January 18, 2003 9:36 PM Subject: Re: [adsp] help on adsp-2181 needed Try to insert this line in your C code as an Assembly line with the "asm" command: asm(".var d1[10]="coeff.dat"); ----- Original Message ----- From: <> To: <> Sent: Friday, January 17, 2003 9:58 AM Subject: [adsp] help on adsp-2181 needed > hi, > Im working on adsp-2181 using VDSP++ 3.0. > To get data from a file we can use > .var d1[10]="coeff.dat"; > > when programming in assembly. I would like to do the same in C. > > previous versions used the format > > int dm d1[10]={ > #include "coeff.dat" > }; > but the compiler is giving errors. > > ANY ideas? > > > _____________________________________ > /groups.php3 _____________________________________ /groups.php3 |