Home

VisualDSP++ Kernel (VDK) User's Guide

image

Contents

1. about interrupts 3 34 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK 2 The New Interrupt dialog box appears Figure 3 25 In the Name field select the desired Interrupt from the drop down list You can optionally change the Source File name in which the new Interrupt is defined New Interrupt Enter a name for this Interrupt below You may optionally change the name of the source file in which this Interrupt will be defined If you choose to not generate this file it will need to be manually added before building Name FIFOOTXI X Source File FIFOOTXI asm Header File 3 Would you like these files to be automaticaly Yes generated and added to your project C No Language Assembly ha Corcel Figure 3 25 New Interrupt Dialog Box 3 To automatically generate a source code for this Interrupt click Yes Note that Interrupts are generated in Assembly language only If you wish to use the existing source code click No Then manually add the source to your project Note that the Interrupt name and source file name must match 4 Click OK to create the new Interrupt If you have chosen to generate a source code the source file is created and automatically added to the project If you create a source file specifying the filename that is already in your project s directory the existing file is overwritten VisualDSP Kernel VDK User s Gui
2. Poed opaan PIE Gonnauratonse Figure 3 1 VisualDSP Environment Project Menu 3 4 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK 3 From the Project menu choose Project Options VisualDSP opens the Project Options dialog box prompting you to set options for your project Figure 3 2 4 Set your target processor in the Project Options dialog box This dialog sets the processor type for which VDK support has been installed This example uses the ADSP 2192 12 target processor Click OK to apply the project option and exit the dialog box Project Options General Compie Assemble Link PostBuild ADSP 2192 12 vi il I DSP executable file VDK_Test C Compiler for 219x ADSP 219x ELF Assembler ADI Family Linker Driver Figure 3 2 Project Options Dialog Box VisualDSP Kernel VDK User s Guide 3 5 Configuring a Project 5 Depending on the selected processor in step 4 you may be queried whether to include VisualDSP kernel instrumentation for this project Figure 3 3 Click Yes to enable VDK support N Would you like to add support For the VisualDSP kernel to this project Figure 3 3 VisualDSP Kernel Message Box 6 The IDDE automatically generates the default VDK source files vdk cpp and vdk h and adds them to the project A third file lt project name gt vdk is added to the project to enable VDK suppo
3. H a Thread Types T Round Robin Prio a Semaphores v Allow Docking mi Event Bits Hide E Events ep E Interrupts Float In Main Window Device Drivers its Project Kernel Figure 3 9 Boot Thread Context Menu 2 Enter a name for the new Boot Thread and press Enter 3 14 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK To View Modify a Boot Thread s Properties 1 Expand the Boot Thread icon in the Kernel window by clicking the Add icon You can edit a property by clicking the left mouse button on the value of the property 2 System a Thread Types Boot Threads B MyBootT hread i Thread Type MyThreadT ype T Round Robin Priorities amp Semaphores fait Event Bits 1 Events E Interrupts Device Drivers seee T H 5 E E E E Figure 3 10 Expanded Boot Threads Icon Multiple boot threads of the same thread type are allowed Refer to page 4 2 for information about boot threads VisualDSP Kernel VDK User s Guide 3 15 Configuring a Project To Rename a Boot Thread 1 Click the right mouse button on the Boot Thread to display the context menu then choose Rename from the menu Alternately select the Boot Thread icon and press F2 Fill in the Boot Thread Name 2 Press Enter to accept the change press ESC to cancel the change To Delete a Boot Thread from the Project 1 Click the right mouse button on the Boot
4. Semaphores fib Event Bits d Events i eO Any a G Dependent Bits El MyE ventBit1 v S Ep Interrupts MyEventBitl Device Drif M Eveni ME ventBits M EventBitd bs Figure 3 22 Events Dependency Drop Down List 3 32 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK To View Modify a Dependent Event Bit s Condition 1 You may edit a dependent Event Bits condition by clicking the left mouse button on the value of the condition Possible values are 1 or 0 Figure 3 23 Project YDK_Test dpj Kemel H 8 System Ho Thread Types H A Boot Threads H S Round Robin Priorities H amp Semaphores H a Event Bits 3 0 Events D M MyEvent 6 a Dependent Bits MyE ventBit3 gt Interrupts ng Device Drivers lt Project Figure 3 23 Evens Dependency Condition Drop Down List VisualDSP Kernel VDK User s Guide 3 33 Configuring a Project Step 9 Add and Edit an Interrupt To Add an Interrupt to the Project 1 Right click the Interrupts icon and select New Interrupt from the context menu Figure 3 24 Project YVDK_Test dpj E F Kemel HR System amp gt Thread Types H 2 Boot Threads H H Round Robin Priorities H amp Semaphores or Event Bits a Events Interrupts oo Device Drivers New Interrupt k Figure 3 24 Interrupts Context Menu Refer to Interrupt Service Routines on page 4 30 for information
5. button on the Device Flags icon to display the con text menu and choose Add Device Flag from the menu Figure 3 30 Project YDK_Test dpj 2 Round Robin Priorities amp Semaphores fob Event Bits H E Events BP Interrupts El Device Drivers El MyDeviceDriver Source File MyDeviceDriver cpp E Header File MyDeviceDriver h Lo gg Device Flags Add Device Flag h Figure 3 30 Device Flags Context Menu 3 42 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK 2 Give the Device Flag a name and press Enter to create the new flag A Device Flag name must be a valid C identifier Device Flags must be unique to the system meaning that two Device Drivers cannot define the same Device Flag name Figure 3 31 Proj est dpj zix Ele Kemel H System amp Thread Types Boot Threads H9 Round Robin Priorities amp Semaphores mb Event Bits 0 Events Ep Interrupts 3 Device Drivers E MyDeviceD river E Source File MyDeviceDriver cpp Header File MyDeviceDriver h E Device Flags i MyFlagl i MyFlag2 w E MyFlag3 H H E E E g g E a I 5 Project Kernel Figure 3 31 Expanded Device Flags Icon VisualDSP Kernel VDK User s Guide 3 43 Debugging a VDK Project Debugging a VDK Project Debugging embedded software is a difficult task To help offset the initial difficulties present in debugging your VDK enabled projects the kernel offers special inst
6. on the event that occurred the thread status changes Press the keyboard s right arrow key or left arrow key to move to the next or previous event When the data cursor hits a thread switch event it moves to the thread being switch in You can zoom in on a region to examine that area in more detail Hold the left mouse button down while dragging the mouse to create a selection box Then release the mouse button to expand the plot To restore the plot to its original scale right click on the plot and choose Reset Zoom 3 48 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK Target Load Graph Instrumented VDK builds allow you to analyze the average load of the processor over a period of time Although the load calculation is not exact the load graph helps you to estimate the utilization level of the processor Note that the information used in the graph is updated at halt The target load graph shown in Figure 3 35 displays the percent of time the target spent in the idle thread DSP O b Target Load Target Load Target Load Figure 3 35 Target Load Window A load of 0 means VDK spent all of its time in the idle thread A load of 100 means the target did not spend any time in the idle thread Load data is processed using a moving window average The load percentage is calculated for every clock tick and all the ticks are averaged The following formula is used to calculate t
7. 3 CONFIGURING A PROJECT TO USE THE VDK In This Chapter This chapter contains information about the VisualDSP Integrated Development and Debugging Environment IDDE support for the ker nel You can access the VDK components and services through the set of menus commands and windows in the development and debugging environment If you are new to VisualDSP DSP development software we recom mend to start with the ViswalDSP 2 0 Getting Started Guide for your target processor family The IDDE support for the VDK can be broken into two areas e Configuring a Project on page 3 2 e Debugging a VDK Project on page 3 44 VisualDSP Kernel VDK User s Guide 3 1 Configuring a Project Configuring a Project This section is designed so that you can quickly learn the VisualDSP environment as it applies to VDK instrumented project development VisualDSP has been extended to manage all of the VDK components You start developing a VDK based application by creating a set of source files The IDDE automatically generates source code framework for each user requested VDK object For example when you request a new thread type by right clicking the Thread Type icon on the Kernel tab in the Project window see Figure 3 5 on page 3 8 and supplying a name for the new thread type the environment generates a source file and a header file of that name The automatically generated files contain all of the func tions require
8. 7 Ee Kernel H A System H n Thread Types H A Boot Threads T gt Round Robin Priorities New Semaphore E onion Doda Ep Interrupts i Device Drivers Float In Main Window lt Project Figure 3 17 Event Bits Context Menu 2 Enter a name for the new Event Bit and press Enter An Event Bit name must be a valid C identifier Refer to page 4 21 for information about the event bits VisualDSP Kernel VDK User s Guide 3 25 Configuring a Project To View Modify an Event Bit s Properties 1 Expand the Event Bit icon in the Kernel window by clicking the Add E icon You can select and edit a property by clicking the left mouse button on the value of the property Figure 3 18 Project YDK_Test dpj E F Kemel 2 System a Thread Types 2 Boot Threads H H Round Robin Priorities H amp Semaphores 01 Event Bits MyE ventBit1 Initial Yalue 1 Events i Ep Interrupts 3 Device Drivers Project Figure 3 18 Expanded Event Bits Properties Icon The Event Bit component has the following properties Table 3 5 The Event Bits Properties Property Description Default Notes Initial Value The value to which this event bit is 0 Type int set when the kernel boots 3 26 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK To Rename an Event Bit 1 Click the right mouse button on the Event Bit to display the c
9. C identifier For information about events refer to Events and Event Bits on page 4 21 3 28 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK To View Modify an Event s Properties 1 Expand the Event icon in the Kernel window by clicking the Add H icon You can select and edit a property by clicking the left mouse button on the value of the property Figure 3 20 Project DK_Test dpj Kernel System a Thread Types Boot Threads gt Round Robin Priorities amp Semaphores p Event Bits C Events 3 0 gSA Type Any fab Dependent Bits E Interrupts Device Drivers 1 AE Kernel lt Project Figure 3 20 Expanded Events Properties Icon The Event component has the following properties Table 3 6 The Events Properties Property Description Default Notes Type The condition upon Any Any is selected the event becomes sig which the event naled when any one of the event bits becomes signaled conditions is met All is selected the event becomes sig naled only when all of the event bits conditions are met VisualDSP Kernel VDK User s Guide 3 29 Configuring a Project To Rename an Event 1 Click the right mouse button on the Event to display the context menu and select Rename from the menu Alternately click the Event icon a
10. DSP Kernel VDK User s Guide Configuring a Project to Use the VDK Initially thread information appears in a collapsed state in which only the thread name and its current state are displayed When a thread is in the Ready state its priority is displayed Clicking the plus sign next to the thread name expands the view When thread status information is not accessible thread out of context no information is displayed Possible thread states are listed in Figure 3 33 on page 3 47 For more information about threads see Threads on page 4 2 General Tips Even with the data collection features built into the VDK you may find that debugging thread code is a difficult task Due to the fact that multiple threads in a system are interacting asynchronously with device drivers interrupts and the idle thread it can become difficult to track down the culprit of an error Unfortunately one of the oldest and easiest debugging methods insert ing breakpoints can have uncommon side effects in VDK projects Since multiple threads either multiple instantiations of the same thread type or different threads of different thread types can execute the same function with completely different contexts the utilization of non thread aware breakpoints is diminished One possible workaround is to insert some thread specific breakpoints if VDK_GetThreadID lt thread_with_bug gt lt some statement gt Insert bre
11. Thread to display the context menu then choose Delete from the menu Alternately select the Boot Thread icon and press the Delete key Once you have removed the Boot Thread from the project you should manually remove all references to the deleted Boot Thread from your code 3 16 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK To Change the Order in which Boot Threads are Created You can change the order in which the Boot Threads are created by drag ging and dropping the Boot Thread icons 1 Left click and drag the icon of the Boot Thread that you want to reorder Project VDK_Test dpj x E Kemel K System amp Thread Types Boot Threads a MyBootT hread1 fx 4 MyBootT hread3 MyBootThread2 N L MyBootT hread3 MyBootThread4 Round Robin Priorities amp Semaphores pb Event Bits f Events B Interrupts Device Drivers H lt Project P2 Kernel Figure 3 11 Moving Boot Thread Objects 2 Release the left mouse button when the Boot Thread is in the correct loca tion In the example above Figure 3 11 MyBootThread3 is being moved to the first position in the list MyBootThread3 is to be created first when the kernel boots This determines the order in which the MyBootThread3 s constructor is called However the boot thread runs in the order that is based on its prio
12. _kThreadTimedOut VDK_kThreadSwitched VDK_HistoryEnum Using the history log the IDDE displays a graph of running threads and system state changes The State History window described in Figure 3 32 displays the history buffer plots Note that the history buffer information is updated only on halt VisualDSP Kernel VDK User s Guide 3 45 Debugging a VDK Project An arowis Data gt Ahorizontalba Current data Athin green vertical line Arrows indicate thread ascroll bars cursor indicates a thread cursor position indicates a thread switch 4 events B Stitc Hetory a kPhilosopherThread Thread 2 tkPhile erThread Thread 4 KP hilosopherThread Thread 0 0 herThread Idle Thread b GaleHistory A Tangala y Enable the data cursor Thread status The green porti on of the to viewthe status bar Thethin green line horizontal ber indicates The stus bar provides baowsthread statusbar thetimethethread wes event details indicates the currently active Trace thread switch active thread history by following the thin green line Figure 3 32 System State History Window Thread status appears as horizontal bars and thread events appear as arrows above the horizontal bars Status bars and event symbols are color coded based on thread status and event type All events of the same type are drawn in the same color The thin green line below the thread status bar indicates the currently active thread Multipl
13. akpoint VisualDSP Kernel VDK User s Guide 3 51 Debugging a VDK Project 3 52 VisualDSP Kernel VDK User s Guide
14. d by for a VDK Thread Type Linker Description File When a new project makes use of the kernel a reference to a VDK specific default Linker Description File LDF is added to the project This file resides in an area of the VisualDSP install directory that is specific to your processor Although the LDF may be used unchanged for many projects you can copy the LDF from the VisualDSP install directory to your project directory add it to the project and modify it to suit your individual hardware configurations Thread Safe Libraries Just as user threads must be reentrant special thread safe versions of the standard C and C libraries are included for use with the VDK The default LDF included in VDK projects links with these libraries If you modify your Linker Description File ensure that the file links with the thread safe libraries Your project s LDF resides in the Linker Files folder and is accessible via the Project window the Project tab of VisualDSP see Figure 3 4 on page 3 7 3 2 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK Header Files for the VDK API When a VDK project is created in the development environment one of the automatically generated files in the project directory is vdk h The header file contains enumerations for every user defined object in the development environment and all VDK API declarations Your source files must include vdk h to access an
15. de 3 35 Configuring a Project To View Modify an Interrupt s Properties 1 Expand the Interrupt icon in the Kernel window by clicking the Add E icon You can edit a property by clicking the left mouse button on the value of the property Figure 3 26 Project VDK_Test dpj zix E Kernel 8 System 2 Thread Types Boot Threads 29 Round Robin Priorities amp Semaphores p Event Bits Events Interrupts Te a A i Enabled at Boot false Entry Point FIFOOTXI_Entry Source File FIFOOTXI asm Device Drivers Figure 3 26 Expanded Interrupts Icon 3 36 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK The Interrupt component has the following properties Table 3 7 The Interrupts Properties Property Description Default Notes Enabled at Boot Controls whether this FALSE Type Boolean interrupt is masked or not You manually enable the when the kernel boots interrupt at runtime if it is not enabled at kernel boot Entry Point The entry point label for lt interrupt_name gt _Entry this Interrupt Service Rou tine Source File The source filename in lt interrupt_name gt asm which this Interrupt is implemented To Delete an Interrupt from the Project 1 Click the right mouse button on the Interrupt to display the context menu and click Delete from the menu Alternately select the Interru
16. e events within a tick are spaced evenly for the display purposes 3 46 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK When a thread is switched the green line is drawn vertically to the next active thread Trace the thread switch history by following the thin green line Thread Status and Thread Event Windows Right click on the plot and choose Status Legend Figure 3 33 or Event Legend Figure 3 34 to display the legends shown below in the State History window Thread Status ems Read W ae Thread Events HB ThreadDestroyed EG ThreadCreated its semaphore Pended E Semaphore Posted ed E Evert bit Cleare rated Devi FlagPosted itched CO Thread Status Change Figure 3 34 Thread Event Legend Refer to VDK Status Window on page 3 50 for more information about VDK thread status VisualDSP Kernel VDK User s Guide 3 47 Debugging a VDK Project Window Operations The state history status bar bottom of plot shows the event s details and thread s status Event details include the event type the tick when the event occurred and an event value The value for a thread switched event indicates the thread being switched in or switched out The yellow triangle to the right of the thread name indicates the currently active thread Right click on the plot and choose Data Cursor to activate the data cursor which is used to display event and thread status details Based
17. e int Thread Type Limited to your processor s word size minus two The highest pri ority is one Stack Size The size of the stack in words 255 Type int The value is set for each Limited by system memory instance of this Thread Type The stack size must be greater than zero Source File The source filename in which N A lt threadtype_name gt cpp this Thread Type is imple lt threadtype_name gt c mented lt threadtype_name gt asm Header File The header filename in which N A lt threadtype_name gt h 1 Right click the Thread Type icon you want to delete then choose Delete from the context menu Alternately select the Thread Type icon and press the Delete key 2 The IDDE prompts you to remove the source and header files for this Thread Type from the project Click Yes to remove or click No to leave the files in the project Note that the files are not deleted from the project directory files are removed from the Project window only Once you have deleted the Thread Type from the project you should manually remove all references to the deleted Thread Type from your code VisualDSP Kernel VDK User s Guide 3 13 Configuring a Project Step 4 Add and Edit a Boot Thread To Add a New Boot Thread to the Project 1 Right click the Boot Threads icon and select New Boot Thread from the context menu Figure 3 9 A new Boot Thread is created Project DK_Test dpj a Kemel 8 System
18. emaphores icon to display the context menu select New Semaphore from the menu Figure 3 15 A new Semaphore is created E P Kernel K System F lt Thread Types J Boot Threads T Round Robin Priorities m mi Event Bits 0 Events v Allow Docking Ep Interrupts Hide Device Drivers Float In Main Window lt Project P2 Kernel Figure 3 15 Semaphores Context Menu 2 Entera name for the new Semaphore and press Enter A Semaphore name must be a valid C identifier Refer to page 4 16 for information about semaphores 3 22 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK To View Modify a Semaphore s Properties 1 Expand the Semaphore icon in the Kernel window by clicking the Add J icon You can select and edit a property by clicking the left mouse button on the value of the property Figure 3 16 Project DK_Test dpj PaE Kernel 8 System amp Thread Types Boot Threads T Round Robin Priorities amp Semaphores amp eee E Initial Value false E Initial Delay 0 f Period 0 mh Event Bits 1 Events E Interrupts SB Device Drivers 1 TS Project Kernel Figure 3 16 Expanded Semaphores Icon The Semaphore component has the following properties Table 3 4 The Semaphores Properties Property Description Default Notes Initial Value The value to which this
19. er cpp Header File MyDeviceDriver h Device Flags lt N Project gt Kernel Figure 3 29 Expanded Device Drivers Icon The Device Driver component has the following properties Table 3 8 The Device Drivers Properties Property Description Default Source File The source filename in which this lt driver_name gt cpp Driver is implemented Header File The header filename in which this lt driver_name gt h Device Driver is defined 3 40 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK To Delete a Device Driver from the Project 1 Click the right mouse button on the Device Driver to display the context menu and choose Delete from the menu Alternately select the Device Driver icon and press the Delete key 2 The IDDE prompts you to remove the source and header files for this Device Driver from the project Click Yes to remove the files or click No to leave the files in the project Note that the files are not deleted from the project directory files are removed from the Project window only Once you have deleted the Device Driver from the project you should manually remove all references to that Device Driver along with all associated Device Flags from your code VisualDSP Kernel VDK User s Guide 3 41 Configuring a Project To Add Device Flags to a Device Driver A Device Driver can have associated Device Flags 1 Click the right mouse
20. he percentage of uti lization for every clock tick Load 1 of times idle thread ran this tick of threads run this tick VisualDSP Kernel VDK User s Guide 3 49 Debugging a VDK Project VDK Status Window Besides history and processor load information an instrumented build collects a thread s statistics such as when the thread has been created the last run the number of runs etc Note that the information displayed in the Status window is updated at halt The VDK Status window Figure 3 36 is available when a DSP executable is built with VDK support ge YDK Status O Current Tick 5 0 Idle Thread Ready El Thread 0 kSystemStartT hread Ready kPriority10 p Template ID ofp Priority O0x00000000 kSystemStartT hread 0x00000015 kPriority10 E Stack Address 0 f0030d24 El NumTimesRun 6 CreationTime cycles 8045 RunStartTime cycles 36088 RunLastTime cycles 39234 i RunTotalTime cycles 22274 CreationTime ticks 0 RunStartTime ticks 1 RunLastTime ticks 1 a Thread 1 kPhilosopherT hread Running kPriority5 a2 Thread 2 kPhilosopherT hread Ready kPriority5 Figure 3 36 VDK Status Window When a thread is created it is added to the display A thread is removed from the display when it is deleted When you halt the execution of a VDK program VisualDSP reads thread data and displays the thread state and status data in this window 3 50 Visual
21. its E Events m Loos N Project Kernel Figure 3 5 Expanded System Parameters Icon 3 8 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK The System component has the following properties Table 3 1 The System s Properties debugging features of the IDDE such as history and state collection Defines the VDK_INCLUDE_INSTRUMENTA TION _ macro Property Description Default Note Clock Frequency The clock frequency of your 40 MHz Type float MHz target processor The value is rounded to the nearest LSB of Clock Frequency must be greater than zero Tick Period ms The tick period of the sys 5 ms Type float tem in milliseconds The value is rounded to the nearest LSB of Clock Frequency must be greater than one History Buffer Size The number of entries in 256 Type int the history buffer Only valid when the 4 words entry tl d Debug Enabled property OEE is TRUE Max Running Threads The upper limit of the 10 Type int number of simultaneously The value must be running threads in the sys greater than zero tem Instrumented Libraries Enables or disables the TRUE Type Boolean Disable this feature to conserve memory and improve run time effi ciency Refer to Round Robin Scheduling on page 4 11 and page 4 34 for more information about the system clock Refer to State History Window on page 3 44 for more information abo
22. nd press F2 An Event name must be a valid C identifier 2 Press Enter to accept the change press ESC to cancel the change You must manually update all references to the Event s modi fied name in your code To Delete an Event from the Project 1 Click the right mouse button on the Event to display the context menu and click Delete from the menu Alternately select the Event icon and press the Delete key Once you have deleted the Event from the project you should manually remove all references to the Event from your code 3 30 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK To Add Event Bits to an Event An Event must have at least one Event Bit and an associated condition 1 Right click the Dependent Bits icon to display the context menu and choose Add Dependency from the menu Figure 3 21 Project VDK_Test dp gt Thread Types Boot Threads T Round Robin Priorities amp Semaphores a10 Event Bits B E Events D M MyEvent Dependent Bits Ep Interrupts Add Dependency 3 ige Device Drivers w Figure 3 21 Events Context Menu VisualDSP Kernel VDK User s Guide 3 31 Configuring a Project 2 Choose the desired Event Bit from the drop down list and then press Enter to accept the new Event Bit dependency Figure 3 22 Project YDK_Test dpj E E Kernel H System nm Thread Types H Boot Threads Round Robin Priorities H S
23. ontext menu and then select Rename from the menu Alternately select the Event Bit icon and press F2 An Event Bit name must be a valid C identifier 2 Once the new name has been entered press Enter to accept the change or ESC to cancel You should manually update all references to the Event Bit of the modified name in your code To Delete an Event Bit from the Project 1 Click the right mouse button on the Event Bit to display the context menu and click Delete from the menu Alternately select the Event Bit icon and press the Delete key Once you have deleted the Event Bit from the project you should manually remove all references to the Event Bit from your code VisualDSP Kernel VDK User s Guide 3 27 Configuring a Project Step 8 Add and Edit an Event To Add an Event to the Project 1 Right click the Events icon select New Event from the context menu Figure 3 19 Note that there must be at least one Event Bit defined before an Event can be created A new Event is created Project YDK_Test dpj j Kernel H System amp Thread Types 2 Boot Threads H9 Round Robin Priorities amp Semaphores mb Event Bits owl E EB gt Interrupts Device Drivers y Allow Docking Hide Float In Main Window Project Kernel Figure 3 19 Events Context Menu 2 Enter a name for the new Event and press Enter An Event name must be a valid
24. pt icon and press the Delete key 2 The IDDE prompts you to remove the source file for this Interrupt from the project Click Yes to remove the Interrupt or click No to leave it in the project Note that the file is not deleted from the project directory the file is removed from the Project window only Once you have deleted the Interrupt from the project you should manually remove all references to that Interrupt from your code VisualDSP Kernel VDK User s Guide 3 37 Configuring a Project Step 10 Add and Edit a Device Driver To Add a Device Driver to the Project 1 Right click the Device Drivers icon to display the context menu select New Device Driver from the menu Figure 3 27 Project YVDK_Test dpj E Kernel System amp Thread Types 2 Boot Threads gt Round Robin Priorities amp Semaphores fab Event Bits 1 Events B Interrupts Hh a New Device Driver v Allow Docking Hide Float In Main Window lt Project Kernel Figure 3 27 Device Drivers Context Menu Refer to Device Drivers on page 4 35 for information about device drivers 2 The New Device Driver dialog appears on the screen Fill in the Device Driver Name field A Device Driver name must be a valid C identifier You may change the Source File and Header File names in which the new Device Driver is defined Figure 3 28 3 38 VisualDSP Ke
25. rity VisualDSP Kernel VDK User s Guide 3 17 Configuring a Project Step 5 Add and Edit a Round Robin Priority To Add a Round Robin Priority to the Project 1 Right click the Round Robin Priorities icon to display the context menu and then select New Priority from the menu Figure 3 12 A new Round Robin Priority is created Project YDK_Test dpj E Kernel amp System amp Thread Types Z Boot Threads Fe Round Robin Priorities amp Semaphores H A ais Event Bits v Allow Docking Events Hide Ep Interrupts Device Drivers Float In Main Window P Project Figure 3 12 Round Robin Priority Context Menu For information about round robin priorities see Round Robin Scheduling on page 4 11 3 18 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK 2 From the drop down list select the priority that you want to make round robin Press Enter to accept the priority Figure 3 13 Project YDK_Test dpj EPE Kernel Hi System Haa Thread Types 2 Boot Threads B rE Round Robin Priorities B g gt Priority lt Project Kernel Figure 3 13 Selecting a Round Robin Priority VisualDSP Kernel VDK User s Guide 3 19 Configuring a Project To View Modify a Round Robin s Priorities 1 Expand the Round Robin Priorities icon in the Kernel window by click ing the Add J icon You can edit a property by clicking the lef
26. rnel VDK User s Guide Configuring a Project to Use the VDK New Device Driver MyDeviceDriver h es LK cma Figure 3 28 New Device Driver Dialog Box 3 To automatically generate the source code for this Device Driver click Yes Selecting Yes allows you to choose the language in which the source is generated Possible choices are C and C If you wish to use the existing source code click No Then manually add the source to your project Note that the Device Driver name and file names must match If you create source files specifying filenames that are already in your project s directory the existing files are overwritten 4 Click OK to create the new Device Driver If you have chosen to generate a source code the files are created and added to the project VisualDSP Kernel VDK User s Guide 3 39 Configuring a Project To View Modify a Device Driver s Properties 1 Expand the Device Driver icon in the Kernel window by clicking its Add icon You can edit a property by clicking the left mouse button on the value of the property Figure 3 29 Project VDK_Test dpj Kernel System a Thread Types J Boot Threads 2 Round Robin Priorities amp Semaphores mi Event Bits 1 Events B Interrupts Device Drivers See MyDeviceDriver FA A 1j t Source File MyDeviceDriv
27. rt in the IDDE vdk h and vdk cpp should not be modified overwritten or removed from the project 3 6 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK 7 Finally add the appropriate VDK Linker Description File for the target processor The Project tab Project window in Figure 3 4 shows the added files Project YOK_Test dpj Source Files Header Files 5 I Linker Files _ vdk 2192 12 Ide Ba Kernel Files E VDK_Testvdk Vok_contig cpp Vdk_config h iT Project Figure 3 4 Project Window Project Tab 8 The Kernel tab is visible at the bottom of the Project window Left click the tab to display the Kernel window Figure 3 5 on page 3 8 In the Kernel window you can add modify and delete kernel compo nents System Thread Types Boot Threads Round Robin Proper ties Semaphores Event Bits Events Interrupts and Device Drivers The IDDE automatically updates vdk cpp and vdk h to reflect any changes made in this window VisualDSP Kernel VDK User s Guide 3 7 Configuring a Project Step 2 Modify VDK System Parameters To View and or Modify System Parameters 1 Expand the System icon in the Kernel window by clicking the Add icon Figure 3 5 Project nevy_vdk_blackfin dpj k Clock Frequency MHz E Tick Period ms 5 E History Buffer Size 256 Max Running Threads 10 baw Instrumented Libraries Semaphores ma Event B
28. rumented builds This section documents information that can help to debug your VDK software For more information on this topic see Debugged Control Structures on page 2 2 Instrumented Build Information When building a VDK project you have an option to include instrumen tation in your executable An instrumented build differs from a release or non instrumented build because the build includes an extra code for thread statistic logging In addition an instrumented build creates a circu lar buffer of important system events The extra logging introduces slight overhead in thread switches and certain API calls but helps you to trace system activities State History Window The VDK logs user defined events and certain system state changes in a circular buffer An event is logged in the history buffer with a call to LogHistoryEvent The call to LogHistoryEvent logs four data values the Thread D of the calling thread the tick when the call had happened the enumeration and a value that is specific to the enumeration Enumer ations less than 0 are reserved for use by the VDK typedef enum DK_kThreadCreated INT_MIN DK_kThreadDestroyed DK_kSemaphorePosted DK_kSemaphorePended D D D _kEventBitSet _kEventBitCleared _kEventPended a N e 3 44 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK VDK_kDeviceFlagPended VDK_kDeviceFlagPosted VDK_kDeviceActivated VDK
29. semaphore FALSE Type Boolean is set when the kernel boots Initial Delay The initial delay time for this 0 Type int Semaphore in Ticks You must set both values to make a Semaphore Period The period in Ticks for which this 0 periodic Semaphore will become signaled VisualDSP Kernel VDK User s Guide 3 23 Configuring a Project To Rename a Semaphore 1 Click the right mouse button on the Semaphore icon to display the context menu and then choose Rename from the menu Alternately select the Semaphore icon and press F2 Enter the new name for the Semaphore The name must be a valid C identifier 2 Press Enter to accept the change press ESC to cancel the change You should manually update all references to the Semaphore of the modified name in your code To Delete a Semaphore from the Project 1 Click the right mouse button on the Semaphore to display the context menu and click Delete from the menu Alternately select the Semaphore icon and press the Delete key Once you have removed the Semaphore from the project you should manually remove all references to the deleted Semaphore from your code 3 24 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK Step 7 Add and Edit an Event Bit To Add an Event Bit to the Project 1 Right click the Event Bits icon and select New Event Bit from the context menu A new Event Bit is created Figure 3 1
30. t mouse button on the value of the property Figure 3 14 Project YDK_Test dpj Parameter Kermel H System Hao Thread Types ZB Boot Threads 1 49 Round Robin Priorities SR Priority i Period S Semaphores mb Event Bits 0 Events 3 E Interrupts 9 Device Drivers lt Project Figure 3 14 Expanded Round Robin Properties Icon The Round Robin Priority component has the following properties Table 3 3 The Round Robin Priorities Property Description Default Notes Period The period in Ticks for this priority 10 Type int Must be greater than zero 3 20 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK To Modify a Round Robin Priority 1 Click the right mouse button on the Round Robin Priority to display the context menu and then choose Rename from the menu Alternately select the Round Robin Priority icon and press F2 Select the new name from the drop down list of predefined names 2 Press Enter to accept the change press ESC to cancel To Delete a Round Robin Priority from the Project 1 Click the right mouse button on the Round Robin Priority to display the context menu and choose Delete from the menu Alternately select the Round Robin Priority icon and press the Delete key VisualDSP Kernel VDK User s Guide 3 21 Configuring a Project Step 6 Add and Edit a Semaphore To Add a Semaphore to the Project 1 Right click the S
31. t to use existing source code click No Then manually add the sources to your project Note that the Thread Type name and file names must match Click OK to create the new Thread Type If you have chosen to generate source code the files are created and automatically added to the project If you create source files specifying filenames that are already in your project s directory the existing files are overwritten VisualDSP Kernel VDK User s Guide 3 11 Configuring a Project To View Modify a Thread Type s Properties 1 Expand the Thread Type icon in the Kernel window by clicking the Add icon Figure 3 8 You can edit a property by clicking the left mouse button on the value of the property Project YVDK_Test dpj E Kernel K System a Thread Types Be UE E Priority E Stack Size 255 E Source File MyThreadT ype cpp E Header File MyThreadT ype h 2 Boot Threads Round Robin Priorities i amp Semaphores aia Event Bits 0 Events E Interrupts Device Drivers DY Project 2 Kernel Figure 3 8 Expanded Thread Types Icon 3 12 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK The Thread Type component has the following properties Table 3 2 The Thread Types Properties To Delete a Thread Type from the Project this Thread Type is defined Property Description Default Notes Priority The initial priority of this 5 Typ
32. ut the history buffer VisualDSP Kernel VDK User s Guide 3 9 Configuring a Project Step 3 Add and Edit a Thread Type To Add a New Thread Type to the Project l Right click the Thread Types icon to display the context menu then select New Thread Type from the menu Figure 3 6 Kernel R System Boot Threads 2 Round Robin Pri v Allow Docking a Semaphores Hide ui Event Bits Events Float In Main Window Ep Interrupts Device Drivers Dy Project Kernel Figure 3 6 Thread Types Context Menu Refer to Thread Types on page 4 2 for information about thread types The New Thread Type dialog box appears on the screen Figure 3 7 on page 3 11 Fill in the Thread Type Name A Thread Type name must be a valid C identifier no special charac ters such as spaces or hyphens are allowed You may change the Source File and Header File names in which the new Thread Type is defined 3 10 VisualDSP Kernel VDK User s Guide Configuring a Project to Use the VDK New Thread Type MyThreadT ype MyThreadT ype cpp MyThreadT ype h fe 2 ic 6 sn ssc ltr oe __cancet_ Figure 3 7 New Thread Type Dialog Box Click Yes to automatically generate source code for this Thread Type Selecting Yes allows you to choose the language in which the sources are generated Your choices are C C and Assembly If you wan
33. y kernel services VDK Program Development All VDK program development within the IDDE includes the following steps Step 1 Start a New Project File on page 3 4 Step 2 Modify VDK System Parameters on page 3 8 Step 3 Add and Edit a Thread Type on page 3 10 Step 4 Add and Edit a Boot Thread on page 3 14 Step 5 Add and Edit a Round Robin Priority on page 3 18 Step 6 Add and Edit a Semaphore on page 3 22 Step 7 Add and Edit an Event Bit on page 3 25 Step 8 Add and Edit an Event on page 3 28 Step 9 Add and Edit an Interrupt on page 3 34 Step 10 Add and Edit a Device Driver on page 3 38 By following these steps your VDK projects build consistently and accu rately with minimal project management This process reduces development time and lets you to concentrate on algorithm development VisualDSP Kernel VDK User s Guide 3 3 Configuring a Project Step 1 Start a New Project File To Create a VDK Enabled Project 1 From the Project menu choose New VisualDSP opens the Save New Project As dialog box prompting you to save the new project Figure 3 1 2 Fill in the project File name choose a Save in directory and click OK to save the project file exiting the dialog box VDK support cannot be added to an existing project gt Analog Devices isualDSP Target ADSP 219x Simulator c BUG Ie arik BUNIG ProjeGt a

Download Pdf Manuals

image

Related Search

Related Contents

AA Navigator User Guide    ZEN Communications Manual  Generator Automatic Voltage Regulator Operation Manual  User Manual - Projector Central  ZoomText Mac  SmartASS-3 Air Speed Speaker Installation and User Manual  User Manual  Garmin 178C GPS Receiver User Manual  Grandstream Networks, Inc.  

Copyright © All rights reserved.
Failed to retrieve file