VDS Users Guide
VDS Users Guide
Users Guide
Prepared by
Arin George, Denise Nguyen, Hanzi Yang, Sabrina Hames, & Trinh Dinh
Page 1/142
\\SNORT\C\Trinh\Documentations\VDSDocumentationNov02.doc
VDS (VoP Development System) Users Guide
TABLE OF CONTENTS
1. INTRODUCTION..................................................................................................................... 6
1.1 Documentation................................................................................................................. 6
1.1.1 DirectDSP Documentation....................................................................................... 6
1.1.2 Algorithm IDE Software .......................................................................................... 6
1.1.3 External Help Files ................................................................................................... 6
2. HARDWARE............................................................................................................................. 7
4. SOFTWARE OPERATION................................................................................................... 17
Page 2 / 142
VDS (VoP Development System) Users Guide
Page 3 / 142
VDS (VoP Development System) Users Guide
Page 4 / 142
VDS (VoP Development System) Users Guide
TABLE OF FIGURES:
Page 5 / 142
1. Introduction
1.1 Documentation
For general documentation for DirectDSP software, please look in the help files included on the
distribution CD or available after installation in the "Signalogic DSP Software" folder or group.
Select the help icon "Reference Guide"; from table of contents select "Function Reference", then
"DLL Functions", then "Hardware Library". Note that functions are presented in the
documentation with C/C++ syntax, but are very similar to their counterparts when called in
Visual Basic or MATLAB format. Specifically, in MATLAB, functions are most often the same
except without the "DS" prefix. For MATLAB reference, the .m example files are always the
best source. For Visual Basic, function names are identical, but calling parameter format can
sometimes vary; please refer to the files hwlib.bas, enmgr.bas, and hwmgr.bas, located on
(default installation) subdirectory \dspower\hwlib\vb.
Page 6/142
\\SNORT\C\Trinh\Documentations\VDSDocumentationNov02.doc
VDS (VoP Development System) Users Guide
2. Hardware
2.1 SigC54xx-PC/104 board
2) Make sure that there is an audio module and a SigC54xx DSP module inserted into the
appropriate sockets on the PC104 card. Normally the SigC54xx module is inserted in the
module site closest to the host connector (site labeled "Module #1" on the board)
3) Make sure the I/O base address is set to 0x320. This is done by setting the rotary hex switch
on the PC/104 board to “2”.
4) Mount the SigC54xx-PC/104 board on a "Passive Carrier Card" (see Figure 2-1 below).
5) Plug the carrier card into an available 16-bit ISA slot inside the host machine.
Page 7 / 140
VDS (VoP Development System) Users Guide
2) Make sure that there is an audio module and a SigC67xx DSP module inserted into the
appropriate sockets on the PC104 card. Normally the SigC67xx module is inserted in the
module site closest to the host connector (site labeled "Module #1" on the board)
3) Make sure the I/O base address is set to 0x320. This is done by setting the rotary hex switch
on the PC/104 board to “2”.
4) Mount the SigC67xx-PC/104 board on a "Passive Carrier Card" (see Figure 2-2 below).
5) Plug the carrier card into an available 16-bit ISA slot inside the host machine.
6) Power up the host machine.
Page 8 / 140
VDS (VoP Development System) Users Guide
then the default 2.5v voltage regulator used on the board is not capable enough. If this becomes
a problem, please contact Signalogic for a suggested replacement component that can handle
more current.
Note that a center-positive adapter is absolutely required. There is no bridge circuit on the
SigC54xx Development System board; use of a center-negative adapter could cause damage to
board components, and should be avoided. Note also that a 6v adapter is the maximum limit.
Adapters with output voltages higher than this should not be used, as they may place excessive
strain on the 3.3v and not consistent with cap V used later (or 1.8v) core-voltage regulators on
the board.
2) Make sure that there is an audio module and a SigC54xx DSP module inserted into the
appropriate sockets on the development board. Normally the SigC54xx module is inserted in
the module site closest to the host connector (site labeled "Module #1" on the board)
3) Make sure the I/O base address on the ISA card is set to 0x340. This is done by setting the
base I/O address switch located on the edge of the ISA Card to
Page 9 / 140
VDS (VoP Development System) Users Guide
∧ ∧ ∨ ∧ ∨ ∨
4) The switch setting should be read left to right, looking at edge of card as shown in Figure 2-3
below.
Figure 2-1 Base I/O Address Settings for ISA Interface Card
5) Insert the ISA interface card into an ISA slot on the host machine.
6) Connect the development board and ISA interface card via provided 37-pin ribbon cable.
7) Power up the board by placing a jumper on the first two pins on S1 jumper (Power Enable).
Page 10 / 140
VDS (VoP Development System) Users Guide
S1 Jumper
Power Enable
Host Interface
Ribbon Cable
Figure 2-3 Jumper Location for power on the SigC54xx Development Board
SigC54xx development boards shipped from Signalogic should have the appropriate voltage set
for the particular processor modules provided. If for any reason you switch out the processor
module type, make sure to configure the correct core voltage as listed below:
• SigC549 – 2.5v
• SigC5409 – 1.8v
• SigC5416 – 1.5v
2) A SigC549 processor module used with an Audio Module needs an on-module jumper
connecting TP5 (on DSP side) to edge pin 46 (on memory side). This allows the processor to
use its XF (X flag) signal to reset the codecs on the Audio Module.
Page 11 / 140
VDS (VoP Development System) Users Guide
3) For Rev. B SigC54xx base boards, module sites that hold Audio Modules need three (3)
jumpers, one for XF flag connection to module edge and two others for ±5V connection to
module edge. Below is a summary of the SigC54xx Development System board jumpers:
(1) Connect +5V to Audio Module socket (typically Module #2 site) pin 23.
(2) Connect –5V to Audio Module socket (typically Module #2 site) pin 26
(3) Connect processor socket (typically Module #1 site) and Audio Module socket pin
46 together.
top view
| |
| |
| |
| | <---- socket
| |________________________________| |
|________+_________|__|_____|______________|
pin 1 23 26 46
Figure 2-1 Audio Module Top View Diagram
On Rev. B SigC54xx base boards, +5V can be obtained from C51 and –5V from pin 18 of J2
(ATX power supply connector). Relatively thick jumper wires should be used as these are
power connections.
Note that for Rev. C SigC54xx baseboards, no jumpers are required. However, the processor
module jumper (XF signal) is still required.
1) The small surface-mount oscillator on the Audio Module is sensitive to ESD. Please handle
unconnected Audio Modules at all times with careful ESD precautions. Always ensure that
you are grounded or at least touching a computer chassis when installing or removing Audio
Modules.
2) When connecting an audio I/O cable to an Audio Modules, it is recommended to turn off the
SigC54xx Development System, remove the Audio Module, connect the cable to the Mictor
connector (see section 2.4.1.1 below), and re-install the Audio Module. This will prevent
excessive flexing of the Audio Module card, which can eventually lead to intermittent
connections due to bad solder joints on the surface-mount components on the Audio Module.
Page 12 / 140
VDS (VoP Development System) Users Guide
A 38-pin Mictor plug connector is used on the Audio Module, which mates to one end of the
audio I/O cable (see section 2.4.1.2 below). If an Audio Module is in use, an audio I/O cable
will likely be required to bring audio and digital signals out to external equipment.
Below is the pin-out for the Mictor connector on the Audio Module (top view of male plug):
GND 1 20 GND
DI11 2 21 DI12
DI21 3 22 DI22
DO11 4 23 DO12
DO21 5 24 DO22
GND 6 25 GND
LOUT0 7 26 ROUT1
GND 8 27 GND
LIN0+ 9 28 RIN1+
GND 10 29 GND
LOUT2 11 30 ROUT3
GND 12 31 GND
LIN2+ 13 32 RIN3+
GND 14 33 GND
LIN0- 15 34 RIN2−
LIN1- 16 35 RIN3−
X 17 36 X
X 18 37 X
X 19 38 X
Notes
1) X = not connected
2) ± indicates balanced input
3) DIij or DOij indicates digital input or output; i indicates codec 1 or 2, and j indicates digital line 1 or 2.
Below is the pin-out for the audio I/O cable (front view of female 37-pin D-sub):
Page 13 / 140
VDS (VoP Development System) Users Guide
IN0+ 1
IN0- 2 20 GND
IN2+ 3 21 DI11
IN1- 4 22 DI21
IN1+ 5 23 DO11
IN2- 6 24 DO21
IN3+ 7 25 DI12
IN3- 8 26 DI22
GND 9 27 DO12
OUT0 10 28 DO22
OUT2 11 29 GND
GND 12 30 GND
OUT1 13 31 GND
OUT3 14 32 GND
GND 15 33 GND
X 16 34 GND
X 17 35 GND
X 18 36 GND
X 19 37 X
Group A Group B
IN0-white IN2-white
IN1-red IN3-red
OUT0-black OUT2-black
OUT1-yellow OUT3-yellow
Hardware
Page 14 / 140
VDS (VoP Development System) Users Guide
Software
• Hypersignal-Macro software
• DirectDSP software
• C54xx Source Code Interface software
• VDS software
Page 15 / 140
VDS (VoP Development System) Users Guide
3. Software Installation
Page 16 / 140
VDS (VoP Development System) Users Guide
4. Software Operation
1) The software will startup on the “System Config” tab. (Note that the only other tab enabled
in "Test/Diagnostic" mode is the “DSP HW Config” tab).
2) If the system does not start up on the System Config tab, or does not have the
"Test/Diagnostic Mode" checkbox selected, check the “Test / Diagnostic Mode” checkbox.
Test / Diagnostic
mode Checkbox
3) If the screen resolution is less than 1280 x 1024 the entire form will not be shown (See HELP
NOTE 2 at right for manual screen move instructions)
4) Click on the “DSP HW Config” tab (only other tab enabled in “Test/Diagnostic” mode).
Page 17 / 140
VDS (VoP Development System) Users Guide
5) In the “DSP Hardware Config” frame, click the Hardware Manager Dialog Button (button
with the picture of a board and the words “DSP” written on it).
Hardware
Manager
Dialog Button
6) When the Hardware Manager Dialog Box appears, verify that the correct “Setup File” is
selected (default filename is HWSetup.lst)
Page 18 / 140
VDS (VoP Development System) Users Guide
7) In the List Box, select the correct hardware. (Default for the 3-processor module is
“SigC54xx module w/ Interface Card”). If you have a 1-processor module, you should select
“SigC54xx Module, “”, 1 processor”.
8) If you are using a SigC54x/PC104 board, the I/O Base Address field should be 0x320,
otherwise, it should be 0x340 for SigC54xx development system.
9) Verify that the Processor Clock and the Number of Processors fields are set correctly.
Default Processor Clock settings are as follows
SigC549 100 MHz
10) Then type in the path to the DSP Program File, if the current one is different (for example,
for MELP codec test, the default path is c:\melp\dsp\melptest.out).
11) Click OK to conclude Hardware Configuration and close the Hardware Manager dialog box.
This will return to the VDS the “System Config” tab.
12) Right click on the “Analog” button in the Receive frame and select “Properties” from the
menu.
Page 19 / 140
VDS (VoP Development System) Users Guide
13) Check all the values and change them if necessary (the defaults shown above in Figure 4-5
should be valid).
14) Click the “Update Variables” button on the “Loopback Mode Configurations” frame.
2) If the system does not start up on the System Config tab, or does not have the
"Test/Diagnostic Mode" checkbox selected, check the “Test / Diagnostic Mode” checkbox.
Test / Diagnostic
mode Checkbox
Page 20 / 140
VDS (VoP Development System) Users Guide
3) If the screen resolution is less than 1280 x 1024 the entire form will not be shown (see HELP
NOTE 2 in section 4 for manual screen move instructions)
4) Click on the “DSP HW Config” tab (only other tab enabled in “Test/Diagnostic” mode).
5) In the “DSP Hardware Config” frame, click the Hardware Manager Dialog Button (button
with the picture of a board and the words “DSP” written on it).
Page 21 / 140
VDS (VoP Development System) Users Guide
Hardware
Manager
Dialog Button
6) When the Hardware Manager Dialog Box appears, verify that the correct “Setup File” is
selected (default filename is HWSetup.lst)
7) In the List Box, select the correct hardware. (Default for the 3-processor module is
“SigC54xx module w/ Interface Card”). If you have a 1-processor module, you should select
“SigC54xx Module, “”, 1 processor”.
8) If you are using a SigC54x/PC104 board, the I/O Base Address field should be 0x320,
otherwise, it should be 0x340 for SigC54xx development system.
9) Verify that the Processor Clock and the Number of Processors fields are set correctly.
Default Processor Clock settings are as follows
SigC549 100 MHz
Page 22 / 140
VDS (VoP Development System) Users Guide
10) Then type in the path to the DSP Program File, if the current one is different (for example,
for MELP codec test, the default path is c:\melp\dsp\melptest.out).
11) Click OK to conclude Hardware Configuration and close the Hardware Manager dialog box.
This will return to the VDS the “System Config” tab.
12) Right click on the “Analog” button in the Receive frame and select “Properties” from the
menu.
13) Check all the values and change them if necessary (the defaults shown above in Figure 4-10
should be valid).
14) Click the “Update Variables” button on the “Loopback Mode Configurations” frame.
2) Click the “Audio Loopback” radio button in the “Loopback Mode Configurations” frame on
the “System Config” tab.
Page 23 / 140
VDS (VoP Development System) Users Guide
3) Click the “Start” button on the “Loopback Mode Configurations” frame and wait for the DSP
to initialize and start (this may take up to a minute on fast machines).
4) You should see the Engine Manager Status window appear with status of the hardware as the
hardware initialization process proceeds. (See Figure 4-12 above).
5) Notes: Depending upon how many processors are on the installed module(s), you should see
corresponding initialization messages in the Engine Manager Status Window. For example,
you might see “coresel=8, 0 C549 HPIC=0 EOH=0 CBE=0 SR=0” three (3) times for a 3-
processor module.
coresel=8, 0 C549 HPIC=0 EOH=0 CBE=0 SR=0 Indicates which processors on the DSP module have
coresel=8, 1 C549 HPIC=0 EOH=0 CBE=0 SR=0 been initialized
coresel=8, 2 C549 HPIC=0 EOH=0 CBE=0 SR=0
Page 24 / 140
VDS (VoP Development System) Users Guide
Initialized MELP Engine MELP or other algorithm DSP Code file(s) have been
downloaded into the DSP(s) successfully
RunProcessor completed, processors running DSP code is running with appropriate properties set
Startboard Is Complete At this point, all initialization is done and DSP code is
running in real-time. For example for a speech codec;
you should be able to hear the audio coming out the
speaker assuming you have hooked up the audio input
correctly
Disable board All processors are held in reset and the board is
disabled
Engine shutdown message received Indicates the engine has been shut done successfully
6) Also you should see a packet interval time measurement (for example, approximately 22.5
msec for standard MELP speech codec) and frame counter updated in the VDS Status
window and in the Rx Index, Tx Index and Play Index fields below the Status window.
Figure 4-3 VDS Status Window Display with Audio Loopback Enabled
7) If you apply audio input, for example CD player output, speak into the microphone, etc.,
there should be audio output delayed by approx 2N where N is the speech codec packet size
in msec. As one example, if you speak into a microphone you should hear your voice on the
speaker output, but with a barely noticeable delay.
Page 25 / 140
VDS (VoP Development System) Users Guide
8) When you wish to stop, click the “Stop” button on the “Loopback Mode Configuration”
frame (this may take up to a minute on fast machines).
2) Click the “Algorithm Loopback” radio button in the “Loopback Mode Configurations” frame
on the VDS “System Config” tab.
3) Click the “Start” button on the “Loopback Mode Configurations” frame and wait for the DSP
to initialize and start (this may take up to a minute on fast machines).
4) You should see the Engine Manager Status Window appear with the status of the hardware
initialization process as it starts up shown there. For a screen capture and detailed
information about the window contents, see Figure 4-12 and Table 4-1 above.
Page 26 / 140
VDS (VoP Development System) Users Guide
5) Also you should see a packet interval time measurement (approximately 22.5 msec for
standard MELP speech codec) and frame counter updated in the VDS Status window and in
the Rx Index, Tx Index and Play Index fields below the Status window.
Figure 4-2 VDS Status Window Display with Algorithm Loopback Enabled
6) If you apply audio input, for example CD player output, speak into the microphone, etc.,
there should be audio output delayed by approx 3N where N is the speech codec packet size
in msec. As one example, if you speak into a microphone you should hear your voice on the
speaker output, but with a barely noticeable delay.
7) When you wish to stop, click the “Stop” button on the “Loopback Mode Configuration”
frame (this may take up to a minute on fast machines).
2) Click the “Host System Loopback” radio button in the “Loopback Mode Configurations”
frame on the “System Config” tab.
Page 27 / 140
VDS (VoP Development System) Users Guide
3) Click the “Start” button on the “Loopback Mode Configurations” frame and wait for the DSP
to initialize and start (this may take up to a minute on fast machines).
4) You should see the Engine Manager Status Window appear with status of the hardware
initialization process as it proceeds. For a screen capture and detailed information about the
window contents, see Figure 4-12 and Table 4-1 above.
5) Also you should see a packet interval time measurement (for example, approximately 22.5
msec for standard MELP speech codec) and frame counter updated in the VDS Status
window and in the Rx Index, Tx Index and Play Index fields below the Status window.
Figure 4-2 VDS Status Window Display with Host System Loopback Enabled
6) If you apply audio input, for example CD player output, speak into the microphone, etc.,
there should be audio output delayed by approx 3N where N is the speech codec packet size
Page 28 / 140
VDS (VoP Development System) Users Guide
in msec. As one example, if you speak into a microphone you should hear your voice on the
speaker output, but with a barely noticeable delay.
7) When you wish to stop, click the “Stop” button on the “Loopback Mode Configuration”
frame (this may take up to a minute of fast machines).
Page 29 / 140
VDS (VoP Development System) Users Guide
Method: modify the entry-point code in the appropriate ISR (interrupt service routine)
source code file; modify the analog I/O initialization code (note that this implies the
remainder of the ISR can be left “as-is”) in t54beg.asm or a add a file with a routine callable
from t54beg.asm
• Application: stream real-time results to hard disk as a waveform file for post-analysis, either
with or without application-specific C code processing of the real-time data
Method: use appropriate setup in DSPower or Hypersignal software; see section 5.2 below.
Hypersignal software or DSPower-Block Diagram software can be used to display, analyze,
and measure the stored .tim or .wav file in both time and frequency domain
• Application: enable a “field debug and measurement” mode in a stand-alone DSP product
Method: implement a flag in the DSP code to determine whether a host interface is present; if
so, then debug and data collection functions can be enabled that are normally not
• Application: adding code to support interboard communication
Method: modify existing ISR; add user-defined C/asm code to user-defined ISR
• Application: adding code to allow digital I/O to application-specific peripheral devices
Method: modify existing ISR; add user-defined C/asm code to user-defined ISR
• Application: measuring algorithms or parts of algorithms against a particular real-time
sampling rate
Method: add buffer overrun detection to UserProc routine; see section 5.1.3.1
• Application: measuring MIPS requirements in a real-time system
Page 30 / 140
VDS (VoP Development System) Users Guide
Method: check ISR buffer pointer value at end of calculation to determine remaining
percentage of time left in current input frame; add to end of UserProc routine
• Application: evaluating the effects of finite word-length
Method: add user-defined function to DSP/math function list in either C or asm code
Maintaining reliable, high-speed data transfer host-interface capability in the face of code
changes and analog I/O based real-time operation is a critical feature of the SigC54xx and
SigC67xx Development System; many software functions depend on it. Host-interface
capabilities provided by DSPower programs and Hypersignal software include:
For more information on DSPower and Hypersignal capabilities, please see section 5.2. DSP
Source Code Access and Control from Host Programs.
Page 31 / 140
VDS (VoP Development System) Users Guide
There are four (4) important ideas underlying the method for adding user-defined 'C' routines to
real-time DSP code that is described in this section. These are:
• hide details of the DSP chip and DSP board--especially the analog I/O, which tends to
vary extensively from board to board and can be extremely complex from a software
point of view
• allow user-defined 'C' code to process analog input/output data on a buffer, or
"frame" basis, and not deal with individual samples (but still allow a single-sample
“framesize” in the case of control systems which require minimum system I/O delay
• allow real-time recording of intermediate results to waveform file or memory for
debugging purposes
• make the modification cycle, or "turn-around time", as fast as possible
To achieve these goals, a routine called "UserProc" (in file userproc.c) has been defined in the
standard DSP Source Code which represents a general entry-point for user-defined real-time 'C'
code. UserProc is called by the underlying DSP Source Code framework after each analog
input/output data buffer is filled and processed by the analog I/O drivers. This occurs at the
interrupt service routine (ISR) level; a flag is set which indicates to foreground (non-interrupt)
code that a new buffer is available. The “buffer ready” notification is handled transparently by
DSP Source Code framework, which forwards the notification from the ISR to foreground
C54xx and C67xx code. Typically, a MODULn .asm file or an application-specific void main()
routine running in the foreground receives the notification. In the case of a MODULn function,
the notification can be (optionally) forwarded to host-side code, which receives the notification
in the form of a callback message or as a release from a blocking WaitForBuffer() function call.
Note that the notification occurs before analog input buffers are sent to host PC software, such as
Hypersignal, or Windows programs using DSPower software (e.g. application-specific Visual
C/C++, Visual Basic, MATLAB, or LabVIEW programs). This “insertion point” for
application-specific C code allows both analog input buffers (before they reach host PC
applications) and output buffers (after they are sent by host PC applications) to be modified by
real-time DSP-based C and/or asm code.
Page 32 / 140
VDS (VoP Development System) Users Guide
to foreground algorithms for processing on a "frame" basis. Note that the "current analog I/O
drivers" are drivers that have been selected in the host PC software user-interface for the
DSP/analog hardware that is currently installed in the system. In Hypersignal software, this is
done using the System Config menu selection; in DSPower programs, this is done using the
Hardware Manager dialog box or in DSAssignBoard function calls in the programs.
Parameters passed to userproc.c include a pointer to the just-acquired input buffer, a pointer to
the next output buffer, length of each buffer in elements, and number of traces (channels)
contained in each element. Note that each "element" could actually be more than one sample; for
example a three-channel acquisition would cause buffers to contain interleaved data in the form
ch0, ch1, ch2, ch0, ch1, ch2, etc.
Below is the default source code listing for the basic userproc.c routine; the default routine is
configured for simple loopback operation (loop input back to output) before user-defined
modification.
short int n;
Here are some important notes about the above code structure:
1) Each input buffer ("x") contains 16-bit A/D values represented as right-justified, signed, N-
bit integer values, where N is the natural integer word-length of the DSP device.
2) Each output buffer ("y") contains 16-bit D/A values represented as right-justified, signed, N-
bit integer values, where N is the natural integer word-length of the DSP device.
Page 33 / 140
VDS (VoP Development System) Users Guide
of channels; for example, channel 0 may not correspond to trace zero (0).
If the nNumTrace parameter is > 1, then data is stored as interleaved values, in repeating
groups of nNumTrace values. For example,
tr0,tr1,tr2,tr0,tr1,tr2, ...
4) The xxxLINKC.CMD (or xxxLINKC.CTL) linker command (or control) file should be used
if run-time 'C' support is needed (see section 5.3.5 and 5.4.5 below, C54xx and C67xx Source
Code Modification Process). Otherwise, the xxxLINK.CMD or xxxLINK.CTL linker
command/control file versions can be used (without C run-time support). See section 5.3.5
and 5.4.5 below, C54xx and C67xx Source Code Modification Process, for details. Run-time
'C' support is made necessary by adding functions or routines to the C code which require
math and other support libraries. Typically, the library file "rtsPP.lib" would be required,
where PP is a name assigned by the DSP chip manufacturer (for example “67” for C67xx,
“54” for C54xx, "30" for C3x, "56" for 56xxx, etc.). The xxxLINKC.CMD and
xxxLINKC.CTL command/control files link in the appropriate rtsPP.lib file.
5) Important Operational Note: UserProc must complete its processing before the next
input/output buffer pair is ready! Otherwise, real-time operation does not occur.
void UserProc(void* ptrIn, void* ptrOut, long nLen, short int nNumTrace) {
Page 34 / 140
VDS (VoP Development System) Users Guide
short int n;
• Compile userproc.c. As an example of how to do this, the batch file "c.bat" is included
which invokes the manufacturer's 'C' compiler from a DOS command prompt.
• Run the lnk.bat file if run-time support is not needed; i.e. if the rtsPP.lib file is not
needed (see section 5.3.5 and 5.4.5 below, C54xx and C67xx Source Code Modification
Process). Otherwise, run the lnkc.bat file.
• Copy the resulting .out file to the Hypersignal directory. The default .out filename is as
specified in the Hypersignal-Macro Series Hardware Reference Guide; other filenames
can be specified by providing the lnk.bat or lnkc.bat files a filename parameter, for
example:
lnkc test.out
or
lnk test
in the ACQ/GEN field in the Analog Conversion function. The 'rt' entry causes
real-time simultaneous input/output operation (mode 6; see section 5.3 and 5.4
below, C54xx and C67xx Source Code Interface Structure). The 'rtd' entry works
the same way, except recording to waveform file is enabled. Maximum sampling
rates at which continuous operation (no gaps or data discontinuity) can be
achieved are lower when file recording is enabled. In all cases, maximum
sampling rates at which real-time operation can be maintained are heavily system
Page 35 / 140
VDS (VoP Development System) Users Guide
dependent. Important factors include the DSP chip speed, DSP onboard SRAM
access-time and efficiency of user-defined 'C' code. In the case of waveform file
recording, factors also include host PC speed, disk drive speed and controller
type, ISA or PCI bus speed, etc. For a detailed discussion of the factors
influencing maximum continuous sampling rate to file, please see the "Super
Guide" online help file which ships with DSPower software products.
Important Note: if the name of the DSP program file has been changed from the
default (by renaming the output of lnkc.bat, or by giving lnkc.bat a filename
parameter), Hypersignal must know about the change before running Analog
Conversion. To do this, suffix the filename to the ANALOG CONVERSION
field in the System Config menu. For example, this could result in entries like
'IIC31-B-50,test.out', 'TBS56-B,AC3.OUT', or 'sig32c,dsp32cxx.out'.
• To activate UserProc when using DSPower software, there are two methods:
• DSAcquireWvfrmFile Approach. Use either "rt" or "rtd" as the stimulus
filename szStimName structure member) in the CONVERSIONINFO
structure passed to the DSAcquireWvfrmFile function. This instructs
Hypersignal to replace stimulus filename output with real-time processed
data. The "rt" value causes indefinite real-time operation (until the engine
is idled; see the dtape.cpp source code file for an example of how to use
the DSSendEngineCommand(hEngine, DS_SEC_IDLE, DS_EEF_SYNC)
function call). The "rtd" value causes real-time operation with continuous
recording to waveform file of the analog input data until the NumSamples
structure member is reached. The record-to-disk option is provided as a
means to post-analyze, in detail, data that has been processed in real-time
by userproc.c. Waveform file data can be analyzed using a Hypersignal or
DSPower-Block Diagram waveform display function.
Also, the stimulus mode (szStimMode stucture member) value should be
set to "R", which instructs the DSP code to perform repetitive frame
output until the waveform file is complete or the operation is aborted.
• DSP Code Control Approach. Modify the rtcode.cpp file as needed.
The rtcode.cpp file shows an example of initializing DSP code for
UserProc operation with DSSetDSPProperty calls. The key steps are to
choose operating mode 6 (set DSP_OPMODE property to 6) and initialize
the value of the DSP_FRMSIZ property to the length of each analog input
buffer. Normally the DSP_FRMSIZ value should be the same as the
DSP_BUFLEN property. Note that with this approach, continuous
recording of input or output buffer data to waveform file is not active; to
make this functionality active, it would have to be added to the rtcode.cpp
file.
Page 36 / 140
VDS (VoP Development System) Users Guide
sum on input channel 0 data, with no loopback to the output. The difference equation for this
example could look something like:
where M is the length of the running sum, in samples. First, userproc.c is modified to look like:
void UserProc(void* ptrIn, void* ptrOut, long nLen, short int nNumTrace) {
After modifying userproc.c, see the steps outlined in section 5.3.5 and 5.4.5 below, C54xx and
C67xx Source Code Modification Process.
Notes
1) The #define constructs above for non-C54xx and C67xx DSP types can be removed.
2) The above use of a long division intermediate calculation above (lSum/M) is not suggested
for real-time processing; it is used only to make the example general and portable across
Page 37 / 140
VDS (VoP Development System) Users Guide
different DSP devices. A better approach would be to make M a power of 2, so the division
could be achieved by shifting the lSum term right.
The first two (2) methods above allow flexible user-specified access and control of the DSP(s) at
all levels, including debug and measurement functions; these are covered in the sections below.
The third method automates DSP hardware control based on graphical signal flow diagrams; the
Real-Time Composer software is currently in beta release, and so is not covered in this document
at this time.
5.2.1 DSP Source Code Access and Control from Hypersignal Software
The Hypersignal-Macro series software packages contain capabilities that facilitate access and
control of Hypersignal DSP source code containing user-defined modifications or additions,
including:
1) The ability to specify different executable DSP files to load and run when a DSP-based
function or display is invoked from Hypersignal. In the System Configuration menu,
entering a filename, such as "new.out", after the board designator will override the default
DSP filename that Hypersignal uses for default operation.
2) Macro language functions including InitBoard, LoadBoard, RunBoard, ResetBoard,
WriteDSPVal and WriteDSPMem that allow macro programs to access DSP/data acquisition
hardware as needed.
3) Instrumentation functions which allow record-to-file and display of real-time data from the
DSP/data acquisition hardware. For example, a mode can be selected in the Analog
Conversion function that allows buffers, either raw or processed, to be uploaded from the
shared memory on the DSP board and stored continuously to disk file. For detailed
information on this procedure, see section 5.1.3.2, UserProc Application Examples.
In general, maintaining the host interface capability in the DSP source code allows Hypersignal
functions to continue to be enabled and usable. This allows Hypersignal to store data in .tim and
.wav waveform file formats, and display and analyze stored data. Time domain and frequency
domain displays, DSP operations such as FFT, filtering, difference equations, etc. continue to be
accessible with results produced by the C54xx and C67xx code. See section 5.3.2 and 5.4.2
C54xx and C67xx Source Code Interface Host PC Communication, for more information.
Page 38 / 140
VDS (VoP Development System) Users Guide
For more information about the functions listed in item 2) above, see Hypersignal-Macro Series
Users Manual section 7.10, Macro Commands and Functions.
Notes
1) Both the WriteDSPMem and WriteDSPVal functions always make full-word accesses, depending on
the natural word-length of the DSP device. This can affect the address value used, if the DSP is
capable of accessing data pieces smaller than full-word length.
2) Both WriteDSPMem and WriteDSPVal functions are capable of accessing all memory types
supported by the DSP chip. For a complete list of internal Hypersignal values that can be written to
arbitrary DSP source code memory, see Signalogic DSP Software Reference Guide section 3.3,
Hypersignal DSP Source Code Variable List. For fully detailed information about the syntax and
usage of these functions, see Hypersignal-Macro Series Users Manual section 7.10, Macro
Commands and Functions.
5.2.2 DSP Source Code Access and Control from DirectDSP Programs
DSPower software is an interface layer between host application programs and DSP/data
acquisition hardware and DSP algorithm code. On the application side, it can be incorporated as
DLLs and ActiveX controls for programs written in Visual C/C++ and Borland C/C++,
MATLAB, Visual Basic, and LabVIEW. On the DSP side, it communicates with drivers for
more than 100+ types of DSP/data acquisition hardware; also, it interfaces to Hypersignal-Macro
software, MATLAB, and other user-defined drivers and “DSP engines”.
• provide a direct, flexible, but still uniform interface to DSP/data acquisition hardware from
popular host environments
• provide a well documented method to interface to DSP algorithms executing in real-time
It is the latter purpose that is the focus of this section. When communicating with DSP code
from one of the supported host environments, DSPower software provides the following low-
level DSP code-oriented functions:
• download DSP program files (COFF files) produced by the DSP vendor’s compiler,
assembler, and linker tools
• set and get DSP properties, both pre-defined and user-defined
• transfer data buffers between host memory and onchip and offchip memory on the DSP
board, including various data formats, automatic format conversion options, and the ability to
transfer data while DSP code continues to execute in real-time
Page 39 / 140
VDS (VoP Development System) Users Guide
• use COFF symbol information to determine physical addresses of variables, buffers, and
vectors in the DSP code
• provide debug capability, including breakpoint, single-step, processor status display, and data
display in text or graphical waveform formats
In addition, DSPower software provides the following high-level DSP code oriented functions:
• real-time buffer management, including “buffer ready” messages and callback message
processing
• pre-defined instrumentation functions such as digital scope, spectrum analyzer, streaming to
disk
• full-featured analog I/O support when applicable
Note that the debug capability mentioned above is not hardware based as with standard JTAG
debuggers. Rather, this capability depends on software “trap” interrupts to handle breakpoints
and single-step, so it is not “true software-independent debug”. However, unlike JTAG, the
DSPower debug capability can transfer large amounts of data without stopping the processor(s).
There are two main approaches to running DSP code from DSPower programs:
• “talker only”
• use pre-defined default Signalogic DSP framework as all or some part of the algorithm code
The “talker only” approach refers to the most general case: only a small interrupt driven host
communication kernel (a talker; see section 5.3.2 and 5.4.2 C54xx and C67xx Source Code
Interface Host PC Communication) is used and all other DSP code is application-specific. In this
case, no assumptions can be made by DSPower programs about pre-defined properties, buffer
locations, code initialization, analog I/O drivers and pre-defined operating modes. This allows
DSPower core functionality (COFF download, data transfer, board control and interrogation,
etc.) to remain intact, but disables higher level DSPower functions such as buffer management,
instrumentation functions such as digital scope, spectrum analyzer, streaming to disk, etc.
Note that the latter case, where the Signalogic C54xx and C67xx framework is utilized, requires
the talker to be enabled, and depends on it for host communication.
The sections below provide a summary of the DSPower API, and also show code examples for
several common DSP board functions, including for COFF file download, DSP property
initialization, and several types of data transfer. Source code examples are provided for host
environments C/C++, MATLAB and Visual Basic.
Page 40 / 140
VDS (VoP Development System) Users Guide
DSWriteBoardReg WM_DSPENGINE_BUFRDY
DSReadBoardReg WM_DSPENGINE_FLAGRDY
DSIEEEToDSP WM_DSPENGINE_ENGINESTATE
DSDSPToIEEE WM_DSPENGINE_FUNCTIONERR
WM_DSPENGINE_CODEGENERROR
Autocalculation and Autodetection WM_DSPENGINE_COMPILEERROR
Page 41 / 140
VDS (VoP Development System) Users Guide
CONVERSIONINFO Structure
DSAssignProcessor
waveform filename DSFreeProcessor
number of channels, channel list
sampling rate DSGetBoardBaseAddr, DSSetBoardBaseAddr
number of samples DSGetBoardBusType, DSSetBoardBusType
output start sample index
gain / attenuation list Memory Function Constants
digital offset and digital scale
output repeat DSGetMemArch,DSPutMem, DSGetMem
input loopback constants
real-time filter 1 filename DS_GMA_LINEAR
real-time filter 2 filename DS_GMA_HARVARD
trigger mode, level, and delay DS_GMA_VECTOR
number of trigger channels,
trigger channel list DS_GM_VECTOR_DATA_X
stimulus filename, mode, and delay DS_GM_VECTOR_DATA_Y
DS_GM_LINEAR_PROGRAM
DS_GM_LINEAR_DATA
DS_GM_SIZE8
DS_GM_SIZE16
DS_GM_SIZE24
DS_GM_SIZE32
For complete C/C++ source code examples, see the following examples included with DSPower
software:
Page 42 / 140
VDS (VoP Development System) Users Guide
// note: if hardware choice is fixed, then skip this call and use
// correct board designator string in DSAssignBoard call below
The driver and board initialization functions below do not include error checking. For complete
examples with error checking, please consult dscope.cpp, sim_io.cpp, and other C/C++ example
source code files included with DSPower software.
if (!hEngine) {
// assign a board handle: engine handle, board designator, bus type, IO base
// addr, Mem base addr
// initialize the board; make sure it's installed, reset all processors
fBoardInitialized = DSInitBoard(hBoard);
Page 43 / 140
VDS (VoP Development System) Users Guide
wBoardClass = DSGetBoardClass(hBoard);
// determine sampling rate ctrl. reg. value, and actual rate (closest rate
// possible to desired); CalcSampFreq returns ctrl. reg. value directly, uses
// ptr to return actual sampling frequency (in Hz); demo assumes 1 channel
uMemArch = DSGetMemArch(hBoard);
if (uMemArch == DS_GMA_VECTOR)
BufMul = 1;
else
BufMul = 2;
// get the memory size, (note that this currently has to be done after LoadFile)
// reset the DSP board (should already be in reset state; processor 0 only)
DSResetProcessor(hBoard, 0x01);
The DSP property initialization examples below may not be complete for all pre-defined
operating modes in the DSP Source Code Interface. Please also consult the Visual Basic and
MATLAB examples for possible additional property examples.
DSSetDSPProperty(hBoard, DSP_STMDATAADDR,
dwOutBufferBaseAddr); // output buffer base address
Page 44 / 140
VDS (VoP Development System) Users Guide
// set output digital scale (multiply) factor and offset(add) to DSP code
}
else {
nShift = 0;
nShift2 = 0;
}
// note the value of buffer size also depends on the type of board;
// different boards have different maximum buffer size depending on
// the amount of onchip/offchip memory available; the value we are
// using is typically small in order to allow this demo program to
// work on a wide range of boards; for better streaming, continuous
// data transfer performance, the buffer size should be increased,
// if the board will allow it; for example, the calculation below
// could be made = / 1, to increase both accuracy and performance
buffer1 = (short*)GlobalLock(hBuf1);
buffer2 = (short*)GlobalLock(hBuf2);
// Create data buffer; note that data must be scaled to be reasonable values
// for D/A converter(s)
Page 45 / 140
VDS (VoP Development System) Users Guide
GlobalUnlock(hBuf1);
GlobalUnlock(hBuf2);
GlobalFree(hBuf1);
GlobalFree(hBuf2);
if (fMultiProcessor)
DSRunProcessor(hBoard, dwProcList);
else if (fMultiProcessor && fFirstProcActiveOnly)
DSRunProcessor(hBoard, 0x01);
else if (fMultiProcessor && fAllProcActive)
DSRunBoard(hBoard);
else if (fSingleProcessor)
DSRunBoard(hBoard);
if (nCurBuf == 0)
uStatus = DSGetMem(hBoard, DS_GM_VECTOR_DATA_X, dwBufferBaseAddr,
DS_GM_SIZE16, pBuffer, wBuflen);
else
uStatus = DSGetMem(hBoard, DS_GM_VECTOR_DATA_Y, dwBufferBaseAddr,
DS_GM_SIZE16, pBuffer, wBuflen);
}
else // linear data/prog memory, or modified harvard arch. with linear
// data memory
uStatus = DSGetMem(hBoard, DS_GM_LINEAR_DATA_RT,
dwBufferBaseAddr+nCurBuf*wBuflen, DS_GM_SIZE16,
pBuffer, wBuflen);
if (!uStatus)
DSMessageBox(hwnd,
"DSGetMem: problem with point transfer", szApp, MB_OK);
Page 46 / 140
VDS (VoP Development System) Users Guide
comment the PutMem section if the pre-loaded data (see WinMain above) should
continue to be output repetitively; otherwise, this section will loop input
buffers to output, with a one buffer delay
*/
if (nCurBuf == 0)
uStatus = DSPutMem(hBoard, DS_GM_VECTOR_DATA_X, dwOutBufferBaseAddr,
DS_GM_SIZE16, pBuffer, wBuflen);
else
uStatus = DSPutMem(hBoard, DS_GM_VECTOR_DATA_Y, dwOutBufferBaseAddr,
DS_GM_SIZE16, pBuffer, wBuflen);
}
else { // linear data/prog memory, or modified harvard arch. with linear
data memory
GlobalUnlock(hBuf);
if (!uStatus)
DSMessageBox(hwnd,
"DSGetMem: problem with point transfer", szApp, MB_OK);
else FirstBufferRcvd = TRUE;
// wait for next buffer; note this function does not actually wait unless the
// DS_WFB_SYNC flag is used; in the example below, it sets up a callback message
MyPlotFunction(hBuf);
Page 47 / 140
VDS (VoP Development System) Users Guide
For complete MATLAB source code examples, see the following .m file examples included with
DSPower software:
if (hEngine == NULL)
if (hEngine == NULL)
Page 48 / 140
VDS (VoP Development System) Users Guide
return; % abort
end
end
fBoardInitialized = InitBoard(hBoard);
if (fBoardInitialized == FALSE)
if (hBoard ~= NULL)
FreeBoard(hBoard);
end
if (hEngine ~= NULL)
EngineClose(hEngine);
end
return; % abort
end
if (hBoard ~= NULL)
FreeBoard(hBoard);
end
if (hEngine ~= NULL)
EngineClose(hEngine);
end
return; % abort
end
The DSP property initialization examples below may not be complete for all pre-defined
operating modes in the DSP Source Code Interface. Please also consult the C/C++ and Visual
Basic examples for possible additional property examples.
Page 49 / 140
VDS (VoP Development System) Users Guide
% prepare hardware and data transfer values, allocate memory to receive buffers
if (MemArch == DS_GMA_VECTOR)
BufMul = 1; % multiplier for BufSize
else
BufMul = 2;
end
% set output digital scale (multiply) factor and offset (add) to DSP code
Page 50 / 140
VDS (VoP Development System) Users Guide
nShift2 = 0;
end
% write analog I/O scale factors (scale factors are implemented as Q-8 in DSP
% code)
buf1(n) = 10000*sin(2*pi*n*1000/FsActual);
buf2(n) = 10000*sin(2*pi*n*1000/FsActual);
end
% pre-load DSP board memory with data buffers; both buffers must be preloaded
% for continuous operation. Note that download depends on whether board has
% linear or Harvard memory architecture
if (Status == NULL)
errstr = ['problem with PutMem; error code = ' num2str(GetEngErrStat(hEngine))];
Page 51 / 140
VDS (VoP Development System) Users Guide
disp(errstr);
end
if (fMultiProcessor)
RunProcessor(hBoard, dwProcList);
else if (fMultiProcessor && fFirstProcActiveOnly) then
RunProcessor(hBoard, 0x01);
else if (fMultiProcessor && fAllProcActive)
RunBoard(hBoard);
else if (fSingleProcessor)
RunBoard(hBoard);
Page 52 / 140
VDS (VoP Development System) Users Guide
% Start board and wait for buffer to be output. Note above that we filled
% second buffer also, to avoid "screech"--because DSP will start output
% on second buffer before we can stop the processor
% Note: first buffer will be output as soon as board starts running; for
% continuous % output, "Buffer Ready" callback messages must be processed,
% and the RegMsgWnd() and WaitForBuffer() functions must be used
if (BufNum == 0)
Status = GetMem(hBoard, DS_GM_VECTOR_DATA_X, TimBaseAddr,
DS_GM_SIZE16_CVT, buf_plot, BufSize);
else
Status = GetMem(hBoard, DS_GM_VECTOR_DATA_Y, TimBaseAddr,
DS_GM_SIZE16_CVT, buf_plot, BufSize);
end
else % board has linear or Harvard memory architecture
buf = buf_plot; % store acquired data in variable buf for PutMem use
if (Status == NULL)
errstr = ['problem with GetMem; error code = ' num2str(GetEngErrStat(hEngine))];
disp(errstr);
end
% To change the output during data acquisition, uncomment the following section
% of code, which feeds the input to the output directly for each buffer
%
% if (MemArch == DS_GMA_VECTOR) % board has vector memory architecture
%
% if (BufNum == 0)
% Status = PutMem(hBoard, DS_GM_VECTOR_DATA_X, OutBaseAddr,
DS_GM_SIZE16_CVT, buf, BufSize);
% else
% Status = PutMem(hBoard, DS_GM_VECTOR_DATA_Y, OutBaseAddr,
DS_GM_SIZE16_CVT, buf, BufSize);
% end
% else % board has linear or Harvard memory architecture
%
% Status = PutMem(hBoard, DS_GM_LINEAR_DATA_RT, OutBaseAddr+BufNum*BufSize,
DS_GM_SIZE16_CVT, buf, BufSize);
% end
%
% if (Status == NULL)
% errstr = ['problem with GetMem; error code = ' num2str(GetEngErrStat(hEngine))];
% disp(errstr);
% end
end
Page 53 / 140
VDS (VoP Development System) Users Guide
% display data
if (hBoard ~= NULL)
if (fBoardInitialized == TRUE)
DisableBoard(hBoard);
end
FreeBoard(hBoard);
end
if (hEngine ~= NULL)
EngineClose(hEngine);
end
For complete Visual Basic source code examples, see the following examples included with
DSPower software:
Page 54 / 140
VDS (VoP Development System) Users Guide
' show hardware manager dialog (Hardware Manager); returns board designator
' string
' note: if hardware choice is fixed, then skip this call and use correct board
' designator string in DSAssignBoard call below
If hEngine = 0 Then
nStatus = DSGetEngMgrErrorStatus()
If (nStatus = NUL) Then nStatus = DSGetHWLibErrorStatus()
tmpstr = Str$(nStatus)
tmpstr = "DSEngineOpen error code =" + tmpstr
ret = DSMessageBox(NUL, tmpstr, szApp,
MB_ICONEXCLAMATION Or MB_ALWAYSONTOP)
GoTo Abort
End If
End If
' note: using a string name instead of the pre-defined “DS_EO_xxx” constants
' above will open a user-defined driver. Drivers must export certain
' baseline functions required by DSPower software. Please ask Signalogic
' for the “OEM DSPower Software Development Guide” document.
' assign a board handle: engine handle, board designator, bus type, IO base
' addr, Mem base addr
' initialize the board; make sure it's installed, reset all processors
fBoardInitialized = DSInitBoard(hBoard)
nStatus = DSGetHWLibErrorStatus()
If (nStatus = NUL) Then nStatus = DSGetEngineErrorStatus(hEngine)
tmpstr = Str$(nStatus)
tmpstr = "DSEngineOpen error code =" + tmpstr
ret = DSMessageBox(NUL, tmpstr, szApp,
MB_ICONEXCLAMATION Or MB_ALWAYSONTOP)
GoTo Abort
End If
Page 55 / 140
VDS (VoP Development System) Users Guide
wBoardClass = DSGetBoardClass(hBoard)
uMemArch = DSGetMemArch(hBoard)
' get memory size, (note that this currently has to be done after LoadFile)
' reset DSP board (should already be in reset state; processor 0 only)
' set the message blaster (MSGBLAST.OCX or MSGBLAST.VBX) to capture buffer ready
' messages from the DSP driver/engine
Buffer_Ready.hWndTarget = graph_window.hWnd
Buffer_Ready.AddMessage WM_DSPENGINE_BUFRDY, POSTPROCESS
' register handle of graph window with engine, to receive "buffer ready"
' messages; this is same as registering callback function in C/C++
' load default file for the board type (processor 0 only)
The DSP property initialization examples below may not be complete for all pre-defined
operating modes in the DSP Source Code Interface. Please also consult the C/C++ and
MATLAB examples for possible additional property examples.
Page 56 / 140
VDS (VoP Development System) Users Guide
dw = 0
For i = 0 To (NumChan - 1)
dw = dw Or Shift(i, 4 * i) ' shift left
ChanList(i) = i
Next i
dwFsMode = DSCalcSampFreq(hBoard,
FsDesired,
NumChan,
ChanList(0),
dwFsActual)
' Framesize property required for real-time C code data transfer to host
' operation (mode 6), or Spectrum Analyzer operation (mode 5)
dw1 = 0
dw2 = 0
' properties below only required for Spectrum Analyzer operation (mode 5)
Page 57 / 140
VDS (VoP Development System) Users Guide
If (fMultiProcessor) Then
DSRunProcessor(hBoard, dwProcList)
ElseIf (fMultiProcessor And fFirstProcActiveOnly) Then
DSRunProcessor(hBoard, &H01)
ElseIf (fMultiProcessor And fAllProcActive) Then
DSRunBoard(hBoard)
ElseIf (fSingleProcessor) Then
DSRunBoard(hBoard)
End If
Sub Buffer_Ready_Message(ByVal hWnd As Long, ByVal MsgVal As Long, wParam As Long, lParam As
Long, nPassage As Integer, lReturnVal As Long)
' transfer below illustrates two common type of DSP memory architectures
Page 58 / 140
VDS (VoP Development System) Users Guide
dwMagBufferBaseAddr, DS_GM_SIZE16,
FFTBuffer(0), 2 * FFTsize * NumChan)
End If
If (nCurBuf = 0) Then
Else
End If
End If
End If
fDataRcvd = True
If (fFirstBuffer = 0) Then
fFirstBuffer = 1 ' first buffer received
Else
fFirstBuffer = 2 ' successive buffer received
End If
DisplayBufferData(Buffer)
End If
End Sub
Page 59 / 140
VDS (VoP Development System) Users Guide
The example below uses Microsoft’s graph32.ocx control to show how to display different types
of waveform data transferred from DSP memory. Note that multichannel data is not shown, but
is easy to incorporate. Multichannel data is interleaved in Number-of-Channel groups; for
example, for 4-channel data:
ch0,ch1,ch2,ch3,ch0,ch1,ch2,ch3, ...
Dim i As Long
Dim j As Integer
Dim Data As Integer ' temporary storage for data in buffer
Dim ret, inc, index As Integer
graph_window.NumSets = NumChan
graph_window.ThisSet = 1
graph_window.ThisPoint = 1
VOffset = 0
Vscale = 1
graph_window.ThisSet = 1
For i = 0 To graph_window.NumPoints - 1
Next
For j = 1 To graph_window.NumSets
graph_window.ThisSet = j
graph_window.ColorData = j ' Set different channel to different color
graph_window.DrawMode = 3 ' Blt to screen, to avoid flicker
Next
End Sub
Page 60 / 140
VDS (VoP Development System) Users Guide
ret = DSFreeBoard(hBoard)
hBoard = NUL
End If
End Sub
All interrupt service routines fully save and restore machine context to protect registers they
modify and some routines (such as the “snap-in” real-time filter routines included in the C54xx
source code library also save and restore registers they use. In all chip families the Digital
Oscilloscope and Spectrum Analyzer functions provide the best examples of full context-save
interrupt service routines combined with substantial foreground processing constructed from
many of the routines in the source code library.
The C54xx Source Code Interface base file list includes .asm and .c function and analog I/O files
plus linker control files and support utilities.
Page 61 / 140
VDS (VoP Development System) Users Guide
The C54xx source code interface supports the basic "modes" of operation below:
Page 62 / 140
VDS (VoP Development System) Users Guide
one way to do this is to leave an non-initialized section, or hole, in the linker command file. An
example linker command file is printed below which shows how to do this.
In addition, there are several pre-defined “DSP properties” which can be set by the host to
initialize and control default operating modes. These properties are implemented as shared,
global variables in the DSP code; they are well documented in the file t54beg.asm. Do not insert
any code of any type before these addresses that would cause them to move.
The talker currently resides in onchip program memory, from 0x80 to 0x100. In addition, it uses
6 words in onchip memory at 0x1000 for a “command structure” used to communicate with host
drivers.
See Appendix B, C54xx Talker Program, for talker source code and map file.
Page 63 / 140
VDS (VoP Development System) Users Guide
Page 64 / 140
VDS (VoP Development System) Users Guide
*****************************************************************************
TMS320C54x COFF Linker PC Version 3.70
*****************************************************************************
>> Linked Wed Jul 24 19:12:30 2002
MEMORY CONFIGURATION
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
RESET 0 00000080 00000070
00000080 00000070 t54beg.obj (RESET)
Page 65 / 140
VDS (VoP Development System) Users Guide
Page 66 / 140
VDS (VoP Development System) Users Guide
Page 67 / 140
VDS (VoP Development System) Users Guide
Page 68 / 140
VDS (VoP Development System) Users Guide
address name
-------- ----
00000300 .bss
00000000 .data
00000775 .text
00000466 ACTADD
00000777 AD50Init
00000237 ADCTR
00000463 AICADD
00000234 AICWRD
00000440 AMPADD
00000211 AMPSCL
0000045d ANAADD
0000022e ANABFK
0000025c ANGLE
00000448 AP2ADD
00000455 APCADD
Page 69 / 140
VDS (VoP Development System) Users Guide
00000226 APCOEF
00000219 APSCL2
00000180 ARCTAN
0000025b BASANG
0000042f BDADD
00000469 BF2ADD
0000025a BFDONE
0000043d BFLADD
0000043f BFNADD
00000200 BOARD
00000456 BPCADD
00000227 BPCOEF
0000020e BUFLEN
00000210 BUFNUM
0000024b BUFPTR
00000431 BZYADD
00000202 BZYFLG
00000445 CF1ADD
0000044a CF2ADD
00000446 CHLADD
00000217 CHNLIST
000003c0 COEFF1
000003e0 COEFF2
00000216 COFXF1
0000021b COFXF2
0000019e CONVLV
00000249 COUNT
0000020a COUPL
00000439 CPLADD
00000243 CURCHN
00000259 CURTRC
00000238 DACTR
00000467 DCTADD
00000380 DELAY1
000003a0 DELAY2
0000025d DENOM
00000449 DF2ADD
0000021a DFSET2
00000241 DISCARD
00000441 DOFADD
00000212 DOFSET
00000261 DSIGN
00000b2b DSKInit
00000200 DSOFF
00000004 DSPAGE
00000444 DUPADD
00000215 DUPCHN
00000d5e EXP2
000004a3 FDIV
00000264 FDRVAL
00000daf FFT
00000436 FFTADD
00000255 FFTBUF
00000254 FFTFLG
000004c3 FFTOUT
00000207 FFTSIZ
00000e6d FILTER
0000023d FILUPD
00000415 FIR
0000044d FL1ADD
0000044e FL2ADD
0000021e FLLEN1
0000021f FLLEN2
00000222 FLTYP1
0000023b FLTYP2
00000206 FRMSIZ
00000426 FS1
0000043b FSMADD
0000020c FS_MODE
00000223 FS_VAL
00000451 FT1ADD
Page 70 / 140
VDS (VoP Development System) Users Guide
0000046a FT2ADD
0000046c FUPADD
0000043a GNLADD
0000020b GNLIST
0000026b I
00000ed5 I2L1
00000edb I2S1
00000ee2 I2S2
00000eea I3L1
00000eed I3L2
00000ef0 I3L3
00000efd I3L4
00000eef I3S1
00000ef4 I3S2
00000ee8 I3S3
0000026f IA
00000275 IADD
0000048d IDIV
00000270 IE
00000ed1 IIR2
00000ee5 IIR3
00000278 IMAG
0000021d IMAX
0000044c IMXADD
00000747 INT_ENABLE
00000eff ISR0_COMMON
00000f83 ISR1_COMMON
00001800 ISR2_COMMON
00001881 ISR5_COMMON
00001921 ISR6_COMMON
00000fc8 ISR_5402
00000fd6 ISR_5402_JUMP
00000fe2 ISR_DSK542
00000ff4 ISR_DSK542_JUMP
00001a4a ISR_SD4_JUMP
000019d9 ISR_SD4_RX
00001a10 ISR_SD4_TX
00000274 J
0000026c L
00000276 LADD
00000464 LC1ADD
00000465 LC2ADD
0000044f LG1ADD
00000450 LG2ADD
00000220 LGFLG1
00000221 LGFLG2
00001a59 LOG2
00000235 LOGC1
00000236 LOGC2
00000272 LOGFLG
000000f0 MAG
0000027b MAGVAL
0000022a MAXA
00000437 MAXADD
0000022b MAXB
0000000b MAXFFTSIZE
00001a91 MAXFIN
00000279 MAXI
00000208 MAXMAG
00000462 MDLADD
00000433 MINADD
0000027a MINI
00000204 MINMAG
00000430 MODADD
00001aac MODUL0
000004f3 MODUL1
00001abe MODUL2
00001ad1 MODUL3
00001b03 MODUL4
00001b23 MODUL5
00001ba6 MODUL7
Page 71 / 140
VDS (VoP Development System) Users Guide
00000233 MODULE
00000201 MODVAL
00000461 MONADD
00000232 MONTOR
00001c15 MOVE
0000045f MPBADD
00000230 MPBBFK
00000258 MPBSAV
00000459 MXAADD
0000045a MXBADD
00000272 N1
00000273 N2
0000045b NCHADD
0000027c NSTAT
0000022c NUMCHN
0000024e NUMCHNM1
0000025e NUMER
0000023f ONE
00000434 ORDADD
00000205 ORDVAL
00000252 OUTPC
00000246 OUTTRA
00000248 OUTTRB
00000432 OVFADD
00000203 OVFFLG
0000043e PCBADD
0000020f PCBFLG
00001c45 PHASE
00000443 PHRADD
00000214 PHZREQ
00006488 PI
00003244 PIOV2
0000024d PRVTRG
00000453 PW1ADD
00000454 PW2ADD
00000224 PWFLG1
00000225 PWFLG2
00000273 PWRFLG
0000046b QNTADD
0000023c QNUM
00000271 QUARTN
0000025f QUOTNT
00000277 REAL
00000256 RIB1
00000257 RIB2
0000045e RIBADD
0000022f RIBBFK
00000438 RIFADD
00000209 RIFLAG
0000021c RMAX
0000044b RMXADD
00000251 SAMP1
00000245 SAMPLA
00000247 SAMPLB
00000244 SAMPLE
0000045c SBTADD
00001200 SINTAB
00000435 SIZADD
00001c87 SPAOUT
0000024a SPTEMP
00001d0c SQRT
00000452 SR2ADD
0000023a STBFLN
0000025b STBPTR
00000dce STFOR1
00000dd1 STFOR2
00000468 STMADD
00000239 STMBFK
0000022d SUBTYP
00000253 SYNFLG
00000275 TASAV
Page 72 / 140
VDS (VoP Development System) Users Guide
00000276 TBSAV
00000447 TCHADD
0000024f TEMP
00000250 TEMP2
00000260 TEMPD1
00000457 TF1ADD
00000458 TF2ADD
00000228 TFFLG1
00000229 TFFLG2
00000274 TFRFLG
00000245 TRACE1
00000247 TRACE2
0000043c TRGADD
00000218 TRGCHN
0000024c TRGFLG
0000020d TRGVAL
0000026e WI
00000442 WINADD
00001d45 WINDOW
00000213 WINSCL
00000460 WNDADD
00000231 WNDBFK
0000026d WR
00001d87 XFER
00000265 XI
00000267 XL
00000269 XT
00000266 YI
00000268 YL
0000026a YT
00000240 ZERO
00000211 _AMPSCL
0000022e _ANABFK
00000219 _APSCL2
0000043f _BFNADD
00000200 _BOARD
0000020e _BUFLEN
00000210 _BUFNUM
0000024b _BUFPTR
00000217 _CHNLIST
00000216 _COFXF1
0000021b _COFXF2
00000302 _ChanList_Shifted
0000021a _DFSET2
00000212 _DOFSET
0000023d _FILUPD
0000021e _FLLEN1
0000021f _FLLEN2
00000222 _FLTYP1
0000023b _FLTYP2
00000206 _FRMSIZ
0000020c _FS_MODE
00000223 _FS_VAL
00000ab4 _InitBSP
00000954 _InitMcBSP
00000747 _InterruptEnable
0000022a _MAXA
0000022b _MAXB
00000b91 _MODUL6
00000201 _MODVAL
00000230 _MPBBFK
00000459 _MXAADD
0000045a _MXBADD
0000022c _NUMCHN
00000246 _OUTTRA
0000043e _PCBADD
0000020f _PCBFLG
0000027d _ProcessorType
0000023c _QNUM
0000022f _RIBBFK
00000301 _RxByteFlag
Page 73 / 140
VDS (VoP Development System) Users Guide
000019fd _RxRead1
00001a03 _RxRead2
00001a0c _RxRead3
00000bc2 _SD4Init
0000023a _STBFLN
0000025b _STBPTR
00000239 _STMBFK
0000022d _SUBTYP
00000ccb _StandAloneInit
00000c8c _SyncSerialInit
00000300 _TxByteFlag
00001a37 _TxWrite1
00001a3c _TxWrite2
00001a41 _TxWrite3
00000d34 _UserProc
00000231 _WNDBFK
00000100 __STACK_SIZE
00000300 ___bss__
ffffffff ___cinit__
00000000 ___data__
00000000 ___edata__
00000303 ___end__
00000d5e ___etext__
ffffffff ___pinit__
00000775 ___text__
00000001 __lflags
00000af5 _c_init
00000401 _c_int00
00000802 _getMcBSPInfo
0000088f _getMcBSPSubReg
000008a3 _setMcBSPSubReg
000008b8 _setMcBSPSubRegAll
ffffffff cinit
00000000 edata
00000303 end
00000d5e etext
ffffffff pinit
address name
-------- ----
00000000 ___edata__
00000000 ___data__
00000000 edata
00000000 .data
00000001 __lflags
00000004 DSPAGE
0000000b MAXFFTSIZE
000000f0 MAG
00000100 __STACK_SIZE
00000180 ARCTAN
0000019e CONVLV
00000200 BOARD
00000200 _BOARD
00000200 DSOFF
00000201 _MODVAL
00000201 MODVAL
00000202 BZYFLG
00000203 OVFFLG
00000204 MINMAG
00000205 ORDVAL
00000206 _FRMSIZ
00000206 FRMSIZ
00000207 FFTSIZ
00000208 MAXMAG
00000209 RIFLAG
0000020a COUPL
0000020b GNLIST
0000020c FS_MODE
Page 74 / 140
VDS (VoP Development System) Users Guide
0000020c _FS_MODE
0000020d TRGVAL
0000020e _BUFLEN
0000020e BUFLEN
0000020f _PCBFLG
0000020f PCBFLG
00000210 _BUFNUM
00000210 BUFNUM
00000211 AMPSCL
00000211 _AMPSCL
00000212 DOFSET
00000212 _DOFSET
00000213 WINSCL
00000214 PHZREQ
00000215 DUPCHN
00000216 _COFXF1
00000216 COFXF1
00000217 _CHNLIST
00000217 CHNLIST
00000218 TRGCHN
00000219 _APSCL2
00000219 APSCL2
0000021a DFSET2
0000021a _DFSET2
0000021b _COFXF2
0000021b COFXF2
0000021c RMAX
0000021d IMAX
0000021e _FLLEN1
0000021e FLLEN1
0000021f _FLLEN2
0000021f FLLEN2
00000220 LGFLG1
00000221 LGFLG2
00000222 FLTYP1
00000222 _FLTYP1
00000223 _FS_VAL
00000223 FS_VAL
00000224 PWFLG1
00000225 PWFLG2
00000226 APCOEF
00000227 BPCOEF
00000228 TFFLG1
00000229 TFFLG2
0000022a _MAXA
0000022a MAXA
0000022b MAXB
0000022b _MAXB
0000022c NUMCHN
0000022c _NUMCHN
0000022d SUBTYP
0000022d _SUBTYP
0000022e _ANABFK
0000022e ANABFK
0000022f RIBBFK
0000022f _RIBBFK
00000230 MPBBFK
00000230 _MPBBFK
00000231 WNDBFK
00000231 _WNDBFK
00000232 MONTOR
00000233 MODULE
00000234 AICWRD
00000235 LOGC1
00000236 LOGC2
00000237 ADCTR
00000238 DACTR
00000239 _STMBFK
00000239 STMBFK
0000023a _STBFLN
0000023a STBFLN
Page 75 / 140
VDS (VoP Development System) Users Guide
0000023b FLTYP2
0000023b _FLTYP2
0000023c QNUM
0000023c _QNUM
0000023d FILUPD
0000023d _FILUPD
0000023f ONE
00000240 ZERO
00000241 DISCARD
00000243 CURCHN
00000244 SAMPLE
00000245 TRACE1
00000245 SAMPLA
00000246 OUTTRA
00000246 _OUTTRA
00000247 SAMPLB
00000247 TRACE2
00000248 OUTTRB
00000249 COUNT
0000024a SPTEMP
0000024b BUFPTR
0000024b _BUFPTR
0000024c TRGFLG
0000024d PRVTRG
0000024e NUMCHNM1
0000024f TEMP
00000250 TEMP2
00000251 SAMP1
00000252 OUTPC
00000253 SYNFLG
00000254 FFTFLG
00000255 FFTBUF
00000256 RIB1
00000257 RIB2
00000258 MPBSAV
00000259 CURTRC
0000025a BFDONE
0000025b BASANG
0000025b _STBPTR
0000025b STBPTR
0000025c ANGLE
0000025d DENOM
0000025e NUMER
0000025f QUOTNT
00000260 TEMPD1
00000261 DSIGN
00000264 FDRVAL
00000265 XI
00000266 YI
00000267 XL
00000268 YL
00000269 XT
0000026a YT
0000026b I
0000026c L
0000026d WR
0000026e WI
0000026f IA
00000270 IE
00000271 QUARTN
00000272 N1
00000272 LOGFLG
00000273 N2
00000273 PWRFLG
00000274 J
00000274 TFRFLG
00000275 TASAV
00000275 IADD
00000276 LADD
00000276 TBSAV
00000277 REAL
Page 76 / 140
VDS (VoP Development System) Users Guide
00000278 IMAG
00000279 MAXI
0000027a MINI
0000027b MAGVAL
0000027c NSTAT
0000027d _ProcessorType
00000300 _TxByteFlag
00000300 .bss
00000300 ___bss__
00000301 _RxByteFlag
00000302 _ChanList_Shifted
00000303 end
00000303 ___end__
00000380 DELAY1
000003a0 DELAY2
000003c0 COEFF1
000003e0 COEFF2
00000401 _c_int00
00000415 FIR
00000426 FS1
0000042f BDADD
00000430 MODADD
00000431 BZYADD
00000432 OVFADD
00000433 MINADD
00000434 ORDADD
00000435 SIZADD
00000436 FFTADD
00000437 MAXADD
00000438 RIFADD
00000439 CPLADD
0000043a GNLADD
0000043b FSMADD
0000043c TRGADD
0000043d BFLADD
0000043e PCBADD
0000043e _PCBADD
0000043f BFNADD
0000043f _BFNADD
00000440 AMPADD
00000441 DOFADD
00000442 WINADD
00000443 PHRADD
00000444 DUPADD
00000445 CF1ADD
00000446 CHLADD
00000447 TCHADD
00000448 AP2ADD
00000449 DF2ADD
0000044a CF2ADD
0000044b RMXADD
0000044c IMXADD
0000044d FL1ADD
0000044e FL2ADD
0000044f LG1ADD
00000450 LG2ADD
00000451 FT1ADD
00000452 SR2ADD
00000453 PW1ADD
00000454 PW2ADD
00000455 APCADD
00000456 BPCADD
00000457 TF1ADD
00000458 TF2ADD
00000459 MXAADD
00000459 _MXAADD
0000045a MXBADD
0000045a _MXBADD
0000045b NCHADD
0000045c SBTADD
0000045d ANAADD
Page 77 / 140
VDS (VoP Development System) Users Guide
0000045e RIBADD
0000045f MPBADD
00000460 WNDADD
00000461 MONADD
00000462 MDLADD
00000463 AICADD
00000464 LC1ADD
00000465 LC2ADD
00000466 ACTADD
00000467 DCTADD
00000468 STMADD
00000469 BF2ADD
0000046a FT2ADD
0000046b QNTADD
0000046c FUPADD
0000048d IDIV
000004a3 FDIV
000004c3 FFTOUT
000004f3 MODUL1
00000747 INT_ENABLE
00000747 _InterruptEnable
00000775 .text
00000775 ___text__
00000777 AD50Init
00000802 _getMcBSPInfo
0000088f _getMcBSPSubReg
000008a3 _setMcBSPSubReg
000008b8 _setMcBSPSubRegAll
00000954 _InitMcBSP
00000ab4 _InitBSP
00000af5 _c_init
00000b2b DSKInit
00000b91 _MODUL6
00000bc2 _SD4Init
00000c8c _SyncSerialInit
00000ccb _StandAloneInit
00000d34 _UserProc
00000d5e etext
00000d5e ___etext__
00000d5e EXP2
00000daf FFT
00000dce STFOR1
00000dd1 STFOR2
00000e6d FILTER
00000ed1 IIR2
00000ed5 I2L1
00000edb I2S1
00000ee2 I2S2
00000ee5 IIR3
00000ee8 I3S3
00000eea I3L1
00000eed I3L2
00000eef I3S1
00000ef0 I3L3
00000ef4 I3S2
00000efd I3L4
00000eff ISR0_COMMON
00000f83 ISR1_COMMON
00000fc8 ISR_5402
00000fd6 ISR_5402_JUMP
00000fe2 ISR_DSK542
00000ff4 ISR_DSK542_JUMP
00001200 SINTAB
00001800 ISR2_COMMON
00001881 ISR5_COMMON
00001921 ISR6_COMMON
000019d9 ISR_SD4_RX
000019fd _RxRead1
00001a03 _RxRead2
00001a0c _RxRead3
00001a10 ISR_SD4_TX
Page 78 / 140
VDS (VoP Development System) Users Guide
00001a37 _TxWrite1
00001a3c _TxWrite2
00001a41 _TxWrite3
00001a4a ISR_SD4_JUMP
00001a59 LOG2
00001a91 MAXFIN
00001aac MODUL0
00001abe MODUL2
00001ad1 MODUL3
00001b03 MODUL4
00001b23 MODUL5
00001ba6 MODUL7
00001c15 MOVE
00001c45 PHASE
00001c87 SPAOUT
00001d0c SQRT
00001d45 WINDOW
00001d87 XFER
00003244 PIOV2
00006488 PI
ffffffff ___pinit__
ffffffff pinit
ffffffff cinit
ffffffff ___cinit__
[336 symbols]
)
The distribution software does not initially contain all .OBJ files necessary to produce a
complete, default executable code module when the T54LINK.CMD control file (above) is
invoked with the Texas Instruments linker utility. Each .ASM module above must be assembled
first; use the BUILD.BAT file to do this.
1) Make changes to C54xx source code, keeping in mind the necessary shared variables between
Hypersignal and the C54xx processor. The file T54DEF.ASM is well documented in this area.
2) Assemble all modules changed and any new modules created (using Texas Instruments
"COFF" assembler) to ensure that a new .OBJ (object) file is generated for each altered module.
For convenience, an "ASM.BAT" batch file has been provided that can be invoked as
ASM filename <car ret>
to assemble source code modules (entering the .ASM extension after "filename" is optional).
This file executes
asm500 -l -v549 -mg %1 > %1.err
type %1.err
statements, where %1 is the filename. If a new module has been created, be sure to add it to the
T54LINK.CMD control file (use an ASCII text-editor to update the T54LINK.CMD file).
Page 79 / 140
VDS (VoP Development System) Users Guide
3) Re-link all modules using Texas Instruments C54xx "lnk500" linker. A "LNK.BAT" batch
file has been provided that can be used by invoking:
LNK <car ret>
lnk500 T54LINK.CMD
statement, where "T54LINK.CMD" is an ASCII linker-command file that specifies all .OBJ files
to be linked by the dsplnk.exe program, as well as specific information about memory addresses
for some sections.
4) Copy the resulting .OUT file to \hsmacro or \dspower subdirectories, run the desired host
program, and invoke the appropriate functions. When using DSPower programs, the .OUT
filename can be specified in the Hardware Manager dialog box (DSP Program File field) or in a
LoadFileProcessor() or LoadFileBoard() function call. When using Hypersignal software, the
.OUT filename can be specified in the System Config menu (added after the board designator
with a separating comma). It is also possible to simply copy the resulting .OUT file to \hsmacro
or \dspower subdirectories over the existing, default tmsc54x.out file. However, in this case, it is
suggested that a backup of the original file be made first in case the new code does not work. In
either case, the DSPower or Hypersignal COFF file download function calls will read the .OUT
file directly according to Texas Instruments COFF file format and download all code and data.
A subsequent RunProcessor() or RunBoard() function call will begin execution at the reset
vector location.
5) There are several references to "trace" and "channel" in DSP source code and source code
variable descriptions. Traces are references to waveforms in displays or waveform files, whereas
channels refer to the physical analog input or output connection on the DSP/analog hardware. A
logical-to-physical mapping takes place when channel lists are sent from Hypersignal software or
DSPower programs to executing DSP code.
1) All code has been tested using version 3.50 of "asm500.exe" and "lnk500.exe".
Page 80 / 140
VDS (VoP Development System) Users Guide
2) To modify the default time data, frequency domain output data, or other buffer addresses,
please consult the comments and suggestions in the T54DEF.ASM file.
3) The LNK.BAT file produces a "T54LINK.MAP" map file which can be used to check for
overlaps and current locations of variables, buffers, and code sections. The map file also shows
the starting address and length of each code module included in the current executable output
file. When significant amounts of code are added, extra attention should be paid to the length of
the executable file as compared to the amount of program memory available. If the available
program memory is exceeded, problems can occur which may be difficult to pin down. Such
problems can seem to result from other causes, and can lead to unnecessary time spent searching
for the real cause.
4) The T54LINK.CMD file creates non-initialized "holes" from 0x80 through 0xff and from
0x1000 through 0x1005that is intended to leave room for the “talker” program (see section 5.3.2
above). The DSPower and Hypersignal COFF download function calls ignore non-initialized
sections in the COFF file and do not download to the area specified by the section.
5) Run-time 'C' support is made necessary by adding C code with functions or routines that
require math and other support libraries. Typically; the library file "rtsPP.lib" would be required,
where PP is a name assigned by the DSP chip manufacturer (for example “54” for C54xx, "30"
for C3x, "56" for 56xxx, etc.). This can be added to the .CMD file being used, or the
xxxLINKC.CMD and xxxLINKC.CTL command/control files can be used to link in the
appropriate rtsPP.lib file.
6) If DSP program filename has been changed from the default (by renaming the output of
lnkc.bat or by giving lnkc.bat a filename parameter), DSPower programs or Hypersignal
software must know about the name change. To do this in DSPower programs, change the value
of the DSP Program File field in the Hardware Manager dialog box (or change the value of
LoadFileProcessor and LoadFileBoard calls in the programs). To do this in Hypersignal
software, suffix the filename to the appropriate field in the System Config menu. For example, if
the Hypersignal Analog Conversion function is being used for test, then add the new filename to
the ANALOG CONVERSION field in the System Config menu; for example, this might be an
entry like 'IIC31-B-50,test.out', 'TBS56-B,AC3.OUT' or 'sig32c,dsp32cxx.out'.
• Set any jumpers that may be required on the board or module itself. See the jumper list
and/or hardware manufacturer documentation.
Page 81 / 140
VDS (VoP Development System) Users Guide
• Select External Sample Clock in the Hardware Manager dialog box or in DSPower
function calls, or enter '-EXT' after the board designator in the Hypersignal System
Configuration menu. This causes the high-level software to set the value of the shared
variable "FS_MODE" as appropriate for external clock operation. If due to the design of
the board no setting is possible, then the value of FS_MODE will be zero. If the high-
level software does not set the value correctly, or the hardware has customized external
sampling circuitry, then the FS_MODE variable should still be used to control the
sampling rate. In this case, the DSP source code should be modified as needed.
• The actual sampling rate value is contained in the shared variable "FS_VALUE". The
value is in Hz (Hertz); note that for C54xx boards, which use 16-bit wide memory
accesses, the maximum value that can be represented is limited to 65535. This value is
initialized by the high-level software, based on what is entered in the current menu
(SAMPLING FREQ field).
All interrupt service routines fully save and restore machine context to protect registers they
modify and some routines (such as the “snap-in” real-time filter routines included in the C67xx
source code library also save and restore registers they use. In all chip families the Digital
Oscilloscope and Spectrum Analyzer functions provide the best examples of full context-save
interrupt service routines combined with substantial foreground processing constructed from
many of the routines in the source code library.
The C67xx Source Code Interface base file list includes .asm and .c function and analog I/O files
plus linker control files and support utilities.
Page 82 / 140
VDS (VoP Development System) Users Guide
The C67xx source code interface supports the basic "modes" of operation below:
Page 83 / 140
VDS (VoP Development System) Users Guide
one way to do this is to leave an non-initialized section, or hole, in the linker command file. An
example linker command file is printed below which shows how to do this.
In addition, there are several pre-defined “DSP properties” which can be set by the host to
initialize and control default operating modes. These properties are implemented as shared,
global variables in the DSP code; they are well documented in the file t54beg.asm. Do not insert
any code of any type before these addresses that would cause them to move.
The talker currently resides in onchip program memory, from 0x80 to 0x100. In addition, it uses
6 words in onchip memory at 0x1000 for a “command structure” used to communicate with host
drivers.
See Appendix B, C67xx Talker Program, for talker source code and map file.
Page 84 / 140
VDS (VoP Development System) Users Guide
The distribution software does not initially contain all .OBJ files necessary to produce a
complete, default executable code module when the T54LINK.CMD control file (above) is
invoked with the Texas Instruments linker utility. Each .ASM module above must be assembled
first; use the BUILD.BAT file to do this.
1) Make changes to C67xx source code, keeping in mind the necessary shared variables between
Hypersignal and the C67xx processor. The file T67DEF.ASM is well documented in this area.
2) Assemble all modules changed and any new modules created (using Texas Instruments
"COFF" assembler) to ensure that a new .OBJ (object) file is generated for each altered module.
For convenience, an "ASM.BAT" batch file has been provided that can be invoked as
Page 85 / 140
VDS (VoP Development System) Users Guide
to assemble source code modules (entering the .ASM extension after "filename" is optional).
This file executes
asm500 -l -v549 -mg %1 > %1.err
type %1.err
statements, where %1 is the filename. If a new module has been created, be sure to add it to the
T54LINK.CMD control file (use an ASCII text-editor to update the T54LINK.CMD file).
3) Re-link all modules using Texas Instruments C67xx "lnk500" linker. A "LNK.BAT" batch
file has been provided that can be used by invoking:
LNK <car ret>
lnk500 T54LINK.CMD
statement, where "T54LINK.CMD" is an ASCII linker-command file that specifies all .OBJ files
to be linked by the dsplnk.exe program, as well as specific information about memory addresses
for some sections.
4) Copy the resulting .OUT file to \hsmacro or \dspower subdirectories, run the desired host
program, and invoke the appropriate functions. When using DSPower programs, the .OUT
filename can be specified in the Hardware Manager dialog box (DSP Program File field) or in a
LoadFileProcessor() or LoadFileBoard() function call. When using Hypersignal software, the
.OUT filename can be specified in the System Config menu (added after the board designator
with a separating comma). It is also possible to simply copy the resulting .OUT file to \hsmacro
or \dspower subdirectories over the existing, default tmsc54x.out file. However, in this case, it is
suggested that a backup of the original file be made first in case the new code does not work. In
either case, the DSPower or Hypersignal COFF file download function calls will read the .OUT
file directly according to Texas Instruments COFF file format and download all code and data.
A subsequent RunProcessor() or RunBoard() function call will begin execution at the reset
vector location.
5) There are several references to "trace" and "channel" in DSP source code and source code
variable descriptions. Traces are references to waveforms in displays or waveform files, whereas
channels refer to the physical analog input or output connection on the DSP/analog hardware. A
logical-to-physical mapping takes place when channel lists are sent from Hypersignal software or
DSPower programs to executing DSP code.
Page 86 / 140
VDS (VoP Development System) Users Guide
1) All code has been tested using version 2.1 of Code Composer Studio.
2) To modify the default time data, frequency domain output data, or other buffer addresses,
please consult the comments and suggestions in the T67DEF.ASM file.
3) The Code Composer Studio linking procedure produces a map file (extension .MAP) which
can be used to check for overlaps and current locations of variables, buffers, and code sections.
The map file also shows the starting address and length of each code module included in the
current executable output file. When significant amounts of code are added, extra attention
should be paid to the length of the executable file as compared to the amount of program
memory available. If the available program memory is exceeded, problems can occur which
may be difficult to pin down. Such problems can seem to result from other causes, and can lead
to unnecessary time spent searching for the real cause.
4) If DSP program filename has been changed from the default (by renaming the output file in
the CCS project options), DSPower programs or Hypersignal software must know about the
name change. To do this in DSPower programs, change the value of the DSP Program File field
in the Hardware Manager dialog box (or change the value of LoadFileProcessor and
LoadFileBoard calls in the programs). To do this in Hypersignal software, suffix the filename to
the appropriate field in the System Config menu. For example, if the Hypersignal Analog
Conversion function is being used for test, then add the new filename to the ANALOG
CONVERSION field in the System Config menu; for example, this might be an entry like
'IIC31-B-50,test.out', 'TBS56-B,AC3.OUT' or 'sig32c,dsp32cxx.out'.
• Set any jumpers that may be required on the board or module itself. See the jumper list
and/or hardware manufacturer documentation.
• Select External Sample Clock in the Hardware Manager dialog box or in DSPower
function calls, or enter '-EXT' after the board designator in the Hypersignal System
Configuration menu. This causes the high-level software to set the value of the shared
variable "FS_MODE" as appropriate for external clock operation. If due to the design of
the board no setting is possible, then the value of FS_MODE will be zero. If the high-
level software does not set the value correctly, or the hardware has customized external
Page 87 / 140
VDS (VoP Development System) Users Guide
sampling circuitry, then the FS_MODE variable should still be used to control the
sampling rate. In this case, the DSP source code should be modified as needed.
• The actual sampling rate value is contained in the shared variable "FS_VALUE". The
value is in Hz (Hertz); note that for C67xx boards, which use 16-bit wide memory
accesses, the maximum value that can be represented is limited to 65535. This value is
initialized by the high-level software, based on what is entered in the current menu
(SAMPLING FREQ field).
• a new buffer of sampled time data has been gathered by the background ISR and analog
input hardware drivers and is ready for processing
• the last buffer of processed data has been output by the analog output drivers
Page 88 / 140
VDS (VoP Development System) Users Guide
2) The routines getData, sendData, getCoeff, sendCoeff are not shown for clarity. These are in
the .c files included in the MELP source code.
3) In this example, the actual routines which call analysis (encode) and synthesis (decode) are
melp_ana and melp_syn.
/******************************************************************************
/*
/* COPYRIGHT (C) SIGNALOGIC, INC, 1991-2000
/*
/* Mixed Excitation LPC speech coder
/* void main()
/* initialization
/* foreground loop
/* buffer processing
/*
******************************************************************************/
#include "melp.h"
#include "spbstd.h"
#include "mat.h"
/* Globals */
int saturation = 0;
int complexity;
/* external memory */
Shortword melpmode;
Shortword opmode;
Shortword speech_in[FRAME];
Shortword speech_out[FRAME];
Shortword speech_save[FRAME];
Shortword loopcnt;
UShortword chbuf[CHSIZE];
Shortword TxByteFlag;
Shortword RxByteFlag;
Shortword RxPTR;
Page 89 / 140
VDS (VoP Development System) Users Guide
Shortword RxBP;
Shortword RxMP;
Shortword RxEP;
Shortword TxPTR;
Shortword TxBP;
Shortword TxEP;
void main() {
/* initialize variables */
rdmemptr = getframeaddr;
wrmemptr = sendframeaddr;
rdcoeffptr = getcoeffaddr;
wrcoeffptr = sendcoeffaddr;
RxBP = (Shortword)getframeaddr;
RxPTR = RxBP;
RxMP = RxBP + FRAMESIZE;
RxEP = RxBP + 2 * FRAMESIZE;
TxBP = (Shortword)sendframeaddr;
TxPTR = TxBP;
TxEP = TxBP + 2 * FRAMESIZE;
/* re-initialize sys_memory */
minit();
if (melpmode != SYNTHESIS)
melp_ana_init();
if (melpmode != ANALYSIS)
melp_syn_init();
if (opmode == REAL_TIME) {
bzyflg = 0;
melpflg = 0;
BSP_Init();
melp_real();
}
else
melp_simu();
}
int melp_real() {
Shortword i,j;
Longword frame;
Shortword eof_reached;
static struct melp_param melp_par; /* melp parameters */
Shortword *input, *output, temp;
frame = 0;
melp_par.chptr = chbuf;
melp_par.chbit = 0;
Page 90 / 140
VDS (VoP Development System) Users Guide
eof_reached = 0;
loopcnt = 0;
while (eof_reached == 0) {
#if debug
#elif
/* if Analysis enabled... */
/* if Synthesis enabled... */
melp_syn(&melp_par, speech_out);
#endif
Page 91 / 140
VDS (VoP Development System) Users Guide
The steps required to modify MELP source code and re-build a MELP real-time executable
COFF file are listed below:
2) Run Asm batch (command) file for asm files that use mnemonic instruction set. Run
Asma.bat file for asm files that use algebraic instruction set.
4) Run Lnk batch (command) file to link all .obj files and re-build a MELP executable COFF
file (default filename is melptest.out).
6) Re-run MELP IDE software; make sure DSP Program File field in Hardware Manager dialog
box matches the linker output filename used in step 5) above.
Page 92 / 140
VDS (VoP Development System) Users Guide
1) The default melptest.out executable has been built with the following Texas Instruments
development tools:
lnk500 melp.cmd
Page 93 / 140
VDS (VoP Development System) Users Guide
Note: Certain algorithm source code products that incorporate the C54xx Source Code Interface (e.g. MELP, MP3,
etc.) may supercede or augment either the C54xx Source Code License Agreement or the NDA requirement or both.
Currently, this includes:
Hyperception, Inc. and Signalogic, Inc. reserve all rights to C54xx Source Code supplied with "Hypersignal" series software.
The C54xx Source Code may still contain sections of original C25 Source Code Developed at Hyperception in 1987-1991, and
protected by License Agreements established between Hyperception and Signalogic in 1991-1993.
COMPETING PRODUCT means a product that performs similar digital signal processing and/or math processing, analysis,
display, measurement, instrumentation, data acquisition, or real-time signal processing functions as Signalogic DSP software
products.
THE PURPOSE OF THIS LICENSE AGREEMENT IS TO ESTABLISH THE BASIS ON WHICH YOU CAN USE THE C54XX SOURCE
CODE, BUT PREVENT YOU OR ANOTHER PARTY ASSOCIATED WITH YOU FROM INCLUDING THE C54XX SOURCE CODE
WITHIN OR WITH A COMPETING PRODUCT. USE OF THE C54XX SOURCE CODE BY YOU FOR PURPOSES OF RESALE OR
PROFIT, OR FOR PARTIAL OR WHOLE INCLUSION IN ANY OTHER SOFTWARE INTENDED FOR SALE OR PROFIT, IS STRICTLY
PROHIBITED.
You are free to copy source code sections to make backup copies and to perform experimentation and testing during algorithm
and product development and research. If it is discovered that you have enabled another party to obtain C54xx Source Code
through resale, lending out, carelessness, negligence, or inaction then HYPERCEPTION AND SIGNALOGIC ARE PREPARED TO
PROSECUTE TO THE FULLEST EXTENT OF THE LAW. You must treat the C54xx Source Code with the same care and
protection as your own valuable confidential and proprietary information.
YOU ACKNOWLEDGE THAT YOU HAVE READ THE ABOVE AGREEMENT, UNDERSTAND IT, AND AGREE TO BE BOUND BY ITS
TERMS AND CONDITIONS. YOU FURTHER AGREE THAT IT AND THE HYPERSIGNAL DSP SOURCE CODE NON-DISCLOSURE
AGREEMENT IS THE COMPLETE AND EXCLUSIVE STATEMENT OF ANY AGREEMENT BETWEEN US, INCLUDING ANY OTHER
ORAL OR WRITTEN COMMUNICATION.
Page 94 / 140
VDS (VoP Development System) Users Guide
; ***************************************************************************
; dskc54hi.asm: Talker program for DSPower and Hypersignal software
; Copyright (C) 1998-2002, Signalogic
;
; Created: Oct98, RC
; Modified: Nov98, RC
; Modified: Dec98, RC
; Modified: Jun98, RC (added far addressing)
; Modified: Jul99, JHB (fixed 100h reset bug, added "interrupt safe" loop)
; Modified: Jan01, JHB (added stack pointer initialization)
; Modified: Apr02, JHB (serial port reset at program launch)
; Modified: May02, JHB (added far code support)
; Modified: Jun24, JHB (added BSP/McBSP 0 and 1 reset and Tx clear in launch command)
;
; ***************************************************************************
.width 80
.length 55
.def main
.def hpiint
.mmregs
.bss COMMAND,1
.bss PUDDADDR,1
.bss PUADDRHI,1
.bss LENGTH,1
.bss DUPDADDR,1
.bss HPIbuf,1
;======================================================================
;
; BEGIN OF MAIN PROGRAM
;
;======================================================================
.text
Page 95 / 140
VDS (VoP Development System) Users Guide
.sect "HI_START"
Page 96 / 140
VDS (VoP Development System) Users Guide
hi_start:
push(st0)
push(st1)
push(ar3)
push(ar2)
push(ar1)
push(al)
push(ah)
push(ag)
ar3 = a
goto restore
ar3 = a
goto restore
Page 97 / 140
VDS (VoP Development System) Users Guide
goto restore
bl = #0
bh = #1
Page 98 / 140
VDS (VoP Development System) Users Guide
nxt5:
ag = pop()
ah = pop()
al = pop()
ar1 = pop()
ar2 = pop()
ar3 = pop()
st1 = pop()
st0 = pop()
.end
MEMORY {
PAGE 0: PROG: ORIGIN = 00H, LENGTH = 027FFH
PAGE 1: DATA: ORIGIN = 00H, LENGTH = 027FFH
}
SECTIONS {
.text 80H : { } PAGE 0
HI_START 100H : { } PAGE 0
.bss 1000H : { } PAGE 1
}
DSKC54HI
******************************************************************************
TMS320C54x COFF Linker PC Version 3.70
******************************************************************************
>> Linked Wed Jul 17 10:33:30 2002
MEMORY CONFIGURATION
Page 99 / 140
VDS (VoP Development System) Users Guide
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
.text 0 00000080 00000080
00000080 00000080 DSKC54HI.obj (.text)
address name
-------- ----
00001000 .bss
00000000 .data
00000080 .text
00001000 ___bss__
00000000 ___data__
00000000 ___edata__
00001006 ___end__
00000100 ___etext__
00000080 ___text__
00000000 __lflags
00000000 edata
00001006 end
00000100 etext
000000e4 hpiint
00000112 main
address name
-------- ----
00000000 ___edata__
00000000 ___data__
00000000 __lflags
00000000 edata
00000000 .data
00000080 ___text__
00000080 .text
000000e4 hpiint
00000100 etext
00000100 ___etext__
00000112 main
00001000 ___bss__
00001000 .bss
00001006 ___end__
00001006 end
[15 symbols]
MEMORY
{
/*
PAGE 0: EXT4 (RWX): origin = 7c00h length = 8400h
*/
PAGE 0: EXT4 (RWX): origin = 7b80h length = 8480h
/* Reserved3: unused */
SECTIONS {
melp_rt.obj (.text)
ss_comm.obj (.text)
}
t54beg
t54def
c_init
/* .c files */
*/
-l rts_x.lib
melp_sub
vq_lib
dsp_sub
fec_code
fs_lib
lpc_lib
mat_lib
math_lib
melp_chn
pit_lib
coeff
mathhalf
mathdp31
/* asm files */
fsvq_cbd
msvq_cbd
frm_mv
isr_sd4
/*
old: replaced by isr_sd4
tic54x
*/
isr_sync
envelope
negate
shr
shl
add
sub
fill_new
extract
deposit
zerflt
window
window_q
divide
l_sub
mult
l_mult
l_mac
v_scale
v_add
v_zap
v_sub
packcd
unpackcd
norm_s
norm_l
fpitscal
iir_2ndd
iir_2nds
lpc_syn
lpc_aejw
lpc_bwex
vequ_shr
ldivide2
lsqrtfxp
iterpary
lvinner
l_msu
l_abs
l_mpyu
vscalshl
cos_fxp
ref2pred
vq_msd2
lsp2pred
lpc_acor
lpcschur
l_shr
zerflt_q
pow10fxp
rand_num
sin_fxp
lv_magsq
l_mpy_ls
shift_r
scaladjl
vq_enc
abs_s
l_add
round
log10fxp
sqrt_fxp
peakines
lsp2freq
v_equ
cfft
findharm
vq_ms4
find_pit
idftreal
/* the following .asm files are not yet bit-exact; use C substitute */
/* l_shl */
MEMORY CONFIGURATION
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
HI_START 0 00000100 00000080 UNINITIALIZED
address name
-------- ----
00003600 .bss
00000f00 .data
00007b80 .text
00000241 ACHIST
00000242 ACLOST
00000466 ACTADD
00000237 ADCTR
00000463 AICADD
00000234 AICWRD
00000440 AMPADD
00000211 AMPSCL
0000045d ANAADD
0000022e ANABFK
0000025c ANGLE
00000448 AP2ADD
00000455 APCADD
00000226 APCOEF
00000219 APSCL2
0000025b BASANG
0000042f BDADD
00000469 BF2ADD
0000025a BFDONE
0000043d BFLADD
0000043f BFNADD
00000200 BOARD
00000456 BPCADD
00000227 BPCOEF
0000020e BUFLEN
00000210 BUFNUM
0000024b BUFPTR
00000431 BZYADD
00000202 BZYFLG
00008c38 C$$EXIT
00000445 CF1ADD
0000044a CF2ADD
0000046f CFLAG
00000217 CHANNL
00000446 CHNADD
0000024e CHNTMP
000003c0 COEFF1
000003e0 COEFF2
00000216 COFXF1
0000021b COFXF2
00000249 COUNT
0000020a COUPL
00000439 CPLADD
00000243 CURCHN
00000259 CURTRC
00000238 DACTR
00000467 DCTADD
00000380 DELAY1
000003a0 DELAY2
0000025d DENOM
00000449 DF2ADD
0000021a DFSET2
00000441 DOFADD
00000212 DOFSET
00000261 DSIGN
00000444 DUPADD
00000215 DUPCHN
00000264 FDRVAL
00000436 FFTADD
0000d2c2 FFTBEG
00000255 FFTBUF
0000d38b FFTEND
00000254 FFTFLG
00000207 FFTSIZ
0000023d FILUPD
0000044d FL1ADD
0000044e FL2ADD
0000021e FLLEN1
0000021f FLLEN2
00000222 FLTYP1
0000023b FLTYP2
00000206 FRMSIZ
0000043b FSMADD
0000020c FS_MODE
00000223 FS_VAL
00000451 FT1ADD
0000046a FT2ADD
0000046c FUPADD
0000043a GNLADD
0000020b GNLIST
00000275 IADD
0000026f IA
0000026b I
00000270 IE
00000278 IMAG
0000021d IMAX
0000044c IMXADD
00000f00 ISR_SD4_RX
00000f3b ISR_SD4_TX
00000f7a ISR_SYNC_RX
00000fac ISR_SYNC_TX
00000274 J
00000276 LADD
00000464 LC1ADD
00000465 LC2ADD
0000044f LG1ADD
00000450 LG2ADD
0000026c L
00000220 LGFLG1
00000221 LGFLG2
00000235 LOGC1
00000236 LOGC2
00000272 LOGFLG
0000027b MAGVAL
00000437 MAXADD
0000022a MAXA
0000022b MAXB
0000000b MAXFFT
00000279 MAXI
00000208 MAXMAG
00000462 MDLADD
00000433 MINADD
0000027a MINI
00000204 MINMAG
00000430 MODADD
00000233 MODULE
00000201 MODVAL
00000461 MONADD
00000232 MONTOR
0000045f MPBADD
00000230 MPBBFK
00000258 MPBSAV
0000c000 MPIOV2
00000459 MXAADD
0000045a MXBADD
00000272 N1
00000273 N2
0000045b NCHADD
00000000 NOINTS
0000027c NSTAT
0000022c NUMCHN
0000025e NUMER
0000023f ONE
00000434 ORDADD
00000205 ORDVAL
00000252 OUTPC
00000246 OUTTRA
00000248 OUTTRB
00000432 OVFADD
00000203 OVFFLG
0000043e PCBADD
0000020f PCBFLG
00000443 PHRADD
00000214 PHZREQ
00008000 PI
00004000 PIOV2
0000024d PRVTRG
00000453 PW1ADD
00000454 PW2ADD
00000224 PWFLG1
00000225 PWFLG2
00000273 PWRFLG
00000400 Q12CON
0000046b QNTADD
0000023c QNUM
00000271 QUARTN
0000025f QUOTNT
00000277 REAL
00000256 RIB1
00000257 RIB2
0000045e RIBADD
0000022f RIBBFK
00000438 RIFADD
00000209 RIFLAG
0000021c RMAX
0000044b RMXADD
00000010 RXENBL
00000251 SAMP1
00000245 SAMPLA
00000247 SAMPLB
00000244 SAMPLE
0000045c SBTADD
00000435 SIZADD
00000004 SPPAGE
0000024a SPTEMP
00000452 SR2ADD
0000d2c2 STAGE1
0000d2d9 STAGE2
0000d2f0 STAGE3
0000d307 STAGE4
0000d31e STAGE5
0000d335 STAGE6
0000d34c STAGE7
0000d363 STAGE8
0000d37a STAGE9
0000027d STAT1
0000027c STAT
0000023a STBFLN
00000468 STMADD
00000239 STMBFK
0000022d SUBTYP
00000253 SYNFLG
00000275 TASAV
00000276 TBSAV
00000447 TCHADD
0000024f TEMP
00000250 TEMP2
00000260 TEMPD1
00000457 TF1ADD
00000458 TF2ADD
00000228 TFFLG1
00000229 TFFLG2
00000274 TFRFLG
00000245 TRACE1
00000247 TRACE2
0000043c TRGADD
00000218 TRGCHN
0000024c TRGFLG
0000020d TRGVAL
00000020 TXENBL
00000442 WINADD
0000026e WI
00000213 WINSCL
00000460 WNDADD
00000231 WNDBFK
0000026d WR
00000265 XI
00000267 XL
00000269 XT
00000266 YI
00000268 YL
0000026a YT
00000240 ZERO
00007dd2 _AudioClockAdjust
0000043f _BFNADD
00000210 _BUFNUM
00003d09 _DEBUG
00007e7b _GetSerialData
0000344a _InitBSP
000032d5 _InitMcBSP
0000a483 _LSP_init
0000bf01 _L_abs
0000cb44 _L_add
0000b442 _L_deposit_h
0000b43f _L_deposit_l
0000bafd _L_divider2
0000cbc9 _L_log10_fxp
0000b520 _L_mac
0000b2a0 _L_mpy_ll
0000ca48 _L_mpy_ls
0000bf05 _L_mpyu
0000bee9 _L_msu
0000b510 _L_mult
0000b37c _L_negate
0000a5eb _L_pow_fxp
0000b1ca _L_shift_r
0000b139 _L_shl
0000c605 _L_shr
0000bb7d _L_sqrt_fxp
0000b4ec _L_sub
0000a4f1 _L_v_add
0000a523 _L_v_equ
0000bec4 _L_v_inner
0000c9f5 _L_v_magsq
0000a5ca _L_v_zap
00003a0d _ProcIdFlag_Shifted
00003a0c _ProcIdFlag
00003c93 _RxBP
00003c91 _RxByteFlag
00003a08 _RxDataVal
00003c95 _RxEP
00003c94 _RxMP
00003c92 _RxPTR
00000f18 _RxRead1
00000f1e _RxRead2
00000f1e _RxRead3
00000f7c _RxRead4
00003c9a _RxSyncBP
00003c9c _RxSyncEP
00003c9b _RxSyncMP
00003c99 _RxSyncPTR
00003ca5 _Rx_sync_dead_count
000005f6 _SD4Init
00007e01 _SendSerialData
00003491 _SyncSerialInit
00003c97 _TxBP
00003c90 _TxByteFlag
00003a07 _TxDataVal
00003c98 _TxEP
00003c96 _TxPTR
00003c9e _TxSyncBP
00003ca0 _TxSyncEP
00003c9f _TxSyncMP
00003c9d _TxSyncPTR
00000f58 _TxWrite1
00000f5d _TxWrite2
00000f63 _TxWrite3
00000fb2 _TxWrite4
00000fd1 _TxWrite5
00000400 __STACK_SIZE
00000800 __SYSMEM_SIZE
00003600 ___bss__
00001600 ___cinit__
00000f00 ___data__
00000f00 ___edata__
000059a5 ___end__
0000ffa3 ___etext__
ffffffff ___pinit__
00007b80 ___text__
00005946 __cleanup_ptr
00000001 __lflags
00005da5 __sys_memory
0000b30c _a_get_data
0000b324 _a_put_data
00008c38 _abort
0000cb3a _abs_s
0000b40b _add
00003a05 _anasyn_loopback
00008c21 _atexit
00003a04 _audio_loopback
00009e3e _binprod_int
000055cd _bp_cof
000054d8 _bpf_den
000054ab _bpf_num
00009140 _bpvc_ana_init
00008ec0 _bpvc_ana
00003600 _bssBeg
000023a4 _bssSize
00003ca1 _bzyflg_rx_sync
00003c7d _bzyflg
00003ca2 _bzyflg_tx_sync
00007b80 _c_init
00008bb8 _c_int00
00008d2b _calloc
0000d290 _cfft
00003c2c _chbuf_ana
00003c50 _chbuf_syn
00003a01 _complexity
0000bf31 _cos_fxp
0000929e _dc_rmv
00003ca6 _debugvar
00005672 _disp_cof
0000b4cb _divide_s
0000a95b _double_chk
0000aa53 _double_ver
0000b33c _envelope
00008bfe _exit
0000b43b _extract_h
0000b433 _extract_l
00003a09 _fPolledTxSync
00003a0b _fUseSyncBit
00003a0a _fUseSyncWord
0000b69d _f_pitch_scale
00009b65 _fec_code
00009c86 _fec_decode
00000800 _fft_data
0000b420 _fill
0000d394 _find_harm_s1
00009f66 _find_harm
0000aab4 _find_pitch
0000d718 _find_pitch_asm
0000a09b _findmax
0000aadf _frac_pch
00008e06 _free
0000a0c5 _fs_init
00001ae5 _fsvq_cb
00004c5b _fsvq_weighted
000092ea _gain_ana
00007d8f _getData
00003165 _getMcBSPInfo
000031f2 _getMcBSPSubReg
00003c84 _getcoeffaddr
00003c80 _getframeaddr
0000d838 _idft_real
00003d0c _idftc
0000b721 _iir_2nd_d
0000b7b6 _iir_2nd_s
0000be77 _interp_array
0000b255 _isLwLimit
0000b27a _isSwLimit
00004c50 _lagw_cof
00009425 _lin_int_bnd
0000cb70 _log10_fxp
00003c2a _loopcnt
0000c337 _lpc_acor
0000b87f _lpc_aejw
0000ba6b _lpc_bwex
0000a0c6 _lpc_clmp
0000c0ef _lpc_lsp2pred
0000a274 _lpc_pred2lsp
0000a37c _lpc_pred2refl
0000bffb _lpc_refl2pred
0000a256 _lpc_schr
0000c4ac _lpc_schur_asm
0000b82e _lpc_syn
000054a2 _lpf_den
00005499 _lpf_num
000045cd _lsp_cos
00004c5a _lsp_delta
0000d12e _lsp_to_freq
0000b21d _mac_r
00007bb5 _main
00008cc4 _malloc
00003cab _mcbsp
00009967 _median
00007fac _melp_ana
00008341 _melp_ana_init
0000a72c _melp_chn_read
0000a612 _melp_chn_write
00007c02 _melp_real
0000845f _melp_syn
00008a29 _melp_syn_init
00003c7e _melpflg
00003a02 _melpmode
00008e89 _memmove
00008ca2 _minit
0000b239 _msu_r
000024e5 _msvq_cb
000058ac _msvq_cb_mean
0000b506 _mult
0000b206 _mult_r
0000b378 _negate
00009466 _noise_est
000094c5 _noise_sup
0000b692 _norm_l
0000b683 _norm_s
00003a03 _opmode
00003cb2 _pMcBSP
0000ae7d _p_avg_init
0000ae1c _p_avg_update
0000b5c2 _pack_code
0000d035 _peakiness
0000b0c4 _pitch_ana_init
0000ae9f _pitch_ana
0000575a _pitch_dec
000056f6 _pitch_enc
000056c2 _pmat74
000056d6 _pmat84
0000c6e5 _pow10_fxp
0000952b _q_bpvc
000095ab _q_bpvc_dec
00009602 _q_gain
000096dc _q_gain_dec
000099e7 _quant_u
00009a9f _quant_u_dec
00009adb _rand_minstdgen
0000c895 _rand_num
00003c8c _rdcoeffptr
00003c88 _rdmemptr
00008d52 _realloc
0000cb5f _round
00003ca4 _rx_received_sync_word
00003a00 _saturation
00009f08 _sbc_dec
00009ee0 _sbc_enc
00009f2e _sbc_syn
0000ca7b _scale_adj_loop
0000979a _scale_adj
00007db1 _sendData
00003c86 _sendcoeffaddr
00003c82 _sendframeaddr
0000321b _setMcBSPSubRegAll
00003206 _setMcBSPSubReg
0000ca5d _shift_r3
0000ca67 _shift_r6
0000ca71 _shift_r7
0000b3c2 _shl
0000b37e _shr
0000c91e _sin_fxp
00003a0e _speech_in
00003ac2 _speech_out
00003b76 _speech_save
0000cd40 _sqrt_fxp
0000b415 _sub
00003a06 _sync_serial_enable
000056ce _syntab74
000056e6 _syntab84
00003ca3 _tx_send_sync_word
0000b624 _unpack_code
0000b56c _v_add
0000d24a _v_equ
0000ba98 _v_equ_shr
0000a549 _v_inner
0000a581 _v_magsq
0000bf0e _v_scale_shl
0000b541 _v_scale
0000b5a1 _v_sub
0000b583 _v_zap
00009e64 _vgetbits
0000cac2 _vq_enc
000098f6 _vq_fsw
00009891 _vq_lspw
0000d3d7 _vq_ms4
0000c061 _vq_msd2
00009ea6 _vsetbits
00005505 _win_cof
0000b4ae _window_Q
0000b492 _window
00003c8e _wrcoeffptr
00003c8a _wrmemptr
0000c650 _zerflt_Q14
0000b445 _zerflt
0000c69b _zerflt_Q15
00001600 cinit
00000f00 edata
000059a5 end
0000ffa3 etext
ffffffff pinit
address name
-------- ----
00000000 NOINTS
00000001 __lflags
00000004 SPPAGE
0000000b MAXFFT
00000010 RXENBL
00000020 TXENBL
00000200 BOARD
00000201 MODVAL
00000202 BZYFLG
00000203 OVFFLG
00000204 MINMAG
00000205 ORDVAL
00000206 FRMSIZ
00000207 FFTSIZ
00000208 MAXMAG
00000209 RIFLAG
0000020a COUPL
0000020b GNLIST
0000020c FS_MODE
0000020d TRGVAL
0000020e BUFLEN
0000020f PCBFLG
00000210 BUFNUM
00000210 _BUFNUM
00000211 AMPSCL
00000212 DOFSET
00000213 WINSCL
00000214 PHZREQ
00000215 DUPCHN
00000216 COFXF1
00000217 CHANNL
00000218 TRGCHN
00000219 APSCL2
0000021a DFSET2
0000021b COFXF2
0000021c RMAX
0000021d IMAX
0000021e FLLEN1
0000021f FLLEN2
00000220 LGFLG1
00000221 LGFLG2
00000222 FLTYP1
00000223 FS_VAL
00000224 PWFLG1
00000225 PWFLG2
00000226 APCOEF
00000227 BPCOEF
00000228 TFFLG1
00000229 TFFLG2
0000022a MAXA
0000022b MAXB
0000022c NUMCHN
0000022d SUBTYP
0000022e ANABFK
0000022f RIBBFK
00000230 MPBBFK
00000231 WNDBFK
00000232 MONTOR
00000233 MODULE
00000234 AICWRD
00000235 LOGC1
00000236 LOGC2
00000237 ADCTR
00000238 DACTR
00000239 STMBFK
0000023a STBFLN
0000023b FLTYP2
0000023c QNUM
0000023d FILUPD
0000023f ONE
00000240 ZERO
00000241 ACHIST
00000242 ACLOST
00000243 CURCHN
00000244 SAMPLE
00000245 TRACE1
00000245 SAMPLA
00000246 OUTTRA
00000247 TRACE2
00000247 SAMPLB
00000248 OUTTRB
00000249 COUNT
0000024a SPTEMP
0000024b BUFPTR
0000024c TRGFLG
0000024d PRVTRG
0000024e CHNTMP
0000024f TEMP
00000250 TEMP2
00000251 SAMP1
00000252 OUTPC
00000253 SYNFLG
00000254 FFTFLG
00000255 FFTBUF
00000256 RIB1
00000257 RIB2
00000258 MPBSAV
00000259 CURTRC
0000025a BFDONE
0000025b BASANG
0000025c ANGLE
0000025d DENOM
0000025e NUMER
0000025f QUOTNT
00000260 TEMPD1
00000261 DSIGN
00000264 FDRVAL
00000265 XI
00000266 YI
00000267 XL
00000268 YL
00000269 XT
0000026a YT
0000026b I
0000026c L
0000026d WR
0000026e WI
0000026f IA
00000270 IE
00000271 QUARTN
00000272 N1
00000272 LOGFLG
00000273 N2
00000273 PWRFLG
00000274 J
00000274 TFRFLG
00000275 TASAV
00000275 IADD
00000276 TBSAV
00000276 LADD
00000277 REAL
00000278 IMAG
00000279 MAXI
0000027a MINI
0000027b MAGVAL
0000027c STAT
0000027c NSTAT
0000027d STAT1
00000380 DELAY1
000003a0 DELAY2
000003c0 COEFF1
000003e0 COEFF2
00000400 Q12CON
00000400 __STACK_SIZE
0000042f BDADD
00000430 MODADD
00000431 BZYADD
00000432 OVFADD
00000433 MINADD
00000434 ORDADD
00000435 SIZADD
00000436 FFTADD
00000437 MAXADD
00000438 RIFADD
00000439 CPLADD
0000043a GNLADD
0000043b FSMADD
0000043c TRGADD
0000043d BFLADD
0000043e PCBADD
0000043f _BFNADD
0000043f BFNADD
00000440 AMPADD
00000441 DOFADD
00000442 WINADD
00000443 PHRADD
00000444 DUPADD
00000445 CF1ADD
00000446 CHNADD
00000447 TCHADD
00000448 AP2ADD
00000449 DF2ADD
0000044a CF2ADD
0000044b RMXADD
0000044c IMXADD
0000044d FL1ADD
0000044e FL2ADD
0000044f LG1ADD
00000450 LG2ADD
00000451 FT1ADD
00000452 SR2ADD
00000453 PW1ADD
00000454 PW2ADD
00000455 APCADD
00000456 BPCADD
00000457 TF1ADD
00000458 TF2ADD
00000459 MXAADD
0000045a MXBADD
0000045b NCHADD
0000045c SBTADD
0000045d ANAADD
0000045e RIBADD
0000045f MPBADD
00000460 WNDADD
00000461 MONADD
00000462 MDLADD
00000463 AICADD
00000464 LC1ADD
00000465 LC2ADD
00000466 ACTADD
00000467 DCTADD
00000468 STMADD
00000469 BF2ADD
0000046a FT2ADD
0000046b QNTADD
0000046c FUPADD
0000046f CFLAG
000005f6 _SD4Init
00000800 __SYSMEM_SIZE
00000800 _fft_data
00000f00 ___data__
00000f00 .data
00000f00 edata
00000f00 ___edata__
00000f00 ISR_SD4_RX
00000f18 _RxRead1
00000f1e _RxRead2
00000f1e _RxRead3
00000f3b ISR_SD4_TX
00000f58 _TxWrite1
00000f5d _TxWrite2
00000f63 _TxWrite3
00000f7a ISR_SYNC_RX
00000f7c _RxRead4
00000fac ISR_SYNC_TX
00000fb2 _TxWrite4
00000fd1 _TxWrite5
00001600 ___cinit__
00001600 cinit
00001ae5 _fsvq_cb
000023a4 _bssSize
000024e5 _msvq_cb
00003165 _getMcBSPInfo
000031f2 _getMcBSPSubReg
00003206 _setMcBSPSubReg
0000321b _setMcBSPSubRegAll
000032d5 _InitMcBSP
0000344a _InitBSP
00003491 _SyncSerialInit
00003600 _bssBeg
00003600 ___bss__
00003600 .bss
00003a00 _saturation
00003a01 _complexity
00003a02 _melpmode
00003a03 _opmode
00003a04 _audio_loopback
00003a05 _anasyn_loopback
00003a06 _sync_serial_enable
00003a07 _TxDataVal
00003a08 _RxDataVal
00003a09 _fPolledTxSync
00003a0a _fUseSyncWord
00003a0b _fUseSyncBit
00003a0c _ProcIdFlag
00003a0d _ProcIdFlag_Shifted
00003a0e _speech_in
00003ac2 _speech_out
00003b76 _speech_save
00003c2a _loopcnt
00003c2c _chbuf_ana
00003c50 _chbuf_syn
00003c7d _bzyflg
00003c7e _melpflg
00003c80 _getframeaddr
00003c82 _sendframeaddr
00003c84 _getcoeffaddr
00003c86 _sendcoeffaddr
00003c88 _rdmemptr
00003c8a _wrmemptr
00003c8c _rdcoeffptr
00003c8e _wrcoeffptr
00003c90 _TxByteFlag
00003c91 _RxByteFlag
00003c92 _RxPTR
00003c93 _RxBP
00003c94 _RxMP
00003c95 _RxEP
00003c96 _TxPTR
00003c97 _TxBP
00003c98 _TxEP
00003c99 _RxSyncPTR
00003c9a _RxSyncBP
00003c9b _RxSyncMP
00003c9c _RxSyncEP
00003c9d _TxSyncPTR
00003c9e _TxSyncBP
00003c9f _TxSyncMP
00003ca0 _TxSyncEP
00003ca1 _bzyflg_rx_sync
00003ca2 _bzyflg_tx_sync
00003ca3 _tx_send_sync_word
00003ca4 _rx_received_sync_word
00003ca5 _Rx_sync_dead_count
00003ca6 _debugvar
00003cab _mcbsp
00003cb2 _pMcBSP
00003d09 _DEBUG
00003d0c _idftc
00004000 PIOV2
000045cd _lsp_cos
00004c50 _lagw_cof
00004c5a _lsp_delta
00004c5b _fsvq_weighted
00005499 _lpf_num
000054a2 _lpf_den
000054ab _bpf_num
000054d8 _bpf_den
00005505 _win_cof
000055cd _bp_cof
00005672 _disp_cof
000056c2 _pmat74
000056ce _syntab74
000056d6 _pmat84
000056e6 _syntab84
000056f6 _pitch_enc
0000575a _pitch_dec
000058ac _msvq_cb_mean
00005946 __cleanup_ptr
000059a5 end
000059a5 ___end__
00005da5 __sys_memory
00007b80 _c_init
00007b80 ___text__
00007b80 .text
00007bb5 _main
00007c02 _melp_real
00007d8f _getData
00007db1 _sendData
00007dd2 _AudioClockAdjust
00007e01 _SendSerialData
00007e7b _GetSerialData
00007fac _melp_ana
00008000 PI
00008341 _melp_ana_init
0000845f _melp_syn
00008a29 _melp_syn_init
00008bb8 _c_int00
00008bfe _exit
00008c21 _atexit
00008c38 C$$EXIT
00008c38 _abort
00008ca2 _minit
00008cc4 _malloc
00008d2b _calloc
00008d52 _realloc
00008e06 _free
00008e89 _memmove
00008ec0 _bpvc_ana
00009140 _bpvc_ana_init
0000929e _dc_rmv
000092ea _gain_ana
00009425 _lin_int_bnd
00009466 _noise_est
000094c5 _noise_sup
0000952b _q_bpvc
000095ab _q_bpvc_dec
00009602 _q_gain
000096dc _q_gain_dec
0000979a _scale_adj
00009891 _vq_lspw
000098f6 _vq_fsw
00009967 _median
000099e7 _quant_u
00009a9f _quant_u_dec
00009adb _rand_minstdgen
00009b65 _fec_code
00009c86 _fec_decode
00009e3e _binprod_int
00009e64 _vgetbits
00009ea6 _vsetbits
00009ee0 _sbc_enc
00009f08 _sbc_dec
00009f2e _sbc_syn
00009f66 _find_harm
0000a09b _findmax
0000a0c5 _fs_init
0000a0c6 _lpc_clmp
0000a256 _lpc_schr
0000a274 _lpc_pred2lsp
0000a37c _lpc_pred2refl
0000a483 _LSP_init
0000a4f1 _L_v_add
0000a523 _L_v_equ
0000a549 _v_inner
0000a581 _v_magsq
0000a5ca _L_v_zap
0000a5eb _L_pow_fxp
0000a612 _melp_chn_write
0000a72c _melp_chn_read
0000a95b _double_chk
0000aa53 _double_ver
0000aab4 _find_pitch
0000aadf _frac_pch
0000ae1c _p_avg_update
0000ae7d _p_avg_init
0000ae9f _pitch_ana
0000b0c4 _pitch_ana_init
0000b139 _L_shl
0000b1ca _L_shift_r
0000b206 _mult_r
0000b21d _mac_r
0000b239 _msu_r
0000b255 _isLwLimit
0000b27a _isSwLimit
0000b2a0 _L_mpy_ll
0000b30c _a_get_data
0000b324 _a_put_data
0000b33c _envelope
0000b378 _negate
0000b37c _L_negate
0000b37e _shr
0000b3c2 _shl
0000b40b _add
0000b415 _sub
0000b420 _fill
0000b433 _extract_l
0000b43b _extract_h
0000b43f _L_deposit_l
0000b442 _L_deposit_h
0000b445 _zerflt
0000b492 _window
0000b4ae _window_Q
0000b4cb _divide_s
0000b4ec _L_sub
0000b506 _mult
0000b510 _L_mult
0000b520 _L_mac
0000b541 _v_scale
0000b56c _v_add
0000b583 _v_zap
0000b5a1 _v_sub
0000b5c2 _pack_code
0000b624 _unpack_code
0000b683 _norm_s
0000b692 _norm_l
0000b69d _f_pitch_scale
0000b721 _iir_2nd_d
0000b7b6 _iir_2nd_s
0000b82e _lpc_syn
0000b87f _lpc_aejw
0000ba6b _lpc_bwex
0000ba98 _v_equ_shr
0000bafd _L_divider2
0000bb7d _L_sqrt_fxp
0000be77 _interp_array
0000bec4 _L_v_inner
0000bee9 _L_msu
0000bf01 _L_abs
0000bf05 _L_mpyu
0000bf0e _v_scale_shl
0000bf31 _cos_fxp
0000bffb _lpc_refl2pred
0000c000 MPIOV2
0000c061 _vq_msd2
0000c0ef _lpc_lsp2pred
0000c337 _lpc_acor
0000c4ac _lpc_schur_asm
0000c605 _L_shr
0000c650 _zerflt_Q14
0000c69b _zerflt_Q15
0000c6e5 _pow10_fxp
0000c895 _rand_num
0000c91e _sin_fxp
0000c9f5 _L_v_magsq
0000ca48 _L_mpy_ls
0000ca5d _shift_r3
0000ca67 _shift_r6
0000ca71 _shift_r7
0000ca7b _scale_adj_loop
0000cac2 _vq_enc
0000cb3a _abs_s
0000cb44 _L_add
0000cb5f _round
0000cb70 _log10_fxp
0000cbc9 _L_log10_fxp
0000cd40 _sqrt_fxp
0000d035 _peakiness
0000d12e _lsp_to_freq
0000d24a _v_equ
0000d290 _cfft
0000d2c2 STAGE1
0000d2c2 FFTBEG
0000d2d9 STAGE2
0000d2f0 STAGE3
0000d307 STAGE4
0000d31e STAGE5
0000d335 STAGE6
0000d34c STAGE7
0000d363 STAGE8
0000d37a STAGE9
0000d38b FFTEND
0000d394 _find_harm_s1
0000d3d7 _vq_ms4
0000d718 _find_pitch_asm
0000d838 _idft_real
0000ffa3 etext
0000ffa3 ___etext__
ffffffff pinit
ffffffff ___pinit__
[501 symbols]
FP .set A15
DP .set B14
SP .set B15
.global $bss
.file "C6201hi.asm"
; .bss _COMMAND,4
; .bss _PUDDADDR,4
; .bss _LENGTH,4
; .bss _DUPDADDR,4
; .bss _HPIbuf,4
.sect ".text"
.global _start
.global _TalkerInt
.global __STACK_SIZE
.global __stack
.sect "TALKVARS"
COMMAND
_COMMAND .word 0
PUDDADDR
_PUDDADDR .word 0
LENGTH
_LENGTH .word 0
DUPDADDR
_DUPDADDR .word 0
HPIbuf
_HPIbuf .word 0
.sect "Talker"
_start:
; Cache initialization
MVC .S2 CSR,B5 ; copy control status register
|| MVKL .S1 0xFFE3,A5
AND .L1X A5,B5,A5 ; clear PCC field of CSR value
|| MVK .S2 0x0008,B5 ; set cache enable mask
OR .L2X A5,B5,B5 ; set cache enable bit
; MVC .S2 B5,CSR ; update CSR to enable cache
NOP 5
NOP 9
NOP 9
NOP 5
ZERO .L1 A3
MVKH .S1 0x1880000,A3 ; get the address of HPIC
LDW .D1T1 *A3,A0
NOP 4
MVKL .S1 0x00030003,A0
MVKH .S1 0x00030003,A0
STW .D1T1 A0,*A3 ; clear DSPINT bit by writing one to DSPINT
NOP 4
MVKL 0x01500000,A3
MVKH 0x01500000,A3 ; address of EINT4 multiplexer
LDW .D1T1 *A3,A0
NOP 4
MVKL 0x00000008, A0
MVKH 0x00000008, A0 ; Triggers on PCI bus (mailboxes) cause EINT4 interrupt
STW .D1T1 A0,*A3
NOP 4
MVKL 0x014000D8,A3
MVKH 0x014000D8,A3 ; address of V3 Mailbox Interrupt Status
LDW .D1T1 *A3,A0
NOP 4
STW .D1T1 A0,*A3 ; clear all interrupts
NOP 5
MVKL 0x019C0000,A3
MVKH .S1 0x019C0000,A3 ; address of interrupt multiplexer high
LDW .D1T1 *A3,A0
NOP 4
MVKL 0xFFE0FFFF, B6
MVKH 0xFFE0FFFF, B6
AND B6, A0, A0 ; clear INTSEL13 area of IMH
MVKL 0x00040000, B6
MVKH 0x00040000, B6
OR B6, A0, A0 ; set interrupt 13 to trigger to EINT4 signal
STW .D1T1 A0,*A3
NOP 4
SetVariable:
InterruptClear:
MVKL .S1 0xFFFFFFFF,A0
MVKH .S1 0xFFFFFFFF,A0
MVC .S2X A0,ICR ; ICR = 0xFFFF, clear all pending interrupts
ZERO B6
; MVC .S2 IER,B6 ; IER |= 0x2000, enable INT13 (DSPINT)
MVKL .S2 8195,B6
; OR .L2X A0,B6,B6
MVC .S2 B6,IER
Infinite:
NOP
B .S1 Infinite
NOP 5
NOP
;******************************************************************************
;* FUNCTION NAME: _TalkerInt *
;* *
;* Regs Modified : A0,A1,A2,A3,A4,A5,A6,B0,B4,B6,SP *
;* Regs Used : A0,A1,A2,A3,A4,A5,A6,B0,B4,B6,SP *
;******************************************************************************
_TalkerInt:
MVKL 0x014000D8,A3
MVKH 0x014000D8,A3 ; address of V3 Mailbox Interrupt Status
LDW .D1T1 *A3,A0
NOP 4
STW .D1T1 A0,*A3 ; clear all interrupts
NOP 5
MVC CSR, B4
MVK 0x1,B0
OR B4,B0,B4 ; enable interrupts in talker
MVC B4,CSR
CMPEQ B0,1,A2
[A2] B CASE1 ; if COMMAND=1, jump to CASE1
NOP 5
CMPEQ B0,2,A2
[A2] B CASE2 ; if COMMAND=2, jump to CASE2
NOP 5
CMPEQ B0,3,A2
CMPEQ B0,4,A2
[A2] B CASE4 ; if COMMAND=4, jump to CASE4
NOP 5
CMPEQ B0,5,A2
[A2] B CASE5 ; if COMMAND=5, jump to CASE5
NOP 5
B .S1 ForLoop
NOP 5
NOP 5
ForLoop:
; FOR loop implemenation
ZERO A1
NOP 4
loop1:
SHL A1,2,A2 ; A2 = i * 4
ADD A4,A2,A6 ; A4* + 4*i = A6
ADD A0,A2,A5 ; A0* + 4*i = A5
; THIS CODE ADDED FOR DEBUG PURPOSES. IF "TALKER" VARIABLE IN TMSII6XM CODE
; IS SET TO 1, THE TALKER WILL NOT STORE ANY DATA WHATSOEVER. DE
; MVKL 0x80002a08, B6
; MVKH 0x80002a08, B6
; LDW *B6, A2
; NOP 4
; [A2] B loop2
; NOP 5
LDW *A5,A2
NOP 4
loop2:
B loop1
NOP 5
CASE4: ; if COMMAND=4
CASE5:
RESTORE:
B IRP
NOP 5
-o C6201hi.out -m C6201hi.map
-heap 0x200
-stack 0x200
/* -lrts6201.lib */
MEMORY
{
SECTIONS
{
C6201hi
vectors6201hi
MEMORY CONFIGURATION
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
vectors 0 00000000 00000200
00000000 00000200 vectors6201hi.obj (vectors)
address name
-------- ----
80001000 $bss
80001000 .bss
80000000 .data
00000400 .text
00000610 _TalkerInt
00000200 __STACK_SIZE
80001000 ___bss__
ffffffff ___cinit__
80000000 ___data__
80000000 ___edata__
80001000 ___end__
00000400 ___etext__
ffffffff ___pinit__
00000400 ___text__
80000000 __stack
UNDEFED _c_int00
00000400 _start
ffffffff cinit
80000000 edata
80001000 end
00000400 etext
ffffffff pinit
address name
-------- ----
00000200 __STACK_SIZE
00000400 .text
00000400 _start
00000400 etext
00000400 ___text__
00000400 ___etext__
00000610 _TalkerInt
80000000 ___edata__
80000000 __stack
80000000 .data
80000000 edata
80000000 ___data__
80001000 end
80001000 .bss
80001000 ___bss__
80001000 $bss
80001000 ___end__
ffffffff pinit
UNDEFED _c_int00
ffffffff ___pinit__
ffffffff cinit
ffffffff ___cinit__
[22 symbols]
FP .set A15
DP .set B14
SP .set B15
.global $bss
.file "talker.asm"
.bss _COMMAND,4
.bss _PUDDADDR,4
.bss _LENGTH,4
.bss _DUPDADDR,4
.bss _HPIbuf,4
.sect ".text"
.global _start
.global _TalkerInt
.global __STACK_SIZE
.global __stack
__stack: .usect .stack, 0, 8
.sect "Talker"
_start:
; INITIALIZE Stack pointer and stack size
MVKL __stack,SP
MVKH __stack,SP
MVKL __STACK_SIZE - 4,B0
MVKH __STACK_SIZE - 4,B0
ADD B0,SP,SP
; Cache initialization
MVC .S2 CSR,B5 ; copy control status register
|| MVKL .S1 0xFF1F,A5
AND .L1X A5,B5,A5 ; clear PCC field of CSR value
|| MVK .S2 0x0000,B5 ; set cache enable mask
OR .L2X A5,B5,B5 ; set cache enable bit
MVC .S2 B5,CSR ; update CSR to enable cache
NOP 4
NOP
ZERO .L1 A3
MVKH .S1 0x1880000,A3 ; get the address of HPIC
LDW .D1T1 *A3,A0
NOP 4
MVKL .S1 0x00020002,A0
MVKH .S1 0x00020002,A0
STW .D1T1 A0,*A3 ; clear DSPINT bit by writing one to DSPINT
NOP 4
Infinite:
NOP
B .S1 Infinite
NOP 5
NOP
;******************************************************************************
;* FUNCTION NAME: _TalkerInt *
;* *
;* Regs Modified : A0,A1,A2,A3,A4,A5,A6,B0,B4,B6,SP *
;* Regs Used : A0,A1,A2,A3,A4,A5,A6,B0,B4,B6,SP *
;******************************************************************************
_TalkerInt:
; clear DSPINT bit inside HPIC and thus enable new interrupts from host
ZERO .L1 A1
MVKH .S1 0x1880000,A1 ; address of HPIC
LDW .D1T1 *A1,A0
NOP 4
MVKL .S1 0x00020002,A0
MVKH .S1 0x00020002,A0 ; setting the bits to HPIC
STW .D1T1 A0,*A1 ; writing to HPIC
NOP 4
CMPEQ B0,0,A2
[A2] B CASE0 ; if COMMAND=0, jump to CASE0
NOP 5
CMPEQ B0,1,A2
[A2] B CASE1 ; if COMMAND=1, jump to CASE1
NOP 5
CMPEQ B0,2,A2
[A2] B CASE2 ; if COMMAND=2, jump to CASE2
NOP 5
CMPEQ B0,3,A2
[A2] B CASE3 ; if COMMAND=3, jump to CASE3
NOP 5
CMPEQ B0,4,A2
[A2] B CASE4 ; if COMMAND=4, jump to CASE4
NOP 5
CMPEQ B0,5,A2
[A2] B CASE5 ; if COMMAND=5, jump to CASE5
NOP 5
ForLoop:
; FOR loop implemenation
MVKL .S1 _LENGTH,A3
MVKH .S1 _LENGTH,A3
LDW .D1T2 *A3,B0
NOP 4
ADD B0,1,B0 ; host is passing length-1, so increment length
ZERO A1
loop1:
CMPEQ A1,B0,A2 ; If i = LENGTH
[A2] B RESTORE ; leave the loop (go to stack pop)
NOP 5
SHL A1,2,A2 ; A2 = i * 4
ADD A4,A2,A6 ; A4* + 4*i = A6
ADD A0,A2,A5 ; A0* + 4*i = A5
LDW *A5,A2
NOP 4
STW A2,*A6 ; A6* = A5*
NOP 4
CASE4: ; if COMMAND=4
MVC .S2 CSR,B6 ; get CSR
AND -2,B6,B6
MVC .S2 B6,CSR ; disable all interrupts, clear GIE
CASE5:
RESTORE:
-o DSKC6XHI.OUT -m DSKC6XHI.MAP
-heap 0x200
-stack 0x200
/* -lrts6201.lib */
MEMORY
{
SECTIONS
{
vectors > VECS
Talker 0x400: { } IPRAM1
.bss > IPRAM2
.cinit > IPRAM1
.text > IPRAM1
.stack > IPRAM1
.data > IPRAM1
.sysmem > IPRAM1
.const > IPRAM1
.cio > IPRAM1
.debug > IPRAM1
.vars > IPRAM1
.far > IPRAM1
******************************************************************************
TMS320C6x COFF Linker PC Version 4.10
******************************************************************************
>> Linked Wed Jul 31 14:19:25 2002
MEMORY CONFIGURATION
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
vectors 0 00000000 00000200
00000000 00000200 vectors6xhi.obj (vectors)
address name
-------- ----
00001000 $bss
00001000 .bss
00000200 .data
00000400 .text
00000578 _TalkerInt
00000200 __STACK_SIZE
00001000 ___bss__
ffffffff ___cinit__
00000200 ___data__
00000200 ___edata__
00001014 ___end__
00000400 ___etext__
ffffffff ___pinit__
00000400 ___text__
00000200 __stack
UNDEFED _c_int00
00000400 _start
ffffffff cinit
00000200 edata
00001014 end
00000400 etext
ffffffff pinit
address name
-------- ----
00000200 __STACK_SIZE
00000200 edata
00000200 ___data__
00000200 ___edata__
00000200 __stack
00000200 .data
00000400 _start
00000400 ___text__
00000400 ___etext__
00000400 .text
00000400 etext
00000578 _TalkerInt
00001000 .bss
00001000 $bss
00001000 ___bss__
00001014 end
00001014 ___end__
ffffffff ___cinit__
ffffffff pinit
UNDEFED _c_int00
ffffffff cinit
ffffffff ___pinit__
[22 symbols]