Home
10 Tutorial: Threaded Integration
Contents
1. Generating default lt I tut_010810 target network_depl _DPE994346876 host _DPE1 John _DPE2 Win32_Threade Generating lt I John _DPE2 Win32_Threaded sct_ncf h gt OK Figure 219 Components with Selected Integration Models Configuring C Code Generation The Targeting Expert GUI for C code generation has four tabs These are SDL to C Compiler Communication Environment Header File and Execution All these tabs contain widgets for configuring the code gen eration for an executable Each of the executable files that will be built have communication through external code All executables use the TCP IP communication module and the mobile phone executables John Marie ParisPizza and LyonPizza use a GUI The external code is connected to the SDL sys tem through environment functions The generation of environment functions must be configured manually 356 Telelogic Tau 4 5 SDL Suite Getting Started July 2003 July 2003 Using the Targeting Expert The Targeting Expert features a wizard for easy configuration of the TCP IP module When activating the wizard all the necessary environ ment functions will be generated by default The TCP IP wizard dialog box is shown in Figure 220 TCP IP Communication Wizard Input here goes to the Communication tab of the main section the Source Files tab of the Compiler section and the Environment tab of the Target Library section Please modify these section
2. Click Compiler Linker Make for Switch in the Partitioning diagram Model window In the Include text box add I After the addition the text box will look as shown in Figure 222 Include f A sctuseinclude l 7 7 2 2 7 Figure 222 The Include Text Box with an Additional I flag Click the Save button Click Target Library for Switch in the Partitioning diagram Model window In the Kernel tab click in the following check boxes Show errors on stdout Setting this option renders log messages if errors are encountered during execution Text trace Setting this option renders textual traces on stdout during execution Click the Save button Click the Full Make button The SDL system is analyzed code is generated and a makefile is generated and executed You will now have an executable file named switch The file extension will be exe on Windows and sct on Solaris Compiling and Linking the MobileStations To configure the compilation and linking of the MobileStation executa bles do the following 1 Click Compiler Linker Make for MobileStation in the Partitioning Diagram Model window In the Include text box add I lt your working directory gt e g I home mobile After the addition the text box will look as shown in Figure 222 Telelogic Tau 4 5 SDL Suite Getting Started July 2003 July 2003 Using the Targeting Expert 3 Add the following flags in the Library Flag text
3. Compiler Linker Make Target Library PatisPizza A Win32 Threaded amp Compiler Linker Make Target Library LyorPizza A Win32 Threaded 4 Compiler Linker Make Target Library 5 x roscoe poesia wine Threaded us Compiler Source Files Additional Compiler Linker Library Manager Make p Compiler Description Compiler name el Defaut The placeholders s source file object file and 1 include path must be used Options nologo 1 MT c Zi DUSER CONFIG Defaut DTHREAD_POSIX_THREADS Fo o s i IT Compile as C IT Compile as debug Library Flag DTHREADWIN32 Default Include 11 18 sctuseinclude Default Comm Include 1 sctCODERDIR 8 ectT CPIPDIR Default Obj extension obi Default p C parser and assembler description C parser name Defaut The placeholders s source file o object file must be used Options Default Input ext Default Assembler Defaut The placeholders s source file o object file must be used Options Default Input ext Default 4 Save Cancel Help Figure 221 The Targeting Expert Compiler Linker Make Section Telelogic Tau 4 5 SDL Suite Getting Started 359 Chapter 10 Tutorial Threaded Integration 360 Compiling and Linking the Switch Executable To configure the compilation and linking of the Switch executable do the following 1
4. Microsoft C possible Wind2_Threaded uis ey se Cy Partitioning Diagram Model SDL to C compiler Communication Env header fie Execution E network _depl B T or F Analyze generate code Analyzer options Save commands 2 Threaded amp Compiler Linker Make r Code generation options amp Target Library The basic options how to generate code have to be set here Switch A Win32 Threaded amp Compiler Linker Make Target Library Marie A Win32 Threaded amp Compiler Linker Make Target Library PatisPizza A Win32 Threaded 4 Compiler Linker Make Target Library I Al files I Capitalization lower case Full variable prefix T Instance information file Separation No do not separate z Defautt File name prefix Default r Environment Note The environment header file generation cannot be switched off if coder or environment functions are selected J Environment header file configuration on other tab LyonPizza F Environment functions A Win32 Threaded Bera amp Compiler Linker Make B Target Library Filter Analyzer output The warning or error message given here will be fitered from the Analyzer output Example WARNING 5 ERROR 300 amp z I tut_010810 target network_depl__DPE994346876 host _DPE1 Wohn _DPE2 Win32_Threaded john exe peearning lt I John _DPE2 Win32_Threaded sct_mcf h gt not found using defaults
5. box DXMAIN NAME SDL Main DXEXTENV_INC lt gui h gt DMARIE DJOHN DPARISPIZZA or DLYONPIZZA depending on which executable you are configuring The XMAIN_NAME flag is used to rename the main function in the gener ated SDL system A main function is provided in the GUI source code The SDL main function renamed SDL Main will be started in a thread from the new main function XEXTENV_INC is a flag for using environment code together with the TCP IP module The gui h file contains definitions of some macros in the generated environment file 4 Click the Source Files tab A list of the external files to compile is shown 5 Click the Add button A dialog box is shown 6 Select gui c in the working directory Click Open The file is added to the file list 7 Windows only The GUI must be compiled using a resource com piler Click the Additional Compiler tab Enter rc in the Compiler Name text box Enter l 0x41d I fo o s in the Options text box Add the file gui rc to the list of files to compile by clicking the Add button and select gui rc from your working directory Enter res in the Object Extension text box Click on the Make tab Change from Microsoft nmake using temporary re sponse file toMicrosoft nmake in the Make tool drop down list 8 Click the Linker tab Telelogic Tau 4 5 SDL Suite Getting Started 361 Chapter 10 Tutorial Threaded Integration 9 Enter the following in
6. the Options text box Windows Change subsystem console to subsystem windows Solaris Add Xm IXt IX11 between Ipthread and L usr lib 10 Click the Save button 11 Click the Full Make button The SDL system is analyzed code is generated and a makefile is generated and executed You will now have an executable file The file extension will be exe on Windows and sct on Solaris The Target System The generated executable files are located in a directory structure creat ed by the Targeting Expert The Targeting Expert uses the target direc tory given in the Organizer as root In the mobile system target is given as target directory The generated target directory structure is shown in Figure 223 1 2 tutorial 2 target S E network_depl _DPE994346876 S host _DPEL C John _DPE2 S Solaris_threaded S E gce_objects B Win32_threaded 4 dobj S LyonPizza _DPE40 CJ Solaris_threaded E E Win32_threaded C dobj S O Marie _DPE36 B C Solaris_threaded H gcc_objects E E win32_threaded H E dobj 2 ParisPizza DPE38 S O Solaris_threaded H E gcc objects S O Wwin32_threaded FD dobj S E Switch _DPE6 S Solaris_threaded 4 gcc_objects S O Win32_threaded HO dobj Figure 223 The Generated Target Directory Structure The executable files are located in the platform specific directories Win32_threaded and Solaris_threaded respectively The object files are located in subdirectories of the platform director
7. Chapter 10 July 2003 Tutorial Threaded Integration The Threaded Integration model provides a powerful template for integrating generated C code with an operating system In this tu torial you will practice building applications using this model You will get hands on experience by building the SDL system Mobile which is an implementation of a small GSM system This tutorial requires basic knowledge of the SDL suite editors the Organizer and the Targeting Expert Brief knowledge of SDL and integration with operating systems will also help your understand ing Before working with this tutorial it is recommended that you read through chapter 65 Integration with Operating Systems To get the most out of this tutorial read the entire chapter As you progress perform the exercises on your computer as described Telelogic Tau 4 5 SDL Suite Getting Started 343 Chapter 10 Tutorial Threaded Integration Introduction 344 The purpose of this tutorial is to make you familiar with the Threaded Integration model After reading the tutorial you should have a basic understanding of how to build a threaded executable and how to inte grate it with external code This tutorial is designed as a guided tour through the build tools in the SDL suite You will get acquainted with the Deployment Editor and the Targeting Expert Note Platform differences This tutorial and the others that are possible to run on both the S
8. ally you may want to partition your SDL system into several executable files This information is modeled using Deployment Diagrams These are edited using the Deployment Editor The Deployment Diagram pro vides a way to model deployment of SDL systems independently of the target platform What You Will Learn e To start the Deployment Editor e To deploy an SDL system onto executable files and threads Starting the Deployment Editor e Double click the deployment symbol network_dep in the Orga nizer The Deployment Editor is launched with the selected dia gram Deploying an SDL System The Deployment Diagram features e Partitioning of SDL systems e Organization of SDL instance sets within executable files e Organization of SDL instance sets within threads Threaded Inte gration only July 2003 Telelogic Tau 4 5 SDL Suite Getting Started 349 Chapter 10 Tutorial Threaded Integration A deployment diagram has five symbols the node the component the thread the object and the comment symbols Each symbol is described in Table 1 Table 1 Deployment Diagram Symbols Symbol Name Description Node A computational resource i e a computer Component An executable file which contains SDL instance sets Thread A point of execution The symbol is used for threaded integrations only Object An SDL instance set i e a system block or process instance set JON The symbols are c
9. ice to keep track of elapsed time and cost for phone calls Implementation Description The system is implemented in a modular way Each functional entity is implemented as a block type The block types are organized in a pack age called GSM The SDL system uses the GSM package and instantiates its block types The Mobile system has four MobileStation block instances four BaseTransceiverStation block instances and two MobileSwitching Center block instances The MobileStation instances are named as mo bile phone owners The names are Marie John ParisPizza and Lyon Pizza The BaseTransceiverStation instances are named Lyon11 Lyon12 Paris11 and Paris12 indicating their location The Target Application Deployment The Mobile system is partitioned into five executable files Each Mo bileStation block instance is built as an executable and the remaining block instances Proxy BaseTranscieverStation BaseStationControl ler MobileSwitchingCenter and Database execute together in one ex ecutable Telelogic Tau 4 5 SDL Suite Getting Started 345 Chapter 10 Tutorial Threaded Integration 346 The Graphical User Interface A graphical user interface GUI is provided for the MobileStation block It is delivered as C source code to be compiled and linked when building each of the four mobile phone executable files The interface resembles that of a typical mobile phone A simple menu system con taining a phone book a
10. ies 362 Telelogic Tau 4 5 SDL Suite Getting Started July 2003 Running the System Running the System July 2003 What You Will Learn e Torun the executable files generated from Targeting Expert e Use the mobile system An Overview of the System Figure 224 shows the run time architecture of a MobileStation execut able TCP IP outgoing signals C Window Events TCP_Port 5959 TCP IP incoming signals ae a enna te sul SDL System SDL SDL Thread Thread SDL Kernel s Sadia DEMAT o a Executable MobileStation File TCPIIP Sewer Thread Figure 224 Run time architecture of a MobileStation Executable The SDL system interacts with the outside world through its environ ment The GUI message loop is run in a thread of execution of its own The TCP IP server thread executes the same way The environment threads interact with the SDL system by inserting signals This is done by calling the SDL kernel function SDL_Output When a signal is sent from the SDL system to the environment it is in terpreted either as GUI feedback or is sent to an external receiver via TCP IP Telelogic Tau 4 5 SDL Suite Getting Started 363 Chapter 10 Tutorial Threaded Integration 364 Using the System Start the mobile system in the following order 1 Start the Marie John ParisPizza and LyonPizza execu
11. igure 216 s Symbol Details Thread T xi Stack Size Thread Priority Queue Size Max Signal Size Figure 216 The Symbol Details Dialog Box for Thread T For a thread four parameters can be set for performance tuning of the generated executable 352 Telelogic Tau 4 5 SDL Suite Getting Started July 2003 Drawing a Deployment Diagram July 2003 e Stack Size e Thread Priority e Queue Size e Max Signal Size The values of these parameters are specific to the target operating sys tem If no values are given default values are used All threads in the network_depl deployment diagram use default values Object Click the object symbol JohnMS The dialog box will change its con tent to reflect that of the object The new appearance of the dialog box is shown in Figure 217 g Symbol Details Object JohnMS xj Stereotype block Properties Qualifier Inetwork JohnMS Threaded Close Help Figure 217 The Symbol Details Dialog Box for Object JohnMS For an object two parameters are mandatory to fill in e Stereotype e Qualifier The stereotype is the type of SDL instance set The possible values are system block and process JohnMS is a block which is reflect ed in the stereotype text box The qualifier is used to identify the SDL instance set Locate the JohnMS block in the Organizer window The block insta
12. nce set is lo cated directly under the network system This renders the qualifier network johnMS The network_depl diagram is complete The next step is to build execut able files from the diagram Telelogic Tau 4 5 SDL Suite Getting Started 353 Chapter 10 Tutorial Threaded Integration More information on the Deployment Editor is available in chapter 41 The Deployment Editor in the User s Manual Using the Targeting Expert What You Will Learn To start the Targeting Expert e To build executable files from a deployment description e To configure C code generation from the Targeting Expert GUI e To configure your compiler and linker from the Targeting Expert GUI Starting the Targeting Expert The deployment diagram should be used as input to the Targeting Ex pert Right click the network_depl diagram symbol in the Organizer and se lect Targeting Expert from the pop up menu The deployment diagram will be analyzed If any errors are found the Organizer Log pops up and shows an error message You can locate the error in the deployment diagram by clicking on the Show error button in the Organizer Log toolbar The Targeting Expert is launched Selecting Target Platform The initial appearance of the Targeting Expert window is shown in Figure 218 354 Telelogic Tau 4 5 SDL Suite Getting Started July 2003 July 2003 S SDL Targeting Expert I tut_010810 network_deplpdm 3 5 x File Edi
13. nd a billing report is provided The user can switch base station from the option menu in the bottom of the window The GUI is shown in Figure 212 ohne TLOG xj wj af Fa Es EA Faj mes a 0 Base Station Parisi Figure 212 The Mobile Phone GUI 7 TCP IP Communication The executable files of the target application communicate by sending signals via TCP IP The communication is handled by the SDL suite TCP IP communication module which is delivered as C source code It is compiled and linked into each of the executables To be able to locate the receiver of a signal the TCP IP module needs the host name and TCP port number of the receiving executable This information must be supplied through a routing function which is man ually implemented in C The mobile system is delivered with default routing functions This will enable you to run all executables on your computer without giving any routing information manually Figure 213 shows a UML component diagram of the executable files in the deployed mobile system Each executable file sets up a TCP IP serv er listening on a specific TCP port number This number is used by re Telelogic Tau 4 5 SDL Suite Getting Started July 2003 July 2003 Description of Example System mote executables for addressing SDL signals The TCP IP server is il lustrated by the interface on each component The dashed arrows indi cate a flow of signals from one compo
14. nent to another r r Marie John ParisPizza LyonPizza T I T T TCP_Port 4940 gt r Ds TCP_Port 5959 t 3 TCP_Pore7979 TCP_Port 8089 x S 4 i eee wn a x s l 1 3 st ees oF z 7 X r F i ba k E nt a ot Sete r y pa TCPAP Pts A Z TCP_Port 6969 y ae N P z Switch Figure 213 A Component Diagram Showing the Deployed Mobile System Telelogic Tau 4 5 SDL Suite Getting Started 347 Chapter 10 Tutorial Threaded Integration Preparations 348 Copy the Example System In order to allow experimentation you should copy the example system from the SDL suite installation into a working directory of your prefer ence UNIX Copy all files from the directory telelogic sdt examples mobile to a working directory e g mobile Windows Copy all files from the directory C Telelogic SDL_TTCN Suite4 5 sdt examples mobile to a working directory e g C Telelogic SDL_ TTCN Suite4 5 work mobile Open the System Open the system file Mobile sdt from the Organizer Telelogic Tau 4 5 SDL Suite Getting Started July 2003 Drawing a Deployment Diagram Drawing a Deployment Diagram In order to build a threaded executable you must supply information about the threads of the application For each thread you must specify which SDL instance sets that should run inside it Fin
15. o laris and Windows platforms are described in a way common to both platforms In case there are differences between the platforms this is indicated by texts like on Solaris Windows only etc When such platform indicators are found please pay attention only to the instructions for the platform you are running on Normally screen shots will only be shown for one of the platforms provided they contain the same information for both platforms This means that the layout and appearance of screen shots may differ slightly from what you see when running the SDL suite in your en vironment Only if a screen shot differs in an important aspect be tween the platforms will two separate screen shots be shown Prerequisites Windows e C compiler e Resource compiler Solaris e C compiler e Motif Library for GUI widgets version 1 2 or later Telelogic Tau 4 5 SDL Suite Getting Started July 2003 Description of Example System Description of Example System July 2003 The SDL System Functional Description The example system is a model of a GSM system The implementation is restricted to the high level layers of the GSM standard The following functionality is implemented e User PIN code verification PIN code is one digit only e Tracking of mobile phones through VLR and HLR databases e Freedom of movement for mobile phones by base station switching e Control of the IMEI code of a mobile phone e Billing serv
16. onnected using compositions When a symbol is se lected in a diagram a handle is shown at its bottom Click the handle to create a composition link Click the symbol you wish to connect to The name of each symbol can be edited from the diagram area Some of the symbols contain additional information which is edited from the Symbol Details dialog box The network_depl deployment diagram is shown in Figure 214 350 Telelogic Tau 4 5 SDL Suite Getting Started July 2003 July 2003 Drawing a Deployment Diagram network_depl host 5 John Marie ParisPizza LyonPizza gt i blocks blocks block MarieMS ParisPizzaMS LyonPizzaMS Switch blocks JohnMS T2 T3 T4 blocks block block DataB Lyon12BTS P block block ParisMSC LyonMSC block block block block Paris11BTS Paris12BTS Paris1BSC Lyon11BTS blocks LyoniBSc Figure 214 The network_depl Deployment Diagram The diagram shows five components each representing an executable file All components are attached to one node Each component has one or many threads Each thread has one or many objects attached to it re flecting the SDL instance sets that execute inside it For instance the JohnMS component contains one thread T The thread has one object attached
17. s if needed IT Show error info on stdout r Aang ea Ea aa Include routing header file Rout i Routing header file frouter h Be Routing source file fouter c B 2 r Server configuration Weal t number erver port number 4944 Lipat meal ee EE Figure 220 The TCP IP Wizard The TCP IP module needs routing information to send signals to the correct recipient A C header file with the routing function declaration must be included The routing function definition must be given in a C source file The TCP port number for incoming signals must also be giv en This number is used by routing functions in remote executables sending signals to this executable For each of the components do the following 1 Click the name of the integration in the left sub window Windows Click Win32 Threaded Solaris Click Solaris Threaded 2 Select the Communication tab 3 Click in the TCP IP check box in the Signal Sending group The TCP IP Wizard is opened 4 Click in the check box Include routing header file 5 Click the file button to the right of the header file text box A file selection dialog box is opened Telelogic Tau 4 5 SDL Suite Getting Started 357 Chapter 10 Tutorial Threaded Integration 6 Select the routing header file in your working directory Ifyou build the John Marie ParisPizza or LyonPizza execut able select router h Ifyou build the Switch exec
18. t Make Tools Help Using the Targeting Expert x IB a SELECT INTEGRATION 7 Partitioning Diagram Model network_depl ral PDM O host John Switch Marie ParisPizza Ss file lt I tut_010810 network_depl pdm gt opened Figure 218 The Targeting Expert When First Opened The left part of the window called Partitioning Diagram Model shows a filtered view of the deployment diagram The nodes and components are represented For each component do the following 1 2 Select the component in the Partitioning Diagram Model window Click the drop down list containing SELECT INTEGRATION A menu with available integrations is opened As the component has Threaded as integration selected in the Deployment diagram this is the only available selection Select the platform in the sub menu Windows Select Win32 Threaded CAdvanced Solaris Select Solaris Threaded CAdvanced Telelogic Tau 4 5 SDL Suite Getting Started 355 Chapter 10 Tutorial Threaded Integration 4 A dialog box will pop up asking if the SDL system should be auto matically generated Click Yes The Targeting Expert window now looks as in Figure 219 SDL Targeting Expert I tut_010810 network_deplpdm l0 x File gdt Make Tools Help Y SH ME EKER Win32 Threaded El Cadvanced
19. tables A GUI will pop up for each of them Start the Switch executable Switch will initialize the MobileStation executables by sending signals You will see that the On buttons on the mobile phone windows become enabled To make a call do the following 1 Click the On button on the MobileStations You will be prompted to enter a PIN code The correct PIN codes are shown in Table 3 Table 3 MobileStation PIN Codes Executable PIN Code Marie 1 John 2 ParisPizza 3 LyonPizza 4 Click OK PIN OK will be displayed You are now ready to make a call Click OK The menu system of the GUI is activated Select Phone Book by pressing the lt and gt buttons and click OK Select a name from the list and click OK If the receiving MobileS tation is on its display will show Incoming Call Click OK on the receiving MobileStation A call is established Click OK on the calling party and the receiving party when you wish to finish the conversation The system has more features not described in this manual Experiment to discover its secrets The tutorial is finished To get more detailed information about the Threaded integration and the TCP IP module please read chapter 65 Integration with Operating Systems in the User s Manual Telelogic Tau 4 5 SDL Suite Getting Started July 2003
20. to it called JohnMS The object re flects an SDL instance set in the network SDL system Look at the Or ganizer window and compare the block instance sets shown in the sys tem with the objects in the deployment diagram The Symbol Details Dialog Box The dialog box is opened in one of the following ways e Double click a diagram symbol Telelogic Tau 4 5 SDL Suite Getting Started 351 Chapter 10 Tutorial Threaded Integration Right click a diagram symbol Select Symbol Details in the pop up menu Component Double click the component named John The symbol details dialog box will appear The dialog box is shown in Figure 215 x Stereotype Properties Gualifie Max Signal Size Integration Mode Threaded z Close Figure 215 The Symbol Details dialog box for Component John The integration model can be selected from a drop down list in the dia log box The selected integration model controls the code generation pa rameters for the executable file that is generated from the component Three integration models can be selected Light Threaded and Tight For the John component the selected integration model is Thread ed The information filled in the other text boxes is not used for code generation Thread Click the thread symbol T The dialog box will change its content to reflect that of the thread The new appearance of the dialog box is shown in F
21. utable select switchrouter h 7 Click Open 8 Click the file button to the right of the source file text box A file selection dialog box is opened 9 Select the routing source file in your working directory Ifyou build the John Marie ParisPizza or LyonPizza execut able select router c Ifyou build the Switch executable select switchrouter c 10 Click Open 11 Enter the server port number of the executable you are building En ter a port number according to Table 2 Table 2 TCP Server Port Numbers for the Executables Executable TCP Port Number Marie 4949 John 5959 ParisPizza 7979 LyonPizza 8989 Switch 6969 12 Click OK in the TCP IP wizard dialog box The code generation configuration is now finished 358 Telelogic Tau 4 5 SDL Suite Getting Started July 2003 July 2003 Using the Targeting Expert Compiling and Linking The Targeting Expert Compiler Linker Make section contains six tabs Compiler Source Files Additional Compiler Linker Library Manager and Make The section is shown in Figure 221 SDL Targeting Expert I tut_010810 network_depl pdm Ele Edt Make Tools Help AE ka Win32 Threaded Cy Partitioning Diagram Model 1 network_depl O host John A Win32 Threaded lt EEE Target Library Switch A Win32 Threaded Compiler Linker Make Target Library Marie A Win32 Threaded amp
Download Pdf Manuals
Related Search
Related Contents
Risk Management in Translation projects: Study and Survey Results 90026775 Rev 1 Web QSG MiFi 5792 NVTL Samsung E2100B Instrukcja obsługi Guide Evinrude - MOTEUR HORS FIUBA-PROG Manual del Usuario user manual - Billiger.de Gamber-Johnson 7160-0444 mounting kit 資料6 印刷ユニットのリスクワークシート分析表(安全方策実施後) サーベイメータ買い出し案内・巡回経路・貸出規定 Copyright © All rights reserved.
Failed to retrieve file