Home
Crescendo Tool Support: User Manual
Contents
1. Configuration Part A Configuration Part B Configuration Part C n B1 C1 TD B2 OS Figure 7 2 Illustration of the ACA process 7 2 Using the ACA Features Launching an ACA is done through the Debug Configuration menu Creating a new Debug Con figuration of an ACA Launch type will bring up the menu to configure the ACA The different tabs in Figure 7 3 will be explained in the following subsections ED Debug Configurations em Create manage and run configurations S Bx SB Pr Name New configuration type filter text Main gt Architectures SDPs Sweep Scenarios CT Settings E Common a E ACA Launch Base Configuration EB Aca CG speed mu 1 ACA ChessWay 20 Pil _ Bronna E New configuration Show plot automaticaly when the script runs E Co Sim Launch Data intensive E Folder Li h E VDM PP Model 7 Filter matched 45 of 45 items O os C Figure 7 3 Creating an ACA debug configuration To start an ACA launch a base configuration needs to be selected This configuration is a normal Crescendo launch which will be used as base for the ACA settings This means that launch options that are not overwritten in the ACA will use as default the ones present in the base launch configuration 7 2 1 The Main Tab The Main tab is the place where general settings for the ACA launch are set The Base Configura tion is the co simulation configuration that forms the base for the ACA to wor
2. PD The PD class has the following constructors set k tauD beta public PD real x real real gt PD PD k tauD beta set k tauD beta 0 1 public PD real real gt PD PD k tauD default k 0 2 tauD 1 0 beta 0 1 public PD gt PD PD PI The PI class has the following constructors set k taul public PI real real gt PI PI k taul default k 0 2 taul 0 5 public PI gt PI PI PID The PID class has the following constructors set k taul tauD beta public PID real real real real gt PID PID k taul tauD beta 53 0 0 Crescendo Tool Support User Manual set k taul tauD beta 0 1 public PID real real real gt PID PID k taul tauD default k 0 2 taul 0 5 tauD 0 5 beta 0 1 public PID gt PID PID 7 6 DE Architecture This feature allows the selection of the hardware and deployment to be specified in a separate file from the VDM system class In order to do this separation the following steps need to be done e The System class must be cleaned of CPU and BUS declarations and deployments of the objects e Annotations need to be added to the system class that indicate where the architecture and deployment statements should be inserted The architecture tag must be placed under an instance va
3. Configure launch perspective settings from the Perspectives preference page Filter matched 42 of 42 items O Create manage and run configurations Project not set sexies Name New configuration type filter text E Main gt Shared Design Parameter DE simulator Gk simulator Post Processing Advanced E Common 4 c Co Sim Launch Project ED ChessWay DESTEC K E ChessWay_DESTEC Project D Pass Simulation Model Paths ciosta test DE Path No Path Selected Browse El debug tractor Zi FuelSystem I Fuelsystem_TTErro Simulation Configuration E Groupl TT E E Group2 Script Browse E Group3 E Group4_competitio El Group4_competitio Total simulation time in seconds 0 E Group4_competitio E Group5 ad mmm Filter matched 43 of 43 items Browse CT Path No Path Selected Browse Simulation Duration Figure 6 2 The Main tab of the Debug Configuration Sectior6 3 for more information on scenarios it is possible to select which one in the Simulation Configuration section The total simulation time should be a number greater than zero to be able to run the co simulation 32 CHAPTER 6 CO SIMULATION 59 6 1 3 Shared Design Parameters Tab An important feature of the debug configuration is the possibility to view and modify the sh
4. RecordType record type Figure 5 5 Icons in the Outline View Source All All All All All All All Simulation Engine View 23 Message Simulation time 16 200000 seconds Completed 81 Simulation time 16 400000 seconds Completed 82 Simulation time 16 600000 seconds Completed 83 Simulation time 16 800000 seconds Completed 84 Simulation time 17 000000 seconds Completed 85 Simulation time 17 200000 seconds Completed 86 Simulation time 17 400000 seconds Completed 87 Figure 5 6 The Crescendo Simulation Engine view 5 1 5 Console View The Crescendo Colsole View located in the lower right part of the environment is acting as a console showing any output from the DE part of the co simulation An extract of this is shown in 20 CHAPTER 5 EDITORS AND MANAGEMENT OF PROJECTS 0 0 Figure x BB rt E rir terminated Debug Console TorsionBarBaseline VDM RT Model 19 42000001 sp 0 hold pwm 3 942828789144597E 4 sample encm 1 3333333333333334b 4 s 19 44000001 sp 0 hold pwm 3 943344918176855E 4 sample encm 1 3333333333333334E 4 s 19 46000001 sp 0 hold pwm 3 9438610472091135E 4 sample encm 1 3333333333333334E 4 19 48000001 sp 0 hold pwm 3 944377176241372E 4 sample encm 1 3333333333333334E 4 s 19 50000001 sp hold pwm 3 94489330527363E 4 sample encm 1 3333333333333334E 4 sc 19 52000001 sp 0 hold pwm 3 9
5. 3 2 2 Licence Both VDM and the Crescendo tools are open source and do not require an additional licence 20 sim is a commercial tool that will run in Viewer mode on any computer This means that you can only run and edit models If you want to save changes to your model you will need a licence You can send an email to Controllab mailto infoG8controllab nl to get a trial licence 3 2 3 Manuals VDM To help you work with VDM the VDM language manual LLB 13 and the Overture user guide LLI 13 20 sim To help you work with 20 sim you can visit the website Con13 or look at the 20 sim reference manual Kle09 d 3 3 20 sim Standalone The Crescendo installer will install the 20 sim Viewer on your computer The 20 sim Viewer will allow you to run and edit all the Crescendo example models but does not allow you to save them When 20 sim is openened the licence dialog will be opened 20 Ssim Version 4 4 4 4 0 build 4262 Controllab Products B V 2013 License Information 20 sim Demonstration Version Controllab Products B V sta trial license for 20 sim Buy a copy of 20 sim dick here for more information Press activate to update or deactivate your license Figure 3 1 Licence for 20 sim e You have to click the Close button to continue Both of these and more manuals can be found athttp overturetool org q Documentation See also http www 20sim com support movies html and http www 20sim co
6. E Install gt Overture gt 3 Run Debug gt amp Team O ces Oe ema Figure 4 3 Dialog for Importing Crescendo Examples 13 0 0 Crescendo Tool Support User Manual Settings Tools Help be ses 5e 9 AA mw A Z O E Control cosim l Drain gt FlowSource mm tank Valve The model has 0 errors and 5 warnings The model has 0 errors and 5 warnings Figure 4 4 The 20 sim Editor contains the continuous time WaterTankPeriodic model 14 CHAPTER 4 QUICK START WITH CRESCENDO 0 0 i 20 sim 3D Animation Ele View Properties Replay Help BR e Ni uU Figure 4 5 20 sim can also show simulation results in a 3D animation 15 Crescendo Tool Support User Manual 20 sim Simulator on Watertank en Ele View Properties Simulation Tools Help Hel I yr tu 9 time triggered control Tanklevel o z gt I 8 time s Output Opening file C Temp Destecs DestecsWorkspace Watertank model_ct Watertank emx File opened No bytes are read from the socket is it still open 20 sim 4 1 c 2011 Controllab Products B V Figure 4 6 The 20 sim Simulator shows the co simulated plots 16 Chapter 5 Editors and Management of Projects 5 1 The Crescendo Workbench Eclipse is an open source platform based around a workb
7. 7 valveActuator Y valveState Appy j Reet Figure 6 9 VDM Options tab permits the selection of variables to log Checking the box next to a variable enables the logging of that variable Currently it is only pos sible to log variables with basic types all types except objects For the WatertankPeriodic example if we use the configuration shown above a file with the contents as follows is generated 40 CHAPTER 6 CO SIMULATION 0 0 time levelSensor fault levelSensor level valveActuator valveState 0 0 0 0 01 0 0 01 0 01 0 0 02 0 02 0 0 03 0 03 0 0 03 0 O O00 0 The first column is the simulation time and the following columns contain the value of the variable at that given moment A CSV file can be better visualized for example in 20 sim Excel or other software capable of opening this format For convenience the first line of the file provides the names of the exported variables 4 Crescendo Tool Support User Manual 42 Chapter 7 Design Space Exploration In order to support Design Space Exploration DSE the Automated Co model Analysis ACA feature can automatically running many different co simulations with minimal user intervention The ACA feature enables the user to select different configurations for each individual parts of the co model and then runs the co simulation combining all possible configurations that were selected by the user 7 1 ACA Workflow
8. Controller Architecture Architectures folder model de architectures Create Architectures Folder Folder not found Architecture Browse Figure 6 4 The DE simulator tab of the Debug Configuration 6 1 5 CT Simulator Tab The 20 sim tab contains options related with the execution of the CT model At first both ta bles Log and Settings contain only the previously saved settings if no settings were previously selected then the tables will be empty the tables can be populated by pressing the Populate button The Populate button launches the model selected in 20 sim model and dynamically extracts the settings and the variables present in the model As shown in Figure 6 5 there are two areas present in the 20 sim options tab Log In this area it is possible to select which CT variables should be logged during the co simulation execution Settings The settings are presented in a tree view In this tree there is two types of nodes option nodes and virtual nodes which are only there to give the tree structure If an option node is selected the different possibilities will be presented on the right side Options group 34 CHAPTER 6 CO SIMULATION 0 0 Name LineFollowingRobot Main Shared Design Parameters DE simulator CT simulator gt Post Processing Advanced E Common Log lll body E servo left E servo right Settings 4 model Options implementations simulator No element s
9. type filter text Crescendo ey vw General E E V Prevent launch of Co Simulations with Contract Link errors 4 Crescendo Octave Help Install Update Run Debug Team VDM Restore Defaults Apply o aa Figure 5 14 Launching with or without contract or link errors 27 o0 Crescendo Tool Support User Manual 5 3 4 Managing the Link Files The link file is automatically created when you start a new project You can edit the link file by selecting the configuration folder in the project tree Expand the project and configuration folder and select the file vam link 1 2 connect shared variables to DE model 3 input level System levelSensor level 4output valve System valveActuator valveState 6 connect shared design parameters to DE model 7 sdp maxlevel Controller maxLevel 8 sdp minlevel Controller minLevel 10 other linked names used in scenarios 11model isLevelSensorBroken System levelSensor isLevelSensorBroken 12 model isValveBroken System valveActuator isValveBroken Contract VDM Link 20 Sim Link Overview Figure 5 15 Expand the configuration folder to see the link file Figure shows the editor with the contents of the link file Contents of a link file The syntax of a link file is a sequence of link definitions each definition is formed by an interface type a qualified name sign and a qualified name separated by line breaks Here all th
10. 0 Crescendo Tool Support User Manual Events need to be marked using the event keyword this marks the variable that it used as re turn value of the event function to be an event variable The keywords eventdown and eventup are used as in standalone 20 sim models Example variables boolean minLevelReached event equations maxLevelReached eventup levelIn maxlevel 5 3 5 Contract Overview An overview of the contract can be seen on the last tab of multi editor as shown in Figure 4 Configuration Editor 3 28 Shared Design Parameters linefollow lateral offset World linefollow lateral offset lt gt linefollow lateral offset lt gt linefollow lateral offset linefollow longitudinal offset world linefollow longitudinal offset lt gt linefollow longitudinal offset lt gt linefollov Monitored Variables lencLeft System encLeft val lt gt encLeft lt gt encLeft not checked lencRight System encRight val encRight encRight not checked lfLeft System lfLeft val lt gt lfLeft lt gt lfLeft not checked IfRight System lfRight val lt gt lfRight lt gt lfRight not checked lfLeftFaultDetected System elfLeft err lt gt lfLeftFaultDetected lt gt lfLeftFaultDetected not checked lfRightFaultDetected System elfRight err lt gt lfRightFaultDetected lt gt lfRightFaultDetected not checked m Controlled Variables velocity Left System
11. 3 explans how to get hold of the software and finally Chapter 4 explains how to quickly get started using the Crescendo tool with existing models that can be imported directly Afterwards the second part also contains four chapters explaining the main possibilities in the Crescendo tool Chapter 5 explains the different views in the Crescendo tool its editors and its way of handling projects Chapter 6 explains the co simulation possibilities This is followed by Chapter 7 which provides information about how co simulation can be extended with exploring the candidate design space Finally this part is completed in Chapter 8 explaining the post analysis possibilities in particular relevant to exploratory situations 5 Appendix A provides a complete list of the Crescendo common concepts 4 Chapter 2 Basic Crescendo Concepts The Crescendo tool allows you to define co models and to perform a co simulation To get a basic understanding of the tool we first need to define some concepts We will use use a popular description of these concepts that might not be completely correct but will hopefully enhance the understanding of users who are new to Crescendo 2 1 Models It starts with models Models are a more or less abstract representation of a system or component of interest In Crescendo we use Continuous Time models CT models and Discrete Event models DE models CT models are models that describe real physical systems These m
12. Kenneth Lausdahl Nick Battle John Fitzgerald Sune Wolff and Shin Sahara VDM 10 Language Manual Technical Report TR 001 The Overture Initiative www overturetool org April 2013 Peter Gorm Larsen Kenneth Lausdahl Peter J rgensen Joey Coleman Sune Wolff and Nick Battle Overture VDM 10 Tool Support User Guide Technical Report TR 2010 02 The Overture Initiative www overturetool org April 2013 Paul Mukherjee Fabien Bousquet J r me Delabre Stephen Paynter and Peter Gorm Larsen Exploring Timing Properties Using VDM on an Industrial Application In J C Bicarregui and J S Fitzgerald editors Proceedings of the Second VDM Work shop September 2000 Available at www vdmportal org Stewart Robinson Simulation The Practice of Model Development and Use John Wiley amp Sons 2004 Marcel Verhoef Peter Gorm Larsen and Jozef Hooman Modeling and Validating Distributed Embedded Real Time Systems with VDM In Jayadev Misra Tobias Nipkow and Emil Sekerinski editors FM 2006 Formal Methods Lecture Notes in Computer Science 4085 pages 147 162 Springer Verlag 2006 64 Appendix A Glossary As might be expected in interdisciplinary projects terms and concepts that are well known in one discipline may be unknown or understood quite differently in another This appendix therefore contains common descriptions of core concepts that are used with the Crescendo technology abstract class in object oriented progra
13. Main Architectures gt SDPs Sweep Scenarios CT Settings Common Architectures folder model de architectures Folder Folder present Architectures selection One cpu arch Y Two cpu arch Figure 7 5 ACA Launch Architecture tab 7 2 3 Shared Design Parameters Tab In the Shared Design Parameters tab it is possible to make a value sweep of the shared design parameters see Figure 7 6 45 0 0 Crescendo Tool Support User Manual Name ACA CG speed mu 1 Main Architectures SDPs Sweep Scenarios CT Settings Common Incremental Sweep Name From To Increment by Clear v 10 20 0 05 Delete dist_b 0 04 0 2 Delete Value Set Sweep Name Values Clear mu 0 5 0 65 Delete Figure 7 6 ACA Launch Shared Design Parameters tab The incremental Sweep In the first column it is possible to select from a drop down the shared design parameter to sweep see Figure 7 7 In the second column F rom it is possible to select the value which the sweep should start from The third column To indicates where the sweep should end and the forth column Increment By indicates the increment to be used in the sweep Incremental Sweep Name From To Increment by linefollow lateral offset 0 01 0 05 0 02 linefollow longitudinal offset 0 01 013 0 06 Figure 7 7 Incremental sweeping The value set Sweep In the first column it is possible to select from a drop down the shared de
14. abs floor ceil binary expression expression binary operator expression binary operator cp co nm s gg div mod te em END s ty lt gt and or gt lt gt duration empty for real literal time unit y 37 0 0 Crescendo Tool Support User Manual gt S El m h ms time unit us body block statement block C statement list gt statement list statement statement statement list statement identifier expression print string warn string error string quit after after revert list 3 revert list 2 revert identifier revert identifier revert list 6 3 3 CSL Examples The following introduces a series of simple examples that demonstrate the features of this script language when time 5 do de real x 10 The time keyword yields the current co simulation time The de keyword indicates that x resides at the top level in the DE model Naturally the ct keyword is used to indicate the CT model Comments may also be included when time 5 do comment ct real y true Statements can also be grouped in blocks surrounded by parentheses and separated by
15. array initial position 3 7sdp real fast wheel speed 8sdp real slow wheel ratio 10 encoders 11 monitored real encoder_left 12 monitored real encoder right 13 14 line following sensors 15monitored real lf left 16 monitored real 1f right 17 18 line following sensor fail flags 19 monitored bool 1f left fail flag 20 monitored bool lf right fail flag 22 servos 23 controlled real servo left 24 controlled real servo right Contract VDM Link 20 Sim Link Overview Figure 5 13 The Editor with a new contract 5 3 2 Contents of a Contract A contract between a CT and a DE model can contain the following kinds of information Design parameters These are typically values which indicate the properties of components e g size weight temperature A designer would like to explore different values of these param eters in order to find an optimal solution to the challenge he is working on The actual values for the shared design parameters are set outside the contract in a separate file Variables The variables are the active interface between the CT and DE models so these indicate the variables that change during one simulation Variables typically represent sensor readings and signals to actuators Events Events can be triggered in the CT world They will stop the simulation before the al lowed time slice is completed The co simulation engine will then allow the DE simulator to take action but only until the point wher
16. class from the library simply define a variable of the correct type instantiate it with a constructor call Set SampleTime and then call Output in your control loop All of the control library classes have an operation called Output which takes in an error and returns a control value with the following form public Output real gt real Output err class Controller instance variables controller object private pid PID setpoint private SP real shared variables private MV real private out real operations constructor for Controller public Controller gt Controller Controller pid new PID 10 1 0 1 pid SetSampleTime SAMPLE TIME i lt control loop public Step gt Step dcl err real SP MV out pid Output err 100Hz control loop values SAMPLE TIME 0 01 thread periodic 10E6 0 0 0 Step end Controller All of the classes have an operation called SetSampleTime which takes a sample time in seconds 51 0 0 Crescendo Tool Support User Manual public SetSampleTime real gt SetSampleTime s Unlike 20 sim VDM does not have a sampletime keyword so it is necessary to explicitly tell the object what sample time to use in calculations Therefore for all control objects except P you must call SetSampleTime before the Output is used This
17. configuration amp contract csc Jf vdm link 4 gt launches 2 LineFollowingRobot Outside launch 2 LineFollowingRobot launch 2 model ct 4 3 model de gt architectures amp controller amp io gt lib E System vdmrt E Thread vdmrt E World vdmrt output 4 scenarios Y left sensor failed script2 Jf quit when idle script2 Figure 5 2 The Crescendo explorer view 5 1 2 Editor View The Crescendo Editor View allows you to edit VDM files Contracts and Scenarios and it highlights the different keywords Figure shows how a Crescendo contract looks in the editor and in a different pane a VDM RT file 1 actuator interface vdmrt Y Configuration Editor 23 im shared design parameters 2sdp real wheel_radius 3sdp real encoder_resolution 4sdp real line_follow_x 5sdp real line_follow_y 6sdp array initial_position 3 7sdp real fast_wheel_speed 8 sdp real slow wheel ratio 10 encoders 11 monitored real encoder_left 12 monitored real encoder right 13 14 line following sensors 15monitored real lf left 16monitored real 1f right 17 18 line following sensor fail flags 19monitored bool lf left fail flag 26 monitored bool lf right fail flag 22 servos 23 controlled real servo left 24 controlled real servo right Contract VDM Link 20 Sim Link Overview Figure 5 3 The Editor View 18 CHAPTER 5 EDITORS AND MANAGEMENT OF PROJECTS 00 5 1 3 Outline View The Cresce
18. e Select the option Co Sim Launch and New Configuration Now a window will show up as Figure where you can enter the settings of the debug configuration We will describe all the tabs that can be configured before running a co simulation 6 1 2 Main Tab Once the project is found and selected the paths for both Discrete Event model will be automati cally set Since multiple Continuous Time models could be present the Browse button to select the one you would like to use The Main Tab is where the project to co simulate is selected This can be done by pressing the Browse button After selecting the wanted project the DE model path is automatically filled since it is only possible to have one DE model in the model de folder Though the CT model path needs to be selected using the Browse button If a scenario should be used see 3l 59 Crescendo Tool Support User Manual Create manage and run configurations x Ez Configure launch settings from this dialog type filter text Press the New button to create a configuration of the selected type gt EB ACA Launch Press the Duplicate button to copy the selected configuration b E Co Sim Launch Folder Launch VDM PP Model Press the Filter button to configure filtering options gt VDM RT Model E VDM SL Model Press the Delete button to remove the selected configuration Edit or view an existing configuration by selecting it
19. in the DE model The qualified name can start with any class name and the referenced value must be a VDM value e model links a name and a variable in the VDM model The name can then be used to reference the variable in scripts The qualified name must start with the system class name The vdm link file for the WaterTankPeriodic example looks as connect shared variables to DE model input level System levelSensor level output valve System valveActuator valveState connect shared design parameters to DE model sdp maxlevel Controller maxLevel sdp minlevel Controller minLevel other linked names used in scenarios model isLevelSensorBroken System levelSensor isLevelSensorBroken model isValveBroken System valveActuator isValveBroken CT Model On the 20 sim side a link file is not used but still the variables parameters need to be declared in a certain way inside the 20 sim model in order to carry out the co simulation Variables used in the co simulation need to be in the externals field and marked as global Depending if they are used as input or output they need to be marked import or export respectively Example externals real global export level real global import valve The parameters to be shared across the two models need to be marked with the keyword shared Example parameters real aParam shared 5 29 0
20. velLeft val lt gt velocity Left lt gt velocity Left not checked velocity Right System velRight val lt gt velocity Right lt gt velocity Right not checked 4 m r Contract VDM Link 20 Sim Link Overview Figure 5 16 Overview of contract information In this view it is possible to see which variable from the DE side is connected to which contract variable and transitively to which CT variable The form they are presented is VDM variable Contract Variable 20 sim variable The not checked warning appears next to the 20 sim variables because at this moment is not possible to static check if the variables exist in the 20 sim model 30 Chapter 6 Co Simulation 6 1 Debug Configuration Before starting a co simulation a debug configuration must be created if a launch configuration is not already available The purpose of this is to define where the Continuous Time and Discrete Event models are located as well as the scenario file and the simulation time In this section we will go through each pane in the debug configuration 6 1 1 Creating a New Debug Configuration e Select the project for which you want to create a Debug Configuration e Press the small arrow next to the debug icon 55 at the top of the the Crescendo Tool e A drop down menu will appear in which the option Debug configuration has to be selected and as a consequence a new window will appear as shown in Figure 6 1
21. 3 Octave in action 20 sim 2012 03 25 20 03 09 LineFolowACA 12 RobotPhysicsservo ightEnergyintoRightMotorE robotSpeedsAndPositionsFor3Dvobo x RobotPhysicsservqeftEnergyintol eftMotor 4 robotSpeedsAndPositionsFor3D robaty Figure 8 4 Octave plotting in seperate window 61 Crescendo Tool Support User Manual type filter text Octave Prove gt General 4 teas Path to octave CASoftwareVOctave 364 binVoctave exe Octave gt Run Debug gt Team p VDM Figure 8 5 The Octave path settings in the Preferences dialog E pess costosos x Create manage and run configurations S x ei Name New configuration type filter text f E Common gt EB ACA Launch Project Selection El Co Sim Launch E 4 Folder Launch Cumis Browse amp New configuration E VDM PP Model pone p VDM RT Model Folder E VOM SL Model C Browse Apply Revert Filter matched 43 of 48 items EA ESS O Deua j ce jJ Figure 8 6 Launching several configurations from a single directory 62 Bibliography ALRL04 BJ78 BLV 10 CCFJ99 Con13 FL98 FLO9 FLM 05 FLV08 FLV 13 Algirdas Avizienis Jean Claude Laprie Brian Randell and Carl Landwehr Basic Concepts and Taxonomy of Dependable and Secure Computing IEEE T
22. 454094343058883E 4 sample encm 1 3333333333333334E 4 19 54000001 sp 0 hold pwm 3 9459255633381466E 4 sample encm 1 3333333333333334E 4 19 56000001 sp 0 hold pwm 3 946441692370405E 4 sample encm 1 3333333333333334E 4 s 7 4 D Figure 5 7 The Crescendo Console view 5 2 Handling Projects All data that is necessary for a co simulation e g models contracts etc is stored in a Crescendo project This section explains how to use the Crescendo tool to manage projects Step by step instructions for importing exporting and creating projects will be given 5 2 1 Creating new Projects Follow these steps in order to create a new Crescendo project e Create a new project by choosing File and New and Project and Crescendo project e Type in a project name e Click the button Finish see Figure 5 8 You can create projects in the Crescendo tool The highlighted project is the project that is currently selected 5 2 2 Importing Projects Follow these steps in order to import an already existing Crescendo project e Right click the Explorer View see Section above and select Import e Select either the standard Crescendo or the General Existing Projects into Workspace part Using the Crescendo one enables you to import the standard Crescendo examples or the examples used in the book about this FLV 13 Using the General entry you can import anything else that has been produced by someone and exported fo
23. 8 1 Octave GNU Octave is an open source and high level interpreted language primarily intended for nu merical computations It provides capabilities for the numerical solution of linear and non linear problems and for performing other numerical experiments It also provides extensive graphics ca pabilities for data visualization and manipulation Octave is normally used through its interactive command line interface but it can also be used to write non interactive batch oriented programs The Octave language is quite similar to Matlab so that most programs are easily portable See for more details ht p www gnu org software octave The Octave project on Source Forge provides an easy installable Windows installer for Octave Furthermore a Octave GUI is provided by which provides a workspace and editor that can be used to assist the user of Crescendo in creating custom scripts 8 1 1 Octave use in Crescendo After each co simulation run an Octave script is automatically generated in the output dir The script contains Octave code that reads the variable logs produced by both VDM and 20 sim during the simulation run 8 1 2 Show Plot Automatically when Script is Run The Octave script will contain the necessary code to interpret the logged variables and functions to generate a plot However it will not contain the command to display the plot This setting will insert the plot commend in the script and automatically show a plot when exec
24. Crescendo Technical Report Series No TR 001 November 2013 Crescendo Tool Support User Manual Version 2 0 0 by Peter Gorm Larsen Kenneth Lausdahl Joey Coleman and Sune Wolff Aarhus University Department of Engineering Finlandsgade 22 DK 8200 Aarhus N Denmark Christian Kleijn and Frank Groen Controllab Products B V Hengelosestraat 500 7521 AN Enschede The Netherlands Crescendo Co Simulation for Embedded Control Systems Crescendo Tool Support User Manual Document history Month Year Version Version of Crescendo exe December 2012 1 1 1 8 then called DESTECS November 2013 2 2 0 0 January 2014 3 2 0 0 review by M Verhoef 11 Contents 1 Introduction 1 1 WhatistheCrescendo Tool lees 1 2 What was the DESTECS Project cre IRA 1 3 What is the Vienna Development Method o o 1 4 What are Bond Graphs o scan cs m AR AR Oe Ses LA Rel ted Tools yg RS A A Ea RAE II bru AA xx Dx dr bee du Sed PER ud ce od Uk he eee ae bee tee eee HERE OR x 1 6 Structure of this User Manual llle 2 Basic Crescendo Concepts DI Models o ee dig a Brad Sta Sr Rep UR cR RI A QS oh Ge Sab ds A LE A E a a a a a a a A DA Conttactl ic e ec REGERE RE E CR E A RES ee ae dre 3 Getting Hold of the Software AR 25 4 mad dra S16 dr rd Rud e ch eph Blech ete be pa A s A E E 3 2 1 Combined Installed soc
25. Figure illustrates the steps in the process of the ACA work flow First the user provides configurations for different parts of the co simulation then the tool generates different complete configurations by combining the different configurations parts that were provided by the user Automatic User Input 1 Automatic Presenting the Generation of Configurations q Analysis results Configurations Figure 7 1 Illustration of the ACA process These complete configurations are used to execute co simulations Currently it is only possible for the user to select different configurations for different parts of the co simulation more specifi cally chose different architectures for deployment of the controller DE side and select different starting values for the shared design parameters From these partial configurations it is possible to construct complete configurations by com bining each of the different partial configurations Figure together with the following de scription helps illustrating the concept The result of generating complete configurations from the partial configuration would be 4 different complete configurations A1 B1 C1 A1 B1 C2 Al B2 Cl and Al B2 C2 The user can easily create many more configurations by adding more parameters or adding more values to existing parameters for example simply adding a A2 value would result in 4 more different configurations 43 0 0 Crescendo Tool Support User Manual
26. For events to be considered during a simulation the event must be defined in Section 5 3 events event identifier Events in the link file Events must be connected to a public async operation in VDM This is done by linking the event name specified in the contract to the fully qualified operation name in VDM in the link file 3 29 events event identifier System 2 identifier gt identifier An example of this could be event eventl System eventHandler eventl where e event 1 is the event name from the contract e Systemis the system class e eventHandler is the class holding the public async operation to execute e event 1 the last event1 is the async operation which to execute when the event occurs 55 59 Crescendo Tool Support User Manual 7 7 2 Events in CT Events need to be marked in 20 sim using the keyword event this marks the variable that it used as return value of the event function to be an event variable The keywords eventdown and eventup are used as in standalone 20 sim models Example variables boolean minLevelReached event equations maxLevelReached eventup levelIn maxlevel 7 7 3 Events in DE The scheduler in VDM does not schedule events in the same way as for instance a microcontroller would do where the current executing job is suspended in favour of the interrupt routine Howev
27. York 2005 J S Fitzgerald P G Larsen and M Verhoef Vienna Development Method Wiley Encyclopedia of Computer Science and Engineering 2008 edited by Benjamin Wah John Wiley amp Sons Inc John Fitzgerald Peter Gorm Larsen and Marcel Verhoef editors Collaborative De sign for Embedded Systems Co modelling and Co simulation Springer 2013 63 Crescendo Tool Support User Manual TEE00 ISO96 Jon90 Kle09 KNO9 LH96 LLB 13 LLJ 13 MBD 00 Rob04 VLHO6 IEEE 100 The Authoritative Dictionary of IEEE Standards Terms Seventh Edition IEEE Std 100 2000 2000 Information technology Programming languages their environments and system software interfaces Vienna Development Method Specification Language Part 1 Base language December 1996 Cliff B Jones Systematic Software Development Using VDM Prentice Hall Interna tional Englewood Cliffs New Jersey second edition 1990 ISBN 0 13 880733 7 C Kleijn 20 sim 4 1 Reference Manual Controllab Products B V Enschede First edition 2009 ISBN 978 90 79499 05 2 T Kurita and Y Nakatsugawa The Application of VDM to the Development of Firmware for a Smart Card IC Chip Intl Journal of Software and Informatics 3 2 3 343 355 October 2009 Peter Gorm Larsen and Bo Stig Hansen Semantics for underdetermined expressions Formal Aspects of Computing 8 1 47 66 January 1996 Peter Gorm Larsen
28. ared design parameters of the co simulation This is configured in Figure 6 3 Name LineFollowingRobot Main Shared Design Parameters DE simulator CT simulator Post Processing Advanced E Common Synchronize with contract Name Value wheel radius 0 03325 encoder resolution 44 line follow x 0 01 line follow y 0 065 initial position 1 0 156 initial position 2 0 33 initial position 3 0 524 fast wheel speed 08 slow wheel ratio 0 Figure 6 3 The Shared Design Parameters tab of the Debug Configuration In the Shared Design Parameters tab a list of the parameters used in the simulation can be viewed For the variables to appear for the first time the button Synchronize with contract needs to be pressed Every time the shared design parameters are changed in the contract the button must be pressed again in order to synchronize the view with the contract For the variables present in the table it is possible to decide which values they will have when the co simulation starts Figure 6 3 shows the Shared Design Parameters tab for a project that has an array 3 as a shared design parameter 6 1 4 DE Simulator Tab The DE Simulator tab is the place where runtime options for the DE part of the model can be activated and deactivated It is divided in 4 options groups Interpreting These are options related to the interpretation of the DE models Certain checks and also the generation of reports such as coverag
29. ave to define a contract The contract also needs to be linked into DE and CT elements respectively In order to show the co simulation tool how to link the elements from the contract to the DE and CT models respectively a link file must be present for each co model This is stored in a vdm link part 5 3 1 Creating a new Contract File Right click on the project that is going to contain the contract file Select New and Crescendo New Contract as shown in Figure e A new window will pop up Choose a contract name and click on the Finish button to end the process After following these steps a new file named contract csc will appear under the configuration folder contained in the project tree The contract can be viewed in the editor as shown in Figure 24 CHAPTER 5 EDITORS AND MANAGEMENT OF PROJECTS 59 New gt CS Project den Crescendo New Architecure E Copy Ctrl C X Crescendo New Contract Paste Ctrl V Crescendo New Scenario MX Delete Delete E Crescendo Project Move File Rename F2 C Folder es Import Add Crescendo Library A a 3 Export i Add VDM Library el femen P fo Empty VDM RT File Close Project Close Unrelated Projects Cj Other Ctrl N Figure 5 12 Choosing a new Crescendo contract actuator interface vdmrt Y Configuration Editor 23 im shared design parameters 2sdp real wheel radius 3sdp real encoder_resolution 4 sdp real line follow x 5 sdp real line follow y 6 sdp
30. axem x es ra e RD Doxor eoe Gor e Box NT 31 6 1 3 Shared Design Parameters Tab 6 6 24 eee eee RR 33 6 14 DE Simulator RD ao ue ee be ye R9 A TA 33 6 1 5 CT Simulator Tabl soa x E x X XS 34 5 2 Post Processing Tab ace ncm ant mom Rok Rm aoe sake Ade eR UK agi s 35 6 2 Advanced Tabu viu ars a PORE BE DER or al 35 622 Common Tab 5 5 4 aaa AS RE RARE E 35 DSO DRI a a Ge EV a DS ia AA oe eS a DA 36 6 3 1 Creating a New Scenario File 4 2442542864 na eee RA 37 Cenk ROS O 5 m Rr eve er RORIS oe Bau Macr Boden Boag M s 37 c EC EP 38 bog eK god x d qux dq de eee qos ed x CREE Rede RSH RS 39 6 4 1 DE Variables lt os soa UR EORR OU SOR RAO eO ee ke E 40 43 71 ACA Workflow serra res pr oe wk Xoeo AR 43 TIC 44 12 1 The Main Tabj v uso uo d ma a Red LR Oa OS EH ES 44 AMI 45 7 2 3 Shared Design Parameters Tab o o o o RA 45 2 4 Scenario Pal nne cue oe oS 903409 RAPER exo Rae RRS RU 47 20 CT Settings Tab au i a Ram oR eee ERA AA 48 LAS Common Tal iy des doceo eR IRSE Foe XU XO LC E SOR SC DA 48 EX Se o SR TRES REOR 48 iv CONTENTS l c 49 7 5 Control Library ordre a 49 1 5 1 Accessing the Control Library ooo a 50 TET 51 1 5 3 Advanced USE rsss E AEE RIDE a wR SCH 52 17 5 4 Constructors o oo o o 9 3 9 RR R3 RO E XO RR 52 PUT PT 54 AAA 26 ox Pee be 3 X O4 X O3 3 ESE ESE X X44 RING SERRE Red A 33 731 1 Simulation Sep uus oe kem ER eS
31. clipse where a simulation scenario is defined design alternatives where two or more co models represent different possible solutions to the same problem design parameter a property of a model that affects its behaviour but which remains constant during a given simulation design space exploration the iterative process of constructing co models performing co simulations and evaluating the results in order to select co models for the next iteration 66 APPENDIX A GLOSSARY 0 0 design step a co model which is considered to be a significant evolution of a previous co model discrete event simulation a form of simulation where only the points in time at which the state of the system changes are represented Rob04 p 15 disturbance a stimulus that tends to deflect the plant from desired behaviour edges in bond graphs see bond effort in bond graphs one of the variables exposed by a power port Represents physical concepts such as electrical voltage mechanical force or hydraulic pressure environment everything that is outside of a given system error part of the system state that may lead to a failure ALRLO4 event an action that is initiated in one constituent model of a co model which leads to an action in the other constituent model executable model a model that can be simulated failure a system s delivered service deviates from specification ALRLO04 fault injection the act of triggering faulty behavi
32. cted event that occurs at a predetermined time variable part of a model that may change during a given simulation vertices in bond graphs the joining points of bonds May be manifested as either a junction or a submodel 70
33. d documentation model management the activity of organizing co models within a model base model structuring the activity of organizing elements within a model model synthesis see code generation model a more or less abstract representation of a system or component of interest modelling the activity of creating models modularisation construction of self contained units modules that can be combined to form larger models monitored variable a variable that a controller observes in order to inform control actions object in object oriented programming an instantiation of a class contains data fields and meth ods objective function see cost function ontology a structure that defines the relationships between concepts operation in object oriented programming defines an operation that an object may perform on some data Operations may be private public or protected output the states of a model as observed during and after simulation non normative behaviour behaviour that is judged to deviate from specification physical concept in bond graphs a class of component or phenomena that could exist or be observed in the real world e g an electrical resistor or mechanical friction plant the part of the system which is to be controlled IEEO0 power port in bond graphs the port type connected in a bond graph Contains two variables effort and flow A power port exchanges energy with its connected models private
34. e design parameters the variables and the events from the contract must be present on the left hand side of each of these definitions It is important to note that the link file may contain more links than required by the contract this allows a DE model to be reused in different simulations where different contracts are used Additionally links can be made to variables that exist within the model in order to be able to reference them from a script the keyword model is used for this purpose The right hand side of all the signs provide the names seen from the DE co model side e g the instance variables inside a system class in the VDM RT model The syntax of these definitions are vdmlink file 4 interface qualified name qualified name input sdp event model interface output qualified name identifier identifier identifier initial letter following letter y Link File Parts e input links one monitored variable in the contract with a instance variable in the DE model The qualified name must start with the system class name 28 CHAPTER 5 EDITORS AND MANAGEMENT OF PROJECTS 0 0 e output links one controlled variable in the contract with an instance variable in the DE model The qualified name must start with the system class name e sdp links a shared design parameter in the contract with a value
35. e or the real time events can be turned on and off Usage of these options are further explained in the Overture VDM user manual LLJ 13 Log In this group it is possible to select variables from the DE model that should be logged during the simulation To find more details about this feature see Section 6 4 Faults In this group it is possible to select a class A to replace a class B before the co simulation start The intention is to experiment with faulty modules that can be substituted by the non faulty model To make sure there will be no run time exceptions class B should be subclass 33 0 0 Crescendo Tool Support User Manual of A To indicate that class A should be substituted by class B the following should be inserted in the text box DE Replace Pattern A B It is possible to make several substitutions by separating the substitutions with a comma A B C D Architecture In this area it is possible to select an architecture file that defines the architecture of the deployment of the DE controller More information on the architecture file can be seen in Section Main Shared Design Parameters DE simulator gt CT simulator Post Processing Advanced Common Interpreting 4 Dynamic type checks V Invariants checks V Pre condition checks V Post condition checks V Measure Run Time checks Generate Coverage Log Real Time Events Check timing invariants Log E System Faults DE Replace pattern A B
36. e the event has been raised The events are used in the contract in order to support event based triggering and not just time triggered scheduling 25 0 0 Crescendo Tool Support User Manual The syntax for contracts follow the following rules contract parameters variables events parameters shared design parameter type identifier sdp type identifier variables kind type identifier kind mat rix identifier shape shape integer integer events event identifier bool type real identifier initial letter following letter controlled kind monitored value float boolean literal boolean literal true false In the following listing an extract from the contract file provided with the WaterTank Periodic example is shown Shared design parameters sdp real maxlevel sdp real minlevel Monitored variables seen from the DE controller monitored real level Controlled variables seen from the DE controller controlled bool valve Matrices It is also possible to exchange matrices between DE and CT models To be able to do this a matrix needs to be declared in the contract The adopted syntax is similar to 20 sim where the shape of the matrix is indicated by a sequence of integers m m For
37. eG eee Gee EXC Yeu lt 55 CERCO MITT 56 LES vents in DE e e ani i aop hk GG Gh eG OB qb a ere aoi gare 56 8 Post Analysis 59 A ss such gee we See dee hee ds he Pe ee ee ee we es 59 amp ll Octave use in Crescendo iy ne eae RR ER ERR 59 rv 59 8 1 3 Invoking Octave from Crescendo o a 60 8 1 4 Setting Octave path 2 2 ee ee 60 iS aca ura AE AEREA RUE n 60 65 Crescendo Tool Support User Manual vi ABSTRACT This document is the user manual for the Crescendo Integrated Development Environment IDE version 2 0 0 enabling collaborative analysis of models written in the Discrete Event DE formal ism VDM and the Continuous Time CT formalism bond graphs The specific dialect of VDM used is called VDM Real Time VDM RT and it is supported by the Overture tool whereas the bond graph formalism is supported by the tool 20 sim Both Crescendo and Overture are built on top of the Eclipse platform Chapter 1 Introduction 1 1 What is the Crescendo Tool The Crescendo tool was originally called the DESTECS tool since it was produced in the Euro pean Seventh Framework research project called DESTECS see Section 1 2 below It supports a method of collaborative modelling and simulation called co simulation 1 2 What was the DESTECS Project The DESTECS Design Support and Tooling for Embedded Control Software project was per formed by a consortium of research groups and companies working on the chal
38. ed Environment VICE 2 CHAPTER 1 INTRODUCTION 59 1 5 Related Tools The Crescendo tool is one of a family of tools with common shared code 1 5 1 Overture The Overture tool www overturetool org represents the opening of these tools This tool is build on top of the Eclipse platform and it support all the VDM dialects VDM SL VDM and VDM Real Time VDM RT Many different features are included but the emphasis is on validation of VDM models by interpretation of executable subsets This also includes support for DE notation VDM RT used inside the Crescendo tool Users who are only interested in Discrete Event DE modelling using one or more of the VDM dialects should use this Overture tool 1 5 2 Crescendo The Crescendo tool www crescendotool org is a gradual increase of the Overture tool in the sense that it has all the support present inside Overture and in addition it supports collaborative modelling and simulation with a combination of the DE notation VDM RT and the Continuous Time CT simulation by the 20 sim toof This is particular useful for those who are interested in modelling and validation of embedded control systems including modelling of the physical plants to be controlled Users who are interested in both DE and CT modelling in a collaborative fashion should use this 1 5 3 Symphony The Symphony tool is an extended musical composition carried out by a large band i e a System of Systems This tool
39. een included in the Crescendo tool This library provides classes that are equivalent to the P PD PI and PID blocks of the 20 sim library under Signal Control PID Control Discrete 49 Crescendo Tool Support User Manual E Debug Configurations Create manage and run configurations 1 amp x oi Name New configuration type filter text El ACA Launch Main El Common Project Selection E Co Sim Launch 4 B Fold Project Browse New configuration DIOS Folder selection VDM RT Model Folder E VOM SL Model B Filter matched 45 of 45 items O Figure 7 14 Lauching with a Folder of launch files 7 5 1 Accessing the Control Library To use the control library the class definitions must be imported into the project e Right click on the project and select New and Other e Under the Crescendo folder select Add Crescendo Library and click Next e Then check the box marked Control Library El Add Library Wizard Add Library Select the libraries to include Libraries E Control Library v 1 0 0 Configuration 7 Used linked libraries SEN Figure 7 15 Adding Crescendo Control Libraries Unless you want to edit the class files leave Use linked libraries option checked default The classes will now be added to your co model see Figure 7 15 50 CHAPTER 7 DESIGN SPACE EXPLORATION 0 0 7 5 2 Using the Control Library Basic Use To use a
40. elected Populate Apply Revert Figure 6 5 The CT simulator tab of the Debug Configuration 6 2 Post Processing Tab The post processing tab shows the options available for the post processing phase see Figure 6 6 Main Shared Design Parameters DE simulator CT simulator Post Processing gt Advanced E Common Octave Options Show plot automatically when the script runs Figure 6 6 Post processing tab for debug configuration Show plot automatically when the script runs with this option enabled the Octave script that is generated after each run will contain the commands to show the plot automatically 1 e simply running the script will show the plots For more information on the use of Octave please see Section 6 2 1 Advanced Tab The advanced tab is reserved for developers extra debug information can be turned on or off in this tab see Figure 6 7 6 2 2 Common Tab The Common tab is a standard Eclipse tab which for example allows users to save the debug configurations into files so that they can be shared with others Figure 6 8 shows how to produce a launch file that can be shared with others 35 0 0 Crescendo Tool Support User Manual Main Shared Design Parameters DE simulator CT simulator Post Processing Advanced gt E Common Development options Remote debug Enable logging V Enable runtime debug info Enable General Debug Simulation Connection DE Simula
41. ence a co model during co simulation without being overly complex For example it does not allow local variables to be defined 36 CHAPTER 6 CO SIMULATION 59 6 3 1 Creating a New Scenario File Follow these steps in order to create a new scenario file e Right click on the project that is going to contain the contract file Select New and Crescendo New Scenario e A new window will pop up named Scenario Wizard Select the current project by clicking on the Browse button Click on the Finish button to end the process After following these steps a new file named Scenario script2 will be placed under the scenarios folder 6 3 2 CSL Syntax Here we give the syntax of the CSL using standard notation Note that the definitions of real literal name and string are not given script trigger script trigger trigger trigger type expression duration do body after trigger type 2 when once expression time literal identifier unary expression binary expresion literal boolean literal real literal boolean literal true false identifier simulator type name simulator de ct type boolean real unary expression unary operator expression unary operator not
42. ench that provides a common look and feel to a large collection of extension products Thus if a user is familiar with one Eclipse product it will generally be easy to start using a different product on the same workbench The Eclipse workbench consists of several panels known as views as shown in Figure A collection of panels is called a perspective The figure below shows the standard Crescendo perspective The Crescendo perspective consists of a set of views for managing Crescendo projects and viewing and editing files in a project Different perspectives are available in Crescendo based on the task that you are doing In the subsections below the different views of the standard Crescendo perspective will be presented E Crescendo TorsionBarExtended model_de TorsionBar vdmet Crescendo Tools File Edit Navigate Search Project Run Window Help Pr 3 Y 0 Q E Crescendo Explorer 3 E Thread vdmet BlackWhiteSensorvdmt TorsionBar vdmrt BE Outline MW wow El Groups system TorsionBar 4 O TorsionBar Yd Groups i Y od ellowinghebet instance variables Ji MorseDecoder Monit Mors Mi fan cul amp mon PaperPath Crescendo Paste eic Son Donor je diy ds YS papesPinch E e env E troller object SOH SimpleController e oll Apa xplorer public static ctrl Controller nil bar io s cpu view iiti fie cal Crescendo a ba public static mon Monitor nil E TorsionBar amp corfiguntica Editor
43. er 1t is possible to get similar behaviour by creating and deploying an object to a CPU that contains the job to run when an interrupt occurs and then call this from the async operation which is triggered when event occurs It is just important that no objects having a periodic threads are deployed to the same CPU since this will delay the event by exactly one periodic loop Events are linked to VDM through async operations and made accessable through the system class system System instance variables eventHandler EventHandler end System The async operation must be specified in a class that is not deployed to a CPU This makes the evaluation instant This means that the event operation it self does not take any time to run class EventHandler operations public async eventl gt eventl skip end EventHandler Note about the VDM scheduler The VDM scheduler uses priorities to select which thread should run each thread is then executed with a limited allowed number of expressions statements it can execute before another thread has to be schedulled and executed The priority defined how many expressions statements a thread can execute at a time A thread will always continue 56 CHAPTER 7 DESIGN SPACE EXPLORATION 59 executing until it is blocked or finished the allowed number of expressions statements 57 Crescendo Tool Support User Manual 58 Chapter 8 Post Analysis
44. eter Chapter 3 Getting Hold of the Software 3 1 Requirements The Crescendo tool suite can be downloaded as a single installation package from the Crescendo website The package contains a full installation for Overture VDM 20 sim and the Crescendo tools Overture VDM and the Crescendo tools are open source tools and will run on any computer equipped with a Java virtual machine However 20 sim is a commerical tool that will run as a viewer on any Windows computer If you want to build your own models in 20 sim and store them you will need a license see Section B 2 In order to install to package of the Crescendo package you need to have Windows platform XP Vista 7 8 e At least 256 MB memory At least 200 MB free disk space An x86 compatible CPU 3 2 Installation 3 2 1 Combined Installer First time users are advised to use the combined installer that will install the Crescendo tool and that will also include the Overture VDM features and the 20 sim tool on your computer You can download the installer from the Crescendo website http www crescendotool org During installation the main installer will pause A second installer will then guide you through the installation of 20 sim Once 20 sim is installed the Crescendo installer will continue Both the Overture VDM tool as well as the Crescendo tool are released as open source under the GNU General Public Licence v3 0 0 0 Crescendo Tool Support User Manual
45. example to declare a 2x2 matrix named M which is monitored the following must be added to the contract monitored matrix M 2 2 26 CHAPTER 5 EDITORS AND MANAGEMENT OF PROJECTS 0 0 In VDM matrices of n dimensions m1 mn are represented as seq of seq of real So a 2x2 matrix is represented as a seq of seq of real The contract matrix variables are linked in the same manner as any other variable but the target variable needs to be of the correct type in our case seq of seq of real At the VDM level this would typically be declared as instance variables M seq of seq of real 0 0 0 0 0 0 0 0 Arrays Arrays which are limited to one dimension can be declared in the same style monitored array position 3 Arrays are basically matrices limited to one dimension 5 3 3 Error Detection in the Contract Link File A static error check is performed every time the contract or the link file are saved This is a cross file consistency check which resolves if all the variables and events declared in a contract are also present in the link and vice versa Crescendo will prevent the launch of projects with consistency errors between the contract and link files but there is the possibility to turn this protection off by un checking the referent preference accessible in the menu Windows followed by Preferences This is illustrated in Figure 5 14 E Preferences
46. ge which can then be executed on the real hardware of the system co model a model comprising two constituent models a DE submodel and a CT submodel and a contract describing the communication between them consistency a co model is consistent if the constituent models are both syntactically and semanti cally consistent constituent model one of the two submodels in a co model continuous time simulation a form of simulation where the state of the system changes contin uously through time Rob04 p 15 contract a description of the communication between the constituent models of a co model given in terms of shared design parameters shared variables and common events controlled variable a variable that a controller changes in order to perform control actions controller the part of the system that controls the plant controller architecture the allocation of software processes to CPUs and the configuration of those CPUs over a communications infrastructure co sim launch the type of debug configuration used in the Crescendo tool to define and launch a single scenario co simulation baseline the set of elements co model scenario test results etc required to re produce a specific co simulation co simulation engine a program that supervises a co simulation co simulation the simulation of a co model cost function a function which calculates the cost of a design debug config Eclipse term the place in E
47. has been used by practitioners who were not specialists in the underlying formalism or logic LH96 CCFJ99 KNO09 Experience with the method suggests that the effort spent on formal modelling and analysis can be recovered easily in reduced rework costs arising from prevented design errors VDM models are expressed in a specification language VDM SL which supports the descrip tion of data and functionality ISO96 FL98 FLO9 Data is defined by means of abstract data types built using constructors that define structured data and collections such as sets sequences and mappings from basic values such as Booleans reals characters and natural numbers These types are very abstract allowing you to add any relevant constraints using data type invariants Functionality is defined in terms of operations over these data types Operations can be defined implicitly by preconditions and postconditions that characterize their behavior or explicitly by means of specific algorithms An extension of VDM SL called VDM supports object oriented structuring of models and also permits direct modelling of concurrency FLM 05 A further extension to VDM called VDM Real Time VDM RTP which includes support for explicit computing and communication architectures for executing specific deployments of discrete time models MBD 00 VLHO6 All three VDM dialects are supported by Overture 1 4 What are Bond Graphs Bond graphs are directed graphs in which the vert
48. ices are submodels and the edges called bonds denote the ideal or idealised exchange of energy between those submodels Entry points of submodels are called ports The exchange of energy through a port p is always described by two implicit variables effort p e and flow p f The product of these variables is the amount of energy that passes through the port The meaning of these two variables depends on the physical domain examples include voltage and current and force and velocity which makes the method ideal for multi domain modelling The 20 sim tool supports the creation and simulation of models that can be represented in a variety of forms including basic bond graphs collections of differential equations describing the behaviour of nodes and iconic diagram Although the 20 sim tool is commercial all the model libraries are open source The package supports mixed mode integration techniques to allow the modelling and simulation of computer controlled physical systems that contain Continuous Time as well as Discrete Event elements The level of complexity of many modern controllers means that discrete event elements are better modelled using a rich formalism such as VDM The 20 sim package supports the connection of external software both for model construction and simula tion Discrete Event Continuous Time or hybrid and this connection is exploited in providing support for co simulation Originally called VDM In a Constrain
49. ie GA RES ROS Dad Y D ICN sco Re eae doe QE ee eee ae eee ee Re Rock G 3 2 3 Man als a 26446 34 od4 63 e454 43h 43455458 4 4 4 d 3 3 20 sim Standalone css a ee eRe 4 1 Opening Crescendo cis isis cds ride tb She eee wees 4 2 Opening a Project oe 2 228 E Roe Seed Re wee Lee eRe 4 3 Running a Project 0 c42 4e i e e22 e b45 440440484444 5 Editors and Management of Projects 5 The Crescendo Workbench see vex ew e UR Ee SE CRX X S L Explorer VieW ocio 2a kde de eee SS ES Rex SONO Reed ill 0 0 Crescendo Tool Support User Manual kG NA Be ON QUON eme cw 9 Se a oe 9 M A Se ee T 18 RBS rere eo ces Uere ci oe ca dere Be te os eee ge eg 19 bas Set Be Be Bi Bs eS Sse es eet A 19 Ba eek bee hee RE ee REE REE ded BERKS 20 5 2 Handling Projects ass sia qo ro ee doa 8 doa KR Gow TR AC A wee USO BRO RON POR E 6 21 5 2 1 Creatine new Projects 2 25 2se so 908 SUR ORE ELS WO teen Gea 21 5 2 2 Importing Projects 52223 x R XO ERR RUE e RES RO 21 A a a E a 23 a kG a Oe V NOR SS Oe bol x Si ras eiae i E oi 24 5 3 1 Creating anew Contract Pile acao std Rr ROO RD Aa 24 5 3 2 COntents f d COHIFIEN e ues ducks A dex eon dw S ack SA 25 5 3 3 Error Detection in the Contract Link File 27 5 3 4 Managing the Link Fies ups 2440248404484 4Gu 2 X ee ws 28 eM ees Gee a wer 30 31 6 1 Debug Configuration 2 re 31 dto a a dd o sia go in et de i 31 612 Man Tabla
50. in object oriented programming VDM the method or data field may only be accessed from within the containing class protected in object oriented programming VDM the method or data field may only be accessed by its containing class or any of its subclasses 68 APPENDIX A GLOSSARY 59 public in object oriented programming VDM the method or data field may be accessed by any other class ranking function a function that assigns a value to a design based on its ability to meet require ments defined by the engineer realistic behaviour a model of a component which includes disturbances defined by the toler ances associated with that component repository a shared store of data or files response a change in the state of a system as a consequence of a stimulus revision control the activity of managing changes revisions to computer data or files scenario test of a co model signal domain where models share a single value or array at each port and where those ports are uni directional unlike bond graphs where the ports are bi directional sensor a component whose input is a physical phenomenon and whose output is a quantitative measure of the phenomenon shared design parameter a design parameter that appears in both constituent models of a co model shared variable a variable that appears in and can be accessed from both constituent models of a co model simulation symbolic execution of a model semantically cons
51. is developed in the COMPASS project and it supports the COMPASS Modelling Language CML Symphony is also an extension of the Overture tool in the sense that it has all the support present inside Overture CML is a combination of VDM and CSP Circus This tool provides validation using execution of an executable subset and test automation using the RT Tester tool as well as formal verification using model checking partially supported by the FORMULA model checker and theorem proving partially supported by the Isabelle theorem prover Users who are interested in modelling and analysis of Systems of Systems should use this This tool was originally developed in the DESTECS Design Support and Tooling for Embedded Control Software project This was partially supported by EU as project number 248134 under the embedded system design area This is an acronym for Comprehensive Modelling for Advanced Systems of Systems project number 287829 under the EU FP7 programme 0 0 Crescendo Tool Support User Manual 1 6 Structure of this User Manual This user manual explains how to use the Crescendo IDE for developing collaborating models co models and analysing them In essence it is structured in 2 parts The first part provides the basics for getting started using the Crescendo tool and the second part acts as a reference manual for the Crescendo tool The first part contains Chapter 2 introducing the basic Crescendo concepts Chapter
52. istent the state when the constituent models of a co model agree on the seman tics of the varaibles parameters and events they share The nature of these semantics is not yet described static analysis a method for checking some property of a model without executing that model state event an event triggered by a change within a model stimulus a phenomenon that effects a change in the state of a system subclass in object oriented programming a class that is defined as extending another class The other class becomes its superclass The subclass inherits all non private data fields and methods submodel a distinct part of a larger model superclass in object oriented programming the class from which a subclass is defined 69 0 0 Crescendo Tool Support User Manual syntactically consistent the state when the constituent models of a co model agree on the identi ties and data types of all shared variables parameters and events system boundary the common frontier between a system and its environment system under test SUT the part of a model that represents the system we wish to build as op posed to parts of the model which are not part of this system system an entity that interacts with other entities including hardware software humans and the physical world ALRLO4 tag to associate metadata with a piece of data test result a record of the output from a simulation of a model see also log time event an expe
53. isting Eclipse projects v Group2 Group2 Y Group3 Group3 7 Group4 Group4 Y Group5 Group5 EM manneNinnh mamen V LineFollowingRobot LineFollowingRobot Y MorseDecoder MorseDecoder Options Search for nested projects Working sets F Add project to working sets Figure 5 10 Import projects 5 2 3 Exporting Projects Follow these steps in order to export a Crescendo project Copy projects into workspace 9 lt Back Nex 23 Select root directory Browse 9 Select archive file C Program Files x86 Crescendo plugins Browse Projects Y ChessWay DESTECS ChessWay_DESTECS Select All Y ChesswaySimple ChesswaySimple iIi 7 FuelSystem FuelSystem Deselect All Y Groupl Group E Select 59 Crescendo Tool Support User Manual e Right click on the target project and select Export followed by General and Archive File See Figure for more details e Click Next to proceed E Export Cabo x Select A Export resources to an archive file on the local file system j Select an export destination type filter text 4 amp General 7 E Archive File 3 File System I3 Preferences 2 Install 3 Run Debug amp Team lt Back Next gt Finish Cancel Figure 5 11 Select an output format for the exporting process 5 3 Managing Contracts To connect the Continuous Time model and Discrete Event model we h
54. k In addition there are two choices that can be made as shown in Figure 7 4 e The first option allows the model designer to use the usual plots shown at the 20 sim side for each single co simulation or to not spending time on that 44 CHAPTER 7 DESIGN SPACE EXPLORATION 0 0 e The second option can be ticked if a huge amount of data is expected to be produced If this is ticked the data generated are not included in the directory used by the Crescendo tool in general Eclipse does not like to have a very high number of files Name ACA ChessWay 2D PidInCT Main gt Architectures SDPs Sweep Scenarios CT Settings E Common Base Configuration ChessWay DESTECS CoSIM 2D PIDinCT Browse Show plot automaticaly when the script runs Data intensive Apply Revert Figure 7 4 ACA Launch Main tab By pressing the button Browse it is possible to browse through the Co Sim Launches present in the Crescendo Tool and select one This configuration will be the base configuration for all the ones generated by the ACA The ACA will take the base configuration and combine it in all possible ways depending on what the user set on the other tabs 7 2 2 The Architecture Tab Deployment Architectures It is possible in this tab to select which Controller Architectures will be used in the ACA run see Figure 7 5 For more information on how to define Controller Architectures see Section 7 6 Name ACA ChessWay 2D PidInCT
55. lenge of develop ing fault tolerant embedded systems BLV 10 The consortium focussed on developing design methods and tools that bridge the gap between the disciplines involved in designing an embedded system systems control mechanical and software engineering for example DESTECS aimed to develop methods and tools that combine Continuous Time CT models with Discrete Event DE controller models through co simulation to allow multi disciplinary modelling including modelling of faults and fault tolerance mechanisms The analysis of these effects at every stage in a design process will help to build more dependable real time embedded systems The DE modelling is carried out using the Vienna Development Method and its support tool Overture see Section 1 3 below The CT modelling is carried out using bond graphs and its support tool 20 sim see Section I 4 below 1 3 What is the Vienna Development Method The Vienna Development Method VDM is one of the oldest established model oriented formal methods for the development of computer based systems and software BJ78 FLVOS It consists of a group of mathematically well founded languages for expressing and analysing system lSee www destecs org 0 0 Crescendo Tool Support User Manual models during early design stages with the aim to reduce developments risks before expensive im plementation commitments are made VDM has a strong record of industrial applications in many cases it
56. m downloads files 20sim43GettingStartedManual pdf 8 CHAPTER 3 GETTING HOLD OF THE SOFTWARE 0 0 Unless you have purchased a license during model editing and simulation the 20 sim Viewer will remind you with a message Crescendo Tool Support User Manual 10 Chapter 4 Quick Start with Crescendo To help you get started with Crescendo this chapter gives you step by step instructions how to configure the software get a basic Wat erTankPeriodic example running and create your own simple project 4 1 Opening Crescendo e Open Crescendo from the start menu You will see a splash screen when the program opens and a dialog prompting you to give a location for the workspace as in Figure 4 1 Workspace Launcher XN E pac Select a workspace Crescendo Tools stores your projects in a folder called a workspace Choose a workspace folder to use for this session Workspace C Program Files x86 Crescendo workspace v Use this as the default and do not ask again OK Cancel Figure 4 1 The Crescendo Workspace Location Screen e Enter a location where you have both read and write access The program should respond by opening with a welcome screen as shown in Figure 4 2 When the welcome screen is closed the standard Crescendo perspective becomes active as shown in Figure 5 1 with different views explained further in Chapter 5 11 59 Crescendo Tool Support User Manual O Welc
57. mming a class where one or more methods are defined abstractly using the text is subclass responsibility as their body actuator a component that produces a physical output in response to a signal IEEO0 aggregate in object oriented programming the act of bringing together several objects into a single whole automated co model analysis tool support for the selection of a single design from a set of design alternatives including definition of scenarios execution of co simulations and visualisation and analysis of co simulation results automated co model execution as automated co model analysis except that is does not perform any analysis of the test results produced by the simulations bond in bond graphs a directed point to point connection between power ports on submodels Represents the sharing of both flow and effort by those ports bond graph a domain independent idealised physical model based on the representing energy and its exchange between submodels causality in bond graphs dictates which variable of a power port is the input cause for sub model s equations and which is the output effect class in object oriented programming the definition of the data field and methods an object of that class will contain 65 0 0 Crescendo Tool Support User Manual code generation the process of implementing a system controller by automatically translating a model into a representation in some programming langua
58. n front of the icon and if that is clicked the fields of the record can be seen Figure 5 5 illustrates the different outline icons At the top of the view there are buttons to filter what is displayed for instance it is possible to hide non public members Clicking on the name of a definition in the outline will navigate to the definition and highlight the name in the Editor view see Section 5 1 2 5 1 4 Simulation Engine View The Crescendo Simulation Engine View located in the lower left part of the environment is showing the evolution of a co simulation This is done by monitoring the interaction between the VDM RT Discrete Event simulation the 20 sim Continuous Time simulation and the engine This view has two columns the first one is specifying the source of the message and the second one the progress of a co simulation in seconds and percentages of completion An extract of this is shown in Figure 19 Crescendo Tool Support User Manual Rxox O v 9 Test g FunPriv nat nat FunPro nat nat FunPub nat nat O FunStat nat nat o instPriv nat instPro nat instPub nat o instStat nat m OpPriv 0 OpPro 0 e OpPubO 0 a OpStat 0 a per_OpStat sync predicate v T tl lt PthreadO 0 TypePriv nat 4 TypePro nat TypePub nat TypeStat seq of char d valPriv Test nat f valPro Test nat of valPub Test nat d valStat Test nat
59. ndo Outline view on the right hand side of Figure presents an outline of the file selected in the editor This view displays any declared VDM definitions such as their state com ponents values types functions and operations The type of the definitions are also shown in the outline view The Outline view is at the moment only available for the VDM models of the system In the case another type of file is selected the message An outline is not available will be displayed Figure 5 4 shows an extract of the outline of a class called System n Outline 53 AY oy O System o controller Controller o cpul CPU o levelSensor LevelSensor o System System o valveActuator ValveActuator Figure 5 4 The outline view showing the composition of the System VDM RT class The type of each definition is also shown in the view and the colour of the icons in front of the names indicates the accessibility of each definition Red is used for private definitions yellow for protected definitions and green for public definitions Triangles are used for type definitions small squares are used for values state components and instance variables functions and operations are represented by larger circles and squares permission predicates are shown with small lock symbols and traces are shown with a T Functions have a small F superscript over the icons and static definitions have a small S superscript Record types have a small arrow i
60. odels describe the behaviour of physical systems at any desired time DE models typically describe computer systems that run at predetermined time steps Between these time steps nothing happens 2 2 Simulation Continuous Time models can be created and simulated in 20 sim This tool will simulate CT models with as many small time steps as required to get accurate results Sometimes the accuracy is violated The tool will then step back and use smaller time steps until the required accuracy is met This is called a Continuous Time simulation A Continuous Time simulation is therefore always characterized by the accuracy of the simulation and the time steps taken Discrete Event models can be created and simulated in Overture VDM This tool will simulate Discrete Event models with predetermined discrete time steps This is called a Discrete Event simulation There are no accuracy issues involved and therefore no backstepping is required The properties of a model that affects its behaviour but which remain constant during a simula tion are called parameters Examples of parameters are for example the height of a watertank or the mass of a car A variable is a property of a model that may change during a given simulation for example the varying waterlevel ofa watertank or the varying speed of a car 5 0 0 Crescendo Tool Support User Manual 2 3 Co Simulation A co simulation is a combined simulation of a Continuous Time model and a Discrete E
61. ome 23 i E OX Crescendo The Crescendo Platform Figure 4 2 The Crescendo Welcome Screen 4 2 Opening a Project e From the File menu choose File and then Import Select General and Existing Projects into Workspace and click Next and get a window similar to Figure 4 3 Go to Crescendo Examples and select at least the WatertankPeriodic example Click Finish to import the selected project s 4 5 Running a Project Now at least the WaterTankPeriodic project should be visible e Click on the WaterTankPeriodic project entry to select it e Press the Debug button if you have multiple projects loaded you have to select the water TankPeriodic project first by clicking the black triangle at the right of the Debug button Now a co simulation will start The 20 sim editor showing the Continuous Time model will be opened as shown in Figure the 20 sim Simulator showing the plot of the Continuous Time part of the simulation will be opened and the 3D animator showing an animation of the watertank will be opened as shown in Figure 4 5 In addition graphs for selected variables during the simulation are shown as in Figure 4 6 12 CHAPTER 4 QUICK START WITH CRESCENDO D A A es Select M Select an import source 4 General E Archive File E Existing Projects into Workspace G File System E Preferences 4 Crescendo El Crescendo Book Examples E Crescendo Examples gt
62. only needs to be done once and it is recommended that it is called immediately after the constructor If this is not done then the co simulation will fail with a pre condition violation the first time Output 1s called 7 5 3 Advanced Use All of the controller classes in the library are subclasses of a single class called DTControl Discrete Time control This class contains the definitions for Set SampleTime and Output and enforces a consistent interface It is possible to use the various controller classes without mak ing reference to DTCont rol However if it is desirable to test different controllers variables can be defined as type DTCont rol meaning that only the call to the constructor needs to be changed in order to use a different controller implementation This is also useful if control objects are passed to controllers In the following example the Cont roller class can accept any control object P PID etc class Controller instance variables controller object private ctrl DTControl operations constructor for Controller public Controller DTControl Controller Controller c ctrl c ctrl SetSampleTime SAMPLE TIME 7 5 4 Constructors P The P class has the following constructors 52 CHAPTER 7 DESIGN SPACE EXPLORATION set K public P real gt P P k default k 0 2 public P gt P
63. option to show plot automatically was chosen a plot will be drawn and shown in a window like in Figure 8 4 8 1 4 Setting Octave path If your Octave installation was not made in the default installer path the path to Octave must be corrected in the Crescendo settings for the feature mentioned above to work The settings below can be found by navigating to the Window Preferences menu as shown in Figure 8 5 8 2 Folder Launch Configuration This is a new way of launching an ACA by selecting a folder containing launch files The user has to produce its own launch files The options to select are the project and the folder containing the launch files 60 CHAPTER 8 POST ANALYSIS scendo Explore New gt Lv Es DirectionSwi eRunning cm sActuated 4 gt 2013 1 Open With gt h update the mo GL 20s mDriveStatus Ch Copy Ctrl C Er push ke id CS Past Ctrl V uration mCo B ae j conditional d X Delete Delete duration if 2 me Move the De E Du Rename F2 setActuated En g Import uated al ot isActuated pA Export update the mo Exe a E mDriveStatus Exe push the driv Gy duration mCo M Debug As b conditional d Es is Run As gt duration 4 the E 10 Team ls Lot Compare With gt pta real gt LEM pPWM Replace With gt Me i Crescendo b Properties Alt Enter skip gt 1 0 and pPwM Figure 8
64. our during simulation fault modelling the act of extending a model to encompass faulty behaviours fault the adjudged or hypothesized cause of an error ALRLO4 fault behaviour a model of a component s behaviour when a fault has been triggered and emerges as a failure to adhere to the component s specification fault like phenomena any behaviour that can be modelled like a fault e g disturbance flow in bond graphs one of the variables exposed by a power port Represents physical concepts such as electrical current mechanical velocity fluid flow ideal behaviour a model of a component that does not account for disturbances inheritance in object oriented programming the mechanism by which a subclass contains all public and protected data fields and methods of its superclass input a signal provided to a model interface in object oriented programming a class which defines the signatures of but no bodies for any of its methods Should not be instantiated junction in bond graphs a point in a bond graph where the sum of flow 1 junction or effort 0 junction of all bonds to that point is zero 67 0 0 Crescendo Tool Support User Manual log data written to a file during a simulation metadata information that is associated with and gives information about a piece of data model base the collection of artefacts gathered during a development including various models and co models scenarios and test results an
65. r your use e Click Next to proceed 21 Crescendo Tool Support User Manual Create a new project resource Pje e Y Use default location Location C Program Files x86 Crescendo workspace3 Browse Working sets 7 Add project to working sets Working sets Figure 5 8 Create project dialog Select Select an import source 4 2 General Archive File E Existing Projects into Workspace C File System E Preferences 4 25 Crescendo Zi Crescendo Book Examples 109 Crescendo Examples gt amp Install gt Overture gt gt Run Debug b Team Figure 5 9 Import project dialog 22 CHAPTER 5 EDITORS AND MANAGEMENT OF PROJECTS e If one of the Crescendo options is taken a list of the potential projects to import will appear Otherwise if the General one was selected you shall select the the radio button Select root directory if the project is uncompressed Otherwise select the the radio button Select archive file if the project is contained in a compressed archive file Afterwards use the Browse button to locate the project e A compressed archive file may contain multiple projects Select the projects that you want to import as shown in Figure 5 10 e Click the Finish button The imported project will appear on the Crescendo explorer view fo Import Projects Select a directory to search for ex
66. ransactions on Dependable and Secure Computing 1 11 33 2004 D Bj rner and C B Jones editors The Vienna Development Method The Meta Language volume 61 of Lecture Notes in Computer Science Springer Verlag 1978 J F Broenink P G Larsen M Verhoef C Kleijn D Jovanovic K Pierce and Wouters F Design Support and Tooling for Dependable Embedded Control Software In Proceedings of Serene 2010 International Workshop on Software Engineering for Resilient Systems pages 77 82 ACM April 2010 Tim Clement Ian Cottam Peter Froome and Claire Jones The Development of a Commercial Shrink Wrapped Application to Safety Integrity Level 2 the DUST EXPERT Story In Safecomp 99 Toulouse France September 1999 Springer Verlag LNCS 1698 ISBN 3 540 66488 2 Controllab products http www 20sim com January 2013 20 Sim official website John Fitzgerald and Peter Gorm Larsen Modelling Systems Practical Tools and Techniques in Software Development Cambridge University Press The Edinburgh Building Cambridge CB2 2RU UK 1998 ISBN 0 521 62348 0 John Fitzgerald and Peter Gorm Larsen Modelling Systems Practical Tools and Techniques in Software Development Cambridge University Press The Edinburgh Building Cambridge CB2 2RU UK Second edition 2009 ISBN 0 521 62348 0 John Fitzgerald Peter Gorm Larsen Paul Mukherjee Nico Plat and Marcel Verhoef Validated Designs for Object oriented Systems Springer New
67. riables block Architecture HH The deployment tab must be placed in the constructor where the deployment normally is spec ified tt Deployment Architecture files arch is placed in a folder called model de architectures in the project root The architecture files should have the following form Architecture instance variables cpul CPU new CPU lt FCFS gt 1000000 x Hz x cpu2 CPU new CPU lt FCFS gt 1000000 x Hz x cpu3 CPU new CPU lt FCFS gt 1000000 x Hz x busl BUS new BUS lt FCFS gt 1000 x bits s x cpul cpu2 cpu3 tt Deployment cpul deploy mmi cpu3 deploy navigation cpu2 deploy radio 54 CHAPTER 7 DESIGN SPACE EXPLORATION 0 0 When an architecture file like this is selected the architecture and deployment declaration is inserted in the right place under the tags in the system file creating a complete system just before the co simulation starts 7 7 Events Events can be triggered in the CT world They will stop the simulation before the allowed time slice is completed The co simulation engine will then allow the DE simulator to take action but only until the point where the event has been raised The events are used in the contract in order to support event based triggering and not just time triggered scheduling 7 7 Simulation setup Events in the contract
68. s can be accessed with the contract name and used in conditions assignments or revert statements It is also possible to have some statements executed exactly once on the first time a condition is detected This is achieved using the once keyword instead of when once de real x 500 do set some flag de bool flag true print First time x exceeds 500 6 4 Logfiles When starting a simulation it is possible to select a set of variables that are logged during the co simulation At the time this manual was written there is only the possibility of logging DE variables support to log CT variables will be added later The result of this logging is a CSV file comma separated values which can be post processed with regular office tools 39 6 4 1 DE Variables Crescendo Tool Support User Manual The variables of the DE model to log can be selected in the tab VDM Options presented in Fig ure 6 9 If a model does not contain type errors this tab will display all instance variables that are accessible from the VDM system class Name Watertank Main Shared Design Parameters DSE VDM Options gt 20 sim options Advanced Common Interpreting V Dynamic type checks V Invariants checks V Pre condition checks Y Post condition checks V Measure Run Time checks V Generate Coverage Log Real Time Events Log La E class System 7 controller a F levelSensor y level Y fault 4
69. semi colons Expressions of time can optionally include a unit e g milliseconds given in curly braces Units are assumed to be in seconds if no unit is given The engineer may output messages to the tool or to a log in batch mode with the print statement when time 900 ms do de real x 10 ct real y true print Co simulation time reached 900 ms 38 CHAPTER 6 CO SIMULATION 59 s Logical operators can be used in expressions When the condition becomes true the state ment s in the do clause will execute when time gt 10 and time lt 15 do print Co simulation time reached 10 seconds If the condition becomes false again the optional after clause will execute once Note that block statements do not permit local variables to be defined Since this script language does not allow local variables to be defined a special statement revert may be used in an after clause to change a value back to what it was when the do clause executed Note that comments may also be included when time gt 10 and time 15 do assume x 5 de real x 10 after revert de real x The engineer can reference co model state in conditions and assignment and revert statements The state that can be referred is either for VDM specified with the model keyword in the link file or for 20 sim marked as global note 20 sim access is not yet implemented Additionally all shared variable
70. sign parameter to sweep see Figure 7 8 In the second column a list of double values should be introduced separated by semicolons It is possible to sweep by value set complex variables as shown in Figure 7 9 46 CHAPTER 7 DESIGN SPACE EXPLORATION 0 0 Value Set Sweep Figure 7 8 Selecting values of SDP variables to sweep over Value Set Sweep Name Values Clear initial Position 1 1 448 1 736 la Delete J initial Position 2 1110 Delete Figure 7 9 Sweeping over complex variables The behaviour of complex SDPs is a bit different from the atomic SDPs For example the con figuration on the picture above will generate two ACA runs for the variable initial Position e First run initial Position 1 448 1 110 e Second run initial Position 1 736 X where X is the value defined in the base debug configuration for initial Position 2 The values defined in the value sweep are put together according to the order they appear if a value for one of the indexes is missing like in this case the second value of initial Position 2 the value from the original debug configuration will be used 7 2 4 Scenario Tab In the scenarios tab it is possible to select which scenarios will be used in the ACA run see Figure The scenarios present in the scenarios folder in the root of the project will be presented on the Scenario selection table It is then possible to check
71. tor URL CT Simulator URL http localhost 5580 Remote Project Base Run CT Simlator Remotely Figure 6 7 Advanced options tab Main Shared Design Parameters DE simulator CT simulator Post Processing Advanced Common Save as Local file Shared file TorsionBarBaseline launches Browse Display in favorites menu Encoding Debug O Default inherited Cp1252 77 E Crescendo Launch Other ISO 8859 1 Standard Input and Output Y Allocate console necessary for input File Append Y Launch in background Figure 6 8 This is where launch files can be created 6 3 Scenarios Scripts allow users to define condition action pairs using a statement called when which per form an action when the condition becomes true during a co simulation This script allows these conditions to reference the current co simulation time and the state of the co model and to com bine them with logical operators Actions can make assignments to selected parts of the co model and also provide information back to the user as well as terminating the simulation This section describes how to create scenario files and introduces a command language for Crescendo scripts called CSL Crescendo Scripting Language The main purpose of CSL is to allow engineers to simulate user input and activate latent non normative behaviours during a co simulation The language is designed to be sufficiently rich as to allow engineers to influ
72. uted by Ocatve If the script is to be included in a custom script written by the user simply as data access this option should be disabled The option is available in the debug configuration that affects the script This option appears in two places both in the normal Crescendo run and in ACA If enabled when the script is executed 59 0 0 Crescendo Tool Support User Manual a plot or several depending on the amount of variables selected will be drawn automatically In the case of an ACA run being executed for the same variable the several runs will juxtaposed in the same graphic so the results are easy to compare and inspect visually Figure 8 1 shows where to find this option for a normal run Post Processing tab and in the ACA launch Main Tab see Figure 8 2 Main Shared Design Parameters VDM 20 sim Post Processing Advanced Common Figure 8 1 Normal Octave Selection Figure 8 2 shows the ACA launch Main Tab Main gt Architectures SDPs Sweep Scenarios CT Settings E Common Base Configuration LineFollowACA 121 Browse Figure 8 2 Octave with use of ACA 8 1 3 Invoking Octave from Crescendo It is possible to invoke Octave from the Crescendo IDE Right clicking on an Octave m file reveals the option Run Octave If you want to use this command be sure to tick the Show plot automatically when the script runs box to get the result shown in Figure 8 3 If the
73. vent model in separate tools The Crescendo tool allows you to run Discrete Event models in VDM and Continuous Time models in 20 sim and exchange information between VDM and 20 sim during run time Because the notion of a model in a co simulation may lead to misinterpretations we will use the following definitions constituent model the CT submodel or the DE submodel of a co simulation co model a model comprising two constituent models a DE submodel and a CT submodel 2 4 Contract The description of the communication between the constituent models of a co model is called the contract A contract typically describes the variables that are shared between the Continuous Time model and the Discrete Event model An example of a shared variable is the waterlevel that is calculated in the Continuous Time model and sent to the Discrete Event model where it is used to calculate the response of a water level controller In most cases a Continuous Time model and a Discrete Event model will use similar param eters For the watertank example such a parameter may be the maximum water level In the Continuous Time model this parameter indicates the height at which a sensor is placed and in the Discrete Event model this parameter may indicate a property of the water level controller To pre vent different values to be used in the Continuous Time model and Discrete Event model we may share this parameter in the contract This is called a shared design param
74. view E generated ser object 20H bado public static user User nil model ct PERTH TION 4 9 model de public static env Environment nil E controller Outline de only b tecture definition b cpul CPU new CPU FP 20086 e pu2 CPU new CPU lt FP gt 20056 view e ub busl BUS new BUS FCFS 115 2 cpul cpu2 i TersionBar vdmit operations public gt TorsionBar Torsionl o Problems G Console 53 PO Proof Obli 7 Simulatio 7 Simulatio 7 VOM Deb 7 Vdm Log Source eG OD gt cee VDM RT Termunating done 20 Sim Terminating 20 Sim Terminating kill 20 Sim Terminating done Simulation engine view terminated Debug Console TorsionBarExtended 1 VOM RT Model E E Crescendo PO Proof Obligation fJ vom 15 98000001 sp 0 hold pum 4 008285062999292E 4 sample encm 4 0E 4 sample encl 1 17 new World run undefined Console view Figure 5 1 Standard Crescendo Perspective 0 0 Crescendo Tool Support User Manual 5 1 1 Explorer View The Crescendo Explorer view lets you create select import export and delete Crescendo projects and navigate between the files in these projects It is also from this view that deleting existing files and adding new files to existing projects is enabled In Figure 5 2 the kind of contents inside one project is illustrated 4 G LineFollowingRobot 4 gt
75. which scenarios will be used in the ACA 47 0 0 Crescendo Tool Support User Manual Name ACA ChessWay 2D PidlnCT Main Architectures SDPs Sweep Scenarios CT Settings El Common Scenarios folder scenarios Folder Folder present Scenario selection V scenario2 script2 Figure 7 10 Possibility for choosing multiple scenarios for ACA 7 2 5 CT Settings Tab The CT side settings works in a similar fashion to the ones in the normal Crescendo launch see Figure 7 11 The only difference is that it is possible to select multiple options instead of one In the ACA Settings tab it is only possible to select options which have limited alternatives 1 e enumerations Name ACA CG speed mu 1 Main Architectures SDPs Sweep Scenarios CT Settings E Common Settings 4 model Options 4 implementations BicycleModel No Options This is a virtual node which contains no Controller options 4 SteeringWheel TransferFunction globals CT Onlyl 4 simulator eventdelta fastmode integrationmethod Populate Figure 7 11 Selecting CT Settings for ACA 7 2 6 Common Tab The common tab settings here work much in a similar fashion to the ones in the normal Crescendo launch see Figure 7 12 7 3 Repeating a Single Launch Part of an ACA After a successful ACA launch the output folder will contain information regarding what was run in a specific ACA launch Each ACA run has generated a file named
76. xxx dlaunch 48 CHAPTER 7 DESIGN SPACE EXPLORATION 0 0 Name ACA CG speed mu 1 Main Architectures SDPs Sweep Scenarios CT Settings Common Save as Local file Mawn mover Browse Display in favorites menu Encoding E 5 Debug Default inherited Cp1252 E crescendo Launch Other ISO 8859 1 Standard Input and Output Allocate console necessary for input File Append V Launch in background Figure 7 12 Common tab for ACA By right clicking a d1aunch file and selecting the option Crescendo and then selecting the Create and Launch option the single selected run will be launched again see Figure 7 13 This single launch configuration is also stored together with the other launch configurations typically its name is prefixed by generated SS z 2013 11 c E E 3 z 4 2013 11 fescendo Create and launch amp covet Properties PEE B Waterco erer 4 Figure 7 13 Relaunching single ACA experiments 7 4 Folder Launch Configuration This is a new way of launching an ACA by selecting a folder containing launch files The user has to produce its own launch files The options to select are the project and the folder containing the launch files This is shown in Figure 7 5 Control Library In order to help build controllers in VDM that can handle low level proportional control in addition to supervisory control a control library has b
Download Pdf Manuals
Related Search
Related Contents
取扱説明書 ~~縄 CEREC AC - Sirona - Technical Documentation TM003 Manual de utilização da Fechadura de cacifo RF Manuale TR0201 - Solarbayer Italia S.R.L. 1. - Vivitek Sharp MD-MT877C MiniDisc Player User Manual Samsung Galaxy E7 用户手册 MANUAL DE INSTRUCCIONES PAVA ELECTRICA Manual de Instrucciones - Ficha Tecnica - CE 日本語 - Kodak Copyright © All rights reserved.
Failed to retrieve file