Fast Model Tools User Guide - ARM Information Center
Fast Model Tools User Guide - ARM Information Center
Fast Model Tools User Guide - ARM Information Center
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong><strong>User</strong> <strong>Guide</strong>Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved.Release <strong>Information</strong>Change historyDescription Issue Confidentiality ChangeAugust 2007 A Confidential New document.December 2007 B Confidential Release 3.1.February 2008 C Confidential Release 3.2.June 2008 D Confidential Update for System Generator 4.0.August 2008 E Confidential Update for System Generator 4.0 SP1.December 2008 F Confidential Update for <strong>Fast</strong> <strong>Model</strong>s 4.1.March 2009 G Non-Condidential Update for <strong>Fast</strong> <strong>Model</strong>s 4.2. New SystemC and TLM 2.0features.April 2009 H Non-Condidential Update for <strong>Fast</strong> <strong>Model</strong>s 5.0.September 2009 I Non-Confidential Update for <strong>Fast</strong> <strong>Model</strong>s 5.1.February 2010 J Non-Confidential Update for <strong>Fast</strong> <strong>Model</strong>s 5.2.Proprietary NoticeWords and logos marked with ® or are registered trademarks or trademarks owned by <strong>ARM</strong> Limited, exceptas otherwise stated below in this proprietary notice. Other brands and names mentioned herein may be thetrademarks of their respective owners.Neither the whole nor any part of the information contained in, or the product described in, this documentmay be adapted or reproduced in any material form except with the prior written permission of the copyrightholder.The product described in this document is subject to continuous developments and improvements. Allparticulars of the product and its use contained in this document are given by <strong>ARM</strong> in good faith. However,all warranties implied or expressed, including but not limited to implied warranties of merchantability, orfitness for purpose, are excluded.This document is intended only to assist the reader in the use of the product. <strong>ARM</strong> Limited shall not be liablefor any loss or damage arising from the use of any information in this document, or any error or omission insuch information, or any incorrect use of the product.Where the term <strong>ARM</strong> is used it means “<strong>ARM</strong> or any of its subsidiaries as appropriate”.ii Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Confidentiality StatusThis document is Non-Confidential. The right to use, copy and disclose this document may be subject tolicense restrictions in accordance with the terms of the agreement entered into by <strong>ARM</strong> and the party that<strong>ARM</strong> delivered this document to.Unrestricted Access is an <strong>ARM</strong> internal classification.Product StatusThe information in this document is final, that is for a developed product.Web Addresshttp://www.arm.com<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. iiiID031910Non-Confidential
iv Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Contents<strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> <strong>User</strong> <strong>Guide</strong>PrefaceAbout this book .......................................................................................................... xiiFeedback .................................................................................................................. xviChapter 1Chapter 2Chapter 3Introduction1.1 About <strong>Fast</strong> <strong>Model</strong>s ................................................................................................... 1-21.2 <strong>Fast</strong> <strong>Model</strong>s design flow .......................................................................................... 1-6Getting Started2.1 About the tutorial ...................................................................................................... 2-22.2 Starting System Canvas .......................................................................................... 2-32.3 Creating a sample system ....................................................................................... 2-72.4 Adding and configuring components ....................................................................... 2-92.5 Connecting components ........................................................................................ 2-152.6 <strong>Fast</strong> <strong>Model</strong>s files .................................................................................................... 2-162.7 Viewing the project settings ................................................................................... 2-172.8 Changing the address mapping ............................................................................. 2-202.9 Building the system ................................................................................................ 2-222.10 Debugging the system ........................................................................................... 2-232.11 Building an ISIM target .......................................................................................... 2-26System Canvas Reference3.1 Launching System Canvas ...................................................................................... 3-33.2 Overview of System Canvas .................................................................................... 3-43.3 Add Existing Files and Add New File dialogs (Component window) ..................... 3-233.4 Add Files (Project menu) ....................................................................................... 3-263.5 Add Connection dialog ........................................................................................... 3-283.6 Component Instance Properties dialog .................................................................. 3-293.7 Component Properties dialog for a library component .......................................... 3-40<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. vID031910Non-Confidential
Contents3.8 Connection Properties dialog ................................................................................. 3-443.9 Edit Connection dialog ........................................................................................... 3-453.10 File/Path Properties dialog ..................................................................................... 3-463.11 Find and Replace dialogs ...................................................................................... 3-503.12 Label Properties dialog .......................................................................................... 3-523.13 New File dialog (from File menu) ........................................................................... 3-543.14 New Project dialogs ............................................................................................... 3-563.15 Open File dialog ..................................................................................................... 3-583.16 Port Properties dialog ............................................................................................ 3-603.17 Preferences dialog ................................................................................................. 3-623.18 Project Settings dialog ........................................................................................... 3-753.19 Protocol Properties dialog ...................................................................................... 3-943.20 Run Dialog ............................................................................................................. 3-953.21 Self Port dialog ...................................................................................................... 3-98Chapter 4Chapter 5Chapter 6Appendix AAppendix BAppendix CDebugging4.1 About debugging ...................................................................................................... 4-24.2 Batch mode debugging ............................................................................................ 4-34.3 Debugging from System Canvas ............................................................................. 4-54.4 Using other debuggers to debug LISA source ....................................................... 4-134.5 Working with the <strong>ARM</strong> Profiler ............................................................................... 4-18SystemC Export5.1 About SystemC export ............................................................................................. 5-25.2 Building a SystemC component from System Canvas ............................................ 5-45.3 Adding the generated SystemC component to a SystemC system ......................... 5-95.4 Using the generated ports ..................................................................................... 5-115.5 Example systems ................................................................................................... 5-185.6 SystemC component API ....................................................................................... 5-325.7 Scheduling of <strong>Fast</strong> <strong>Model</strong>s and SystemC .............................................................. 5-445.8 Limitations .............................................................................................................. 5-50Creating a New Component6.1 Basic configuration .................................................................................................. 6-26.2 Adding ports ............................................................................................................. 6-46.3 Behavior section ...................................................................................................... 6-86.4 Using the SerialCharDoubler component in the system ........................................ 6-13Building and Running the EB RTSM Example SystemA.1 Using System Canvas to build the platform model .................................................. A-2A.2 Connecting to the model .......................................................................................... A-5A.3 Running an application on the system model ........................................................ A-13Red Hat Linux DependenciesB.1 About dependencies ................................................................................................ B-2B.2 Dependencies for Red Hat Enterprise Linux 4.4 ..................................................... B-3B.3 Dependencies for Red Hat Enterprise Linux5 ......................................................... B-5Building System <strong>Model</strong>s in Batch ModeC.1 Introduction .............................................................................................................. C-2C.2 SIMGEN command-line options .............................................................................. C-3Glossary<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. viID031910Non-Confidential
List of Tables<strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> <strong>User</strong> <strong>Guide</strong>Change history ................................................................................................................................ iiLISA terminology .......................................................................................................................... xivTable 3-1 System Canvas command line options ....................................................................................... 3-3Table 3-2 Suffixes for parameter values ................................................................................................... 3-32Table 3-3 Component properties .............................................................................................................. 3-35Table 3-4 Release parameters in the Category View tab ......................................................................... 3-78Table 3-5 Target parameters in the Category View tab ............................................................................ 3-79Table 3-6 Debugging parameters in the Category View tab ..................................................................... 3-80Table 3-7 Compiler parameters in the Category View tab ........................................................................ 3-82Table 3-8 Linker parameters in the Category View tab ............................................................................. 3-83Table 3-9 Full list of parameters shown in List View ................................................................................. 3-85Table 6-1 Special-purpose behaviors ....................................................................................................... 6-11Table B-1 Dependencies for Red Hat Enterprise Linux 4.4 ......................................................................... B-3Table B-2 Dependencies for Red Hat Enterprise Linux 5 ............................................................................ B-5Table C-1 simgen command-line options .................................................................................................... C-3<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. viiID031910Non-Confidential
List of Figures<strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> <strong>User</strong> <strong>Guide</strong>Figure 1-1 <strong>Fast</strong> <strong>Model</strong>s design flow ............................................................................................................. 1-6Figure 1-2 Project organization .................................................................................................................... 1-8Figure 1-3 Top-level of <strong>ARM</strong>1176 Versatile EB system in System Canvas ............................................... 1-11Figure 1-4 Emulation Baseboard component ............................................................................................. 1-12Figure 1-5 Clock divider component external ports .................................................................................... 1-12Figure 2-1 System Canvas at startup ........................................................................................................... 2-3Figure 2-2 Preferences dialog, Setup Default <strong>Model</strong> Repository ................................................................. 2-5Figure 2-3 Add <strong>Model</strong> Repository File dialog ............................................................................................... 2-6Figure 2-4 New project dialog ...................................................................................................................... 2-7Figure 2-5 Select Top Component LISA File dialog ..................................................................................... 2-7Figure 2-6 <strong>ARM</strong>CortexA8CT core component in the Block Diagram window .............................................. 2-9Figure 2-7 Rename component .................................................................................................................. 2-10Figure 2-8 Processor component after changes ........................................................................................ 2-12Figure 2-9 Port context menu ..................................................................................................................... 2-13Figure 2-10 Example system with added components ................................................................................. 2-14Figure 2-11 Connected components ............................................................................................................ 2-15Figure 2-12 Project settings for the example ................................................................................................ 2-17Figure 2-13 Select Components dialog showing available components ...................................................... 2-19Figure 2-14 Viewing the address Mapping from the Port Properties dialog ................................................. 2-20Figure 2-15 Edit Connection dialog .............................................................................................................. 2-20Figure 2-16 Edit address map for slave port ................................................................................................ 2-21Figure 2-17 Build process output ................................................................................................................. 2-22Figure 2-18 Configuring <strong>Model</strong> Parameters dialog ....................................................................................... 2-23Figure 2-19 Select Targets dialog ................................................................................................................ 2-24Figure 2-20 <strong>Model</strong> Debugger Application Input window ............................................................................... 2-25Figure 2-21 Build Integrated Simulator target .............................................................................................. 2-26Figure 2-22 Specifying user-defined main() option ...................................................................................... 2-27Figure 3-1 Layout of System Canvas ........................................................................................................... 3-5Figure 3-2 Add New File dialog .................................................................................................................. 3-23Figure 3-3 Add Existing Files dialog ........................................................................................................... 3-23<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. viiiID031910Non-Confidential
List of FiguresFigure 3-4 Add Files dialog ........................................................................................................................ 3-26Figure 3-5 Add Connection dialog .............................................................................................................. 3-28Figure 3-6 Component Instance Properties dialog, General tab ................................................................ 3-30Figure 3-7 Component Instance Properties dialog, Properties tab ............................................................ 3-31Figure 3-8 Component Instance Properties dialog, Parameters tab .......................................................... 3-31Figure 3-9 Component Instance Properties dialog, Ports tab .................................................................... 3-33Figure 3-10 Component Instance Properties dialog, Methods tab ............................................................... 3-33Figure 3-11 Component <strong>Model</strong> Properties dialog ......................................................................................... 3-34Figure 3-12 Component <strong>Model</strong> Properties dialog, Properties tab ................................................................ 3-35Figure 3-13 Component <strong>Model</strong> Properties dialog, Parameters tab .............................................................. 3-37Figure 3-14 Add Component Parameter dialog ............................................................................................ 3-38Figure 3-15 Component <strong>Model</strong> Properties dialog, Ports tab ........................................................................ 3-39Figure 3-16 Component Properties dialog for SerialCharDoubler ................................................................ 3-41Figure 3-17 Component Properties dialog, Properties tab ........................................................................... 3-41Figure 3-18 Component Properties dialog, Parameters tab ......................................................................... 3-42Figure 3-19 Component Properties dialog, Ports tab ................................................................................... 3-43Figure 3-20 Component Properties dialog, Methods tab .............................................................................. 3-43Figure 3-21 Connection Properties dialog .................................................................................................... 3-44Figure 3-22 Add/Edit Connection Mapping dialog ........................................................................................ 3-45Figure 3-23 File/Path Properties dialog, General tab ................................................................................... 3-46Figure 3-24 File/Path Properties dialog, Build actions tab ........................................................................... 3-48Figure 3-25 Find dialog ................................................................................................................................ 3-50Figure 3-26 Find and Replace dialog ........................................................................................................... 3-51Figure 3-27 Label Properties dialog ............................................................................................................. 3-52Figure 3-28 New File dialog ......................................................................................................................... 3-54Figure 3-29 New Project dialog .................................................................................................................... 3-56Figure 3-30 Select Top Component LISA File dialog ................................................................................... 3-57Figure 3-31 Open File dialog ........................................................................................................................ 3-58Figure 3-32 Port Properties dialog ............................................................................................................... 3-60Figure 3-33 Preferences dialog .................................................................................................................... 3-62Figure 3-34 Preferences dialog, Applications ............................................................................................... 3-64Figure 3-35 Preferences, Applications for Linux .......................................................................................... 3-66Figure 3-36 Preferences dialog, External <strong>Tools</strong> ........................................................................................... 3-68Figure 3-37 Preferences dialog, Fonts ......................................................................................................... 3-69Figure 3-38 Preferences dialog, <strong>Model</strong> Repository ...................................................................................... 3-71Figure 3-39 Add <strong>Model</strong> Repository File ........................................................................................................ 3-72Figure 3-40 Preferences dialog, Suppressed Messages ............................................................................. 3-73Figure 3-41 Preferences dialog, Verbose Messages ................................................................................... 3-74Figure 3-42 Project Settings dialog .............................................................................................................. 3-75Figure 3-43 Project Settings dialog, Category View top level ...................................................................... 3-78Figure 3-44 Project Settings dialog, Category View Targets ........................................................................ 3-79Figure 3-45 Project Settings dialog, Category View Debugging .................................................................. 3-80Figure 3-46 Project Settings dialog, Category View Sim Generator ............................................................ 3-81Figure 3-47 Project Settings dialog, Category View Compiler ..................................................................... 3-82Figure 3-48 Project Settings dialog, Category View Linker .......................................................................... 3-83Figure 3-49 Project Settings dialog, List View .............................................................................................. 3-84Figure 3-50 Project Settings dialog, Tree View ............................................................................................ 3-85Figure 3-51 Protocol Properties dialog for SerialData .................................................................................. 3-94Figure 3-52 Run Dialog ................................................................................................................................ 3-95Figure 3-53 Self Port dialog .......................................................................................................................... 3-98Figure 4-1 Direct execution use case ........................................................................................................... 4-3Figure 4-2 Debug server use case ............................................................................................................... 4-4Figure 4-3 Configure <strong>Model</strong> Parameters dialog ........................................................................................... 4-6Figure 4-4 Select Targets dialog .................................................................................................................. 4-7Figure 4-5 Load application for core ............................................................................................................. 4-8Figure 4-6 Dual core system running in <strong>Model</strong> Debugger ............................................................................ 4-9Figure 4-7 <strong>Model</strong> Debugger paths in the Preferences dialog ..................................................................... 4-11Figure 5-1 Scheduling between <strong>Fast</strong> <strong>Model</strong>s and SystemC domains .......................................................... 5-2Figure 5-2 Port wrappers connect <strong>Fast</strong> <strong>Model</strong>s and SystemC components .............................................. 5-11Figure 5-3 SGSignal component in System Canvas .................................................................................. 5-15<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. ixID031910Non-Confidential
List of FiguresFigure 5-4 CADI client and server connects <strong>Model</strong> Debugger and system ................................................ 5-19Figure 5-5 Dhrystone system example ....................................................................................................... 5-20Figure 5-6 Dhrystone2 system example ..................................................................................................... 5-22Figure 5-7 DMA system example ............................................................................................................... 5-24Figure 5-8 Linux example ........................................................................................................................... 5-26Figure 5-9 Protocols example .................................................................................................................... 5-28Figure 5-10 Reset Example system ............................................................................................................. 5-30Figure 5-11 Timing diagram for driving the reset signal ............................................................................... 5-31Figure 5-12 Simulation without a debug server ............................................................................................ 5-46Figure 5-13 Standalone simulation with a debug server .............................................................................. 5-49Figure 5-14 Connecting Signal Bridges to a Peer port ................................................................................. 5-50Figure 5-15 SC_THREAD wrapper for exported components ..................................................................... 5-51Figure 5-16 Blocking transactions in single SC_THREAD ........................................................................... 5-52Figure 5-17 Calling wait() in the middle of a transaction .............................................................................. 5-53Figure 5-18 Transaction issued by EVS ....................................................................................................... 5-54Figure 5-19 Transaction issued by SystemC ............................................................................................... 5-54Figure 5-20 Local modification of external memory ..................................................................................... 5-55Figure 5-21 Debug accesses from a SystemC component .......................................................................... 5-56Figure 6-1 Character doubler component .................................................................................................... 6-2Figure 6-2 Self Port dialog ............................................................................................................................ 6-4Figure 6-3 Select Protocol dialog ................................................................................................................. 6-5Figure 6-4 SerialCharDoubler inserted in dual core system ....................................................................... 6-13Figure 6-5 Linux booting with SerialCharDoubler component .................................................................... 6-14Figure A-1 <strong>Model</strong> Debugger Connect remote dialog .................................................................................... A-8Figure A-2 <strong>Model</strong> Debugger Select Targets dialog ....................................................................................... A-8Figure A-3 Configure <strong>Model</strong> Parameters dialog ........................................................................................... A-9Figure A-4 CLCD window ........................................................................................................................... A-14Figure A-5 Breakpoint in brot.c ................................................................................................................... A-16Figure A-6 CLCD window at startup ........................................................................................................... A-17Figure A-7 CLCD window alternative display ............................................................................................. A-18<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. xID031910Non-Confidential
PrefaceThis preface introduces the <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> <strong>User</strong> <strong>Guide</strong>. It contains the followingsections:• About this book on page xii• Feedback on page xvi.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. xiID031910Non-Confidential
PrefaceAbout this bookThis book is for <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> from <strong>ARM</strong> ® and describes how to set up and useSystem Canvas and related <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong>.Intended audienceThis book has been written for experienced hardware and software developers to aid thedevelopment of <strong>ARM</strong>-based products using <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> as part of a developmentprocess.OrganizationThis book is organized into the following chapters:Chapter 1 IntroductionRead this chapter for an introduction to <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong>.Chapter 2 Getting StartedRead this chapter for a step by step tutorial on using <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong>.Chapter 3 System Canvas ReferenceThis chapter provides the reference for the System Canvas menus, icons,and dialogs.Chapter 4 DebuggingThis chapter describes how to debug component and system designs.Chapter 5 SystemC ExportThis chapter describes how to export a <strong>Fast</strong> <strong>Model</strong>s system as a SystemCcomponent.Chapter 6 Creating a New ComponentThis chapter describes how to use the LISA+ language to create a newcomponent.Appendix A Building and Running the EB RTSM Example SystemThis appendix describes how to build and run the supplied EmulationBaseboard RTSM model.Appendix B Red Hat Linux DependenciesThis appendix dependencies for <strong>Fast</strong> <strong>Model</strong>s installations on Red HatLinux.xii Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
PrefaceAppendix C Building System <strong>Model</strong>s in Batch ModeThis appendix lists the command-line options for simgen, the simulationgenerator.GlossaryRead the Glossary for definitions of terms used in this book.Typographical conventionsThe typographical conventions are:italicboldmonospacemonospacemonospace italicmonospace boldHighlights important notes, introduces special terminology,denotes internal cross-references, and citations.Highlights interface elements, such as menu names. Denotessignal names. Also used for terms in descriptive lists, whereappropriate.Denotes text that you can enter at the keyboard, such ascommands, file and program names, and source code.Denotes a permitted abbreviation for a command or option. Youcan enter the underlined text instead of the full command or optionname.Denotes arguments to monospace text where the argument is to bereplaced by a specific value.Denotes language keywords when used outside example code.< and > Enclose replaceable terms for assembler syntax where they appearin code or code fragments. For example:MRC p15, 0 , , , <strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. xiiiID031910Non-Confidential
PrefaceTerminologyIn this book the following terms of the LISA language are used and have the followingmeaning:LISA terminologyTermComponentInternal portExternal portConnectionLabelObjectOperationBehaviorDefinitionAn individual sub-system element such as core, memory, bus, or peripheral.Internal ports communicate with subcomponents and are not visible if thecomponent is used in a higher-level system. Unlike hidden external ports, theyare permanently hidden.A port that is used to connect the subsystem to other components within ahigher-level system.A link between two components. The connection is made between a masterport on one component and a slave port on the second component.An annotation in a diagram. There is no processing or connections associatedwith a label.One of the following:• component• connection• external port• label.The basic elements of LISA that describe pieces of the processor model. Eachoperation can consist of multiple sections such as composition, coding,syntax, and behavior.Each LISA operation or instruction can have multiple behavior sections.These sections describe the behavior code in C.For a complete reference of the LISA language and its terms, see the LISA LanguageReference Manual.Further readingThis section lists publications by <strong>ARM</strong>.See http://infocenter.arm.com/ for access to <strong>ARM</strong> documentation.xiv Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Preface<strong>ARM</strong> publicationsThis book contains information that is specific to the use of <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> to createand debug models. See the following documents for other relevant information:• <strong>ARM</strong> Architecture Reference Manual (<strong>ARM</strong> DDI 0100)• <strong>Model</strong> Debugger for <strong>Fast</strong> <strong>Model</strong>s <strong>User</strong> <strong>Guide</strong> (<strong>ARM</strong> DUI 0314)• LISA+ Language for <strong>Fast</strong> <strong>Model</strong>s Reference Manual (<strong>ARM</strong> DUI 0372)• Cycle Accurate Debug Interface Developer <strong>Guide</strong> (<strong>ARM</strong> DUI 0444)• MxScript for <strong>Fast</strong> <strong>Model</strong>s Reference Manual (<strong>ARM</strong> DUI 0371)• <strong>Model</strong> Shell for <strong>Fast</strong> <strong>Model</strong>s Reference Manual (<strong>ARM</strong> DUI 0457)• RealView ® Debugger <strong>User</strong> <strong>Guide</strong> (<strong>ARM</strong> DUI 0153).<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. xvID031910Non-Confidential
PrefaceFeedback<strong>ARM</strong> welcomes feedback on this product and its documentation.Feedback on this productIf you have any comments or suggestions about this product, contact your supplier andgive:• The product name.• The product revision or version.• An explanation with as much information as you can provide. Include symptomsif appropriate.Feedback on this bookIf you have any comments on this book, send an e-mail to errata@arm.com. Give:• the title• the number• the relevant page number(s) to which your comments apply• a concise explanation of your comments.<strong>ARM</strong> also welcomes general suggestions for additions and improvements.xvi Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Chapter 1IntroductionThis chapter provides a general introduction to <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong>. It contains thefollowing sections:• About <strong>Fast</strong> <strong>Model</strong>s on page 1-2• <strong>Fast</strong> <strong>Model</strong>s design flow on page 1-6.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 1-1ID031910Non-Confidential
Introduction1.1 About <strong>Fast</strong> <strong>Model</strong>s<strong>Fast</strong> <strong>Model</strong>s is an environment for easy creation of virtual platform models that executewith high simulation speeds. Because <strong>Fast</strong> <strong>Model</strong>s uses Code Translation (CT) models,the simulation speed of generated platforms ranges between 100-500 MIPS on a typicalworkstation.Generated platforms are equipped with the Cycle Accurate Debug Interface (CADI)and can run stand-alone as well as from a suitable debugger. <strong>Fast</strong> <strong>Model</strong>s automaticallygenerates the required interfaces for both standalone and integrated platforms.System Canvas provides the Graphical <strong>User</strong> Interface (GUI) to the <strong>Fast</strong> <strong>Model</strong> tools andenables you to assemble systems by using graphical representations of:• components in a system• component ports• external ports, if the system is itself a component in a larger system• connections between ports.System Canvas has a block diagram editor for creating the graphical representation ofa system. It provides features similar to vector oriented drawing tools such as flowcharting programs. The graphical nature of System Canvas provides a rapid way tocreate and configure components or systems consisting of multiple components.New components can be added to a single project or added to a component repositoryfor use in multiple projects. Components are defined by LISA or LISA+ code and canbe written using the text editor that is part of System Canvas.1.1.1 Software requirementsThis section lists the software components that must be available to run <strong>Fast</strong> <strong>Model</strong>s.LinuxThe following software is required for Linux:Operating system• Red Hat Enterprise Linux version 4 or 5 (on either 32 or64 bit architectures).• xorg-x11-devel (makedepend) if using RHEL4.• imake-1.0.2-3 (makedepend) if using RHEL5.Shell A shell compatible with sh, such as bash or tcsh.Compilergcc version 3.4.3.gcc version 4.1.2 with GNU binutils 2.17.1-2 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
IntroductionNoteTo run <strong>Fast</strong> <strong>Model</strong>s on RHEL 5 with gcc 3.4.3, you must useGNU binutils 2.16. An appropriate GNU tool chain can bedownloaded from here:ftp://esl-support.arm.com/tools/gnu/binary/enterprise-linuxNote<strong>ARM</strong> is planning to deprecate support for gcc 3.4.3 for the<strong>Fast</strong> <strong>Model</strong>s by June 30th 2010. Email support-esl@arm.comfor any commentsAdobe Acrobat readerVersion 8 or higher.License management utilitiesIf you are using floating licenses, FLEXlm version 9.2 orhigher. Newer versions are called FLEXnet.FLEXnet 10.8 license management utilities are availablethrough a link on the ESL support website, on the same pagefrom which you downloaded your tools. Use the highestversion of the license management utilities provided with any<strong>ARM</strong> tools you are using. If you do not have a copy of theseutilities, contact <strong>ARM</strong> License Support,license.support@arm.com.WindowsThe following software is required for Windows:Operating systemWindows XP with Service Pack 2 or Vista (32-bit operatingsystem).Compiler Microsoft Visual Studio 2005 with Service Pack 1 orMicrosoft Visual Studio 2008 with Service Pack 1 onWindows XP.Microsoft Visual Studio 2008 with Service Pack 1 onWindows Vista.Note<strong>Fast</strong> <strong>Model</strong>s does not contain the Visual Studio runtimelibraries. If Visual Studio is not installed, you must downloadand install the Microsoft Visual C++ 2005 SP1 (or 2008 SP1)Redistribution Package to run models on your workstation.The service package is available from the Microsoft web site.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 1-3ID031910Non-Confidential
Introduction<strong>Fast</strong> <strong>Model</strong>s does not support the Express versions ofMicrosoft Visual StudioNote• <strong>ARM</strong> is planning to deprecate support for WindowsVista for the <strong>Fast</strong> <strong>Model</strong>s in the next release of <strong>Fast</strong><strong>Model</strong>s.• <strong>ARM</strong> is planning to deprecate support for WindowsVisual Studio 2005sp1 when support for Visual Studio2010 is provided. This may be in the next release of the<strong>Fast</strong> <strong>Model</strong>s product.Please email support-esl@arm.com with any comments.Adobe Acrobat readerVersion 8 or higher.License management utilitiesIf you are using floating licenses, FLEXlm version 9.2 orhigher. Newer versions are called FLEXnet.FLEXnet 10.8 license management utilities are availablethrough a link on the ESL support website, on the same pagefrom which you downloaded your tools. Use the highestversion of the license management utilities provided with any<strong>ARM</strong> tools you are using. If you do not have a copy of theseutilities, contact <strong>ARM</strong> License Support by emailinglicense.support@arm.com.NoteIf you are using Microsoft Windows Remote Desktop (RDP)to access System Canvas or a simulator generated by SystemCanvas, the type of license you have for <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> orthe <strong>Fast</strong> <strong>Model</strong> Portfolio can restrict use of the product:• Floating licenses require a license server and do nothave any special restrictions relating to use of RemoteDesktop. Such licenses are normally issued to <strong>Fast</strong><strong>Model</strong>s users who have purchased the tool.• Node-locked licenses are tied to a specific workstation.These licenses do not work over Remote Desktopconnections. Node-locked licenses are typically issuedto users who are evaluating <strong>Fast</strong> <strong>Model</strong>s. If this1-4 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Introductionlimitation prevents your evaluation of the product,contact license.support@arm.com and request a floatingevaluation license.1.1.2 Installation and uninstallationRun the installation executable to install <strong>Fast</strong> <strong>Model</strong>s. If an existing installation isfound, a dialog is displayed to enable you to select re-installation or to uninstall theexisting installation.To uninstall <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> from a Windows workstation, click the Start button andselect All Programs → <strong>ARM</strong> → <strong>Fast</strong> <strong>Model</strong>s → Uninstall System Generator.To uninstall <strong>Fast</strong> <strong>Model</strong> Portfolio from a Windows workstation, click the Start buttonand select All Programs → <strong>ARM</strong> → <strong>Fast</strong> <strong>Model</strong>s → Uninstall <strong>Fast</strong> <strong>Model</strong>Portfolio.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 1-5ID031910Non-Confidential
Introduction1.2 <strong>Fast</strong> <strong>Model</strong>s design flowThe basic design flow for <strong>Fast</strong> <strong>Model</strong>s is:1. Create or buy standard component models.2. Use System Canvas to interconnect components and set parameters.3. Generate a new model from System Canvas.4. Use the new model as input to a more complex system or distribute it as astandalone simulation environment.ComponentsourceLISAC++<strong>Fast</strong> <strong>Model</strong>PortfoliocomponentCT libraries modelPeripheralsOther<strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong>(System Canvas andSystem Generatorutilities)GenerateGenerateGenerateVirtualPlatform(executable)VirtualPlatform(library)ExportedVirtualSystem(EVS)LoadLoadRPC<strong>Model</strong> Shell(command line)<strong>Model</strong> Debugger(GUI)<strong>Model</strong> Debugger(GUI)Figure 1-1 <strong>Fast</strong> <strong>Model</strong>s design flowThe input to System Canvas consists of:C++ library objectsTypically these are models of processor cores or standard peripherals.LISA+ source codeThe source code files define custom peripheral components. These can beexisting files in the <strong>Fast</strong> <strong>Model</strong> Portfolio or new LISA+ files that werecreated with System Canvas. The LISA+ descriptions can be located inany directory. One LISA+ file can contain one or more componentdescriptions.After the required components have been added and connected, System Canvasproduces the output object as one or more C++ library objects or SystemC objects. Theoutput can be either a single component or a system that contains many differentcomponents.1-6 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Introduction1.2.1 Project and repository files<strong>Fast</strong> <strong>Model</strong>s simplifies projects by using a single project file (.sgproj) to drive thecomplete design process of system creation, build configuration, and building themodel:• There is no requirement to provide a makefile and a set of configuration files foreach new project.• Each project is self contained with respect to the components being used. Theproject file references all files required to build and run a simulation, includingLISA, C and C++ sources, libraries including directories, files to deploy to thesimulation directory, and nested repository files.Repository files have the same format as project files and group references tocommonly-used files shared across different projects.You can add single files or a complete repository, such as the <strong>Fast</strong> <strong>Model</strong> Portfolio, tothe project file. For more information on project file contents, see Project Settingsdialog on page 3-75.Figure 1-2 on page 1-8 shows the organization of directories and files for a typicalproject on Windows:<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 1-7ID031910Non-Confidential
IntroductionD:Work_directoryMy_Projects1My_System.sgprojMy_System.lisa 4My_System.sgcanvasMy_custom_component.lisaMy_custom_component.sgcanvasWin32-Debug-VC200856cadi_system_Win32-Debug-VC2008.dll\Program Files\<strong>ARM</strong>\<strong>ARM</strong><strong>Fast</strong><strong>Model</strong>Lib_x.yetcsglib.sgrepo2LISActmodel.sgrepocomponents.sgrepo33PL011_Uart.lisaSSMC_91C111.lisalibWin32-VC2005Debugcomponents.libFigure 1-2 Project organizationFor Figure 1-2, the Build subdirectory of the My_System directory contains theMy_System.sgproj project file:1. My_System.sgproj points to the standard <strong>Fast</strong> <strong>Model</strong> Portfolio repository filesglib.sgrepo.2. The sglib.sgrepo file contains a list of repository locations such ascomponents.sgrepo. Repository files eliminate the requirement to individuallyspecify the path and library for each component. The repository can behierarchical, as this one is, or can list individual component details.3. components.sgrepo lists the locations of the LISA files for the components and thelocation and type of libraries that are available for the components.1-8 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Introduction4. The project file lists My_System.lisa as the top-level LISA file for the system. Thetop-level LISA file lists the components that are used in the system and how thecomponents are interconnected.5. This project uses a custom component in addition to the standard <strong>Fast</strong> <strong>Model</strong>Portfolio components. Custom components can be located anywhere in thedirectory structure. For Figure 1-2 on page 1-8, the custom component is onlyused with the My_System component, so the My_custom_component.lisa file is in thesame directory.The My_System.sgcanvas and My_custom_component.sgcanvas files are generatedwhen a component is edited in the System Canvas Workspace window. Thesefiles describe the display settings for a component such as:• component location and size• label text, position and formatting• text font and size• whether ports have been moved or hidden• grid spacing.6. My_System.sgproj lists Win32-Debug-VC2008 as the build directory for the selectedplatform. The build options in the project file determine:• the libraries that are used• the location• the format of the generated system.For example, the extension for the model is .so for Linux or .dll forWindows.File processing orderSub-repositories are expanded as soon as they are encountered. The File List view inthe right pane corresponds to the processing order.Example 1-1 and Example 1-2 on page 1-10 show an example project and a repositoryfile:Example 1-1 Source project file/// project filesgproject "MyProject.sgproj"{files{path = "./MyTopComponent.lisa";<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 1-9ID031910Non-Confidential
Introduction}}path = "./MySubComponent1.lisa";path = "./repository.sgrepo";path = "./MySubComponent2.lisa";Example 1-2 Files in repository/// subrepository filesgproject "repository.sgrepo"{files{path = "../LISA/ASubComponent1.lisa";path = "../LISA/ASubComponent2.lisa";}}The files listed in Example 1-1 on page 1-9 and Example 1-2 are processed in thefollowing order:1. ./MyTopComponent.lisa2. ./MySubComponent1.lisa3. ./repository.sgrepoa. ../LISA/ASubComponent1.lisab. ../LISA/ASubComponent2.lisa4. ./MySubComponent2.lisaThis processing order enables a custom implementation of a component to be used inplace of standard component implementations. If MySubComponent1.lisa and../LISA/ASubComponent1.lisa both list a component with the same name, only the firstdefinition is used.The order of occurrence of files is significant. Use the System Canvas controls tospecify the order of files and repositories:• Use Up and Down context menu entries in the File List view of the Componentwindow to change the file order within a repository. The commands havekeyboard shortcuts of Alt + Arrow Up and Alt + Arrow Down.You can also drag-and-drop files inside a repository or between repositories.1-10 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Introduction• Use the Up and Down buttons on the Default <strong>Model</strong> Repository tab in theProperties dialog to specify the order of repositories in new projects.1.2.2 Hierarchical systemsThe term system and component are both used to describe the output from SystemCanvas. The main difference is whether the output is intended as a standalone systemor is to be used within a larger system.Figure 1-3 shows the advantage of using a hierarchical system with a complex model.This system includes a Secure <strong>ARM</strong>1176JZ-S Core Tile and an Emulation Baseboard.Figure 1-3 Top-level of <strong>ARM</strong>1176 Versatile EB system in System CanvasThe central component in the system is a EmulationBaseboard component. Open thisitem by selecting it and selecting Open Component from the Object menu. Figure 1-4on page 1-12 shows that it is a complex object with many subcomponents:<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 1-11ID031910Non-Confidential
IntroductionFigure 1-4 Emulation Baseboard componentHiding the complexity of the Emulation Baseboard in a component simplifies thedrawing shown in Figure 1-3 on page 1-11 and also enables the Emulation Baseboardcomponent to be maintained separately from the <strong>ARM</strong>1176 Core Tile component. TheEmulation Baseboard component communicates with components in the higher-levelsystem through its self ports. The clock dividers in the Clocking component at thetop-left of the diagram show a connection to an external port called clk_in_master.Opening a clock divider component to see the LISA code. The Block Diagram windowshows the external ports for that subcomponent, see Figure 1-5.Figure 1-5 Clock divider component external ports1-12 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
IntroductionThe clock divider component contains only external ports. There are nosubcomponents. The behavior for this component is determined by the LISA code and,if present, the C++ code. Only two ports are shown for the clock divider in Figure 1-4on page 1-12 because the rate port is hidden. There is no connection to this port. Theport itself can be unhidden by selecting the component and selecting Show all portsfrom the context menu.The term self port refers to a port in a system that is not part of a subcomponent. InFigure 1-4 on page 1-12, self ports are represented by hollow rectangles with trianglesto indicate data flow and a text label in the rectangle. Examples include keyboard, mouseand hdr. Self ports can be either:Internal portsThese ports communicate with subcomponents and are not visible if thecomponent is used in a higher-level system. Unlike hidden external ports,you cannot expose internal ports outside of the subcomponent.Right-click on a port and selecting Object Properties... to identify orcreate internal ports. Set the port attributes to Internal for an internal selfport.External portsThese ports communicate with components in a higher-level system. Bydefault, self ports are external. In Figure 1-4 on page 1-12, self ports inthe Emulation Baseboard system that communicate with the higher levelsystem include display, keyboard, leds, and user_switch.If you use the Block Diagram editor to make a connection between an external port anda subcomponent, the LISA code uses the keyword self to indicate the standalone port:self.clk_in_master => clkdiv_ref25.clk_in;<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 1-13ID031910Non-Confidential
Introduction1-14 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Chapter 2Getting StartedThis chapter is a tutorial that covers the steps to create a new project and create a systemmodel. It contains the following sections:• About the tutorial on page 2-2• Starting System Canvas on page 2-3• Creating a sample system on page 2-7• Adding and configuring components on page 2-9• Connecting components on page 2-15• <strong>Fast</strong> <strong>Model</strong>s files on page 2-16• Viewing the project settings on page 2-17• Changing the address mapping on page 2-20• Building the system on page 2-22• Debugging the system on page 2-23• Building an ISIM target on page 2-26.NoteSee also Appendix A Building and Running the EB RTSM Example System for the stepsto build an EB RTSM model.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-1ID031910Non-Confidential
Getting Started2.1 About the tutorialThis tutorial covers the basic operations that are required to build a typical system inSystem Canvas.The goal of this tutorial is to use the System Canvas Block Diagram view to build asimple standalone system that can run a simple application image. LISA source is notedited directly.NoteThe <strong>Fast</strong> <strong>Model</strong> Portfolio must be installed before starting the tutorial.The tutorial relies upon an executable image that is included in the Third Party IPadd-on for the <strong>Fast</strong> <strong>Model</strong> Portfolio. You must download this package and install itbefore you can run the dhrystone image.In this tutorial, path names and environment variables for a Windows environment areused. If you are using Linux, reverse the direction of the slash character in path namesand substitute $PVLIB_HOME for %PVLIB_HOME%. Linux models have the extension .soinstead of .dll.2-2 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting Started2.2 Starting System CanvasTo start System Canvas:• on Linux, enter sgcanvas in a terminal window and press return• on Windows, select System Canvas from the Start menu.Additional startup options can be specified directly on the command line or by addingthem to the Additional Command Line options in the Preferences dialog as describedelsewhere. See Applications on page 3-64.System Canvas starts as shown in Figure 2-1. The application contains the followingsubwindows:• a blank diagram window on the left hand side of the application window.• a component window at the right hand side• an output window across the bottom.The System Canvas window is described in more detail in Chapter 3 System CanvasReference.Figure 2-1 System Canvas at startup<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-3ID031910Non-Confidential
Getting Started2.2.1 Setting up the <strong>Fast</strong> <strong>Model</strong> PortfolioNoteThe <strong>Fast</strong> <strong>Model</strong> Portfolio installation typically updates the system variables and pathsto use the standard libraries. This section describes how to manually configure thelibraries. This step is only necessary if you are using non-standard libraries or if yousystem has been modified.To incorporate existing components in a system, System Canvas requires informationabout these components such as their ports, protocols and library dependencies. Forconvenience, multiple components are grouped together in model repositories such asthe <strong>Fast</strong> <strong>Model</strong> Portfolio (sglib.sgrepo).Repositories contain lists of components with details of all the LISA files and Linux orWindows libraries required to build systems. System Canvas can be configured to usedefault repositories if a new project is started. The project files stores the references tothe repositories that are used for the assembled system.In addition to using the default repository, you can include further components. Theseare typically newly created custom components and previously assembled hierarchicalsystems.Use the Preferences dialog to select the required components:1. Select Setup Default Repository... from the Project menu. The Preferencesdialog is displayed as shown in Figure 2-2 on page 2-5:2-4 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting StartedFigure 2-2 Preferences dialog, Setup Default <strong>Model</strong> Repository2. The default model repository at %PVLIB_HOME%\etc\sglib.sgrepo is always presentin the list of available default files. It is the only library required by the examplecovered in this tutorial.Although the %PVLIB_HOME%\etc\sglib.sgrepo entry cannot be edited or deleted, ifthe repository is not used by your new system, you can uncheck the entry toexclude the repository from your new project file.You can also add new repositories for use with your project, though this is notrequired for the tutorial:• Click the Add button, in the Default <strong>Model</strong> Repository view of thePreferences dialog, to display the Add <strong>Model</strong> Repository File dialog shownin Figure 2-3 on page 2-6.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-5ID031910Non-Confidential
Getting StartedFigure 2-3 Add <strong>Model</strong> Repository File dialog• Browse to the required model repository file.• Click Select.• The Preferences window is updated to show the added repository.When a new project is created, the component window is filled with the collection ofperipherals, core components, and memories that are present in the repository list.2-6 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting Started2.3 Creating a sample systemNew projects are started by creating a project file.1. Select New Project from the File menu.You can also create a new system by clicking the New button on the toolbar.2. The New Project dialog is displayed, shown in Figure 2-4. Navigate to thedirectory to use for your project.Figure 2-4 New project dialog3. Enter MyProject in the file name box and click the Select button. The dialog inFigure 2-5 is displayed for you to enter the name and location of the LISA file thatrepresents your new system.Figure 2-5 Select Top Component LISA File dialog4. Enter My_Top_Component.lisa in the file name box and click the Select button.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-7ID031910Non-Confidential
Getting StartedNoteThe component name for the top component is, by default, set to the name of theLISA file.5. The Workspace area now contains a blank block diagram with scroll bars.6. The Component window, to the right of the Workspace area, lists all of thecomponents that are contained in the specified default repositories. See Setting upthe <strong>Fast</strong> <strong>Model</strong> Portfolio on page 2-4.2-8 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting Started2.4 Adding and configuring componentsThis section describes how to add and configure the components required for theexample system. Some key features of System Canvas are introduced in this way.2.4.1 Adding the <strong>ARM</strong> ® processorDrag-and-drop the <strong>ARM</strong> ® processor component from the Component window onto theWorkspace window:1. If it is not already visible, click the Block Diagram tab in the Workspace window.This displays a blank window with grid points.2. Select the Components tab in the Components window to display thecomponents that are contained in the <strong>Fast</strong> <strong>Model</strong> Repository.3. Move the mouse pointer over the <strong>ARM</strong>CortexA8CT processor component in theComponent window and press and hold the left mouse button.4. Drag the component over to the middle of the Workspace window.NoteIf you move the component in the Workspace window, the componentautomatically snaps to the grid points.5. Release the left mouse button when the component is in the desired location.The component shown in Figure 2-6 is added to the current system.Figure 2-6 <strong>ARM</strong>CortexA8CT core component in the Block Diagram window6. The system name in the title bar now contains an asterisk (*) next to the name toindicate that the LISA file has been modified but not yet saved. You can save thefile at any time by selecting File → Save File or using Ctrl+S.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-9ID031910Non-Confidential
Getting Started2.4.2 Naming componentsYou can give your component a custom name. The following steps describe how tochange the name of the processor from the default to <strong>ARM</strong>.1. Select the component and click the Properties button on the toolbar to display theComponent Instance Properties dialog.You can also display the dialog by either:• Right-clicking on the component and select Object Properties from thecontext menu.• Selecting the component and then selecting Object Properties from theObject menu.2. Click the General tab on the Component Instance Properties dialog.3. Enter <strong>ARM</strong> in the Instance Name field.Figure 2-7 Rename component4. Click OK to accept the change. The instance name of the component, that is thename displayed in processor component title, is now <strong>ARM</strong>.2-10 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting Started2.4.3 Hiding portsYou can hide some of the component ports. This is useful if they are not connected toanything. To hide multiple ports:1. Select the component and then select Object Properties from the Object menu.2. Click the Ports tab on the dialog.3. Click Select All to select all of the ports.4. Click Hide selected ports.5. Select the boxes next to clk_in and pvbus_m.6. Click OK to accept the change, so that all ports except clk_in and pvbus_m arehidden in the Block Diagram view.If there is only a small number of ports to hide, use the port context menu shown inFigure 2-9 on page 2-13. Right click on the port and select Hide Port.2.4.4 Moving portsMove the remaining visible ports in the tutorial system to improve readability:1. Move the mouse pointer so that it is over the port that is to be moved. The mousepointer changes shape to a hand with a pointing finger. This is the move portmouse pointer.2. Press and hold the left mouse button down over the port.3. While holding down the mouse button, drag the port to the desired location. Thiscan be anywhere along the inner border of the component that is not on top of anexisting port. If you select an invalid position, the port returns to its originallocation.4. When the port is in desired position, release the mouse button.5. Move the other port so that there is one port on each side of the processorcomponent. The clk_in port must be on the left side.2.4.5 Resizing componentsYou can resize components for aesthetic purposes or to make labels easier to read.1. Select the processor component and move the mouse pointer over one of thegreen resize control boxes on the edges of the component.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-11ID031910Non-Confidential
Getting Started2. Hold the left mouse button down and drag the pointer to resize the component.3. Release the mouse button to end the resize operation. Your processor componentshould look similar to that shown in Figure 2-8.To vertically resize the component title bar to avoid truncating text, click thecomponent and drag the lower handle of the shaded title bar.Figure 2-8 Processor component after changes2.4.6 Adding additional componentsAdd more components to the project:1. Use drag and drop to place one of each of the following components onto theBlock Diagram window:• ClockDivider• MasterClock• PL340_DMCNoteThe PL340_DMC component is included to demonstrate some features ofSystem Canvas and is not part of the final example system.• PVBusDecoder• RAMDevice.2. Select the new components individually and use the General tab of theComponent Instance Properties dialog to rename them to:• Divider• Clock• PL340• BusDecoder• Memory.NoteComponent names cannot have spaces in them.2-12 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting Started2.4.7 Using port arraysThis section demonstrates how to expand and collapse port arrays using the PL340component.1. Right click on one of the axi_if_in ports in the PL340 component. This opens acontext menu as shown in Figure 2-9. Select Collapse Port to reduce the portarray to a single visible item in the component.Figure 2-9 Port context menu2. Select the PL340 component and then select Object Properties from the Objectmenu.3. Select the Ports tab in the Component Instance Properties dialog.4. The axi_if_in port is a port array as indicated by the + beside the port name. Clickon the + to expand the port tree view.5. Deselect the checkboxes beside axi_if_in[2] and axi_if_in[3]. This hides thechosen array ports so that expanding the port array still does not display them.Click OK to close the dialog. You can also hide a port by using the port contextmenu and selecting Hide Port.6. Right click on the axi_if_in port in the PL340 component and this time selectExpand Port from the port context menu. Only the axi_if_in[0] andaxi_if_in[1] ports are shown.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-13ID031910Non-Confidential
Getting Started7. To redisplay the axi_if_in[2] and axi_if_in[3] ports, you can either:• use the port context menu shown in Figure 2-9 on page 2-13 and selectShow All Ports, or• repeat step 5 and select the checkboxes next to the hidden ports.NotePorts with more than eight items are shown collapsed by default.An alternative sequence of steps to expand the port is:a. Display the Component Instance Properties dialogb. Select the Ports tabc. Click on the + next to the port array to expand the port tree viewd. Select the Show as Expanded radio button.8. After you have completed this section of the tutorial, select the PL340 componentand delete it from your system. It is not required for the remainder of the tutorial.9. Rearrange the components so that your system looks similar to the one shown inFigure 2-10.Figure 2-10 Example system with added components2-14 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting Started2.5 Connecting componentsConnect the components:1. Switch connection mode by clicking the Connect button. You can also enter theconnect mode by selecting Connect Ports Mode from the Edit menu.2. Move the mouse pointer around in the Block Diagram window:• If the mouse pointer is not over an object, the pointer changes to the invalidpointer. This is a circle with a diagonal line through it.• If the mouse pointer is over an object, the mouse pointer changes to the startconnection pointer and the closest valid port is highlighted.3. Move the cursor so that it is over the Clock component and close to the clk_outport.4. Ensure that the clk_out port is highlighted and then press and hold the left mousebutton down.5. Move the cursor over the clk_in port of the Divider component.6. Release the mouse button. A connection is made between the two ports.NoteThe application remains in connect mode after the connection is made.7. Continue connecting components until the system looks like the one shown inFigure 2-11. Some ports have been moved to non-default locations to improveclarity.Figure 2-11 Connected componentsNoteConnections between the addressable bus ports are displayed with bold lines.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-15ID031910Non-Confidential
Getting Started2.6 <strong>Fast</strong> <strong>Model</strong>s filesThis section describes the content and purpose of the <strong>Fast</strong> <strong>Model</strong>s files that have beencreated by this stage of the tutorial. All files are located in your project directory.2.6.1 LISA sourceYou can use the LISA language directly to create or modify your system. The BlockDiagram view of your system is a graphical representation of the LISA source displayedon the Source tab of the workspace window. Click on the Source tab to display thecontents of the My_Top_Component.lisa file. This file is automatically updated if you addor rename components in the Block Diagram.You can view the LISA source for many of the supplied components. To view thesource, double-click a component in the Block Diagram. Alternatively you can rightclick on a component in the Components window and select Open.For more details on the LISA language, see the LISA+ Language for <strong>Fast</strong> <strong>Model</strong>sReference Manual.2.6.2 System Canvas fileThe System Canvas file contains the Block Diagram layout information for yoursystem. In this tutorial, your system layout file is called My_Top_Component.sgcanvas. Donot edit this file yourself.2.6.3 <strong>Fast</strong> <strong>Model</strong>s project fileWhen you created the tutorial project, a project file was also created. Project files havethe extension .sgproj and contain:• components used in the system• connections between system components• references to the component repositories used• settings for model generation and compilation are stored in project files.In this tutorial, the project file is called MyProject.sgproj. Do not edit this file yourself.Instead let System Canvas to modify it for you automatically if you change projectsettings. See Viewing the project settings on page 2-17.2-16 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting Started3. Click the Category View, List View, and Tree View tabs and observe how theproject parameters are displayed in different groupings.2.7.1 Specifying the Project Active ConfigurationThe Select Active Project Configuration drop-down menu box on the main tool barindicates the target for which your system is built. The project file for the systemcontains one or more sets of configuration values that control how the target isgenerated.The Configuration drop-down in the Project Settings dialog has configurations to:• build models with debug support• build release models optimized for speed.The full list of project settings can be displayed and edited by selecting Project Settingsfrom the Project menu. You can inspect and modify a configuration for your operatingsystem by selecting it from the Configuration combo box and clicking the differenthierarchy elements to view the settings.NoteThe configuration options available, including compilers and platforms, might bedifferent depending on your operating system.Projects created with earlier versions of System Generator might not have the compilerversion specified in the Project Settings dialog. You can update an earlier project tospecify the compiler option.2.7.2 Viewing the top component propertiesThe top component defines the root component of the system. Any component can beset as the top component. This enables building models from subsystems.In the Project Settings dialog shown in Figure 2-12 on page 2-17, click theSelect From List... button to view the top components in the system.The Select Component From List dialog opens and lists all possible top components.See Figure 2-13 on page 2-19.NoteIf the value in the Type column is System, the component has subcomponents.2-18 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting StartedFigure 2-13 Select Components dialog showing available componentsMy_Top_Component is the top component in the tutorial project.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-19ID031910Non-Confidential
Getting Started2.8 Changing the address mappingAll addressable bus mappings, that is connections that have bold lines, areparameterized by editable address maps.1. Double-click the pvbus_m_range port of the BusDecoder component to open thePort Properties dialog for the port, shown in Figure 2-14.Figure 2-14 Viewing the address Mapping from the Port Properties dialog2. Select the Memory.pvbus Slave Port line, and click Edit Connection... to open theEdit Connection dialog shown in Figure 2-15.Figure 2-15 Edit Connection dialogYou can also double-click on the entry to open the Edit Connection dialog.3. Select the Enable address mapping checkbox to activate the address text fields.The address mapping for the master port is shown on the left side of the EditConnection dialog. Start, End, and Size are all editable. If one value changes, theother values are automatically updated if necessary. The equivalent LISAstatement is displayed at the bottom of the Edit Connection dialog.2-20 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting StartedEnter a Start address of 0x00000000 and an End address of 0x10FFFFFF in theactive left hand side of the Edit Connection dialog. The Size of 0x11000000 isautomatically calculated. This maps the master port to the selected address range.4. If mapping the master port to a different address space on the slave port isrequired, select Enable slave port address range . If Enable slave port addressrange is checked, the parameters for the slave port can be edited as shown inFigure 2-16. The default values are the same as for the master port. In this tutorial,a slave port address range is not required, so deselect the Enable slave portaddress range checkbox.Figure 2-16 Edit address map for slave port5. Click OK to close the Edit Address Mapping dialog for the Memory.pvbus slaveport.6. Click OK to close the Port Properties dialog.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-21ID031910Non-Confidential
Getting Started2.9 Building the systemClick the Build icon on the System Canvas toolbar to build the model as a .so or .dlllibrary. You can also build an executable model as described in Building an ISIM targeton page 2-26.NoteDepending on your preference setting, a system check might be performed and awindow might open if warnings or errors occur. Click Proceed to start the build.The progress of the build is displayed in the Log window as shown in Figure 2-17.Depending on the speed of your computer and the type of build selected, this processmight take several minutes.Figure 2-17 Build process outputNoteUsing the num-comps-file and num-build-cpus build options can considerably reducecompilation time.For more detail on the simulation generation options, see SIMGEN command-lineoptions on page C-3.2-22 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting Started2.10 Debugging the systemAfter the model successfully built, it can be executed and debugged with <strong>Model</strong>Debugger:1. Click the Debug button in the System Canvas Toolbar to launch <strong>Model</strong> Debugger.2. The Configure <strong>Model</strong> Parameters dialog displays the instantiation parameters forthe top-level components in the model as shown in Figure 2-18.You can display parameter sets either by either:• selecting a Parameter category in the left side of the dialog• clicking on a + next to a component name in the right hand side.You can select the List View or Tree View tabs for a different view of the systemparameters.No changes are required in this tutorial, so click OK to close the dialog.Figure 2-18 Configuring <strong>Model</strong> Parameters dialog3. The Select Target dialog opens and displays the components to use in <strong>Model</strong>Debugger as shown in Figure 2-19 on page 2-24. The <strong>ARM</strong> processor componentis selected by default.You can select additional targets to load in their own instances of <strong>Model</strong>Debugger. This is not required for the tutorial.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-23ID031910Non-Confidential
Getting StartedFigure 2-19 Select Targets dialog4. Click OK to start <strong>Model</strong> Debugger.The debugger loads the model library from the build directory of the activeconfiguration. One instances of <strong>Model</strong> Debugger starts.If the Load Application Code dialog is not automatically displayed, select LoadApplication Code from the File menu.Select %PVLIB_HOME%\images\dhrystone.axf as the application.NoteYou must have installed the Third Party IP add-on for the <strong>Fast</strong> <strong>Model</strong> Portfolio.This is available as a separate download from the <strong>ARM</strong> ESL Support website.5. Click Run to start the simulation.6. A <strong>Model</strong> Debugger Application Input pop-up window appears. Type 1000000 intothe Application input field. See Figure 2-20 on page 2-25.2-24 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting StartedFigure 2-20 <strong>Model</strong> Debugger Application Input windowClick OK. After a short pause, the results of the benchmark are shown in theStdIO tab of <strong>Model</strong> Debugger.This tutorial used existing library components to create a system. Creating newcomponents is described in Chapter 6 Creating a New Component.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-25ID031910Non-Confidential
Getting Started2.11 Building an ISIM targetYou can build an Integrated Simulator (isim) target by checking the Integratedsimulator checkbox under the Targets option in the Project Settings dialog as shownin Figure 2-21.Figure 2-21 Build Integrated Simulator targetAn isim target is generated by statically linking the <strong>Model</strong> Shell executable with aCADI simulation library. Integration of the executable and library simplifies host-leveldebugging and profiling.2-26 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting Started2.11.1 Overloading the main() function in the targetThe generated isim executable target has its own main() function. To overload thedefault main() with a user-supplied main():• use the Project Settings dialog to define USER_DEFINED_ISIM_MAIN preprocessoroption for compiler as shown in Figure 2-22.Figure 2-22 Specifying user-defined main() option• supply a C++ file or a library with user-defined main() function. A fragment ofthe standard IsimMain.cpp file is shown in Example 2-1for comparison:Example 2-1 Standard IsimMain()#ifdef USER_DEFINED_ISIM_MAIN// function that preforms command line parsing,// CADI system initialization and run modelextern int LoadInitAndRunCADI<strong>Model</strong>(int argc, char *argv[]);int main(int argc, char *argv[])<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-27ID031910Non-Confidential
Getting Started{}return LoadInitAndRunCADI<strong>Model</strong>(argc, argv);#endif // #ifdef USER_DEFINED_ISIM_MAINThe user-defined main() can implement processing of own command line optionsbut must, after filtering out all user-defined switches, pass the remaining optionsto the <strong>Model</strong> Shell entry function LoadInitAndRunCADI<strong>Model</strong>().• Add the new source file containing the custom main() to the project. See AddExisting Files and Add New File dialogs (Component window) on page 3-23.CautionIf the option USER_DEFINED_ISIM_MAIN and a user-supplied main() are used, youcannot build a CADI shared library from the project. If a CADI shared library isrequired:— add a new configuration for isim_system that defines USER_DEFINED_MAIN— add an #ifdef USER_DEFINED_MAIN test block around the main() in the usersource file.2.11.2 Command line switches for the executable targetBecause an isim target includes the <strong>Model</strong> Shell executable, all <strong>Model</strong> Shell commandline options apply to isim executable except --model. The model is integrated into theexecutable so there is no requirement to specify a model for the isim executable.2.11.3 Debugging the modelClick the Devenv (Windows) or gdb (Linux) button on the System Canvas toolbar tolaunch the host debugger for LISA source level debugging:• For Windows, open the generated solution file. Any target, including isim targets,can be used. Use Microsoft Developer Studio to define command line switchesfor debugging.NoteIf the isim target contains a user-defined main() that contains a call toLoadInitAndRunCADI<strong>Model</strong>(), a cadi_system cannot be compiled because theLoadInitAndRunCADI<strong>Model</strong>() function is not defined. See Overloading the main()function in the target on page 2-27.2-28 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Getting Started• For Linux, the host level debugger (gdb by default) can only be launched forgenerated isim executables.If the model was built as a library, for example cadi_model.so, and you are using<strong>Model</strong> Debugger or <strong>Model</strong> Shell for source level debugging, you must start gdbin a standard Unix shell.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 2-29ID031910Non-Confidential
Getting Started2-30 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Chapter 3System Canvas ReferenceThis chapter describes the windows, menus, dialogs, and controls present in SystemCanvas. It contains the following sections:• Launching System Canvas on page 3-3• Overview of System Canvas on page 3-4• Add Existing Files and Add New File dialogs (Component window) on page 3-23• Add Files (Project menu) on page 3-26• Add Connection dialog on page 3-28• Component Instance Properties dialog on page 3-29• Component Properties dialog for a library component on page 3-40• Connection Properties dialog on page 3-44• Edit Connection dialog on page 3-45• File/Path Properties dialog on page 3-46• Find and Replace dialogs on page 3-50• Label Properties dialog on page 3-52• New File dialog (from File menu) on page 3-54• New Project dialogs on page 3-56• Open File dialog on page 3-58• Port Properties dialog on page 3-60<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-1ID031910Non-Confidential
System Canvas Reference• Preferences dialog on page 3-62• Project Settings dialog on page 3-75• Protocol Properties dialog on page 3-94• Run Dialog on page 3-95.• Self Port dialog on page 3-98.3-2 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference3.1 Launching System CanvasYou can start System Canvas from the Windows Start menu or from the command lineon all supported platforms.To start System Canvas from the command line, at the prompt type sgcanvas. You canoptionally define additional parameters as listed in Table 3-1.Short form Long form DescriptionTable 3-1 System Canvas command line options-E --enable-verbose class Enables verbose messages for the specified messagesclasses. Use a comma separated list to specify more thanone class. The list of supported messages classes can bedisplayed in the System Canvas GUI by clicking File →Preferences → Verbose Messages.-h --help Prints help text and exits.-V --verbose Enables all verbose messages. This is the same as--enable-verbose SystemGen.-v --version Prints version and exits.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-3ID031910Non-Confidential
System Canvas Reference3.2 Overview of System CanvasSystem Canvas consists of the following windows and graphical elements:Main menu The main menu contains the available options with their correspondingkeyboard short cuts. See Menu bar on page 3-5.Toolbar The tool bar contains buttons for frequently used features. See Toolbar onpage 3-15.Workspace The workspace panel has tabs to select the views:• the Block Diagram panel contains the components, ports, andconnections• the Source panel is used to edit the LISA code of the component.See Workspace windows on page 3-17.Component listThe component list contains a list of all components and their protocolsand libraries available in the current project. See Component window onpage 3-20.Output windowThe output window contains status messages that are output from thebuild process.Status bar The status bar gives information about menu items, commands, buttons,and component information.The main elements of the System Canvas window are shown in Figure 3-1 on page 3-5.3-4 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceWorkspace windowToolbarComponent windowWorkspace tabsStatus barOutput windowFigure 3-1 Layout of System Canvas3.2.1 Menu barThe main menu provides access to System Canvas functions and commands.File menuThe File menu has the following options:New Project Use the New Project entry to create a new model project. See New Projectdialogs on page 3-56.Load ProjectThis option opens an existing project.Close ProjectThis operation closes the currently opened project. If there are pendingchanges, the Save changes dialog is displayed.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-5ID031910Non-Confidential
System Canvas ReferenceSave ProjectThis command saves the changes made to the current project.Save Project AsThis command saves the current project to a new location and name.New FileOpen FileClose FileSave FileSave File AsSave AllPrintPreferencesThis displays the New File dialog to create a new file. Select the typefrom the File type drop-down list.This displays the Open File dialog to create a new file. Filter the types todisplay by selecting the type from the File type drop-down list. If the filetype is not LISA, you can open the file as text in the source editor.This operation closes the currently open LISA file. If there are pendingchanges, the Save changes dialog is displayed.This command saves the changes made to the current LISA file.This command saves the current LISA file to a new location and name.This command saves the changes made to the current project and anymodified LISA files.This command prints the contents of the Block Diagram window. Adialog displays to enable you to select the destination printer.Use this option to modify the user preferences.Recently Opened FilesA list of the sixteen most recently opened LISA files. Click on a list entryto open the file.To remove a file from the list, move the mouse cursor over the file nameand press the Delete key or right click and select Remove from list fromthe context menu.Recently Opened ProjectsA list of the sixteen most recently opened projects. Click on a list entryto open the project.To remove a project from the list, move the mouse cursor over the projectname and press the Delete key or right click and select Remove from listfrom the context menu.3-6 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceExitEnd System Canvas. If you have modified files or projects, a dialogprompts you to save your changes. You can choose to not have the dialogpresented in future by selecting Do not show this message again. Tore-enable the dialog, edit the Preferences. See Suppressed Messages onpage 3-73.Edit menuThe Edit menu has the following options:UndoUndo the last change to a file in the Source window or to the layout in theBlock Diagram view. Up to 42 actions can be undone. The followingactions can be undone:• adding an object such as a component, label, or connection• pasting or duplicating objects• cutting or deleting objects• editing object properties• moving objects• resizing objects.NoteUndo and Redo operations can affect block diagram view zoom andscroll actions.Undo and Redo typically work in the usual intuitive way, but thefollowing special case requires explanation:1. Change the system in the Block Diagram view by, for example,adding a RAMDevice component with name RAM.2. Switch to Source view. The text RAM : RAMDevice(); is present inthe composition section.3. Change the code by removing the line RAM : RAMDevice(); from theSource view.4. Change the code by adding, for example, the linePVS : PVBusSlave(); to the Source view.5. Click on the Block Diagram tab. The change to the source code isreflected by the RAM component being replaced by the PVScomponent.6. Select Undo from the Edit menu. This Block Diagram view showsthe system as it was before step 2. RAM is present but PVS is not.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-7ID031910Non-Confidential
System Canvas Reference7. Select Redo from the Edit menu. This Block Diagram view showsthe system as it was before step 6. PVS is present but RAM is not.RedoCutCopyPasteDuplicateDeleteSelect AllEdit ModeRedo the last undone change. This cancels the result of selecting Undo.Selecting Redo multiple times cancels multiple Undo actions. See thedescription for Undo for more information.Cut the marked element and place it into the copy buffer.Place the marked element into the copy buffer.Paste the content of the copy buffer at the current cursor position.Duplicate the marked content.Delete the marked element.Select all elements.Change the Workspace to Edit Mode. Components can be selected withthe cursor.Connect Ports ModeSelect connection mode. The cursor is used to connect components.Pan ModeSelect movement mode. The cursor is used to move the entire system inthe Workspace window.Search menuThe Search menu has the following options:FindFind NextSelecting Find opens a dialog that allows searching for a string in acurrently active window. The Active window is highlighted by a thickblack frame around it. See Find and Replace dialogs on page 3-50.The last defined search is repeated to find the next occurrence.Find PreviousThe last defined search is repeated, but the search direction is backwardsin the document.ReplaceSelecting Replace opens the Find dialog with replace controls displayed.This lets you replace strings in a text document. The Replace feature isonly available if the active window is a source editor. See Find andReplace dialogs on page 3-50.3-8 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceGo To LineSelecting this option displays a dialog that enables you to specify a linenumber in the currently open LISA file. This option is only enabled in theSource view.NoteYou can also use the search icons displayed at the top right of the application windowto search for text. Enter the text to search for in the text box to the right of the searchicons. As you enter text, an incremental search is performed in the active window.View menuThe View menu has the following options:Show GridZoom InZoom OutDisplay the grid in the Workspace window. Using the grid simplifiescomponent alignment.Increase the magnification for the Workspace window to show part of thesystem in more detail.Decrease the magnification for the Workspace window to show more ofthe system.Zoom 100% Change the magnification for the Workspace window to the fullworkspace canvas area.Zoom FitChange the magnification for the Workspace window to fit the entiresystem into the workspace canvas area.Zoom Fit SelectionChange the magnification for the Workspace window to fit the selectedportion of the system into the workspace canvas area.Object menuUse the Object menu to modify the system or a component in the system. The Objectmenu has the following options:Open ComponentThis option opens the source for the component that has been selected inthe Workspace.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-9ID031910Non-Confidential
System Canvas ReferenceAdd ComponentThis option displays a dialog that contains all the available componentsthat can be added to the diagram.Add LabelAdd PortThis option changes the mouse cursor into a default label. To add a label,move the label to the location desired and click the left mouse button. Thelabel properties dialog is displayed to enable you to change the label textand properties.This option displays the External Port dialog used to specify the type ofport to add.Mirror Self PortThis option switches the direction of drawing the external port. It doesnot reverse the signal direction, so a master port remains a master port. Ifan unconnected port is not selected, this option is disabled.Expand PortIf a port array is selected, this option is enabled. Select it to display all ofthe individual port elements. Port arrays with more than eight elementsare collapsed by default.NotePorts with a large number of elements might expand so that all elementsappear on top of one another. Click and drag to move the individual portelements to separate locations. Alternatively, collapse the port, increasethe component size, then expand the port again.Collapse PortIf a port array is selected, this option is enabled. Select it to hide theindividual port elements and only display the top-level port name. Portswith eight or fewer elements are expanded by default.Hide PortUse this option to disable the selected port and make it invisible in theBlock Diagram window.Hide All Unconnected PortsThis option hides all ports that are not connected to a component.3-10 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceShow/Hide Ports of Protocol Types...This option hides all ports that use a specified protocol. Select theprotocols to filter from the displayed Show/Hide Connection Typesdialog.Show All PortsThis option shows all ports that have previously been hidden. This mightresult in overlapping port symbols if there is not enough space fordisplaying all of the hidden ports.Autoroute ConnectionThis option removes any manually placed points or manually moved linesegment end points from the currently selected connection and reroutesthe connection.Autoroute All ConnectionsThis option removes any manually placed points or manually moved linesegment end points from all connections and reroutes the connections.DocumentationThis option opens the PDF file that contains the documentation for theselected component.Object PropertiesThis option displays the Component Instance Properties dialog to viewand edit the properties for the selected component.NoteIf a component is not selected, the Component <strong>Model</strong> Properties dialogis displayed.Project menuThe Project menu has the following options:Check SystemUse this entry to check if the system being developed has any errors ormissing information. This feature cannot check everything, but does giveuseful feedback.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-11ID031910Non-Confidential
System Canvas ReferenceGenerate SystemGenerate a system. After generation finishes, click Build System andDebug to run the model.Build SystemCompile the system files.Stop BuildCleanCancel the build process that is currently active.Delete all generated files.Launch <strong>Model</strong> DebuggerExecute simulation under control of <strong>Model</strong> Debugger .RunRun...Open Run Dialog to specify command to run.Run in <strong>Model</strong> ShellExecute simulation under control of <strong>Model</strong> Shell withcommand line options taken from project settings and userpreferences. For ow to configure the latter options seeApplications on page 3-64.Run ISIM systemExecute simulation as ISIM executable with <strong>Model</strong> Shellcommand line options taken from project settings and userpreferences.Run SystemC executableRun SystemC simulation application specified in projectsettings (see Building a SystemC component from SystemCanvas on page 5-4).Clear HistoryClear all recent run command entries.Recent Command Entries (up to 10)Call recent command entries.Kill Running CommandStop currently running synchronous command.3-12 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceLaunch Host DebuggerLaunch the debugger. The behavior of this entry depends on the operatingsystem:• For Windows, Microsoft Visual Studio 2005 or 2008 is launcheddepending on the configuration. A generated solution file issupplied as an argument that can generate any target. If the systemhas not already been built, that can be done in Visual Studio.You can start a debug session from the Visual Studio session.Command line arguments for isim systems or model_shell can besupplied by from Visual Studio by selecting Project →Properties → Configuration Properties → debugging.• For Linux, the executable or script defined in ApplicationPreferences is launched (see Preferences dialog on page 3-62).Only an isim target can be specified as the argument. <strong>ARM</strong> ®recommends this as the preferred way to do source leveldebugging.Add FilesAdd an existing file to the system.Add Current FileAdd the currently open file to the system.Refresh Component ListUpdate the Component List window to show all available components.Setup Default DirectoryDisplays the Default <strong>Model</strong> Repository section of the Preferenceswindow. Use this dialog to select the repositories that will beautomatically included in the next new project.NoteThe currently open project is not affected by changes to the default modelrepository list.Active ConfigurationSelect the configuration to use to build the system from the list of projectfiles.Project SettingsDisplay the Project Settings dialog.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-13ID031910Non-Confidential
System Canvas ReferenceHelp menuThe Help menu has the following options:<strong>User</strong> <strong>Guide</strong>This option opens this book in Adobe Acrobat Reader.<strong>Model</strong> Shell Reference ManualThis option opens the PDF file that contains the <strong>Model</strong> Shell reference.LISA Language Reference ManualThis option opens the PDF file that contains the language reference.System Generator Release NotesThis option opens the text file that contains the release notes.Documents in $PVLIB_HOME/DocsThis option lists the PDF files that are in the directory $PVLIB_HOME/Docs.The location syntax is the same on both Windows and Linux. ThePVLIB_HOME environment variable is set when the <strong>Fast</strong> <strong>Model</strong> Portfolio isinstalled.End <strong>User</strong> License Agrement (EULA)This option opens the HTML file that contains the license agreement.AboutThis displays the standard About dialog box displaying version andlicense information.System <strong>Information</strong>This displays a dialog that contains extended information about the toolsand loaded models.3-14 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference3.2.2 ToolbarThe Toolbar provides access to the most frequently used functions that are alsoaccessible through the Main Menu:NewCreate a new project or LISA file. See New File dialog (from File menu)on page 3-54.Open Open an existing project or file. See Open File dialog on page 3-58.SaveAllUndoRedoPropertiesSave current changes to the file.Save project and all open files.Undoes the last change in the Source or Block Diagram view. See Editmenu on page 3-7.Redoes the operation that was cancelled by the last Undo.Display the Properties dialog for the selected component.NoteThe Properties button only displays properties for items in the BlockDiagram:• If nothing is selected, the Component <strong>Model</strong> Properties dialogopens. This gives you the properties for your top-level component.See Component <strong>Model</strong> Properties dialog for system on page 3-34.• If a component is selected, the Component Instance Propertiesdialog opens. See Component Instance Properties dialog onpage 3-29.• If a connection is selected, the Connection Properties dialog opens.See Connection Properties dialog on page 3-44.• If a port is selected, the Port Properties dialog opens. See PortProperties dialog on page 3-60.• If a self port is selected, the Self Port Properties dialog opens. SeeSelf Port dialog on page 3-98.• If a label is selected, the Label Properties dialog opens. See LabelProperties dialog on page 3-52.SettingsDisplay the project settings. See Viewing the project settings onpage 2-17.Select Active Project ConfigurationSelect the build target for the project.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-15ID031910Non-Confidential
System Canvas ReferenceRefreshCheckBuildStopCleanDebugRunKillDevenvRefresh the component and protocol lists.Perform a basic model error and consistency check.Generate a virtual system model using the settings from the ProjectProperties.Stop the current generation process.Delete all generated files.Start <strong>Model</strong> Debugger to debug the generated simulator.Clicking the button executes the most recent run command. The downarrow next to the button opens the Run Dialog.Stop <strong>Model</strong> Shell and end the simulation.Open the project in the compiler. For Windows, Visual Studio is opened.For Linux, gdb is opened.NoteThe project and debugger that is opened is determined by the value of theSelect Active Project Configuration drop-down menu.The project solution must be generated before using this button. If thesolution is not found, the compiler opens without a project.EditConnectPanZoomSelect edit mode. The cursor is used to select and move components.Select connection mode. The cursor is used to connect components.Select movement mode. The cursor is used to move the entire system inthe Workspace window.Use the In, Out, 100%, and Fit buttons to change the zoom factor for thesystem view in the Workspace window.3-16 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference3.2.3 Workspace windowsThe workspace window is the large pane on the left side of the application window.Use the workspace views to display and edit the graphical representation of a systemthe LISA code for the components.Components can be hierarchical system components or single components that do nothave any sub components or internal connections.The workspace window has two tabs at the bottom of the window:SourceDisplays the LISA source code of the component.The workspace can also display other text files. See Open File dialog onpage 3-58.The Source view is a fully-featured source text editor that includes thefollowing:• Similar operation to common Windows text editors.• Standard copy and paste operations on selected text are supported.Text copied from the Source view can be pasted into anotherSystem Canvas text field or into an external text editor.• Undo/redo operations are enabled. Text changes can be undone byusing Ctrl-Z or Edit → Undo. Text changes can be repeated byusing Ctrl-Y or Edit → Redo.• Syntax highlighting is provided for LISA, C++, HTML, Makefiles,project (*.sgproj) and repository (*.sgrepo) files.• Auto-indenting and brace matching is provided. Indenting is doneby using four spaces rather than tab characters.• Auto-completion for LISA source. If you type a delimiter such as“.” or “:”, a list box with appropriate components, ports orbehaviors for the context is shown. Master and slave ports areindicated by icons.• Call hint functionality is included. If you type a delimiter such as“(“, a tooltip is displayed with either a component constructor orbehavior prototype, depending on the context. Call hints areenabled if tooltips are enabled in the Appearance section of thePreferences dialog. See Preferences dialog on page 3-62.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-17ID031910Non-Confidential
System Canvas ReferenceNoteLexical information for auto-completion and call hint functionality isupdated every time a LISA file is parsed. This occurs, for example, whenswitching between the Source and Block Diagram.Block DiagramDisplays the graphical representation of the component. It enables addingcomponents, connections between components, and ports to thedisplayed component. Add labels to the diagram to provide comments.Displaying the block diagram fails if:• the file is not written in LISA• the syntax of the LISA file is incorrect• the LISA file contains more than one component• the LISA file contains a protocol.The Block Diagram view supports copy and paste operations on selectedcomponents, connections, labels, and self ports. Either:• use the cursor to draw a bounding rectangle around the box• press and hold shift while clicking on the components to copy.Component instance names are changed if the component is copied.Connections are only copied if both ends of the connection are copied.NoteIf the system is changed in the Source view, the change is immediately reflected in theBlock Diagram view. If a change is made in the Block Diagram view, it is immediatelyreflected in the Source view.For each open component, or other open file, a new workspace tab is created at the topof the Workspace window. The name of the file shown in the workspace tab. The statusof the file is indicated by:• an asterisk is displayed behind the name if the file is modified• a question mark behind the file name if the file is not part of the project.Click the right mouse button in the workspace to open the context menu for that view.Context menu for the Source viewThe context menu of the Source tab contains items for common text operations:Undo Cancel last action.Redo Cancel Undo. Repeat the action that was undone.3-18 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceCutCopyPasteDeleteSelect AllCut selected text.Copy selected text.Paste text from global clipboard.Delete selected text.Selects all text in the window.Context menu for the Block Diagram viewThe context menu for the Block Diagram tab has the following entries:Open ComponentThis item opens a new workspace tab for the selected component.DeleteDeletes the component or connection, depending on the item the mousepointer was positioned when activating the context menuAdd Port... Adds a port to the component in the active workspace.Mirror Self PortMirrors the graphical object representing the port.Expand PortIf a port array is selected, this option is enabled. Select it to display all ofthe individual port elements. Port arrays with eight or fewer elements areexpanded by default.NotePorts with a large number of elements might expand so that all elementsappear on top of one another. Click and drag to move the individual portelements to separate locations. Alternatively, collapse the port, increasethe component size, then expand the port again.Collapse PortIf a port array is selected, this option is enabled. Select it to hide theindividual port elements and only display the top-level port name. Portarrays with more than eight elements are collapsed by default.Hide PortIf a port is selected, this option is enabled. Select it to hide only theselected port.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-19ID031910Non-Confidential
System Canvas Reference3.2.4 Component windowHide All Unconnected PortsIf a port is selected, this option is enabled. Select it to hide ports that havenot yet been connected to other ports.Show/Hide Ports of Protocol Types...This option hides all ports that use a specified protocol. Select theprotocols to filter from the displayed Show/Hide Connection Typesdialog.Show All PortsShows all ports of the component.Autoroute connectionIf a connection is selected, this option is enabled. If selected, theconnection line is redrawn.Object PropertiesOpens a dialog that lists the object properties.The component window is located to the right of the workspace window. Thecomponent list contains a list of all components and their protocols and librariesavailable in the current project.NoteThis view is empty if no project is loaded.The component list consists of the following tabs:Components Lists all components along with their version number, type and filelocation. The components can be dragged and dropped into the blockdiagram. Double clicking on a component opens it in the workspace.ProtocolsFilesLists all protocols and their file locations that are used by the listedcomponents. Double clicking on a protocol opens it in the workspace.All files that belong to the current project are displayed hierarchically.The root of this hierarchy is always the project file describing the loadedproject. The project file can reference LISA files or componentrepositories. A repository can itself contain a repository. Double clickingon a file opens it in the workspace.3-20 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceNoteThe view shows the fully expanded file tree. The order of file processingis from top to bottom of the list.To move files within the project and change the processing order fromthis view, either:• Select a repository and use the Up and Down entries in the contextmenuUse the keyboard shortcuts of Alt + Arrow Up or Alt + ArrowDown, to change the order of files inside the repository.• Drag a file from one repository to a new location in the samerepository or to a different repository.Component window context menuThe context menu of the component list contains the following items:OpenAdd...Add New...Opens the file associated to the selected item.Opens a dialog for adding an existing file containing a repository,component or protocol. It also allows adding existing libraries.Opens a dialog for adding a new file to the project.Add Directory...(Files tab only) Opens a dialog for adding an include path to be used bythe compiler. To simplify navigation, the dialog also shows the filename.RemoveReloadUpDownRemoves the selected item.Reloads the selected component or protocol.(Files tab only) Moves the selected file higher in the file list. The fileorder determines the processing order for the file contents.(Files tab only) Moves the selected file higher in the file list. The fileorder determines the processing order for the file contents.Refresh Component ListRefreshes the entire component list.DocumentationThis option opens the PDF file that contains the documentation for theselected component.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-21ID031910Non-Confidential
System Canvas ReferencePropertiesA dialog opens showing the properties of the selected item.3.2.5 Output windowThe Output window displays the output resulting from build or script commands.The left side of the window has the following controls:First click the icon to navigate to the first error message in the text.Previous click the icon to navigate to the first error message in the text.Lock click the icon to stop scrolling if an error occurs.Next click the icon to navigate to the next error message in the text.Last click the icon to navigate to the last error message in the text.The right side of the window has the following controls:Scroll bar If the output window contains more text that fits in the window, use thescroll bar to view the text.Lock Click the icon to force the output window to the include the bottom linein the text output and ensure the most recent text is viewable in thewindow.3-22 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference3.3 Add Existing Files and Add New File dialogs (Component window)NoteJapanese or Korean characters must not be used in project filename paths, as they canlead to failure to find the specified libraries.On Windows, the direction of the slash characters separating directories appears to bereversed. You can enter slash characters in either direction but are displayed as / in allcases. This does not affect operation.Use these dialogs to add a component, protocol, library, repository, or additional sourcecode to a project:• The Add New File dialog in Figure 3-2 is displayed by right-clicking in theComponent window and selecting Add New from the context menu.Figure 3-2 Add New File dialog• The Add Existing File dialog in Figure 3-3 is displayed by right-clicking in theComponent window and selecting Add from the context menu.Figure 3-3 Add Existing Files dialog<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-23ID031910Non-Confidential
System Canvas Reference• See New File dialog (from File menu) on page 3-54 for details of the dialog usedfor creating a new project file.• See Add Files (Project menu) on page 3-26 for details on the dialog used to addfiles from the Project menu.NoteRepository and LISA files are always processed in the order they occur in the projectfile (*.sgproj) and sub-repository files (*.sgrepo). You can change the order of files andrepositories in the File List view in the Component window by clicking and using thecontext menu to move the item up or down, or clicking and dragging the item to its newposition. See File processing order on page 1-9.To add a file using the Component window context menu:1. Select Components, Protocols, or Files tab in the Component window to selectthe type of file to add.NoteIf you selected the Files tab and you are adding a file at the top level, select thetop entry in the list.If you are adding a file to an existing repository, select the repository file in thelist.2. Right-click in the Component window and select Add or Add New from thecontext menu:Add The Add Existing File dialog is displayed.Navigate to the location of the file and select it.Add New The Add New File dialog is displayed.Navigate to the directory to contain the new file and enter a name forthe file.3. Click Open to add the file and close the dialog.If you have added a library file, that is, a file with a .lib or .a extension, you must alsospecify the build actions and platform for the library. See File/Path Properties dialogon page 3-46.3-24 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceNoteYou can use the Recently selected files dropdown list on the dialog to display files thathave been added to other projects. To remove a file from the list, move the mouse cursorover the file name and press the Delete key or right click and select Remove from listfrom the context menu.3.3.1 Using environment variables in file namesUsing environment variables in file names enables switching to new repository versionswithout the requirement to modify the project. For example, use$(PVLIB_HOME)/etc/sglib.sgrepo as the reference to the components of the <strong>Fast</strong> <strong>Model</strong>Portfolio to enable migrating to future version of this library by simply modifyingenvironment variable PVLIB_HOME.The path of a file can be edited through the File Properties dialog as listed in File/PathProperties dialog on page 3-46. Select Properties from the context menu activatedwhile the file is selected. The file path can be modified by editing the File entry.NoteOn Windows, you can use Unix syntax to define environment variables and paths. Thismeans $PVLIB_HOME/etc/my.sgrepo is valid on Windows.3.3.2 Assigning libraries and compiler option for platformsYou must assign the operating system that a library is built for and specify the compilersthat can be used to build the library. For Windows libraries it might also necessary todistinguish between Debug and Release versions.Use the File Properties dialog to specify the operating system and compilers bychecking the appropriate boxes in the Supported platforms panel as described inFile/Path Properties dialog on page 3-46.See Project Settings dialog on page 3-75 for information on specifying compiler andbuild options for the project.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-25ID031910Non-Confidential
System Canvas Reference3.4 Add Files (Project menu)NoteJapanese or Korean characters must not be used in project filename paths, as they canlead to failure to find the specified libraries.Select Add File from the Project menu to add a new file to the project. See Figure 3-4.NoteRepository and LISA files are always processed in the order they occur in the projectfile (*.sgproj) and sub-repository files (*.sgrepo). You can change the order of files andrepositories in the File List view in the Component window by clicking and using thecontext menu to move the item up or down, or clicking and dragging the item to its newposition. See File processing order on page 1-9.On Windows, the direction of the slash characters separating directories appears to bereversed. You can enter slash characters in either direction but they are displayed asforward slash (/ ) in all cases. This does not affect operation.Figure 3-4 Add Files dialogThe behavior of this dialog is identical to the Add Existing Files dialog described in AddExisting Files and Add New File dialogs (Component window) on page 3-23.If a new file is currently being edited in the Source tab, select Add Current File fromthe Projects menu to immediately add the file to the project. No dialog is displayed.3-26 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceNoteYou can use the Recently selected files dropdown list on the dialog to display files thathave been added to other projects. To remove a file from the list, move the mouse cursorover the file name and press the Delete key or right click and select Remove from listfrom the context menu.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-27ID031910Non-Confidential
System Canvas Reference3.5 Add Connection dialogThe Add Connection dialog enables adding a connection to a component port. Todisplay the dialog in Figure 3-5:• Select a component port.• Display the Port Properties dialog by selecting Object Properties from thecontext menu or by selecting Object Properties from the Object menu.• Click the Add Connection button on the Port Properties dialog.The enabled fields for the dialog depend on whether a slave or master was displayed inthe Port Properties dialog. The controls are the same as the Edit Connection dialog butthis dialog adds a new connection instead of modifying an existing connection. See EditConnection dialog on page 3-45.NoteThis dialog is also displayed if the cursor is used in connect mode to connect two portsin the Block Diagram area and one or more of the ports is a port array.Figure 3-5 Add Connection dialog3-28 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference3.6 Component Instance Properties dialogTo display the properties for a component you can either:• select a component in the Block Diagram and then click on the Properties buttonin the toolbar• select a component in the Block Diagram and select Object Properties from theObject menu.NoteThe following additional properties dialogs are also available:Component <strong>Model</strong> PropertiesThe properties for the top-level component. See Component <strong>Model</strong>Properties dialog for system on page 3-34.Repository Component PropertiesThe properties for component in the Components list. See ComponentProperties dialog for a library component on page 3-40.Self Port PropertiesThe properties for a self port in the top-level component. See Self Portdialog on page 3-98.Port PropertiesThe properties for a self port in an individual component. See PortProperties dialog on page 3-60.Label PropertiesThe properties for a label. See Label Properties dialog on page 3-52.Protocol PropertiesThe properties for a protocol. See Protocol Properties dialog onpage 3-94.The Component Instance Properties dialog has the following tabs:General tabThis tab displays the component name, instance name, file name andpath, and repository. See Figure 3-6 on page 3-30.The Instance name field is editable. To change the name of a componentinstance, enter the new name in the field.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-29ID031910Non-Confidential
System Canvas ReferenceFigure 3-6 Component Instance Properties dialog, General tabNoteTo view the properties of the top-level component, double-click in anarea of the Workspace window that does not contain a component.On Windows, the direction of the slash characters separating directoriesappears to be reversed. You can enter slash characters in either directionbut they get displayed as / in all cases. This does not affect operation.Properties tabThis tab displays all properties for the selected component. SeeFigure 3-7 on page 3-31. If the properties for the instance of thecomponent in the workspace are not editable, the tab is labeledProperties (read only).If the property is a Boolean variable, a checkbox is displayed next to theproperty.3-30 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceFigure 3-7 Component Instance Properties dialog, Properties tabParameters tabThis tab displays all editable parameters for this component. SeeFigure 3-8. To modify the parameter, enter a new value in the Value editbox.Figure 3-8 Component Instance Properties dialog, Parameters tabThe following controls are present on the Parameters tab:Parameter nameThis list contains the parameters for this component.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-31ID031910Non-Confidential
System Canvas ReferenceValueSelect a parameter and then click the text box in the Valuecolumn to set the default value for the component parameter.Integer parameters in decimal format can contain the binarymultiplication suffixes listed in Table 3-2. These left-shift thebits in parameter value by the corresponding power of two.Table 3-2 Suffixes for parameter valuesSuffix Name MultiplierK Kilo 2 10M Mega 2 20G Giga 2 30T Tera 2 40P Peta 2 50Ports tabThis tab displays all ports present in this component. See Figure 3-9 onpage 3-33.For port arrays, all of the individual ports or only the port array name canbe displayed by selecting Show as Expanded or Collapsed.The properties of individual ports can be edited:1. Select a port from the list.2. Click Edit to change the properties of the port.3. Click OK to save the changes.NoteIf you click OK, the changes are applied immediately.Individual ports can be enabled or disabled with the checkboxes:• Click Show selected ports to display the ports that have a check.• Click Hide selected ports to hide ports that have a check.NoteIf the top level of a port array is hidden, all of the individual portsare hidden but they retain their check mark setting.If the port array is expanded and not hidden, individual ports canbe either shown or hidden.3-32 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceFigure 3-9 Component Instance Properties dialog, Ports tabMethods tabThis tab displays all of the methods, that is, component functions, that areimplemented by the selected component. See Figure 3-10.Figure 3-10 Component Instance Properties dialog, Methods tab<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-33ID031910Non-Confidential
System Canvas Reference3.6.1 Component <strong>Model</strong> Properties dialog for systemSelect a blank area in the Block Diagram view and right-click and select ObjectProperties from the context menu to display the properties for the system. If nocomponent is selected, you can select Object Properties from the Object menu.The dialog has the following tabs:General tabThis tab displays the system name, file name and path, and repository asshown in Figure 3-11.The Component name field is editable. To change the name of thesystem, enter the new name in the field.NoteOn Windows, the direction of the slash characters separating directoriesappears to be reversed. You can enter slash characters in either directionbut are displayed as / in all cases. This does not affect operation.Figure 3-11 Component <strong>Model</strong> Properties dialogProperties tabThis tab displays all properties for the system as shown in Figure 3-12 onpage 3-35. If a component can have a specific property, but it is not usedin this component instance, the box next to the property is unchecked.3-34 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceChanges made in these dialogs result in changes to the LISA code in themodel.Figure 3-12 Component <strong>Model</strong> Properties dialog, Properties tabDouble-click in the Value column to change the property.The available properties are listed in Table 3-3:Table 3-3 Component propertiesProperty ID Default DescriptionComponent name component_name "" A string containing the name for the component.ComponentcategoryComponentdescriptionComponentdocumentationcomponent_type "" A string describing the type of component. This can be"Core", "Bus", "Memory" or any free form category text.description "" A textual description of the component.documentation_file "" Path to a file or http link containing documentation on thecomponent. A path to a file can be absolute or relative tothe directory containing the LISA file for the component.Supported file formats are pdf, txt, and html.Executes software executes_software 0 This property indicates that the component executessoftware and that application files can be loaded into thistype of component. This typically has to be set to 1 forCPU-like components and to 0 for all other components.The default is 1 for Core Generator generated cores and 0for all other components.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-35ID031910Non-Confidential
System Canvas ReferenceProperty ID Default DescriptionTable 3-3 Component properties (continued)Has CADIinterfacehas_cadi 1 If set to 1 a CADI interface is generated for thiscomponent allowing to connect to the target with a CADIcompliant debugger. If set to 0 no CADI interface will begenerated for this component.Icon pixmap file icon_file "" The name of the file that contains the icon, in xpm format,for this system. This icon can be used in hierarchicalsystems.Single steppedmodeis_single_stepped 0 The default of 0 has to be used for systems using thebatch-event-based scheduler, i.e. systems containing CTcores. This must be set to 1 for cycle-based systems wherebehavior step must be called on every cycle.License feature license_feature "" The license feature string required to run this systemmodel.Load file extension loadfile_extension "" Application filename extension for this target. Example:".elf" or ".elf;*.hex"Supports Save andRestoreSmall icon pixmapfilesave_restore 0 True if the system supports save and restore.small_icon_file "" The name of the file that contains the 12x12 pixel icon, inxpm format, for this system.Component version version "1.0" Version of the component.Parameters and properties that are integers displayed in decimal formatcan have the K, M, G, T, and P binary multiplier suffixes listed inTable 3-2 on page 3-32.Parameters tabThis tab displays the parameters for the system. See Figure 3-13 onpage 3-37.3-36 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceFigure 3-13 Component <strong>Model</strong> Properties dialog, Parameters tabThe Parameters tab contains the following controls:Parameter nameThis column contains the parameters for this component.Value Select a parameter and then click the text box in the Valuecolumn to set the default value for the component parameter.Integer parameters in decimal format can contain the binarymultiplication suffixes listed in Table 3-2 on page 3-32. Theseleft-shift the bits in parameter value by the correspondingpower of two.Parameter ID in LISA codeThis column contains the LISA ID for the componentparameters.Add Click to add a new parameter to the selected component.Edit Select a parameter and then click to change the name of anexisting component parameter. See Figure 3-14 on page 3-38.Delete Select a parameter and then click to delete the componentparameter.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-37ID031910Non-Confidential
System Canvas ReferenceFigure 3-14 Add Component Parameter dialogPorts tabThis tab displays all external ports present in the system. See Figure 3-15on page 3-39.If a port contains an array of ports, the Size column displays the numberof ports in the array.Individual ports can be enabled or disabled with the checkboxes:• Click Show selected ports to display the ports that have a check.• Click Hide selected ports to hide ports that have a check.3-38 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceFigure 3-15 Component <strong>Model</strong> Properties dialog, Ports tabMethods tabThis tab displays the LISA prototypes that are available for the selectedcomponent. The list is for reference only and cannot be edited.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-39ID031910Non-Confidential
System Canvas Reference3.7 Component Properties dialog for a library componentSelect a component from the Components list and right-click and select Propertiesfrom the context menu to display the properties for the selected component. You canalso select a component and then select Object Properties from the Object menu.NoteIf a component is not selected, selecting Properties from the context menu or ObjectProperties from the Object menu displays the properties for the entire model. SeeComponent <strong>Model</strong> Properties dialog for system on page 3-34.The General tab shown in Figure 3-16 on page 3-41 displays the following:Component nameThe name of the component.Type The component category as, for example, Core or Peripheral.Version The revision number for the component.File The file that defines the component.NoteOn Windows, the direction of the slash characters separating directoriesappears to be reversed. You can enter slash characters in either directionbut they get displayed as / in all cases. This does not affect operation.Repository The repository that contains the reference to the file path.Description Descriptive information that was added when the component was addedto the project.3-40 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceFigure 3-16 Component Properties dialog for SerialCharDoublerClick the other tabs to display read-only information about the component:Properties Any properties that can be used with the component. See Figure 3-17.Figure 3-17 Component Properties dialog, Properties tab<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-41ID031910Non-Confidential
System Canvas ReferenceNoteThe properties of a component in the Components list cannot bemodified. To display the dialog, select Object Properties from theObject menu.The license_feature property identifies the license feature string that isrequired to use this component in a virtual platform model.Parameters Any parameters that have been defined for the component. SeeFigure 3-18.PortsFigure 3-18 Component Properties dialog, Parameters tabAny ports that are present in the component. See Figure 3-19 onpage 3-43.3-42 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceFigure 3-19 Component Properties dialog, Ports tabNotePort arrays are displayed as the array name only. Individual ports in thearray cannot be expanded and viewed.MethodsThis tab displays the LISA prototypes of methods, that is, behaviors, thatare available for use by the selected component. The list is for referenceonly and cannot be edited.Figure 3-20 Component Properties dialog, Methods tab<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-43ID031910Non-Confidential
System Canvas Reference3.8 Connection Properties dialogTo display connection properties, double click on a connection between components inthe Workspace window. The dialog shown in Figure 3-21 has the following fields:Name The name of the port.Type The type of port and the protocol used.Figure 3-21 Connection Properties dialogTo change the address mapping, click either Master Port Properties or Slave PortProperties. The Port Properties dialog for the port is displayed as described in PortProperties dialog on page 3-60.3-44 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference3.9 Edit Connection dialogTo change the connected port or the address mapping, select a connection from the PortProperties dialog and click Edit Connection.... The resulting dialog, shown inFigure 3-22, has the following controls:Component The source component if a slave port was displayed in the Port Propertiesdialog or the destination component if a master port was displayed in PortProperties.Port The master port for the connection if a slave port was displayed in thePort Properties dialog or the slave port for the connection if a master portwas displayed in Port Properties.Array index If the port selected in the Port field is a port array, enter an index valueto specify which of the elements of the array is used for the connection.Enable address mappingIf this box is checked, the port address range is determined by the valuesin the Start and End boxes.Start The start address port the port.End The end address for the port.Size The size of the address region. If the Start and End values are entered,this value is calculated automatically. If the Size value is entered, the Endvalue is calculated automatically.OK/Cancel After specifying the port and address, click OK to modify the connection.Click Cancel to close the dialog without changing the connection.Figure 3-22 Add/Edit Connection Mapping dialogThe LISA statement field shows the code that matches the entered address ranges.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-45ID031910Non-Confidential
System Canvas Reference3.10 File/Path Properties dialogThe File/Path Properties dialog shown in Figure 3-23 displays properties for the file andlets you specify build and compile options. For details of how the settings made fromthis dialog affect the project file, see Alphabetical list of project parameter IDs onpage 3-85.NoteOn Windows, the direction of the slash characters separating directories appears to bereversed. You can enter slash characters in either direction but they are always displayedas forward slashes (/). This does not affect operation.Figure 3-23 File/Path Properties dialog, General tabSelect a component from the Component window Files tab, right click to open thecontext menu, then click Properties to display the properties for the selected file.The General tab contains:File or path The name of the file.3-46 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceNoteThe File Properties dialog is modeless. A different file can be selectedwithout closing the dialog. If, however, any of the properties for thepreviously selected file have been modified, a warning message isdisplayed to prompt you to save the changed contents for the current filebefore displaying the properties for the selected file.Absolute pathThe full path to the file.RepositoryTypeInfoThe repository file that contains this component entry.A brief description of the component type.The status of the file. For example, file does not exist.Supported platformsSelect the platforms that the component will support:• Linux• Win32 Release run-time library• Win32 Debug run-time library.CompilerSelect the compiler to use to compile this component. The Compilerdropdown list enables you to specify the preferred compiler as:• no preference• Microsoft Visual C++ 2005 SP1• Microsoft Visual C++ 2008• gcc version found in $PATH at compile time• gcc-3.4 - gcc version 3.4.3• gcc-4.1 - gcc version 4.1.2<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-47ID031910Non-Confidential
System Canvas ReferenceFigure 3-24 File/Path Properties dialog, Build actions tabThe Build actions tab enables assigning actions to selected files:Default actions depending on file extensionThe actions are determined by the extensions:.lisaa LISA source file that is parsed by simgen..c .cpp .cxxa C or C++ source file that is compiled..a .o an object file that is linked on Linux..lib .obj an object file that is linked on Windows.directory_path/is an include directory that is added to the search path used bythe compiler.All other files except for .lisa, .sgproj, and .sgrepoa deploy file and is copied to the build directory.IgnoreExcludes the selected file from build and deploy. This can be useful forexamples, notes, or temporarily disabled files.3-48 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceCustomize actionsThe file extension is ignored. Use the check boxes to specify the actionas one or more of:LISA - input file passed to Simulator Generator as LISAThe file is passed to the Simulator Generator as a LISA file.This option must not be selected if the file is not written inLISA.Compile - compile as C/C++ source codeThe file is added to the list of files that are compiled as C/C++code during the build process.Link - input file for linkerThe file is linked with the object code during the build process.Deploy - copy to build directoryThe file is copied into the build directory. This option can beused, for example, to add dynamic link libraries that arerequired to run the generated system model.Include path - add the file’s path to additional include directoriesThe path of the parent directory that holds the file is added tothe list of additional include directories for the compiler.Library path - add the file’s path to additional library directoriesThe path of the parent directory that holds the file is added tothe list of additional library directories for the compiler.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-49ID031910Non-Confidential
System Canvas Reference3.11 Find and Replace dialogsThe Find and Replace dialog enables you search for, and optionally replace, text in aneditor window. Essentially it is the same dialog in two modes, find only, and find andreplace. You can switch modes by clicking the Find mode or Find and replace modebuttons in the dialog. By default, matches are case sensitive but matches can appear aspart of longer words. You can change the default behavior by setting or clearing therelevant checkboxes in the dialog.The Find dialog, shown in Figure 3-25, is opened by clicking Search → Find... in themain menu. Type the text to find in the box and click the Find Next or Find Previousbuttons to search upwards or downwards from the current cursor position. You canre-use previous search terms by clicking on the drop-down arrow on the right of the textentry box.Figure 3-25 Find dialogThe Find and Replace dialog, shown in Figure 3-26 on page 3-51, is opened by clickingSearch → Replace in the main menu. You can replace the current match with new textby clicking the Replace button, or all matches by clicking the Replace All button. Youcan re-use previous find or replacement terms by clicking on the drop-down arrow onthe right of the text entry boxes.3-50 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference3.12 Label Properties dialogUse the Label Properties dialog to change the text and display properties for a label. SeeFigure 3-27. Double-click on a label to display the dialog. Select Add Label from theObject menu to add a label to the component.The dialog has the following controls:Figure 3-27 Label Properties dialogLabelFontSpecify the text to display on the label.The text font. Click Select Font... to change it.Select Text Color...Click to select a color for the text.Select Background Color...Click to select the background color for the label.3-52 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceCheck Transparent Background to enable objects behind the label to bevisible. If this box is selected, the background color setting is ignored.HorizontalVerticalRotationSelect the required horizontal justification for the label text.Select the required vertical justification for the label text.Select the required orientation for the label.Frame ThicknessSelect the required thickness of the label border.Shadow ThicknessSelect the required thickness of the label drop shadow.Display on TopCheck to display the label on top of any components below it.Use these settings as defaultCheck to use the current settings as the default settings for any newlabels.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-53ID031910Non-Confidential
System Canvas Reference3.13 New File dialog (from File menu)Use the New File dialog to create a new project or LISA source file. Select New Filefrom the File menu or click the New button to display the dialog in Figure 3-28.The dialog has the following controls:Figure 3-28 New File dialogLook inSpecify the directory for the new file in this text box.NoteJapanese or Korean characters must not be used in project filename paths,as they can lead to failure to find the specified libraries.On Windows, the direction of the slash characters separating directoriesappears to be reversed. You can enter slash characters in either directionbut they get displayed as / in all cases. This does not affect operation.File nameFile typeAdd toSelectEnter the name for the new file in this box.The file type:• If a project is not already open, this box will display .sgproj bydefault to enable creating a new project.• If a project is open, this box will display .lisa by default to enablecreating a new LISA source file.If the selected file type is not .sgproj, this control is enabled and thecreated file will be added to the currently open project.Click Select to accept the name and path. Click Cancel to close the dialogwithout creating a new file.3-54 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceIf the new file is of type .sgproj, you are prompted for the top level LISAfile. See Select Top Component LISA File dialog on page 3-57.NoteIf an existing file is selected, you are prompted whether to replace theexisting file with a new file of the same name.Attempting to add multiple files that are already part of the project resultsin a warning message and the existing project files are not replaced.NoteYou can use the Recently selected files dropdown list on the dialog todisplay files that have been added to other projects. To remove a file fromthe list, move the mouse cursor over the file name and press the Deletekey or right click and select Remove from list from the context menu.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-55ID031910Non-Confidential
System Canvas Reference3.14 New Project dialogsSelect New Project from the File menu to display the New Project dialog and create anew project. See Figure 3-29.The dialog has the following controls:Figure 3-29 New Project dialogLook inSpecify the directory to hold the new project file in this box.NoteJapanese or Korean characters must not be used in project filename paths,as they can lead to failure to find the specified libraries.On Windows, the direction of the slash characters separating directoriesappears to be reversed. You can enter slash characters in either directionbut they get displayed as / in all cases. This does not affect operation.File nameFile typeSelectEnter the name for the new project in this box.If you select an existing file, the new project replaces the existing project.The drop down menu selects the files that are displayed in the file list.This is useful if it is necessary to replace an existing file or use a similarname for the project. The default type for <strong>Fast</strong> <strong>Model</strong>s projects is .sgproj.Click Select to accept the project name and path. Click Cancel to closethe dialog without creating a new project.If an existing project is selected, you are prompted to replace the existingproject with a new project of the same name.3-56 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceNoteThe path to the model repositories that are currently specified by the Default <strong>Model</strong>Repositories section of the Preferences dialog is included in the project file. Moreinformation on specifying repositories is given later. See Default <strong>Model</strong> Repository onpage 3-70.3.14.1 Select Top Component LISA File dialogAfter clicking Select in the New Project dialog, the Select Top Component LISA Filedialog is displayed as shown in Figure 3-30. By default, the file name for the top-levelLISA file is the same as the project name. You can, however, specify a different namein this dialog.NoteOn Windows, the direction of the slash characters separating directories appears to bereversed. You can enter slash characters in either direction but they are always displayedas forward slash (/ ). This does not affect operation.Figure 3-30 Select Top Component LISA File dialog<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-57ID031910Non-Confidential
System Canvas Reference3.15 Open File dialogUse the Open File dialog shown in Figure 3-31 to open a project file, LISA source file,or text document.To display the dialog, either:• select Open File from the File menu• select a file in the Component window and select Open from the context menu.NoteJapanese or Korean characters must not be used in project filename paths, as they canlead to failure to find the specified libraries.On Windows, the direction of the slash characters separating directories appears to bereversed. You can enter slash characters in either direction but they are always displayedas forward slashes (/ ). This does not affect operation.The dialog has the following controls:Figure 3-31 Open File dialogLook inFile nameFile typeOpenSpecify the directory that contains the file.Enter the name of the file to open in this box.Select the type of file to filter for.Click Open to open the file. Click Cancel to close the dialog withoutopening a file.Open project file as text in source editorThis box is enabled if the selected file is not of type .lisa or.sgproj.Check the box to open the file as a plain text file in the Source window.3-58 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceNoteIf an .sgproj file is selected and this box is not checked, the project willbe loaded. All changes to.sgproj files are normally done through theProject menu.You can use this option for a .sgproj to, for example, manually edit thelist of repositories that are used by the project. Changes that are manuallymade to.sgproj files do not take effect until the file has been closed andreopened.NoteYou can use the Recently selected files dropdown list on the dialog to display files thathave been added to other projects. To remove a file from the list, move the mouse cursorover the file name and press the Delete key or right click and select Remove from listfrom the context menu.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-59ID031910Non-Confidential
System Canvas Reference3.16 Port Properties dialogThe Port Properties dialog in Figure 3-32 can be displayed by selecting a port or aconnection:• Select a component port in the Block Diagram view and do one of the following:— double-click on the port— click the Properties button— select Object Properties from the Object menu— right-click and select Object Properties from the context menu.• Select a connection in the Block Diagram view and display the ConnectionProperties dialog. See Connection Properties dialog on page 3-44. To display thePort Properties dialog either:— click the Master Port Properties button to display the properties for themaster port.— click the Slave Port Properties button to display the properties for theslave port.Figure 3-32 Port Properties dialogThe dialog contains the following controls:Name The name of the port.Type The type of port and the protocol used.Size If the port is a port array, the number of elements is displayed.Index If the port is a port array, enter a value in the text box and click Refreshto display only the specified element of the port array.If the port array was expanded and an individual port was selected, thisbox displays the index for the selected port.3-60 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferencePort connectionsThis section displays the connections to the port:• To sort the connections, click on one of the column headings.To change the priorities to match the current sort order, clickReorder Priority. The priority numbers are updated to reflect thecurrent order in the list.• To change the connected port or address mapping, select aconnection from the list and click Edit Connection.• To add a connection, select a connection from the list and click theAdd Connection button.• To delete a connection, select the connection from the list and clickthe Remove button.• To change the priority of a single connection, select the connectionfrom the list and click either the Increase Priority or DecreasePriority buttons. The list is refreshed to show the new order.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-61ID031910Non-Confidential
System Canvas Reference3.17 Preferences dialogUse the Preferences dialog to configure the working environment of System Canvas.Select Preferences from the File menu to display the dialog. See Figure 3-33.Figure 3-33 Preferences dialogThe left side of the dialog displays the preferences that can be set from this dialog. Seethe following sections for more details on the options:• Appearance on page 3-63• Applications on page 3-64 on page 3-63• Fonts on page 3-69 on page 3-63• Default <strong>Model</strong> Repository on page 3-70 on page 3-63• Suppressed Messages on page 3-73 on page 3-63• Verbose Messages on page 3-74. on page 3-633-62 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference3.17.1 AppearanceThis group, shown by default when the Preferences dialog is opened, contains checkboxes that enable you to modify the appearance of the application:Show Tool TipsSelecting this option turns on the display of all tool tips within theapplication. The default setting is on.Display tool bar text labelsThis option toggles the display of the status bar labels.Word wrap in source windowsThis option toggles wrapping long lines to display within the sourcewindow. If off, the scroll bar must be used to read or edit long lines.Show splash screen on startupThis option enables you to toggle between showing the splash screen onstartup. The default setting is on.Reload recent layout on startupThis option reloads the layout settings that were used for the last modifiedproject.Recent files and directoriesThis option lets you set the maximum number of directories and filesshown in System Canvas file dialogs and menus. You can display up to32 directories and 16 files in your history.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-63ID031910Non-Confidential
System Canvas Reference3.17.2 ApplicationsThe Applications group is shown in Figure 3-34.Figure 3-34 Preferences dialog, ApplicationsNoteOn Windows, the direction of the slash characters separating directories appears to bereversed. You can enter slash characters in either direction but are displayed as / in allcases. This does not affect operation.On Windows, environment variables are displayed as $MAXxxxx_HOME. You can use thisformat instead of %MAXxxx_HOME%.Use this entry to display the settings for application paths:Simulator Generator ExecutableUse the SimGen control to select the path to the SimGen.exe file.3-64 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceUse the Command arguments control to specify additional commandline options. See Appendix C Building System <strong>Model</strong>s in Batch Mode.<strong>Model</strong> Debugger ExecutableUse the <strong>Model</strong> Debugger control to select the path to the <strong>Model</strong>Debugger executable.Use the Command arguments control to specify additional commandline options. See the <strong>Model</strong> Debugger <strong>User</strong> <strong>Guide</strong>.NotePrevious versions of System Generator used the $MAXCORE_HOME variableto specify the path for both the System Canvas and <strong>Model</strong> Debuggerapplications.The separate path specifications enable using different versions of <strong>Model</strong>Debugger and provide more flexibility for installing <strong>Model</strong> Debuggerseparately from System Canvas.<strong>Model</strong> Shell ExecutableUse the <strong>Model</strong> Shell control to select the path to the <strong>Model</strong> Shellexecutable.Use the Command arguments control to specify additional commandline options. See the <strong>Model</strong> Shell <strong>User</strong> <strong>Guide</strong>.NoteCheck Run <strong>Model</strong> Shell asynchronously to enable starting a separate<strong>Model</strong> Shell instance with its own output window.Select the Run in <strong>Model</strong> Shell entry on the Projects menu to startsimulation.Path to Microsoft Visual C++ .NET application ‘devenv.com’Use the browse controls to select the paths to the Microsoft Visual C++.NET devenv.com file for either the 2005 or the 2008 versions. This pathis used for building the model and for displaying the developmentenvironment.See Project Settings dialog on page 3-75 for details on how to specify thecompiler to use for different models.Click Reset to Defaults to reset the application paths. After changing a path, clickApply to save the changes.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-65ID031910Non-Confidential
System Canvas ReferenceNoteFor Linux, you cannot configure the gcc C++ complier that builds the model. TheSimulator Generator uses the gcc found in the search path. Make that the version of thisgcc matches the gcc version configured in the the used configuration.NoteThe appearance of this dialog is different for the Linux version of System Canvas asshown in Figure 3-35:Figure 3-35 Preferences, Applications for LinuxIf Run <strong>Model</strong> Shell asynchronously is checked, the following command line is used:xterm -e optional_command_arguments_list -m model.soYou can use Host Debugger Command Line to specify command-line options. Thedefault text is:xterm -e gdb --args %ISIM%3-66 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Referencewhere %ISIM% is a placeholder for the isim_system executable file.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-67ID031910Non-Confidential
System Canvas Reference3.17.3 External <strong>Tools</strong>The External <strong>Tools</strong> Preferences dialog is shown in Figure 3-36.Figure 3-36 Preferences dialog, External <strong>Tools</strong>NoteThe use operating system file associations checkbox is only available on Windows,and is selected by default. This inactivates the external tool edit fields and buttons. Toactivate these fields, clear the checkbox.The default external tools are different on Linux.Use these settings to configure the tools used to display <strong>Fast</strong> <strong>Model</strong>s documentation.Documentation is accessible through:• the System Canvas Help menu item. You can access the PDFs for the SystemCanvas and <strong>Fast</strong> Portfolio books this way.3-68 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference• the documentation_file property in a component property listing. This propertycan point to a PDF, a text file, an HTML file, or http:// link.You can change the default external tools used to access the documentation. Click onthe folder icon to open a browser, or use the drop down list to choose a previouslyselected executable.3.17.4 FontsThe Font settings preferences dialog is shown in Figure 3-37.Figure 3-37 Preferences dialog, FontsUse the controls in the Font panel to select font type and size for text displayed in theapplication windows:Application This font is used in the application window.Base fixed fontThis font is used for text in the Source view of the Workspace window.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-69ID031910Non-Confidential
System Canvas ReferenceBlock Diagram Component NameThis font is used in component title blocks in the Block Diagram window.Fonts depend on $DISPLAY variableCheck this box to use the font specified in the $DISPLAY variable.Reset to base sizeSelect a new font size from the spin control and click this button to resetall fonts sizes to the selected value.Reset to defaultsClick this button to reset all the fonts back to the factory settings.NoteIf non-Latin characters are used in LISA code, the font selected for Source windowsmust support the character set used in the code. The default font might not supportnon-Latin characters.3.17.5 Default <strong>Model</strong> RepositoryUse this section to specify the <strong>Model</strong> Libraries that are added by default to new projects.See Figure 3-38 on page 3-71.NoteThe selected model repositories are added to a project when it is created. Changing therepository settings after a project has been created has no effect on the project.The paths to the repositories are hard coded into the project_name.sgproj file. To changethe repositories for an existing project, open the file and edit the path.On Windows, the direction of the slash characters separating directories appears to bereversed in the GUI. You can enter slash characters in either direction but they getdisplayed as / in all cases. This does not affect operation.Use environment variables, such as $(PVLIB_HOME), to enable the same project file to beused on different workstations.3-70 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceThe dialog has the following controls:Figure 3-38 Preferences dialog, <strong>Model</strong> RepositoryAdd Click the Add button to open a file selection dialog shown in Figure 3-39on page 3-72 and add a new sgrepo repository file to the list. A repositoryfile contains:• a list of components• the path to the LISA source for the component• a list of library objects for the components.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-71ID031910Non-Confidential
System Canvas ReferenceFigure 3-39 Add <strong>Model</strong> Repository FileA repository file can also consist of lists of paths to other repository files.This enables a hierarchical repository structure.Select a directory to add all of the repositories in that directory to the listof repositories searched for components.RemoveEditSelect a repository and click Remove to exclude the selected repositoryfrom new projects. The repository itself is not affected.The default repository $(PVLIB_HOME)/etc/sglib.sgrepo cannot bedeleted.Select a repository and click Edit to edit the path to the selectedrepository.The path to the default repository $(PVLIB_HOME)/etc/sglib.sgrepocannot be edited.File checkboxesCheck the box to automatically include the repository in all new projects.Uncheck the box to prevent automatically including the repository in newprojects, but keep the path to the repository available for later use.Up/DownUse the Up and Down buttons to change the order of repositories. Fileprocessing is based on the repository order.Default Repositories can also contain a set of default configuration settings for one ormore configurations. The values of these settings are appended to the correspondingdefault configuration values for all new projects. This mechanism enables presettingconfiguration parameters that are required by all projects that use the specified defaultmodel library. The following settings are affected:• Additional Include Directories3-72 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference• Additional Compiler Settings• Additional Linker Settings.NoteTo enable using models from the <strong>Fast</strong> <strong>Model</strong> Portfolio in new projects immediatelywithout being forced to add a default repository, the default entry$(PVLIB_HOME)/etc/sglib.sgrepo is present when System Canvas is started. This entrycannot be deleted. You can however uncheck the box next to the default path if you donot require the default repository in your new project.3.17.6 Suppressed MessagesUse this section to suppress display of the selected messages. See Figure 3-40.Figure 3-40 Preferences dialog, Suppressed MessagesTo enable a suppressed message, select it in the list, then click Enable selectedmessages.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-73ID031910Non-Confidential
System Canvas Reference3.17.7 Verbose MessagesUse this section to control message display. See Figure 3-41.Use the radio buttons to control message output:None Disable all verbose messages.Selective Enable messages that are checked in the list.All Enable all verbose messages.Figure 3-41 Preferences dialog, Verbose Messages3-74 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference3.18 Project Settings dialogClick the Settings button to display the project settings and customize the generationprocess or edit the LISA code of components. The default view is shown in Figure 3-42.Figure 3-42 Project Settings dialog3.18.1 Project top-level settingsThe top part of the dialog enables you to configure project build options:Top level componentThe Top Level Component defines the root component of the system.Each component in a system can be set as the top component to buildmodels from functional sub-blocks of a system.The top level component can be set in the Project Settings Dialog by oneof the following methods:• Enter the name into the Top Level Component edit box• Click Use Current to use the component currently selected in theworkspace as the top component• Click Select From List to open a dialog and select any componentpresent in the system.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-75ID031910Non-Confidential
System Canvas ReferenceConfigurationThe Configuration control enables you to set parameters for the differentconfigurations:• Selecting an entry listed in Configuration drop-down list to useone of the existing configurations.• Click Add New to create and new configuration.A dialog prompts for the name of the new configuration and anoptional description. You can use the Copy values from button toselect a configuration to copy the values from. This can be one ofthe existing configurations or a default set of configurationsettings.• Click Delete to delete the currently selected configuration from thelist of available configurations.The value defaults to the currently selected active configuration.Selecting a configuration in this dialog does not set the configurationdisplayed in the Select Active Project Configuration drop-down box onthe main window. The configuration set in this dialog is stored in theproject file and is used if the system is rebuilt with the specifiedconfiguration. You can use this control to specify the options for all of theconfigurations that you use for a project and simplify switching from oneactive configuration to another.NoteIf you are building your system on Windows, you must ensure thatanyone else using your model system has the appropriate additionalsupport libraries installed on their computer, otherwise the system fails torun:• For a debug build, the appropriate version of Microsoft VisualStudio.• For a release build, the appropriate version of the Microsoft VisualStudio redistributable package.3.18.2 Parameters categoryThe Parameter category panel lists parameters for the selected build option. See thefollowing sections for details of the different display options for parameters in theCategory View tab:• Category View on page 3-77• List View on page 3-843-76 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference• Tree View on page 3-84.For more information on the parameters, see Alphabetical list of project parameter IDson page 3-85.To set the release options for example:1. Click the Category View tab.Select the Windows-Release entry and select the operating system and linkoptions from the Platform/Linkage dropdown menu:• Win32 builds using the release run-time library for Windows• Win32D builds using the debug run-time library for Windows• Linux builds release version for Linux• LinuxD builds debug versions for Linux.2. Select the compiler to use for this configuration from the Compiler dropdownmenu.3. Enter a path into the Build directory field to select the directory where the buildis performed. This directory will contain the source code and the build library forthe system model. If the path is not absolute, it is interpreted as being relative tothe directory that contains the project file.4. The Configuration description text box contains text that indicates theconfiguration options selected for release, compiler, and build directory.Category ViewClick the Category View tab to display the categories in the left pane and text boxes forthe options in the right pane as shown in Figure 3-43 on page 3-78. Select an item in theParameter Category view to display the controls for configuring the correspondingparameters:Top-level configuration detailsSelect the top-most item in the panel to configure the project settings asshown in Figure 3-43 on page 3-78:<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-77ID031910Non-Confidential
System Canvas ReferenceFigure 3-43 Project Settings dialog, Category View top levelThe controls in the right panel correspond to the parameters listed inTable 3-4:Table 3-4 Release parameters in the Category View tabControl nameConfiguration namePlatform/LinkageCompilerConfiguration descriptionBuild directoryParameterCONFIG_NAMEPLATFORMCOMPILERCONFIG_DESCRIPTIONBUILD_DIRSee Alphabetical list of project parameter IDs on page 3-85 for adescription of the available parameters.3-78 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceTargetsSelect the Targets item in the panel to configure the build targets asshown in Figure 3-44:Figure 3-44 Project Settings dialog, Category View TargetsThe controls in the right panel correspond to the parameters listed inTable 3-5:Table 3-5 Target parameters in the Category View tabControl nameIntegrated simulator (isim_system)CADI librarySystemC componentParameterTARGET_ISIMTARGET_MAXVIEWTARGET_SYSTEMCSee Alphabetical list of project parameter IDs on page 3-85 for adescription of the available parameters.DebuggingSelect the Debugging item in the panel to configure the debug options asshown in Figure 3-45 on page 3-80:<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-79ID031910Non-Confidential
System Canvas ReferenceFigure 3-45 Project Settings dialog, Category View DebuggingThe controls in the right panel correspond to the parameters listed inTable 3-6:Table 3-6 Debugging parameters in the Category View tabControl nameEnable model debuggingSource ReferenceVerbosity<strong>Model</strong> Debugger<strong>Model</strong> ShellParameterENABLE_DEBUG_SUPPORTGENERATE_LINEINFOVERBOSITYMODEL_DEBUGGER_COMMAND_LINEMODEL_SHELL_COMMAND_LINESee Alphabetical list of project parameter IDs on page 3-85 for adescription of the available parameters.3-80 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceSim GeneratorSelect the Sim Generator item in the panel to configure the debugoptions as shown in Figure 3-46:Figure 3-46 Project Settings dialog, Category View Sim GeneratorYou can add additional command-line options in the SimGen options textbox. The SIMGEN_COMMAND_LINE parameter is set to the text in the box.CompilerSelect the Compiler item in the panel to configure the compiler optionsas shown in Figure 3-47 on page 3-82:<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-81ID031910Non-Confidential
System Canvas ReferenceFigure 3-47 Project Settings dialog, Category View CompilerThe controls in the right panel correspond to the parameters listed inTable 3-7:Table 3-7 Compiler parameters in the Category View tabControl namePre-Compile ActionsInclude DirectoriesPreprocessor DefinesCompiler SettingsEnable pre-compilingParameterPRE_COMPILE_EVENTINCLUDE_DIRSPREPROCESSOR_DEFINESADDITIONAL_COMPILER_SETTINGSENBALE_PRECOMPILE_HEADERSee Alphabetical list of project parameter IDs on page 3-85 for adescription of the available parameters.3-82 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceLinkerSelect the Linker item in the panel to configure the linker options asshown in Figure 3-48:Figure 3-48 Project Settings dialog, Category View LinkerThe controls in the right panel correspond to the parameters listed inTable 3-7 on page 3-82:Table 3-8 Linker parameters in the Category View tabControl namePre-Link ActionsLinker SettingsPost-Built ActionsParameterPRE_LINK_EVENTADDITIONAL_LINKER_SETTINGSPOST_BUILD_EVENTSee Alphabetical list of project parameter IDs on page 3-85 for adescription of the available parameters.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-83ID031910Non-Confidential
System Canvas ReferenceList ViewClick the List View tab to display all categories and their parameter values in a singleflat list as shown in Figure 3-49. See Alphabetical list of project parameter IDs onpage 3-85 for a description of the available parameters.Figure 3-49 Project Settings dialog, List ViewTree ViewClick the Category View tab to display all categories and their parameter values in asingle hierarchical list as shown in Figure 3-50 on page 3-85. See Alphabetical list ofproject parameter IDs on page 3-85 for a description of the available parameters.3-84 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceFigure 3-50 Project Settings dialog, Tree View3.18.3 Alphabetical list of project parameter IDsThe configurable parameters for a project configuration are listed in Table 3-9.Parameter name Parameter ID Default DescriptionTable 3-9 Full list of parameters shown in List ViewCompiler Settings ADDITIONAL_COMPILER_SETTINGS "" Operating system-specific additional compilersettings. For Windows consult the Visual .NETdocumentation on the compiler options.Linker Settings ADDITIONAL_LINKER_SETTINGS "" Linker settings specified here are added to thedefault linker flags. For Windows consult theVisual .NET documentation on the compileroptions.Build directory BUILD_DIR "" Build directory. If this is not an absolute path, itis relative to the position of the project file.For Windows, this is typically either./Windows-Debug or ./Windows-Release.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-85ID031910Non-Confidential
System Canvas ReferenceTable 3-9 Full list of parameters shown in List View (continued)Parameter name Parameter ID Default DescriptionCompiler COMPILER "" Compiler to use for this model:“VC2005” for Microsoft VC++2005 SP1“VC2008” for Microsoft VC++2008 SP1“gcc” for first gcc found in search path“gcc-3.4” for gcc version 3.4.3“gcc-4.1” for gcc version 4.1.2ConfigurationdescriptionConfigurationnameEnable modeldebuggingEnable namespacestdEnablepre-compilingCONFIG_DESCRIPTION "" More descriptive form of the configurationspecified in CONFIG_NAME.CONFIG_NAME "" Name of the configuration.ENABLE_DEBUG_SUPPORT "0" If 1 (true) the generated model code allowsdebugging, such as no function inlining. If set to0 (false) the model code is optimized for speed.ENBALE_NAMESPACE_STD "1" Enable use of namespace std:• if 1 (true), using namespace std isgenerated and placed in the code• if 0 (false), you must specify thenamespace. A user-specified namespacemight reduce compilation time.ENBALE_PRECOMPILE_HEADER "0" Enable pre-compiling of headers if true/1.Source Reference GENERATE_LINEINFO "LISA Code(inclheaders)"Controls line redirection in the generated modelsource code:"LISA Code": source code only"LISA Code (incl. headers)": Source and header"Generated Code": No line redirection at all.Additional IncludeDirectoriesINCLUDE_DIRS "" Additional include directories. Multiple entriesmust be separated by a semicolon.<strong>Model</strong> Debugger MODEL_DEBUGGER_COMMAND_LINE "" Additional options to be passed on the commandline.<strong>Model</strong> Shell MODEL_SHELL_COMMAND_LINE "" Additional options to be passed on the commandline.Platform/Linkage PLATFORM - Platform for which this configuration is valid.One of "Linux", "Win32", "Win32D".3-86 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceTable 3-9 Full list of parameters shown in List View (continued)Parameter name Parameter ID Default DescriptionPost-Built Actions POST_BUILD_EVENT "" Commands executed after building the model.Multiple commands must be separated by asemicolon.Pre-CompileActionsPreprocessorDefinesPRE_COMPILE_EVENT "" Commands executed before compilation isstarted. Applies to Windows only. Multiplecommands must be separated by a semicolon.PREPROCESSOR_DEFINES "" Preprocessor defines. Multiple defines must beseparated by semicolon.Pre-Link Actions PRE_LINK_EVENT "" Commands executed before linking is started.Applies to Windows only. Multiple commandsmust be separated by a semicolon.SimGen options SIMGEN_COMMAND_LINE "" Additional options to be passed on the commandline.Integratedsimulator(isim_system)TARGET_ISIM "0" If 1 (true), builds an executable with astatically-linked CADI system.CADI library TARGET_MAXVIEW "1" If 1 (true), build a CADI system dynamic libraryfor running from <strong>Model</strong> Debugger.SystemCcomponentTARGET_SYSTEMC "0" If 1 (true), build a SystemC component library.Verbosity VERBOSITY "Off" Verbosity level. Must be either "Sparse", "On",or "Off".Warnings as errors SIMGEN_WARNINGS_AS_ERRORS "1" If 1 (true), treat LISA parsing and compilerwarnings as errorsSystemCargumentsSystemCexecutableSYSTEMC_COMMAND_LINE "" Command line arguments for System CexecutableSYSTEMC_EXE "" Name of final SystemC Executable. Thisexecutable is called by ‘Run SystemCExeuctable’.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-87ID031910Non-Confidential
System Canvas Reference3.18.4 Project file contentsThe project file is generated from the specified configuration options and describes theoptions used for each platform and the files that are required to build the model. Fileand directory names can be either absolute or relative to the project or repository file.You can use environment variables in file names.CautionFiles and directories are processed in the order they are encountered in the project file.See File processing order on page 1-9 for details.An individual file can have both file and directory actions associated with it. SeeDirectories in path statements on page 3-90.Japanese or Korean characters must not be used in project filename paths, as they canlead to failure to find the specified libraries.File or directory entries in project files can include filters to specify the following buildoptions:Host platformSpecifies the operating system as either:• "Linux"• "Win32" for a release version of the build• "Win32D" for a debug version of the build.CompilerSpecifies the compiler to use as either:• "VC2005" for Microsoft VC++ 2005 SP1• "VC2008" for Microsoft VC++ 2008 SP1• "gcc" for gcc version found in search path (Linux)• "gcc-3.4" for gcc version 3.4.3 (Linux)• "gcc-4.1" for gcc version 4.1.2 (Linux)Additional compiler options might be added in future product versions.NoteFor Linux, the chosen compiler version only effects the files identified bythe project file and repositories as described in File/Path Propertiesdialog on page 3-46. It does not select the gcc version used to build themodel. The Simulator Generator always uses the gcc found in the searchpath instead. To enable the Simulator Generator to automatically selectthe libraries that match the current gcc compiler, use the compiler optiongcc.3-88 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceNoteFor Microsoft VC++2005 and VC++2008, you must have service packone (SP1) installed.ActionSpecifies the action to take for the specified file or directory as one ormore of:• "lisa" to process the file as a LISA file. This action cannot beapplied to directories.• "compile" to process the file as a C++ fileIf a directory is specified, all *.c, *.cpp, and *.cxx files in thedirectory are compiled.• "ignore" to exclude the file or directory from the build and deployprocess, such as a disabled file or project notes.• "link" to link the file with existing files.If a directory is specified, on Windows all *.lib and *.obj files inthe directory are added to the linker input. On Linux, all *.a and *.ofiles are added.• "deploy" to produce a deployable file.If a directory is specified, the entire directory and its subdirectoriesare recursively copied to the destination.Note"deploy" is the only action that acts recursively on subdirectories.• "incpath" to include the directory in the list of include search pathsspecified by the -I option for the compiler. This is the default actionfor a directory.• "libpath" to include the directory in the list of library search pathsspecified by the -L option for the compiler.Note"libpath" is the default action for directories.The build options for the file or directory entries are not case sensitive.For example, the my_file.lib file can specify host, compiler, and action as:path = my_file.lib, platform="WIN32"|"Win32D", compiler="VC2008", action="link"|"deploy";The compiler options cannot be ORed together, but they can be omitted to indicate thatmore than one compiler is permitted:<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-89ID031910Non-Confidential
System Canvas Referencepath = ../src/my_windows_code.cpp, platform = "win32";File entries in the project file can have a compiler filter in addition to the platform andaction filters:path = ../lib/release_2005/my_lib.lib, platform = "win32", compiler="VC2005";path = ../lib/my_lib.lib, platform = "win32", compiler="VC2008";path = ../src/my_windows_code.cpp, platform = "win32"; // both compilers can be usedDirectories in path statementsProject files can contain directories in the path statement. Directories are differentiatedfrom normal files by including the trailing / character. Platform and compiler filtersmight apply.If an action is specified for a file that indicates an action associated with a directory, thedirectory path is formed by removing the file name from the full path.The path specification:path = MyFile.lisa, actions="lisa|incpath|libpath";causes MyFile.lisa to be used as the LISA source and the parent directory forMyFile.lisa to be added to both the include and library search paths.If, for example, MyFile.lisa is in the directory C:/<strong>ARM</strong>/MyProjects/Project_1/, thatdirectory path is added to the include and library search paths.3-90 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceExample project fileExample 3-1 lists a typical project file and shows how the different configurationsections are used.Example 3-1 Typical project filesgproject "VP_DualCore.sgproj"{TOP_LEVEL_COMPONENT = "DualCoreSystem";ACTIVE_CONFIG_LINUX = "Linux-Release-GCC-3.4";ACTIVE_CONFIG_WINDOWS = "Win32-Release-VC2005";config "Linux-Debug-GCC-3.4"{ADDITIONAL_COMPILER_SETTINGS = "-march=pentiumpro -mtune=pentium4 -g -Wall";ADDITIONAL_LINKER_SETTINGS = "-L $(PVLIB_HOME)/lib/Linux_GCC-3.4 -lpthread";BUILD_DIR = "./Linux-Debug-GCC-3.4";COMPILER = "gcc-3.4";CONFIG_DESCRIPTION = "Default Linux configuration for gcc 3.4 with debug info support";CONFIG_NAME = "Linux-Debug-GCC-3.4";ENABLE_DEBUG_SUPPORT = "1";PLATFORM = "Linux";SIMGEN_COMMAND_LINE = "--num-comps-file 10";}config "Linux-Release-GCC-3.4"{ADDITIONAL_COMPILER_SETTINGS = "-march=pentiumpro -mtune=pentium4 -O3 -fomit-frame-pointer -Wall";ADDITIONAL_LINKER_SETTINGS = "-L $(PVLIB_HOME)/lib/Linux_GCC-3.4 -lpthread";BUILD_DIR = "./Linux-Release-GCC-3.4";COMPILER = "gcc-3.4";CONFIG_DESCRIPTION = "Default Linux configuration for gcc 3.4, optimized for speed";CONFIG_NAME = "Linux-Release-GCC-3.4";PLATFORM = "Linux";PREPROCESSOR_DEFINES = "NDEBUG";SIMGEN_COMMAND_LINE = "--num-comps-file 50";}config "Linux-Debug-GCC-4.1"{ADDITIONAL_COMPILER_SETTINGS = "-march=pentiumpro -mtune=pentium4 -g -Wall";ADDITIONAL_LINKER_SETTINGS = "-L $(PVLIB_HOME)/lib/Linux_GCC-4.1 -lpthread";BUILD_DIR = "./Linux-Debug-GCC-4.1";COMPILER = "gcc-4.1";CONFIG_DESCRIPTION = "Default Linux configuration for gcc 4.1 with debug info support";CONFIG_NAME = "Linux-Debug-GCC-4.1";ENABLE_DEBUG_SUPPORT = "1";PLATFORM = "Linux";SIMGEN_COMMAND_LINE = "--num-comps-file 10";<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-91ID031910Non-Confidential
System Canvas Reference}config "Linux-Release-GCC-4.1"{ADDITIONAL_COMPILER_SETTINGS = "-march=pentiumpro -mtune=pentium4 -O3 -fomit-frame-pointer -Wall";ADDITIONAL_LINKER_SETTINGS = "-L $(PVLIB_HOME)/lib/Linux_GCC-4.1 -lpthread";BUILD_DIR = "./Linux-Release-GCC-4.1";COMPILER = "gcc-4.1";CONFIG_DESCRIPTION = "Default Linux configuration for gcc 4.1, optimized for speed";CONFIG_NAME = "Linux-Release-GCC-4.1";PLATFORM = "Linux";PREPROCESSOR_DEFINES = "NDEBUG";SIMGEN_COMMAND_LINE = "--num-comps-file 50";}config "Win32-Debug-VC2005"{ADDITIONAL_COMPILER_SETTINGS = "/Od /RTCsu /Zi";ADDITIONAL_LINKER_SETTINGS = "/DEBUG";BUILD_DIR = "./Win32-Debug-VC2005";COMPILER = "VC2005";CONFIG_DESCRIPTION = "Win32 Debug. Linked to DEBUG runtime library";CONFIG_NAME = "Win32-Debug-VC2005";ENABLE_DEBUG_SUPPORT = "1";PLATFORM = "Win32D";PREPROCESSOR_DEFINES = "_WINDOWS";SIMGEN_COMMAND_LINE = "--num-comps-file 10";}config "Win32-Debug-VC2008"{ADDITIONAL_COMPILER_SETTINGS = "/Od /RTCsu /Zi";ADDITIONAL_LINKER_SETTINGS = "/DEBUG";BUILD_DIR = "./Win32-Debug-VC2008";COMPILER = "VC2008";CONFIG_DESCRIPTION = "Win32 Debug. Linked to DEBUG runtime library";CONFIG_NAME = "Win32-Debug-VC2008";ENABLE_DEBUG_SUPPORT = "1";PLATFORM = "Win32D";PREPROCESSOR_DEFINES = "_WINDOWS";SIMGEN_COMMAND_LINE = "--num-comps-file 10";}config "Win32-Release-VC2005"{ADDITIONAL_COMPILER_SETTINGS = "/O2 /Ob1";BUILD_DIR = "./Win32-Release-VC2005";COMPILER = "VC2005";CONFIG_DESCRIPTION = "Win32 Release. Linked to RELEASE runtime library";CONFIG_NAME = "Win32-Release-VC2005";PLATFORM = "Win32";PREPROCESSOR_DEFINES = "_WINDOWS;NDEBUG";SIMGEN_COMMAND_LINE = "--num-comps-file 50";}3-92 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Referenceconfig "Win32-Release-VC2008"{ADDITIONAL_COMPILER_SETTINGS = "/O2 /Ob1";BUILD_DIR = "./Win32-Release-VC2008";COMPILER = "VC2008";CONFIG_DESCRIPTION = "Win32 Release. Linked to RELEASE runtime library";CONFIG_NAME = "Win32-Release-VC2008";PLATFORM = "Win32";PREPROCESSOR_DEFINES = "_WINDOWS;NDEBUG";SIMGEN_COMMAND_LINE = "--num-comps-file 50";}files{path = "../LISA/DCVisualisation.lisa";path = "../LISA/DualCoreSystem.lisa";path = "$(PVLIB_HOME)/etc/sglib.sgrepo";path = "../../Common/LISA/common.sgrepo";}}<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-93ID031910Non-Confidential
System Canvas Reference3.19 Protocol Properties dialogSelect a protocol from the Protocols list and right-click and select Properties to displaythe properties as shown in Figure 3-51 for the selected protocol:Protocol nameThe name of the protocol.File The file that defines the protocol.Repository The repository that contains the reference to the file path.Info Descriptive information that was added when the file was added to theproject.Figure 3-51 Protocol Properties dialog for SerialDataClick the Methods tab to display the LISA prototypes of methods, or behaviors,available for the protocol. The displayed values are for reference only and cannot beedited.Click the Properties tab to display the properties for protocol. The displayed values arefor reference only and cannot be edited.3-94 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Reference3.20 Run DialogThe Run Dialog can be used to specify the actions that are executed to run a selectedtarget. This section describes the actions for the different targets and explains theadditional options.To display the dialog in Figure 3-52 click Run from the Project menu.The dialog contains of the following areas:Select command to runSelect which executable you want to run.Figure 3-52 Run DialogFull Command LineThis field allows to adjust the command line generated by SystemCanvas. You might specify additional parameters or change the locationof the application which is loaded onto the executable .<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-95ID031910Non-Confidential
System Canvas ReferenceEffective Command LineShows the complete command line to be executed with expanded macrosand environment variables.The dialog has the following controls:<strong>Model</strong> DebuggerClick to to run model in <strong>Model</strong> Debugger. The initial command lineoptions are taken from project settings and user preferences. You can alterthe options in Full Command Line.<strong>Model</strong> ShellClick to to run model with <strong>Model</strong> Shell. The initial command line optionsare taken from project settings and user preferences. You can alter theoptions in Full Command Line.ISIM systemClick to to run model as ISIM system. The initial command line optionsare taken from project settings and user preferences. You can alter theoptions in Full Command Line.SystemC executableClick to to run SystemC executable specified in configuration settingSYSTEMC_EXE and SYSTEMC_COMMAND_LINE. You can alter the options in FullCommand Line.CustomRecentSpecify arbitrary command lines from scratch in Full Command Line.Select recent command.Insert Placeholder MacroInsert macro or environment variable from drop-down list at the currentcursor position in Full Command Line. Those macros are expanded tobuild the complete command line.The following macros are supported:%CADI%%ISIM%%SYSTEMC_EXE%full absolute path of CADI dynamic libraryfull absolute path of ISIM executable3-96 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas Referencefull SYSTEMC_EXE executable pathname%BUILD_DIR%relative path to build directory (relative to project path)%DEPLOY_DIR%relative path to deploy directory (currently identical to%BUILD_DIR%)%PROJECT_DIR%full absolut path to project’s directoryLaunch in backgroundRun application asynchronously in a separate console window. Use thisif the application requests user input or a big amount of output isexpected.Clear HistoryRemove all recent entries from command history. This also removescorresponding items from the Design Canvas main menu.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-97ID031910Non-Confidential
System Canvas Reference3.21 Self Port dialogUse the Self Port dialog to add a port to the top-level component. To display the dialogin Figure 3-53, without having anything selected in the Block Diagram view click AddPorts, or click Add Port from the Object menu.Figure 3-53 Self Port dialogThe dialog has the following controls:Instance nameSpecify the name of the port.Array SizeProtocolTypeAttributesEnter the number of ports is the new port is to be a port array. Leave thebox empty, or enter 1, for normal ports.Enter the name of the protocol for the port. To display a list of availableprotocols, click the Select... button.Select Master port or Slave Port.If required, specify the optional attributes for the port:• Addressable for bus ports• Internal for ports between subcomponents. The port is not visibleif the current component is added to a system.3-98 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
System Canvas ReferenceCreate LISA method templates according to selected protocolSelect an option from the drop-down list to create implementationtemplates for methods, or behaviors, for the selected protocol:• Do not create method templates.• Create only required methods. This is the default• Create all methods, including optional behaviors.Only methods corresponding to the selected port type, that is, for eithermaster or slave, are created.Editing the existing port might result in the creation of new methods, butexisting methods will not be deleted.Mirror port imageReverse the direction of the port.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 3-99ID031910Non-Confidential
System Canvas Reference3-100 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Chapter 4DebuggingThis chapter describes how to debug component and system designs. It contains thefollowing sections:• About debugging on page 4-2• Batch mode debugging on page 4-3• Debugging from System Canvas on page 4-5• Using other debuggers to debug LISA source on page 4-13.• Working with the <strong>ARM</strong> Profiler on page 4-18.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 4-1ID031910Non-Confidential
Debugging4.1 About debuggingAfter a system has been generated, there are two ways to debug applications that arerunning on it:• Create a batch file and run the debugger from a debug server, using the <strong>Model</strong>Shell application. This method is useful for running long or repetitive tests on thesame system. See Batch mode debugging on page 4-3.• Start the <strong>Model</strong> Debugger GUI directly from System Canvas. This is the mostconvenient way to debug the system. See Debugging from System Canvas onpage 4-5.You can debug the LISA+ code that defines the model itself. See Using other debuggersto debug LISA source on page 4-13.4-2 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Debugging4.2 Batch mode debuggingFor batch mode debugging, use <strong>Model</strong> Shell to start and simulate systems from thecommand line.<strong>Model</strong> Shell is a debugging host that can be used with local or networked models. Tostart <strong>Model</strong> Shell from the System Canvas GUI, select Run in <strong>Model</strong> Shell from theProject menu or click on the Toolbar icon. For more information on <strong>Model</strong> Shell, seethe <strong>Model</strong> Debugger <strong>User</strong> <strong>Guide</strong>.4.2.1 Direct executionDirect execution is used to start a standalone simulation directly from the commandline, for example to perform regression tests that do not require interaction. This isillustrated in Figure 4-1. Simulation of the system model begins immediately.<strong>Model</strong> Shell<strong>Model</strong> libraryFigure 4-1 Direct execution use case4.2.2 Debug server<strong>Model</strong> Shell can be started with a debug server by using the -S command line optionwith a CADI server. This enables CADI-compliant debuggers to connect to thesimulation and take control of it.After starting, the debugger can connect to the simulation and debug the model asthough the model had been directly loaded into the debugger. The connection can beeither local or remote across a network. See Figure 4-2 on page 4-4. For moreinformation on connecting to CADI and using a debugger, refer to the documentationsupplied with your debugger.Multiple debuggers can connect to a single model shell instance. This is useful forsystems that consist of multiple CPUs such as, for example, the Dual Core System.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 4-3ID031910Non-Confidential
Debugging<strong>Model</strong> ShellDebugserverNetwork protocolDebugclient<strong>Model</strong> Debugger<strong>Model</strong> libraryFigure 4-2 Debug server use case4-4 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Debugging4.3 Debugging from System CanvasAfter you have built your model, it can be simulated and debugged with <strong>Model</strong>Debugger.For more information on using <strong>Model</strong> Debugger, see the <strong>Model</strong> Debugger <strong>User</strong> <strong>Guide</strong>.NoteYou can use RealView ® Debugger instead of <strong>Model</strong> Debugger. See Using RealViewDebugger on page 4-11To use <strong>Model</strong> Debugger:1. If it has not already been configured, ensure that System Canvas can locate theexecutable for <strong>Model</strong> Debugger. See Configuring <strong>Model</strong> Debugger on page 4-10.2. Click the Debug button on the System Canvas toolbar to launch <strong>Model</strong> Debugger.3. The <strong>Model</strong> Debugger Configure <strong>Model</strong> Parameters dialog opens to show theparameters that you can configure. See Figure 4-3 on page 4-6. Make anyrequired changes, then click OK.NoteThe names of the panes in the dialog might be different to those shown inFigure 4-3 on page 4-6, depending on the model you are using, but the purposeand usage is the same in all cases.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 4-5ID031910Non-Confidential
DebuggingFigure 4-3 Configure <strong>Model</strong> Parameters dialog4. The <strong>Model</strong> Debugger Select Targets dialog opens and displays the debuggablecomponents that are available for connection to <strong>Model</strong> Debugger. See Figure 4-4on page 4-7.Select the targets to load by clicking the box next to it and clicking OK. One ormore instances of <strong>Model</strong> Debugger are then created, depending on how manytargets you selected to load.4-6 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
DebuggingFigure 4-4 Select Targets dialog5. For each instance of <strong>Model</strong> Debugger connected to a core:a. Use the Load Application dialog shown in Figure 4-5 on page 4-8 tospecify the application to load for the core.NoteIf there is only one core in the model, the dialog is typically displayed afterthe target is selected. If the dialog is not automatically displayed, selectLoad Application Code from the File menu.b. Select the application code (.axf) to load for the core.c. Click Open to select the file and close the dialog.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 4-7ID031910Non-Confidential
DebuggingFigure 4-5 Load application for core6. Click Run to start the simulation.An example of a dual core system connected to two instances of <strong>Model</strong> Debugger isshown in Figure 4-6 on page 4-9. One core is running <strong>ARM</strong> ® embedded Linux, and theother is running the brot.axf example.4-8 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
DebuggingFigure 4-6 Dual core system running in <strong>Model</strong> Debugger<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 4-9ID031910Non-Confidential
Debugging4.3.1 Configuring <strong>Model</strong> DebuggerThe <strong>Fast</strong> <strong>Model</strong>s installation includes System Canvas and <strong>Model</strong> Debugger and sets thecorrect path.If required, you can change the path by using the Preferences dialog:• Click File → Preferences → Applications to open the dialog shown inFigure 4-7 on page 4-11.• Click on the <strong>Model</strong> Debugger or <strong>Model</strong> Shell drop-down lists to select theexecutable you use. You can also specify <strong>Model</strong> Shell or <strong>Model</strong> Debuggercommand line options here. See also the <strong>Model</strong> Debugger <strong>User</strong> <strong>Guide</strong>.NoteFor Windows, separate debugger executables are provided to use with the Release andDebug build variants:• Use the Release version to debug models in the <strong>Fast</strong> <strong>Model</strong> Portfolio.• The Debug version must only be used when debugging CADI 1.1 models. See the<strong>Model</strong> Debugger release notes for further information.4-10 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
DebuggingFigure 4-7 <strong>Model</strong> Debugger paths in the Preferences dialog4.3.2 Using RealView DebuggerAs an alternative to <strong>Model</strong> Debugger, you can debug your model using RealView ®Debugger version 3.1 or later. See the following sections for more information on theways that you can connect to your model:• Starting model as an RTSM connection on page 4-12• Connecting to a running model using RealView Debugger on page 4-12.Further information on how to use RealView Debugger is provided elsewhere. See theRealView Debugger <strong>User</strong> <strong>Guide</strong>.NoteYou must not connect to more than one virtual platform model or RTSM at any one timein RealView Debugger. If you do, you might experience unexpected behavior, includingcrashes.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 4-11ID031910Non-Confidential
DebuggingStarting model as an RTSM connectionYou can add your model to the RealView Debugger Connect to Target window underthe Real-Time System <strong>Model</strong> (RTSM) debug interface configuration.1. In RealView Debugger, click Target → Connect to Target... to open the Connectto Target window.2. Click the Add button beside the Real-Time System <strong>Model</strong> (RTSM) debuginterface name. This opens the <strong>Model</strong> Configuration Utility window. Click theBrowse... button to open a file browser for locating your model .dll or .so file.3. Select the model to use in the <strong>Model</strong>s pane on the left side of the <strong>Model</strong>Configuration Utility. Configure the device parameters if required by selectingthe device in the upper right Devices pane, and setting the parameters in the lowerright Parameters pane. When you have finished, or if no parameters requireconfiguration, click OK.4. In the RealView Debugger Connect to Target window, double click on yournewly-created target to connect to it. If you are grouping targets by Configuration,expand the target connection tree view to see your target instance. Connecting toa target opens a CLCD window, where you can, for example, enable Tortoisebefore loading an image.Connecting to a running model using RealView DebuggerYou can use RealView Debugger ® to connect to an already running <strong>Model</strong> Shellinstance. You can make multiple debugger connections to a single model instance.1. Start <strong>Model</strong> Shell, if it is not already running. See Batch mode debugging onpage 4-3.2. In RealView Debugger, click Connect to Target... from the Target menu to openthe Connect to Target window.3. Click the Add button beside the debug interface name. The debugger detects anyrunning CADI servers and displays them in a pop-up window. Click OK.4. In the RealView Debugger Connect to Target window, double click on yournewly-created SoC Designer target to connect to it.NoteYou cannot define instantiation-time parameters at connection time because themodel is already running.4-12 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Debugging4.4 Using other debuggers to debug LISA sourceThis section describes how to use GDB on Linux or Microsoft Visual Studio onWindows to debug the LISA source code of models.The generated simulation code is annotated with line redirections to the correspondingLISA+ code. This enables debugging a LISA+ model with all the debug featuresprovided by GDB or Visual Studio.For both GDB and Visual Studio, you can start model execution in one of the followingways:• Directly start the model in the debuggerThis method is easier for an ISIM system. It is especially useful if the userprovided a new implementation of main().• Dynamically connect to an already running simulation process.4.4.1 <strong>Model</strong> generation requirementsTo debug the model with <strong>Model</strong> Debugger, you must build a system model library forCADI compliant debuggers:1. Start System Canvas and load the project for your model.2. In the Select Active Project Configuration drop-down menu, select a validdebug configuration for your build environment. For example, on Windows, ifyou have Visual Studio 2008 installed, this would be Win32-Debug-VC2008.3. Click the Build button to build a debug version of your model.4.4.2 Debugging with GDBTo debug ISIM targets, start a GDB session directly from <strong>Fast</strong> <strong>Model</strong>s Canvas byselecting Launch Host Debugger from the Project menu. Command line argumentscan be specified on the Applications page of the Preferences Dialog.NoteYou can also debug CADI shared library from either the <strong>Model</strong> Shell or <strong>Model</strong>Debugger executable. This method of debugging is not directly available from Canvas,but you can use a Linux shell start the executable.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 4-13ID031910Non-Confidential
DebuggingTo start the GDB session with <strong>Model</strong> Debugger as the executable:1. Load <strong>Model</strong> Debugger into GDB by typing gdb modeldebugger.exec in theconsole.NoteEnsure that you use GDB version 6.2 or higher.Starting modeldebugger.exec might require manually modifying theLD_LIBRARY_PATH environment variable to include a reference to the directorycontaining libcadiclient.so. This directory is $MAXVIEW_HOME/lib.2. Type run at the GDB prompt to start <strong>Model</strong> Debugger.You can load the model in the same step by adding the name of model library, forexample:run cadi_system_Linux-Debug-GCC-3.4.so3. <strong>Model</strong> Debugger starts and the Configure <strong>Model</strong> Parameters dialog opens.4. Configure any required parameters for the target, then click OK.5. The Select Targets dialog opens. The <strong>ARM</strong> processor is selected by default.Select the additional targets, if any, to load into <strong>Model</strong> Debugger. A separate<strong>Model</strong> Debugger window is created for each target. Click OK to close the targetselection dialog.6. Load the applications to the targets that execute software:• If there is one target selected, a <strong>Model</strong> Debugger prompt for the applicationis displayed.• If more then one target was selected, load the application to the targets ineach debug view separately by selecting Load Application from the Filemenu.NoteSelecting the application can also be done when <strong>Model</strong> Debugger is started byadding command line option -a in line with the name of the target and applicationfile:run cadi_system_Linux-Debug-GCC-3.4.so -a targetName1=application1 -atargetName2=application27. GDB is now ready to debug the model source code.4-14 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
DebuggingExample GDB LISA debug sessionThis section describes a typical example of debugging a system model on the sourcecode level and setting and running to a breakpoint in the LISA source.1. In GDB, interrupt execution of <strong>Model</strong> Debugger by pressing Ctrl+C.2. You can now type commands at the GDB prompt. To set a breakpoint in GDB,for example at line 123 in the MyCode.lisa file, enter:break MyCode.lisa:1233. In GDB, continue execution of <strong>Model</strong> Debugger by typing:continue4. In <strong>Model</strong> Debugger, click the Run button to start execution.You can use GDB to perform any debug action on the LISA code such as printing valuesof variables or stepping through code.4.4.3 Debugging with Visual StudioUse Microsoft Visual Studio to perform LISA+ source level debugging on Windows.<strong>ARM</strong> recommends that you generate the system and launch Microsoft Visual Studiofrom Canvas:• Start System Canvas and load the project for your model.• If you have not already done so, build a Debug version of your system byselecting one of the Win32-Debug-VC200x options in the Select Active ProjectConfiguration menu and rebuilding your model.NoteIf you select Generate, you can use Visual Studio later to build the model.• Launch Visual Studio from System Canvas by clicking the Devenv button orpressing Alt+F5.• From Visual Studio, select StartUp project to select the target to debug. Thetarget file can be either an ISIM or CADI dll.• Use the Project Properties dialog to configure any required parameters for thetarget.NoteFor ISIM systems, all <strong>Model</strong> Shell command lines options are available.Specifying the model on the command line is not required.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 4-15ID031910Non-Confidential
DebuggingFor a CADI dll, you must specify either <strong>Model</strong> Debugger or <strong>Model</strong> Shell as theexecutable to run.• Start debugging by selecting Run in Visual Studio.To perform host-level debugging, attach Visual Studio to a running <strong>Model</strong> Debuggerprocess:1. Start System Canvas and load the project for your model.2. If you have not already done so, build a Debug version of your system byselecting one of the Win32-Debug-VC200x options in the Select Active ProjectConfiguration menu and rebuilding your model.3. Click the Debug button or pressing F5 to launch <strong>Model</strong> Debugger from Canvas.4. <strong>Model</strong> Debugger starts and the Configure <strong>Model</strong> Parameters dialog is displayed.5. Configure any parameters required for the target and click OK.6. The Select Targets dialog opens. The <strong>ARM</strong> processor is selected by default.Select the additional targets, if any, to load into <strong>Model</strong> Debugger. A separate<strong>Model</strong> Debugger window is created for each target. Click OK to close the targetselection dialog.7. Load the applications to the targets that execute software:• If there is one target selected, <strong>Model</strong> Debugger displays a dialog promptingfor the application .• If more then one target was selected, load the application to the targets ineach debug view separately by selecting Load Application from the Filemenu.8. Start Visual Studio.9. In Visual Studio, select <strong>Tools</strong> → Attach to Process.... Select the<strong>Model</strong>Debugger.exe process in the Attach to Process dialog. Click the Attachbutton. It might be necessary to close additional dialogs before you can proceed.10. Visual Studio is now attached to <strong>Model</strong> Debugger and can control the entire hostlevel simulation.4-16 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
DebuggingExample Visual Studio LISA debug sessionThis section describes a typical example of debugging a system model on the sourcecode level and setting and running to a breakpoint in the LISA source.1. In Visual Studio, select File → Open → File... to open the LISA source file todebug.2. Set a breakpoint in the LISA source by double clicking on a source line.3. In <strong>Model</strong> Debugger, click the Run button to start execution. When the breakpointis reached, use Visual Studio to perform host-level debugging of the LISA+source code.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 4-17ID031910Non-Confidential
Debugging4.5 Working with the <strong>ARM</strong> ProfilerVirtual platforms produce with <strong>Fast</strong> <strong>Model</strong>s generate profiling data that can be used by<strong>ARM</strong> Profiler 2.1. This data can be visualized using <strong>ARM</strong> Workbench IDE. Thischapter explains how to setup the vitual platform with <strong>ARM</strong> Profiler and how the datais visualized in the <strong>ARM</strong> Workbench IDE. For more detailed information, consult the<strong>ARM</strong> Profiler documentation, chapter 4.8.To extract data from the model a utility, armprocap, is required.4.5.1 <strong>ARM</strong> profiler on Windows workstation<strong>ARM</strong> Profiler 2.1 is installed as part of the RealView Developers Studio 4.0sp2 or later.On Windows the <strong>ARM</strong> Profiler is typically installed into the standard Program filesdirectory. Depending on your locale settings the executable (armprocap.exe) is installedin:\Profiler\tools\\windows\armprocap.exeIn the following we refer to this executable as ‘armprocap’.4.5.2 <strong>ARM</strong> Profiler on Linux Workstation<strong>ARM</strong> Profiler 2.1 is installed as part of the RealView Developers Studio 4.0sp2 or later.On Linux workstations the location of armprocap is in:/Profiler/tools//linux/armprocap.In the following we refer to this executable as ‘armprocap’.4.5.3 Running <strong>ARM</strong> Profilerarmprocap must be called with a set of options to indicate that the <strong>ARM</strong> Profiler isexecuting an virtual platform or EVS. The syntax is as follows:armprocap ---create_connection_script --models --output --load wherePROFILING_OUTPUTCON_SCRIPTdefines the filename where the profiling data will be storedpoints to the location of a script file that armprocap will create4-18 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
DebuggingAPPLICATIONpoints to the location of the application which must be loaded ontothe virtual platform or EVS4.5.4 Running the <strong>ARM</strong> profiler with Dhrystone exampleThe following command will execute the dhrystone EVS with the <strong>ARM</strong> Profiler. To runthis example, make sure you have built the Dhrystone EVS. Replace ‘armprocap’ withthe fully qualified path to ‘armprocap’ in your installation.Example 4-1 Running <strong>ARM</strong> Profiler with Dhrystone EVSarmprocap --models --output test --create_connection_script myscript.sh --load$PVLIB_HOME/dhrystone.axfsource ./myscript.sh./Dhrystone.x $PVLIB_HOME/dhrystone.axfWhile running the simulation armprocap will print messages similar to the following:Loading symbols from dhrystone.axf...Finished loading symbols.Transferring target imageEnabled streaming trace.<strong>ARM</strong> Profiler (Build: Jun 24 2009, 01:00:06)Writing <strong>ARM</strong> Profiler analysis file to 'test.apd'.Please wait.Done. (0.2 seconds)Disconnect...This will generate a folder called test.apd which can be loaded into the <strong>ARM</strong> Profileras follows:1. Open <strong>ARM</strong> Workbench IDE 4.02. If the <strong>ARM</strong> Profiler Data tab is not already displayed, go to: Window → ShowView → Other → <strong>ARM</strong> Profiler → <strong>ARM</strong> Profiler Data3. In the <strong>ARM</strong> Profiler Data tab, click on the Folder icon on the top right - it hasthe tooltip Edit locations. Add the directory containing your Profiling directory.4. You should now see your Profiling directory in the list below.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 4-19ID031910Non-Confidential
Debugging4-20 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Chapter 5SystemC ExportThis chapter describes how to export a <strong>Fast</strong> <strong>Model</strong>s system as a SystemC component.It contains the following sections:• About SystemC export on page 5-2• Building a SystemC component from System Canvas on page 5-4• Adding the generated SystemC component to a SystemC system on page 5-9• Using the generated ports on page 5-11• Example systems on page 5-18• SystemC component API on page 5-32.• Scheduling of <strong>Fast</strong> <strong>Model</strong>s and SystemC on page 5-44.• Limitations on page 5-50<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-1ID031910Non-Confidential
SystemC Export5.1 About SystemC exportThe SystemC export feature of System Canvas generates a SystemC component thatcontains and wraps a <strong>Fast</strong> <strong>Model</strong>s system. This involves two different simulationdomains:• Exported Virtual Subsystem (EVS), this is a <strong>Fast</strong> <strong>Model</strong> Virtual Platformexported into SystemC using the SystemC export feature from System Canvas.• SystemC components.The SystemC export feature generates one component and generates a SystemCwrapper for this component. The resulting component is the EVS. SystemC 2.2, TLM2.0 and TLM 2.0.1 are supported by <strong>Fast</strong> <strong>Model</strong>s.Figure 5-1 shows how the <strong>Fast</strong> <strong>Model</strong>s virtual platform interacts as an SC_THREAD withthe SystemC master scheduler and communicates with other SystemC threads ormodules.SystemC Scheduleractivateswait(t_sim)activateswait(...)SC_THREAD (<strong>Fast</strong> <strong>Model</strong>s)SC_THREADactivatescalculate simulated time:t_simexecution<strong>Fast</strong> <strong>Model</strong> Scheduleractivatesdatamasterclock armcortexr4ct ramdeviceclk_out clk_in pvbus_m pvbusExported Virtual System (EVS)SystemC componentsFigure 5-1 Scheduling between <strong>Fast</strong> <strong>Model</strong>s and SystemC domains5-2 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC ExportThe SystemC scheduler uses the wait() command to track the simulated time reportedby the SC_THREAD and ensures that, over a long time period, all components are activatedto simulate the same amount of time.After the SC_THREAD (that encapsulates the <strong>Fast</strong> <strong>Model</strong>s virtual platform) is activated, the<strong>Fast</strong> <strong>Model</strong>s scheduler is invoked. It activates all components that are part of thesubsystem until the (configurable) time quantum is finished. The actual time that haspassed is calculated and the SystemC scheduler is notified.Data can be exchanged between components in the <strong>Fast</strong> <strong>Model</strong>s platform and otherSystemC components by using either the Direct Memory Interface (DMI) or normal(blocking) transactions.NoteThe examples in this chapter assume the following:• main.cpp is the file where the generated EVS, as well as other SystemCcomponents, are instanciated.• MySystem is the name of the top level component of the <strong>Fast</strong> <strong>Model</strong>s system• AConfig is the build configuration name, for example, Linux-Release-GCC-3.4 orWin32-Release-VC2005.To export your own component, replace main.cpp, MySystem, and AConfig with theappropriate names for your model.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-3ID031910Non-Confidential
SystemC Export5.2 Building a SystemC component from System CanvasThis section describes prerequisites and build instructions to create an EVS fromSystem Canvas.5.2.1 Installing SystemC and TLM filesTo build an EVS (SystemC Export) from the <strong>Fast</strong> <strong>Model</strong>s platform, SystemC and TLMheader files and libraries are required. This can be either done by installing the ThirdParty IP (TPIP) package which is available as a separate download package from thesame location as the <strong>Fast</strong> <strong>Model</strong>s package or using already installed packages on yoursite.The Third Party IP package contains binary releases of the SystemC and TLM packagesand patch files. The patch files document the required changes to the SystemC and TLMpackages available from the OSCI website, http://www.systemc.org. The SystemCbinary packages is link compatible with the OSCI download version.NoteThe <strong>Fast</strong> <strong>Model</strong>s SystemC examples rely on a certain directory structure for librariesand header files. This is different from the package that can be obtained from the OSCIwebsite because <strong>Fast</strong> <strong>Model</strong>s supports a wider range of compilers than the OSCIpackage. If the original OSCI package is be used in conjunction with the <strong>Fast</strong> <strong>Model</strong>sSystemC examples, a set of patch files is required that is applied to the package whichwill adjust the directory names. To re-build the packages follow the instructions fromthe README.txt file avaliable in the /OSCI/ source directory.5.2.2 Building the EVS1. System Canvas automatically uses the following include path:• $(SYSTEMC_HOME)/include• $(TLM_HOME)/include/tlmThe SYSTEMC_HOME and TLM_HOME environment variables are set when the TPIPpackage is installed. This package is available as a seperate download from thesame location as the <strong>Fast</strong> <strong>Model</strong>s package. If you require a different copy ofSystemC or TLM, modify the variables before starting System Canvas.2. In System Canvas, enable the target option SystemC component under the menuentry Project → Project Settings → Targets.5-4 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Export3. Add the ports you require on the generated SystemC component as normal <strong>Fast</strong><strong>Model</strong>s ports. See Using the generated ports on page 5-11 for more informationon using ports.4. Add the headers and library files specified for your operating system. See Addingheader files and libraries for Linux export on page 5-6 or Adding header files andlibraries for Windows export on page 5-7.5. Build the SystemC component. The output is:• static library MySystem-sc_sg_wrapper-AConfig.a.For Windows, the library is MySystem-sc_sg_wrapper-AConfig.lib.• header file sc_sg_wrapper_MySystem.h in the Linux directoryAConfig/gen_sc_sg_wrapper_AConfig_Linux.For Windows, the header file is located in the directoryAConfig/gen_sc_sg_wrapper_AConfig_Win32.NoteThe SystemC examples that ship with the <strong>Fast</strong> <strong>Model</strong>s Portfolio will directlyproduce a SystemC executable by specifying Post Build Actions for the linker inthe Project Settings dialog. This allows to build and run these examples directlyfrom System Canvas.This is accomplished by customized Makefiles/vcprojswhich compile the users SystemC files and link against the EVS. They aretriggered in the Post-Build Actions of the sgproj<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-5ID031910Non-Confidential
SystemC Export5.2.3 Adding header files and libraries for Linux exportThis section describes additional header files and libraries that are required for theSystemC export on Linux. This is splitted into headers and libraries that are required atbuild time and those that are required for packaging.Header Files and libraries to build the EVS on LinuxThe exported component requires specific header files and libraries:• the header file $MAXCORE_HOME/include/sc_sg_wrapper_base.h• all header files mentioned in all include sections of the protocols for the ports inthe top level component, for example amba_pv.h• SystemC header files from $SYSTEMC_HOME/include• OSCI TLM header files from $TLM_HOME/include/tlm• AMBA-PV header files from $MAXCORE_HOME/AMBA-PV/include if AMBA-PV portsare used• $MAXCORE_HOME/lib/Linux_GCC-3.4/libsc_sg_export.a• SystemC library from $SYSTEMC_HOME/lib/Linux_GCC-3.4/libsystemc.a• Additional libraries required for Linux: -ldl -lpthreadLibraries to package the EVS on LinuxSee Packaging the model for use on Linux on page A-4 for more details on how topackage the EVS.NoteThe SYSTEMC_HOME and TLM_HOME environment variables are set when the Third Party IPpackage (TPIP) is installed. This package is available as a seperate download from thesame location where the <strong>Fast</strong> <strong>Model</strong>s package is taken from.This package also containsthe SystemC and TLM header files and libraries.Depending on the example, additional libraries may be necessary (e.g. the Linuxexample requires the SDL library). Such libraries are searched in the same directorywhere the EVS is built.5-6 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Export5.2.4 Adding header files and libraries for Windows exportThis section describes additional header files and libraries that are required for theSystemC export on Windows. This is splitted into headers and libraries that are requiredat build time and those that are required for packaging.Headers and Libraries to build the EVS on WindowsThe exported component requires specific header files and libraries:• the header file $MAXCORE_HOME/include/sc_sg_wrapper_base.h• all header files mentioned in all include sections of the protocols of the ports ofthe top level component, for example amba_pv.h• SystemC header files from $SYSTEMC_HOME/include• OSCI TLM header files from $TLM_HOME/include/tlm• AMBA-PV header files, if AMBAPV ports are used, from$MAXCORE_HOME/AMBA-PV/include• EVS Export Library $MAXCORE_HOME/lib/Release_2005/libsc_sg_export.lib forrelease builds using Microsoft VC2005• EVS Export Library $MAXCORE_HOME/lib/Debug_2005/libsg_export.lib for debugbuilds using Microsoft VC2005• EVS Export Library $MAXCORE_HOME/lib/Release_2008/libsc_sg_export.lib forrelease builds using Microsoft VC2008• EVS Export Library $MAXCORE_HOME/lib/Debug_2008/libsg_export.lib for debugbuilds using Microsoft VC2008• SystemC library from $SYSTEMC_HOME/lib/Release_2005/SystemC.lib for releasebuilds using Microsoft VC2005• SystemC library from $SYSTEMC_HOME/lib/Win32_VC2005/Debug/SystemC.lib fordebug builds using Microsoft VC2005• SystemC library from $SYSTEMC_HOME/lib/Win32_VC2008/Release/SystemC.lib forrelease builds using Microsoft VC2008• SystemC library from $SYSTEMC_HOME/lib/Win32_VC2008/Debug/SystemC.lib fordebug builds using Microsoft VC2008<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-7ID031910Non-Confidential
SystemC ExportLibraries to package the EVS on WindowsSee Packaging the model for use on Windows on page A-4 for more details on how topackage the EVS on Windows.NoteThe /vmg option must be used in the project settings to correctly compile source codefor use with SystemC.The SYSTEMC_HOME and TLM_HOME environment variables are set when the Third Party IPpackage (TPIP) is installed. This package is available as a seperate download from thesame location where the <strong>Fast</strong> <strong>Model</strong>s package is taken from.This package also containsthe SystemC and TLM header files and libraries.Depending on the example, additional libraries might be necessary (e.g. the Linuxexample requires the SDL library). Such libraries are searched in the followinglocations:1. same directory where the EVS is built.2. searching the PATH environment variable (which will include attempting thedirectory containing the executable as per windows default searching behaviour)5-8 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Export5.3 Adding the generated SystemC component to a SystemC systemThe following steps are required to add the generated System C component to yourSystemC project:• Link the generated library to your existing SystemC system.• Include the generated header file of the generated SystemC component intomain.cpp:#include "sc_sg_wrapper_MySystem.h"• Instantiate the generated SystemC component:sc_sg_wrapper_MySystem mySystem("mySystem");• If your generated system contains components that can load application files,such as CPUs, load the application files into them:mySystem.load_application_file("cpu0", "myApplication.elf");where cpu0 is the instance name of a CPU in the <strong>Fast</strong> <strong>Model</strong>s system.NoteThe Cortex-A9MP and Cortex-A5MP require that the CPU is specified by usinga period (.) before the name. To load an application to cpu0, use a specificationstring like Core.cpu0 where Core is the instance name. The Dhrystone example inthe SystemC export directory uses this convention.• If required, set parameters for the configurable components of the <strong>Fast</strong> <strong>Model</strong>ssystem. For example, to set parameter PAR of component instance cpu0 to valuetrue:mySystem.set_parameter("cpu0.PAR", true);NoteThe Cortex-A9MP and Cortex-A5MP requires that the CPU is specified if theparameter is set for a specific core. Use a specification string like Core.cpu0.PARwhere Core is the instance name.• Setup the simulation frequency of the <strong>Fast</strong> <strong>Model</strong>s system, in Hz:mySystem.set_frequency(1000000000);The parameter value must be the same frequency as the master clock connectedto the system.• Setup the execution quantum of the <strong>Fast</strong> <strong>Model</strong>s system:mySystem.set_global_quantum(0.001);<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-9ID031910Non-Confidential
SystemC ExportFor this example, the <strong>Fast</strong> <strong>Model</strong>s system runs for 100 ticks before SystemCwait() is called.• Bind the master port and slave ports (exports) of the generated SystemCcomponent to the other components in the SystemC system. Because thegenerated ports are native SystemC ports, binding the ports works in the sameway as between all other SystemC components.5-10 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Export5.4 Using the generated portsThe generated SystemC component must have SystemC ports to enable communicationwith the SystemC world. These ports are generated automatically from the <strong>Fast</strong> <strong>Model</strong>sports of the top-level component.The SystemC export feature automatically generates port wrappers that bind theSystemC domain to the <strong>Fast</strong> <strong>Model</strong>s virtual platform as shown in Figure 5-2.System Generator Virtual PlatformSystemC EnvironmentTop-level systemMEMExternalslave portPortwrapperDMA(SystemCmaster)CPUExternalmaster portPortwrapperMEM(SystemCslave)Figure 5-2 Port wrappers connect <strong>Fast</strong> <strong>Model</strong>s and SystemC componentsEach master port in the <strong>Fast</strong> <strong>Model</strong>s top level component results in a master port on theSystemC side. Each slave port in the <strong>Fast</strong> <strong>Model</strong>s top level component results in a slaveport (export) on the SystemC side.For <strong>Fast</strong> <strong>Model</strong>s to instantiate and use the ports, it requires protocol definitions that:• correspond to the equivalent SystemC port classes• refer to the name of these SystemC port classes.This effectively describes the mapping from <strong>Fast</strong> <strong>Model</strong>s port types (protocols) toSystemC port types (port classes).For a list of supported protocols, their associated definitions, and bridges to theAMBA-PV protocol, see the <strong>Fast</strong> <strong>Model</strong> Portfolio Peripheral Components ReferenceManual.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-11ID031910Non-Confidential
SystemC Export5.4.1 Protocol definitionThis section describes requirements for the protocols that are used by the ports of thetop level <strong>Fast</strong> <strong>Model</strong>s component. It does not apply to other protocols that are not usedto create SystemC ports. This section describes protocols that are based both on TLM1.0 (for example signal protocols) and TLM 2.0 (for example bus protocols).• The behaviors in a <strong>Fast</strong> <strong>Model</strong>s protocol definition must match exactly thefunctions in the SystemC port class. System Canvas does not check this forconsistency and any inconsistencies are found by the C++ compiler whencompiling the generated SystemC component.• The set of functions and behaviors, their arguments, and their return value mustbe the same. The order of the functions and behaviors does not matter.• All behaviors in the <strong>Fast</strong> <strong>Model</strong>s protocol must be slave behaviors. There is nocorresponding concept of master behaviors.• The protocol definition also contains a properties section that contains theproperties that describe the SystemC C++ classes that implement thecorresponding ports on the SystemC side.Example 5-1 Example TLM 1.0 protocol for exported SystemC componentprotocol MySignalProtocol{includes{#include }properties{sc_master_port_class_name= "my_signal_base";sc_slave_base_class_name = "my_slave_base";sc_slave_export_class_name = "my_slave_export";}}slave behavior set_state(const bool & state);5-12 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC ExportExample 5-2 Example TLM 2.0 bus protocol for exported SystemC componentprotocol MyProtocol{includes{#include }}properties(sc_master_base_class_name = "my_master_base";sc_master_socket_class_name = "my_master_socket";sc_slave_base_class_name = "my_slave_base";sc_slave_socket_class_name = "my_slave_socket";}slave behavior read(uint32_t addr, uint32_t &data); slave behaviorwrite(uint32_t addr, uint32_t data);master behavior invalidate_dmi(uint32_t addr);Example 5-2 defines a protocol that enables declaring ports that have a read() and awrite() function. Master and slave ports can be declared using this protocol.5.4.2 Properties for TLM1.0 based protocolsTLM1.0 based protocols are mapped to their SystemC counterparts using threeproperties in the LISA protocol definition. These properties must be set in the protocoldescription:sc_master_port_class_nameThe sc_master_port_class_name property is the class name of theSystemC class that is instantiated in the generated SystemC componentfor master ports on the SystemC side. This class must implement thefunctions defined in the corresponding protocol such as, for example,:my_master_port::set_state(bool state).sc_slave_base_class_nameThe sc_slave_base_class_name property is the class name of the SystemCclass that is specialized in the generated SystemC component for slaveports on the SystemC side. This class must declare the functions definedin the corresponding protocol such as, for example:my_slave_base::set_state(const bool &state).<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-13ID031910Non-Confidential
SystemC ExportIt must be derived in the SystemC component to forward the protocolfunctions from the SystemC component to the <strong>Fast</strong> <strong>Model</strong>s top levelcomponent corresponding port. It must also provide a constructor takingthe argument:const std::string &sc_slave_export_class_nameThe sc_slave_export_class_name property is the class name of theSystemC class that is instantiated in the generated SystemC componentfor slave ports (exports) on the SystemC side. It is bound to the derivedsc_slave_base_class_name SystemC class and forwards calls from theSystemC side to the bound class.In Example 5-3:• sc_slave_export_class_name and sc_master_port_class_name describe the type ofthe port instances in the SystemC domain• sc_slave_base_class_name denotes the base class from which the SystemCcomponent is publicly derived.Example 5-3 AMBAPV Signal protocol in <strong>Fast</strong> <strong>Model</strong>sprotocol AMBAPVSignal {includes {#include }properties {version = "1.0";description = "AMBA-PV signal protocol";sc_master_port_class_name = "amba_pv::signal_master_port";sc_slave_base_class_name = "amba_pv::signal_slave_port";sc_slave_export_class_name = "amba_pv::signal_slave_export";}. . .The SystemC module ports must use the corresponding names in the SystemC code asshown in Example 5-4 on page 5-15.5-14 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC ExportExample 5-4 AMBAPV Signal protocol in SystemC component classclass pv_dma: public sc_module,public amba_pv::amba_pv_slave_base{/* Module ports */amba_pv::signal_master_port signal_out;amba_pv::signal_slave_export signal_in;. . .The SystemC port names must also match the <strong>Fast</strong> <strong>Model</strong>s port names. For example,signal_out is the instance name for the master port in the <strong>Fast</strong> <strong>Model</strong>s AMBAPVBuscomponent and the SystemC port shown in Example 5-4.Figure 5-3 SGSignal component in System Canvas<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-15ID031910Non-Confidential
SystemC Export5.4.3 Properties for TLM 2.0 based protocolsTLM 2.0 protocol provides forward and backward paths for master and slave ports.Protocols that use TLM 2.0 must specify the following properties in the protocoldeclaration:sc_master_socket_class_nameThis is the class name of the SystemC class that is instantiated in thegenerated SystemC component for master ports (master sockets) on theSystemC side. It is bound to the derived sc_master_base_class_nameSystemC class and forwards calls from the bound class to SystemC(forward path) as well as from the SystemC side to the bound class(backward path).sc_master_base_class_nameThis is the class name of the SystemC class that is specialized in thegenerated SystemC component for master ports on the SystemC side.This class must declare the master behavior functions defined in thecorresponding protocol such as, for example:my_master_base:: invalidate_dmi(uint32_t addr)It must be derived in the SystemC component to forward the protocolfunctions from the SystemC component (backward path) to the SystemGenerator top level component corresponding port. It must also providea constructor taking the argument const std: : string &.sc_slave_socket_class_nameThis is the class name of the SystemC class that is instantiated in thegenerated SystemC component for slave ports (sockets) on the SystemCside. It is bound to the derived sc_slave_base_class_name SystemC classand forwards calls from the bound class to SystemC (backward path) aswell as from the SystemC side to the bound class (forward path).sc_slave_base_class_nameThis is the class name of the SystemC class that is specialized in thegenerated SystemC component for slave ports (slave ports or sockets) onthe SystemC side. It must also provide a constructor taking the argumentconst std: : string &.5-16 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC ExportExample 5-5 AMBAPV protocol in System Generatorprotocol AMBAPVSignal {includes {#include }properties {version = "1.0";description = "AMBA-PV protocol";sc_master_base_class_name = "amba_pv::amba_pv_master_base";sc_master_socket_class_name = "amba_pv::amba_pv_master_socket";sc_slave_base_class_name = "amba_pv::amba_pv_slave_base";sc_slave_socket_class_name = "amba_pv::amba_pv_slave_socket";}The SystemC module ports must use the corresponding names in the SystemC code asshown in Example 5-6.Example 5-6 AMBAPV protocol in SystemC component classclass pv_dma:public sc_module,public amba_pv::amba_pv_slave_base {/* Module ports */amba_pv::amba_pv_slave_socket amba_pv_s;amba_pv::amba_pv_master_socket amba_pv_m;}<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-17ID031910Non-Confidential
SystemC Export5.5 Example systemsThis section describes the procedure to build and run the SystemC Export examples.These examples are installed with the <strong>Fast</strong> <strong>Model</strong> Portfolio and placed in$PVLIB_HOME/examples/SystemCExport.NoteThe <strong>Fast</strong> <strong>Model</strong> Portfolio must be set up in the System Canvas before building theexamples.The examples use the AMBA-PV protocol and components provided with the <strong>Fast</strong><strong>Model</strong> Portfolio. The SystemC TLM AMBA-PV API is provided with the <strong>Fast</strong> <strong>Model</strong>spackage, in $MAXCORE_HOME/AMBA-PV.5.5.1 Building Example systemsTo build the SystemC executable select Settings → Targets → SystemC Componentand build the project by pressing the Build button in System Canvas. For the SystemCexamples that ship with <strong>Fast</strong> <strong>Model</strong>s this generates an executable that consists of theproject name followed by .x (Linux workstation) or .exe (Win32 workstation).Examples are Dhrystone.x, Dhrystone2.x, or DMA.x.NoteThe executable can also be built from the command line. Navigate to the ./Builddirectory and type:$MAXCORE_HOME/bin/simgen -p Dhrystone.sgproj -b --configuration 5.5.2 Running the Example systemYou can start the executable from System Canvas by pressing the Run button andselecting Run SystemC executable from the dropdown box that appears by pressing thearrow next to the run button.NoteThe executable can also be started from the command line by executing the run.sh(Linux workstation) or run.bat (Win32 workstation) scripts. This will automaticallyload the correct application onto the EVS and start the SystemC simulation.Alternatively the generated executable can be started directly, followed by theapplication which is loaded onto the platform.5-18 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Export/Dhrystone.x $PVLIB_HOME/images/dhrystone.axf5.5.3 Running the examples with debug supportTo start the examples with support for debugging, use the Run button dropdown list thatappears when pressing the arrow on the right side to it. Select Run...and add the -dparameter to the full command line window.NoteThe executable can also be started from the command line of a shell. Just use the normalcommand to start the executable, but add the -d option. For example, enter the followingtext to start the Dhrystone application from a shell with a debug server:./run.sh -dTo debug the application, attach <strong>Model</strong> Debugger to the simulation. All <strong>Model</strong>Debugger features such as, for example, source level debugging, step, step over, andbreakpoints, can be used to debug the application.Figure 5-4 shows how the CADI debug server is linked into the generated SystemCcomponent and enables debug access to the wrapped <strong>Fast</strong> <strong>Model</strong>s virtual platform. TheCADI interface enables attaching <strong>Model</strong> Debugger and performing interactive debugsessions. Debugging the wrapped native SystemC components is possible by usingnative debug methods of the platform in use, such as GDB on Linux or Visual C++ onWin32 platforms.System Generator VirtualPlatformSystemC Components(handwritten debug support)<strong>Model</strong>DebuggerCADI debug clientCADI debug serverTop-level system(built-in debug support)MEMCPUDMA(SystemCmaster)MEM(SystemCslave)Figure 5-4 CADI client and server connects <strong>Model</strong> Debugger and system<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-19ID031910Non-Confidential
SystemC Export<strong>Model</strong> Debugger is installed with the <strong>Fast</strong> <strong>Model</strong>s installation. Start <strong>Model</strong> Debuggerand select Connect to <strong>Model</strong> from the File menu to list all running simulations. Selectthe core component and connect by double-clicking on the system to debug. See the<strong>Model</strong> Debugger <strong>User</strong> <strong>Guide</strong> for more information on debugging targets.5.5.4 Dhrystone exampleThis example, shown in Figure 5-7 on page 5-24, runs the Dhrystone benchmarkapplication on a <strong>Fast</strong> <strong>Model</strong>s system that consists of the following components:• Cortex-A9MP CPU• PVBusDecoder• RAMDevice• PVBus2AMBAPV Bridge to memory on the SystemC side.NoteSome of the memory in this example application is on the SystemC side.Figure 5-5 Dhrystone system exampleThe project file is$PVLIB_HOME/examples/SystemCExport/Dhrystone/Build/Dhrystone.sgproj.Building the Dhrystone exampleSee Building Example systems on page 5-18 for how to build the example. UseDhrystone.sgproj as the name for the project file.5-20 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC ExportRunning the Dhrystone exampleSee Running the Example system on page 5-18 or Running the examples with debugsupport on page 5-19 for more instructions on how to run the example system.NoteThe dhrystone image which must be loaded onto the simulation executable is part of theTPIP package. The location is /images/dhrystone.axf and will beautomatically used if the example is started from SGCanvas or using the providedscripts in the Build directory.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-21ID031910Non-Confidential
SystemC Export5.5.5 Dhrystone2 exampleThis example, shown in Figure 5-6, runs the Dhrystone benchmark application on a<strong>Fast</strong> <strong>Model</strong>s system that consists of the following components:• <strong>ARM</strong>1176 CPU• PVBusDecoder• RAMDevice.NoteIn this example, all of the application memory is on the <strong>Fast</strong> <strong>Model</strong>s side.The project file is$PVLIB_HOME/examples/SystemCExport/Dhrystone/Build/Dhrystone2.sgproj.Figure 5-6 Dhrystone2 system exampleBuilding the Dhrystone2 exampleSee Building Example systems on page 5-18 for how to build the example. UseDhrystone2.sgproj as the name for the project file.Running the Dhrystone2 exampleSee Running the Example system on page 5-18 or Running the examples with debugsupport on page 5-19 for more instructions on how to run the example system. Thelocation of the5-22 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC ExportNoteThe dhrystone image which must be loaded onto the simulation executable is part of theTPIP package. The location is /images/dhrystone.axf and will beautomatically used if the example is started from SGCanvas or using the providedscripts in the Build directory.5.5.6 DMA exampleThis example, shown in Figure 5-7 on page 5-24, is a modified version of the PVexample from the OSCI TLM 2.0 package.The Cortex-R4 programs a transfer and waits for an interrupt signaled by the PV DMAfrom the SystemC side to indicate the transfer is complete.The <strong>Fast</strong> <strong>Model</strong>s system contains the following components:• Cortex-R4 CPU• PVBusDecoder• RAMDevice for the application memory• PVBus2AMBAPV bridge to the SystemC side• AMBAPVSignal2SGSignal bridge to forward end of transfer interrupts from SystemCinto <strong>Fast</strong> <strong>Model</strong>s• SGSignal2AMBAPVSignal bridge to forward the end of transfer interrupts from <strong>Fast</strong><strong>Model</strong>s back into SystemC.• AMBAPV2PVBus bridge from the SystemC side• DMA transfer source memory.The SystemC side contains:• Simple PV DMA model• Associated source and destination memories• Pseudo master to receive end of transfer interrupt from <strong>Fast</strong> <strong>Model</strong>s.The project file is $PVLIB_HOME/examples/SystemCExport/DMA/Build/DMA.sgproj.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-23ID031910Non-Confidential
SystemC ExportFigure 5-7 DMA system exampleBuilding the DMA exampleSee Building Example systems on page 5-18 for how to build the example. UseDMA.sgproj as the name for the project file.Running the DMA exampleSee Running the Example system on page 5-18 or Running the examples with debugsupport on page 5-19 for more instructions on how to run the example system.5.5.7 EVS_Callbacks_Cortex-R4 exampleThe EVS_Callbacks_Cortex-R4 example, shown in Figure 5-9 on page 5-28,demonstrates the use of the callbacks that are described in set_callbacks() on page 5-36.It is based on the DMA example (See DMA example on page 5-23 for a description ofthe system). This example has two different execution modes, depending on whetherthe debug server is enabled or not.Debug Server enabledThe size of the quantum will be set to 10 simulation ticks and will trigger the followingcallbacks:• start_of_quantum• proceed_quantum()5-24 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Export• simulation_stop()• simulation_quit()The simulation_quit() callback will be triggered if the visualization unit is closed bypressing the close symbol (typically ‘X’ in the upper right corner, depending on yourwindow manager). To properly reproduce the behavior it is recommended to attach adebugger to the debug server of the EVS and ‘instruction step’ through the code. SeeREADME.txt in the top level directory of the example for more detailed instructions anda description of the expected output.NoteThe -d option must be passed to the executable to start the debug server.No Debug Server enabledThe following callbacks will be triggered if the example is started without the debugserver being enabled (default case)• start_of_quantum()• wait()• simulation_stop()See README.txt in the top level directory of the example for more detailed instructionsand a description of the expected output.Building the EVS_Callbacks_Cortex-R4 exampleSee Building Example systems on page 5-18 for how to build the example. UseEVS_Callbacks_Cortex-R4.sgproj as the name for the project file.Running the EVS_Callbacks_Cortex-R4 exampleSee Running the Example system on page 5-18 or Running the examples with debugsupport on page 5-19 for more instructions on how to run the example system.5.5.8 Linux ExampleThe Linux example shown in Figure 5-8 on page 5-26 is based on the Cortex A8 EBplatform. This variant of the system provides sufficient resource to run the operatingsystem and a simple example application. The SystemC side contains a simple CPTimersmodel. The Cortex-A8 component runs a Linux image.The project file is$PVLIB_HOME/examples/SystemCExport/LinuxSystem/Build/LinuxSystem.sgproj<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-25ID031910Non-Confidential
SystemC ExportFigure 5-8 shows the LinuxSystem with the bridges between <strong>Fast</strong> <strong>Model</strong>s and SystemC.The rate_hz_X 64 integer value bridges allow to configure the SystemC based timermodule for dynamic clock configuration. The int_X integer brige transmits the interruptsource signals for the core. The amba_pv_m bridge connects to the peripheral memorymapped registers of the timer component.Figure 5-8 Linux exampleBuilding the LinuxSystem exampleSee Building Example systems on page 5-18 for how to build the example. UseLinuxSystem.sgproj as the name for the project file.Running the LinuxSystem exampleSee Running the Example system on page 5-18 or Running the examples with debugsupport on page 5-19 for more instructions on how to run the example system.5-26 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC ExportNoteThe Linux image which must be loaded onto the simulation executable is part of theTPIP package. The location is/images/eba8-rtsm_armv5t-min_config-2.6.28-arm1-realview-v7-ethDCC-profiler.axf and will be automatically used if the example is started fromSGCanvas or using the provided scripts in the Build directory.5.5.9 Protocols exampleThe Protocols example, shown in Figure 5-9 on page 5-28, uses the AMBA-PV Signaland SignalState protocols and associated components provided with the <strong>Fast</strong> <strong>Model</strong>Portfolio. The example tests these two protocols. The AMBA-PV API on the SystemCside is provided by <strong>Fast</strong> <strong>Model</strong>s.The <strong>Fast</strong> <strong>Model</strong>s system contains the following components:• <strong>ARM</strong>1176CPU• PVBusDecoder• RAMDevice for the application memory• bridges to the SystemC side• bridges from the SystemC side.The SystemC side contains a simple component model with associated master ports andslave exports.The <strong>ARM</strong>1176 component runs NOPs if no application is loaded. The simple componentin the example performs various state transfers.NoteThe Protocols example does not include support for debugging. The only purpose forthis example is illustrating the use of additional protocols and corresponding bridges.The project file is$PVLIB_HOME/examples/SystemCExport/Protocols/Build/Protocols.sgproj.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-27ID031910Non-Confidential
SystemC ExportFigure 5-9 Protocols exampleBuilding the Protocols exampleSee Building Example systems on page 5-18 for how to build the example. UseProtocols.sgproj as the name for the project file.Running the Protocols exampleSee Running the Example system on page 5-18 or Running the examples with debugsupport on page 5-19 for more instructions on how to run the example system.5-28 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Export5.5.10 EVS_Delay_Cortex-A8 ExampleThe Delay example describes how to delay the simulation startup of an EVS and settingan external reset signal from SystemC. There are two options to force the EVS to stopsimulation until a certain condition is met. These are described in this section.Overloading the wait() callbackThis solution implements a derived sc_sg_callback object (see sc_sg_callbacks class onpage 5-36 and EVS_Callbacks_Cortex-R4 example on page 5-24), which waits for thereset signal going low in it's overloaded wait callback during the init phase. This isachieved by introducing an event which is triggered by the reset signal going low. Thefirst quantum of the EVS will start straight away after the wait() callback returns fromwaiting for the event (e.g. reset signal was set to 0).Example 5-7 Waiting for reset in ‘wait()’ callbackclass callback : public sc::sc_sg_callbacks{public:// overloaded callbacks from the EVS (Exported Virtual Subsytem)void wait(double time, int mode);}void callback::wait(double time, int mode){if (mode == SG_MODE_INIT){sc_core::wait(reset_event);}sc_core::wait(sc_core::sc_time(time, sc_core::SC_SEC)); /* do normal wait */}The SystemC signal reset_event is triggered in the example after 10 ns. At timestamp11ns the signal is triggered and the wait() callback will return from its call allowing theEVS to start the simulation.Upon simulation the wait() callback is called which waits for an event to be set by someother component. The EVS simulation will not advance until the callback returns..Somewhere within the quantum it will set the reset_event which causes the wait()callback to return and unlock the EVS. The next time the SystemC scheduler activatesthe EVS it will start simulating its quantum.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-29ID031910Non-Confidential
SystemC ExportNoteThe advantage of this solution is that it will effectively prevent the entire EVS fromstarting and there is no delay once the callback returns. The disadvantage is that formulticore systems all cores will be halted. If only a single core is to be stopped then thissolution is not applicable. In this case the reset port must be used .Using the Reset portThe other solution is to connect a reset signal to the respective port within the EVS.Figure 5-10 shows the example system using an <strong>ARM</strong> Cortex-A8 where the reset portis connected by an ambapvsignal2sgsignal component. This example is based on theDhrystone example with the difference that the reset port is routed by this bridge toanother SystemC component.NoteTo drive the reset signal to ‘1’ from the very beginning of the simulation, it is necessaryto set this signal in the simulation phase end_of_elaboration(). If that is not done, it willdepend on the scheduler which component is activated first. This can result in a delayof one quantum before the EVS will recognize the reset signal being active.Figure 5-10 Reset Example systemTo activate this behavior in the example DELAY_WAIT in the main.cpp file is required to beundefined. The drawback of this solution is that setting the reset signal will only berecognized by the EVS at the end of its quantum. This is due to the nature of temporal5-30 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Exportdecoupling. In contrast to the solution where the callback is overloaded this solutiondoes not make use of a simulation API and therefore suffers from the effects of temporaldecoupling.end_of_elaboration()simulationstartEVSreset(‘1’)SystemC ResetComponenttimequantumreset(‘0’)timeFigure 5-11 Timing diagram for driving the reset signalFigure 5-11 shows the timing diagram for the reset example using the reset signal.Before the simulation starts (end_of_elaboration()) the reset signal is set. Within thequantum of the SystemC Reset component the reset signal is set back to ‘0’. The EVSwill recognize this change at the end of its quantum. This difference to the solutionwhich uses the wait() callback has to be taken into account when choosing one or theother solution.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-31ID031910Non-Confidential
SystemC Export5.6 SystemC component APIThis section describes the API functions for a SystemC component built by performinga SystemC export from a <strong>Fast</strong> <strong>Model</strong>s system.5.6.1 Component access functionThere is a single component access function.get_instance()Use this function to access the singleton exported SystemC component. The format is:static sc_sg_wrapper_base * get_instance()5.6.2 Parameter access functionsRefer to component parameters by forming a dot (.) separated string that combines:• the <strong>Fast</strong> <strong>Model</strong>s hierarchical component instance name, but without the top levelcomponent of the <strong>Fast</strong> <strong>Model</strong>s system• the name of the parameter to be accessed.For example:MySubComponentA.MyParamset_parameter()Use this function to get parameters from components present in the <strong>Fast</strong> <strong>Model</strong>s system.The formats are:bool set_parameter(const std::string & name, const std::string & value)bool set_parameter(const std::string & name, const char * value)bool set_parameter(const std::string & name, bool value)bool set_parameter(const std::string & name, int value)bool set_parameter(const std::string & name, unsigned int value)bool set_parameter(const std::string & name, long long value)bool set_parameter(const std::string & name, unsigned long long value)where:namevaluespecifies the name of the parameter to be changed.specifies the value of the parameter to be changed.The function returns false if the parameter is unknown, otherwise it returns true.5-32 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC ExportNoteChanges made to parameters within System Canvas take precedence over changesmade with set_parameter().get_parameter_list()Use this function to get a list of all parameters from components present in the <strong>Fast</strong><strong>Model</strong>s system. The format is:std::map get_parameter_list() const5.6.3 Simulation control functionsThe time to pass to SystemC wait() after the <strong>Fast</strong> <strong>Model</strong>s system has been simulatedfor a quantum is determined by:• the parameter value specified in the set_global_quantum() method• the <strong>Fast</strong> <strong>Model</strong>s simulation frequency specified by the parameter value used in theset_frequency() method.break_quantum()void break_quantum(unsigned long delta = 0)NoteThis function is deprecated. Use break_quantum_seconds() instead.break_quantum_seconds()Use this function to instruct the <strong>Fast</strong> <strong>Model</strong>s simulation to break its current simulationquantum. The format is:void break_quantum_seconds(double intr_time = 0)where:intr_timespecifies the number of seconds from now to when the simulationquantum is to be broken.If break_quantum_seconds() is called, the <strong>Fast</strong> <strong>Model</strong>s system simulation stopsintr_time seconds from the method call. The SystemC wait() callback is called, withan sc_time value corresponding to the fraction of the quantum simulated so far, to<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-33ID031910Non-Confidential
SystemC Exportenable simulating other SystemC components. If intr_time is zero, the simulationquantum is broken immediately, that is, as soon as the callee returns control to thesimulation.break_quantum_seconds() can be called more than once per simulation quantum. Thesimulation quantum is broken as many times as break_quantum_seconds() is called.After the quantum has been broken, the next quantum is a new/full quantum.However, distinct calls to break_quantum_seconds() are merged if they refer to the samesimulation timing point. This is done even though the calls might have come fromwithin distinct quantums.It is the responsibility of the SystemC scheduler, or any other component of theSystemC environment, to call break_quantum_seconds() with the appropriate parameter.To synchronize <strong>Fast</strong> <strong>Model</strong>s and SystemC environments, <strong>ARM</strong> recommends usingbreak_quantum_seconds() instead of SystemC wait(). See also sc_sg_break_quantum()on page 5-36.get_callbacks()This function returns the callback object registered within the <strong>Fast</strong> <strong>Model</strong>s simulation.The format is:sc_sg_callbacks * get_callbacks() constget_cycle_count()This function returns the total number of cycles simulated by the <strong>Fast</strong> <strong>Model</strong>s systemsince the start of the simulation. The format is:unsigned long long get_cycle_count()get_freq()NoteThis function is deprecated. Use get_frequency() instead.get_frequency()Use this function to retrieve the simulation frequency of the exported <strong>Fast</strong> <strong>Model</strong>ssystem. The format is:unsigned long long get_frequency() const5-34 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Exportget_global_quantum()This function retrieves the global simulation quantum time in seconds as stored in theTLM 2.0 final class tlm_global_quantum. The format is:double get_global_quantum() const;NoteIf this function is called without including TLM 2.0 final headers, it falls back to usingget_quantum_seconds().The frequency must have been set with the set_frequency() API call before using thequantum API functions.get_quantum_seconds()This function retrieves the time in seconds per local simulation quantum of the exported<strong>Fast</strong> <strong>Model</strong>s subsystem. The format is:double get_quantum_seconds() const;NoteThe frequency must have been set with the set_frequency() API call before using thequantum API functions.get_quantum()This function retrieves the local quantum of the exported <strong>Fast</strong> <strong>Model</strong>s subsystem insimulation clock ticks. The format is:unsigned long get_quantum()NoteThis function is deprecated. Use get_quantum_seconds() instead. (Seeget_quantum_seconds()). The frequency must have been set with the set_frequency()API call before using the quantum API functions.get_rate()NoteThis function has been deprecated. Use get_clock_rate() instead for equivalent results.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-35ID031910Non-Confidential
SystemC Exportget_slot()NoteThis function is deprecated. Use get_global_quantum() instead. (Seeget_global_quantum() on page 5-35.)sc_sg_break_quantum()Use this function to pass a time value in seconds to the break_quantum_secondsfunction of the wrapper component. It there is no wrapper instance, SystemC wait() iscalled. The format is:void sc_sg_break_quantum(double intr_time = 0)where:intr_timespecifies the number of seconds from now to when the simulationquantum is to be broken.NoteThis is a convenience function for break_quantum_seconds(). It can be replaced by thefollowing call in the SystemC component:sc::sc_sg_wrapper_base::get_instance()->break_quantum_seconds(intr_time);set_callbacks()Use this function to register a callback object within the <strong>Fast</strong> <strong>Model</strong>s simulation. Theformat is:void set_callbacks(sc::sc_sg_callbacks * cb)where:cbspecifies a pointer to an instance of an sc_sg_callbacks derived class thatdefines these virtual methods. See Example 5-8.on page 5-49 on page 5-49Example 5-8 sc_sg_callbacks classnamespace sc{5-36 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Exportclass sc_sg_callbacks{public:virtual ~sc_sg_callbacks(){};// the callbackspublic:virtual void start_of_quantum(int /* mode */){};/*Called by the EVS*at the start of each quantum.*This default implementation does nothing.*mode - one of:*SG_MODE_INIT*SG_MODE_STOP*SG_MODE_RUN*SG_MODE_BPT */virtual void wait(double time, int mode);/*Called by the EVS to*synchronize with SystemC.*This default implementation calls sc_wait() with the*appropriate sc_time argument.*t - time to wait in seconds*mode - one of:*SG_MODE_INIT*SG_MODE_STOP*SG_MODE_RUN*SG_MODE_BPT*/virtual void proceed_quantum(int /* mode */){};/* Called by the EVS*before executing the System Generator scheduler*This default implementation does nothing.*mode - one of:*SG_MODE_INIT*SG_MODE_STOP*SG_MODE_RUN*SG_MODE_BPT */virtual void simulation_quit(int /* mode */ );/* Called by the EVS*before simulation quits.*This default implementation calls sc_stop().*mode - one of:*SG_MODE_INIT*SG_MODE_STOP*SG_MODE_RUN*SG_MODE_BPT */virtual void simulation_stop(int /* mode */ ){};/* Called by the EVS*after simulation stops, e.g. after application exit.*This default implementation does nothing.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-37ID031910Non-Confidential
SystemC Export};*mode - one of:*SG_MODE_INIT*SG_MODE_STOP*SG_MODE_RUN*SG_MODE_BPT */};The callback object defines a set of methods that the <strong>Fast</strong> <strong>Model</strong>s simulation calls at apredefined simulation time point.The <strong>Fast</strong> <strong>Model</strong>s simulator has its own predefined callbacks, with defaultimplementations. The callbacks object given to the method can override the defaultimplementations.set_freq()NoteThis function has been deprecated. Use set_frequency() instead.set_frequency()Use this function to specify the simulation frequency of the exported <strong>Fast</strong> <strong>Model</strong>ssystem. The specified frequency must be the same as the master clock rate of the CPUcomponent in the <strong>Fast</strong> <strong>Model</strong>s system. If multiple CPUs are present, it must be set tothe highest frequency connected to one of the CPUs. The format is:void set_frequency(unsigned long long freq)where:freqspecifies the simulation frequency.NoteThe set_frequency() method can be called before sc_start() or at any time duringsimulation. If called after sc_start(), the new simulation frequency is taken intoaccount at the next simulation quantum.5-38 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Exportset_global_quantum()Use this function to define the global simulation quantum time in seconds. The SystemGenerator system is simulated for the specified time before calling SystemC wait() toallow simulating other SystemC components. The format is:void set_global_quantum(double interval);NoteThis method can be called before sc_start() or at any time during simulation. If calledafter sc_start(), the number of seconds per simulation slot is taken into account at thenext simulation slot. It is highly recommended to call this function orset_quantum_seconds() before sc_start() to set a reasonable high quantum to achievehigh simulation performance.The frequency must have been set with set_frequency() API call before using thequantum API functions. If a quantum of 100000 is set the call looks like/* Simulation quantum, i.e. seconds to run per quantum */.set_global_quantum(100000.0 / .get_frequency());where refers to the name of the EVS instance.set_quantum_seconds()Use this function to define the local simulation quantum time of the exported <strong>Fast</strong><strong>Model</strong>s subsystem in seconds. The <strong>Fast</strong> <strong>Model</strong>s system is simulated for the specifiedtime before calling SystemC wait() to allow simulating other SystemC components.The format is:void set_quantum_seconds(double interval);NoteThis method can be called before sc_start() or at any time during simulation. If calledafter sc_start(), the number of seconds per simulation slot is taken into account at thenext simulation slot.The frequency must have been set with the set_frequency() API call before using thequantum API functions. Once one of the local quantum setting API functions have beencalled, the global tlm quantum will no longer be queried during simulation to update thelocal simulation quantum of the exported <strong>Fast</strong> <strong>Model</strong>s subsystem.If a quantum of 100000 is set the call looks like/* Simulation quantum, i.e. seconds to run per quantum */.set_global_quantum(100000.0 / .get_frequency());<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-39ID031910Non-Confidential
SystemC Exportwhere refers to the name of the EVS instance.set_quantum()NoteThis function is deprecated. Use set_quantum_seconds() instead.set_rate()NoteThis function is deprecated. Use set_frequency() instead for equivalent results. (Seeget_frequency() on page 5-34.)set_slot()NoteThis function is deprecated. Use set_global_quantum() instead. (Seeget_global_quantum() on page 5-35.)stop()NoteThis function is deprecated. Use the SystemC function sc_stop() instead.5.6.4 Application loading functionsThis section describes the function used for loading an application file.load_application_file()Use this function to specify the application files to be loaded by <strong>Fast</strong> <strong>Model</strong>s systemcomponents. This method must be called before starting the simulation. The specifiedapplication files are loaded into the respective components. If this method is calledbefore the system components are initialized, the calls are deferred until simulationstarts. The format is:void load_application_file(const std::string & instance_name,const std::string & file)5-40 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Exportwhere:instance_nameis the instance name of the componentNoteIf the component has subcomponents, such as the Cortex-A9MP andCortex-A5MP, the subcomponent must be specified. Use a period (.) toseparate the components. For example, if Core is the instance name,specify the first CPU as Core.cpu0.filespecifies the application file to be loaded by the component.5.6.5 Debug control functionsThis section describes the different debug modes of the EVS.set_debug_mode()Use this function to specify whether to start the simulation of the exported <strong>Fast</strong> <strong>Model</strong>ssystem with a debug server (‘debug mode’) or not. If the simulation is started in debugmode, the <strong>Fast</strong> <strong>Model</strong>s system enables setting up a debugging session by launching aCADI debug server. This server allows connections with debuggers like <strong>Model</strong>Debugger to debug the source code of the applications loaded and executed by the <strong>Fast</strong><strong>Model</strong>s system CPU. The format is:void set_debug_mode(bool debug = true, bool start_simulation = false, cadi_log =false)where:debugSet to true to specify that the simulation starts in debug mode. If set tofalse, debuggers cannot connect to the simulation.start_simulationThis parameter determines if the simulation starts running after the debugserver is launched. If start_simulation is set to false, the default if debugmode is enabled, the debug server blocks the simulation from runningand waits for debugger execution control commands to run thesimulation.NoteIf the system is set up in non-debug mode, the simulation starts runningby default.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-41ID031910Non-Confidential
SystemC ExportCalling set_debug_mode() after sc_start() is ignored.cadi_logThis parameter allows to log all CADI calls and responses into a XMLfile for each component instance.set_debug()Noteset_debug(bool debug = true) is depricated. Use set_debug_mode(bool debug = true,bool start_simulation = false, cadi_log = false) instead.5.6.6 Accessing the CADI interface directlyThere are two ways to access the CADI interface of the EVS.• Connect with the CADI Client Integration Kit (CCIK). This method uses TCP/IPas transport layer.• Connect directly to the CADI Interface.The direct connection to the CADI Interface of the EVS is provided through a globalsymbol of the exported platform:extern "C"{ CADI_WEXP eslapi::CADIBroker * CreateCADIBroker(); }This enables getting the CADIBroker. The CADIBroker enables querying allCADIInterfaces that are maintained by the simulation.IncludesThe following header files must be included to access the CADIBroker:"#include "eslapi/CADIFactory.h""#include "eslapi/CADI.h""#include "sc_sg_wrapper_.h"For the include sc_sg_wrapper_, the term must bechanged to the name of the EVS. This include file is generated into a subdirectory ofthe actual build path.Accessing CADIBrokerAn instance of the CADIBroker can be initialized by:5-42 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Exporteslapi::CAInterface *ca_interface = CreateCADIBroker();See the CADI documentation for more information on using the CADIBroker.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-43ID031910Non-Confidential
SystemC Export5.7 Scheduling of <strong>Fast</strong> <strong>Model</strong>s and SystemCThis section describes:• The function of the scheduler generated by <strong>Fast</strong> <strong>Model</strong>s.The scheduler handles debugger requests and balances simulation time (quantum)between the EVS and SystemC models.• The callbacks that are executed in the different simulation steps.Callbacks are described in more detail in get_callbacks() on page 5-34 andset_callbacks() on page 5-36.NoteThe following conventions are used in this section:• EVS refers to the instance of the <strong>Fast</strong> <strong>Model</strong>s platform exported to a SystemCmodel (Exported Virtual System)• For graphics, callbacks are annotated with the text Callback5.7.1 Standalone simulation without a debug serverIf the simulation is started without a debug server, the scheduler operates as shown inFigure 5-12 on page 5-46. This is the default startup mode.The simulation steps are:Initializing the simulationThe simulation is started and initialized:1. The simulation is started by calling sc_start() from the simulationenvironment.2. A wait() callback is issued. The time parameter is zero and themode parameter is SG_MODE_INIT.The wait() callback is issued only once immediately after the startof simulation.NoteIf the use-case of the EVS requires to prevent the EVS from startingits quantum you might register for the wait() callback and checkfor SG_MODE_INIT. Once the EVS is allowed to start the callback canbe returned5-44 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC ExportRunning the simulationAfter the initial callback, the simulation enters a loop to execute thefollowing simulation steps:1. If stopped, the simulation exits.2. The start_of_quantum() callback is issued with parameterSG_MODE_RUN if the quantum has not been already been interrupted.3. EVS is simulated for a time quantum equivalent to the number ofsimulation steps specified by set_quantum().4. A wait() callback is issued with the time parameter equivalent tothe actual simulated time in the EVS.This is typically used to issue a SystemC wait() to hand overcontrol to the SystemC model to simulate the same amount of timeand synchronize the two models. This is the defaultimplementation. A custom simulation environment canreimplement this callback.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-45ID031910Non-Confidential
SystemC ExportStart Simulationwait(0,0, SG_MODE_INIT)callbackSimulationstopped?YesExitNostart_of_quantum(SG_MODE_RUN)callbackSimulate Quantum(set_quantum)<strong>Model</strong> simulation: Execute the SG subsystem for a timequantum equivalent to set_quantum.wait(delta, SG_MODE_RUN)Callback: Hand over control to SystemC or to callback. deltaindicates the amount of time that has passed during theSimulate Quantum(set_quantum) callFigure 5-12 Simulation without a debug server5.7.2 Simulation with a debug serverA debug server with a CADI 2.0 interface can be started with the exported model. Theinitialization is done in the simulation phase before_end_of_elaboration(). The debugserver is therefore ready to accept incoming requests after sc_start() is called. Thescheduler executed for this case is shown in Figure 5-13 on page 5-49.After the simulation starts:1. The wait() callback is initiated with mode parameter set to SG_MODE_INIT.5-46 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Export2. A check is made to determine whether a debugger command must be processed.Such commands are typically:• Run to changes the simulation state from stop to running• Stop to change the state from running to stop.3. The simulation state is tested to determine if the simulation is still running:Simulation runningThe following steps are executed. These steps are equivalent to thecase where no debug server is started:1. If a previous quantum has executed, the start_of_quantum()callback is executed with parameter SG_MODE_RUN.If the previous quantum was interrupted by a breakpoint or stopcommand, the callback is not executed.Because a single step causes a breakpoint to be hit, the callbackis not typically executed after a single step.2. The proceed_quantum() callback is executed before eachexecution of the <strong>Fast</strong> <strong>Model</strong>s scheduler.This callback is especially useful for debugger integration thatrequires a notification before each start of simulation from the<strong>Fast</strong> <strong>Model</strong>s subsystem.3. EVS is simulated for a time quantum equivalent to the timespecified by set_quantum_seconds().4. The wait() callback is issued with the time parameter equal tothe actual simulated time in <strong>Fast</strong> <strong>Model</strong>s. This is typically usedto issue a SystemC wait() to cause the SystemC model tosimulate the same amount of time and synchronize the twomodels. This is the default implementation. A custom simulationenvironment can reimplement this callback.Simulation stoppedThe following steps are executed:1. A wait() callback is issued with the time parameter zero and themode set to SG_MODE_STOP.2. The simulation is then suspended for 20ms to allow othersimulators to catch up.3. The simulation resumes with the check for a pending debuggercommand that might have arrived.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-47ID031910Non-Confidential
SystemC ExportNoteThe following callback functions can be used to notify the end ofsimulation:simulation_quit()Called before the simulation quits because of a user eventsuch as, for example, pushing the close button of thevisualization component in the LinuxSystem example.The default implementation calls sc_stop(), but this can beoverloaded by the SystemC user.simulation_stop()Called after the simulation stops because of, for example,application exit (_sys_exit).The default implementation does nothing, but this can beoverloaded by the SystemC user.See also Simulation control functions on page 5-33.5-48 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC ExportStart Simulationwait(0,0, SG_MODE_INIT)CallbackPendingDebuggerCommand?YesNoProcess Debugger Commands:Run: Simulation running=yesStop: Simulation running=falseTimed_Wait()Wait for a fixed amount of timeSimulationrunning?Nowait(0,0, SG_MODE_STOP)CallbackYesPreviousquantumfinished?NoYesstart_of_quantum(SG_MODE_RUN)Callbackproceed_quantum(SG_MODE_RUN)CallbackSimulate Quantum(set_quantum)wait(delta, SG_MODE_RUN)Callback<strong>Model</strong> simulation:Execute the SG subsystem for a time quantumequivalent to set_quantumHand over control to SystemC or to callback:delta indicates the amount of time that has passedduring the Simulate Quantum(set_quantum) callFigure 5-13 Standalone simulation with a debug server<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-49ID031910Non-Confidential
SystemC Export5.8 LimitationsThis section describes limitations of the current release.NoteIt is important to understand that the EVS do not provide any level of timing accuracy.These platforms have no implementation of timing or cycle accuracy, although theplatforms are accurate on a functional level.5.8.1 Event port on Cortex-A9, Cortex-A9MP, Cortex-A5, Cortex-A5MP, Cortex-M3 andCortex-M4Event ports are currently modeled using a proprietary port type ‘peer’ within the <strong>Fast</strong><strong>Model</strong>s portfolio. Such ports can not be exported to SystemC directly. However, thereis a workaround which is described in this section.Peer ports are basically a combination of a master and a slave port. They allowconnections from both port types so that an external master as well as a slave port canconnect to it. A peer port shows up in the Canvas as a master port, although it in factaccepts connections from master and slave ports. In the following example aCortex-A9MPx4 is connected to two busbridges. See Figure 5-14 for a more detailedview on how this connection is established.Figure 5-14 Connecting Signal Bridges to a Peer port5-50 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC ExportNotepeer ports will no longer be present in future releases (after 5.1). They will be replacedby a port of type ‘broadcast’.The ‘event_in’ port will act as the slave port (from the EVS point of view), while‘event_out’ mimics the master port part of the event port.5.8.2 Single SC_THREAD and wait() callsAll exported models from a System Generator EVS are exported within a singleSC_THREAD. Therefore all initiators on the EVS side are seen from the SystemC scheduleras a single component.Figure 5-15 shows a scenario where two cores in an EVS issue a transaction toperipherals modeled in SystemC (Peripheral 1 and 2). Both peripherals call wait(10ms)to finish the transaction. This results in an overall delay of 20ms. The correct delaywould be 10ms if both Cores in the EVS were modeled in a separate SC_THREAD.SC_THREADSC_THREADTransactionCore 1 Peripheral 1Wait (10ms)10Core 1Core 2Peripheral 1wait (10ms)Peripheral 2wait (10ms)Core 2Exported Virtual System(EVS)TransactionPeripheral 2SC_THREADWait (10ms)20Time [ms]Figure 5-15 SC_THREAD wrapper for exported componentsNotePeripherals used with temporal decoupled models must not call wait(). It isrecommended to model peripherals in a way to avoid wait() calls as EVS targetfunctional correct behavior but is not timing accurate. This limitation will be removedin a future release.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-51ID031910Non-Confidential
SystemC Export5.8.3 Single SC_THREAD and problems with re-entrancyFigure 5-16 shows two components in an EVS where Core 2 issues a blockingtransaction to a peripheral (Peripheral 2). Peripheral 2 issues a blocking transaction toPeripheral 1 that in turn generates a blocking transaction to Core1. The problem is thatTransaction #1 blocks the SC_THREAD for the EVS and this results in a deadlock situationwhen Peripheral 1 tries to access Core1. This limitation will be removed in a futurerelease.SC_THREADSC_THREADblocking Transaction #2Core 1 Peripheral 1Core 2blocking Transaction #1Peripheral 2Exported Virtual System(EVS)SC_THREADFigure 5-16 Blocking transactions in single SC_THREAD5-52 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Export5.8.4 Calling wait() in the middle of a transactionIf wait() is called in a middle of a transaction for externally triggered signals, it is notguaranteed that signals/transactions are always generated within the SC_THREAD contextof the EVS. If a signal is triggered by an external event, such the WFI signal in theCortex-A9, calling wait() in the behavior implementation of a peripheral that respondsto this signal causes a runtime error. In Figure 5-17, Peripheral 1 issues a signal thatcauses the wfi signal on the core to be set. The Core, directly responding to this signalchange in its behavior (not buffered) generates a signal change on its wfi port with thecontext of SC_THREAD #1.If it is required that the peripheral really issues a wait() in reaction to a signal that ischanging, it must be buffered in the bridge between the EVS and SystemC. On the nextactivation of the bridge the signal can be set with the thread context of the EVS.SC_THREAD #1 SC_THREAD #2SC_THREAD #3Peripheral 1SignalCorewfiSignalPeripheral 2wait(…)Exported Virtual System(EVS)Figure 5-17 Calling wait() in the middle of a transactionNoteThe exported platform runs in temporal decoupled mode using a time quantum.Therefore targets (Peripheral 2 for example shown in Figure 5-17) should not callwait().<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-53ID031910Non-Confidential
SystemC Export5.8.5 Timing annotationTLM 2.0 supports the annotation of time to transactions. The EVS does honor suchtiming as described by the scenarios shown in Figure 5-18 and Figure 5-19.Core0nsread #1, sc_time=SC_ZERO_TIMEread #1, sc_time=10nsread #2, sc_time=SC_ZERO_TIMEMemoryTimeExported Virtual System(EVS)10nsSystemCFigure 5-18 Transaction issued by EVSFor Figure 5-18, the component in the EVS Core issues a read transaction to theSystemC component Memory. The transaction immediately returns annotating a delayof 10ns. The EVS ignores this annotation and continues the execution (read transaction#2) for the time quantum as if the memory had responded with a SC_ZERO_TIME delay.Memory0nsTimeread #1, sc_time=SC_ZERO_TIMEread #1, sc_time=SC_ZERO_TIMEread #1, sc_time=10nsread #1, sc_time=10nsDMAExported Virtual System(EVS)10nsSystemCFigure 5-19 Transaction issued by SystemCFor Figure 5-19, a transaction is issued by a component in the SystemC domain (Core)that accesses a memory modeled in the EVS (Memory). The timing annotation of thetransaction is never be changed by the EVS because it runs in a temporal-decoupledway that assumes all transactions are handled immediately. Figure 5-19 shows two readtransactions that are issued by a DMA component. The first transaction, marked withSC_ZERO_TIME, is answered by the memory component in the EVS immediately.Therefore the timing annotation is not changed. The second transaction is similar andthe annotation of 10ns is also not changed by the memory component. This behavior isinherent to the temporal decoupled fast models and will not change for future releases.5-54 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
SystemC Export5.8.6 Code translation support for external memoryThe Core components in the EVS make use of code translation for high simulationspeed. Therefore they will fetch data from external memory to translate it into hostmachine code. If the memory contents are changed outside of the scope of the core, thedata will be inconsistent.Figure 5-20 shows this scenario. In step 1, the core fetches the contents from theexternal memory by a direct memory interface (DMI) read transaction. This code istranslated into host machine code. If the memory content in the external memory ischanged by the SystemC DMA controller, the core is not notified. Therefore, theSystemC component is responsible to invalidate the DMI pointer so that the core canreload the content.wfiread(fetch data for codetranslation)CoreStep #1: get localcopy code translationMemoryStep #2: DMAchanges externalmemoryDMAExported Virtual System(EVS)SystemCFigure 5-20 Local modification of external memory<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 5-55ID031910Non-Confidential
SystemC Export5.8.7 Debug accessesAMBA-PV offers two functions based on the TLM 2.0 base protocol to generate debugaccesses:• debug_read(…)• debug_write(…).There is important limitation if such debug transactions are initiated from a SystemCmaster port to an EVS slave port such as shown in Figure 5-21.standard read()and write()Transaction Generatordebug_read()debug_write()TCMMemoryAMBAPV2PVBusDMAExported Virtual System(EVS)SystemCFigure 5-21 Debug accesses from a SystemC componentDebug transactions from a SystemC component (for Figure 5-21, DMA) can accessdebug_read() and debug_write() functions on the respective bus bridge (<strong>ARM</strong>BAPV2PVBus).However, the transactions that are generated on the bus connection are only standardnon-debug transactions. Because the attached component can not distinguish betweena non-debug and a debug transaction, it is assumed to be a normal transaction.This limitation will be removed in a future release.NoteDebug accesses that are initiated by a master port in the EVS are correctly translated todebug accesses in the AMBAPV bridge (PVBus2AMBAPV).5-56 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Chapter 6Creating a New ComponentThis chapter is a tutorial that covers the steps to create a new component. It contains thefollowing sections:• Basic configuration on page 6-2• Adding ports on page 6-4• Behavior section on page 6-8• Using the SerialCharDoubler component in the system on page 6-13.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 6-1ID031910Non-Confidential
Creating a New Component6.1 Basic configurationIn addition to using the supplied components and integrating C libraries, you can alsocreate your own custom LISA+ components. The LISA+ language is the base for newcomponents and is described in the LISA+ for <strong>Fast</strong> <strong>Model</strong>s Reference Manual.This section describes how to create a new LISA+ component and integrate it into the<strong>ARM</strong> ® dual core system. The component doubles each character that is sent from theUART to the terminal. See Figure 6-1.MasterSlaveData transmitData receiveoutinFigure 6-1 Character doubler componentThe transmit direction of the component requires a dedicated behavior to double eachcharacter and treat escape sequences in a proper way.6.1.1 Create a new LISA fileThe new component is defined in a LISA source file:1. Open the VP_DualCore project.Click on the New button to create an empty LISA file.2. Navigate to the directory for the new file. For example:path_to_modellib\examples\VP_DualCore\LISA3. Enter a file name for the component. For example:SerialCharDoubler.lisaClick Select to set the file name.4. The Workspace window shows an empty block diagram with the labelSerialCharDoubler?*. The question mark indicated that the file is not part of thecurrent system. The asterisk means that the file has not yet been saved.5. Click the Save button or select Save File from the File menu.6. Select Add Current File from the Project menu.7. Click the Files tab of the Component window.6-2 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Creating a New ComponentThe list now includes SerialCharDoubler.lisa as part of the project fileVP_DualCore.lisa. The question mark and asterisk in the title are no longerpresent.6.1.2 Resources sectionThe resources section describes the resources, including registers, memories, states, andother variables, of the component. In addition to annotated resources such as REGISTERand MEMORY, variable definitions can also be used.The doubler component only requires a single variable that indicates if the currentcharacter sequence follows an escape character:1. Select the Source tab in the Workspace for the file SerialCharDoubler.lisa.2. Add the resources section to the code as shown in Example 6-1.Example 6-1 Resource section with marker// This file was generated by System Generator Canvas// --------------------------------------------------component SerialCharDoubler{composition{}connection{}resources{// remember whether we are inside an escape sequence// which came through 'in'bool inEscape;}}<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 6-3ID031910Non-Confidential
Creating a New Component6.2 Adding portsTwo ports are required for this component. See Figure 6-1 on page 6-2:• the slave port receives the serial data• the master port writes out the doubled characters.Both ports use serial data and they must therefore use the SerialData protocol that isprovided in <strong>Fast</strong> <strong>Model</strong> Portfolio.Add the ports to the component:1. In the Block Diagram view of the SerialCharDoubler component, right click intothe blank diagram and select context menu item Add port...2. The Self Port dialog is displayed. See Figure 6-2. Enter in for the ports InstanceName.3. For Type select Slave Port.Figure 6-2 Self Port dialog4. To choose the protocol, click the Select... button Protocol. Select SerialDatafrom the displayed list and click OK.6-4 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Creating a New ComponentFigure 6-3 Select Protocol dialog5. Leave the Self Port dialog by pressing the OK button. A port is added to the blockdiagram. Click to drop the port on the canvas.6. Repeat the procedure for the out master port:• Instance Name is out• Type is Master Port• Protocol is SerialData.7. Click the Source tab for the SerialCharDoubler component. The code is updatedas shown in Example 6-2:Example 6-2 Ports added to char doubler// This file was generated by System Generator Canvas// --------------------------------------------------component SerialCharDoubler{composition{}connection{}resources{// remember whether we are inside an escape sequence<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 6-5ID031910Non-Confidential
Creating a New Component// which came through 'in'bool inEscape;}slave port in{behavior dataTransmit(uint16_t data):void{// TODO: place your code here}behavior dataReceive():uint16_t{// TODO: place your code here}behavior signalsSet(uint8_t signal):void{// TODO: place your code here}behavior signalsGet():uint8_t{// TODO: place your code here}}master port out;{behavior dataTransmit(uint16_t data):void{// TODO: place your code here}behavior dataReceive():uint16_t{// TODO: place your code here}behavior signalsSet(uint8_t signal):void{// TODO: place your code here}behavior signalsGet():uint8_t{// TODO: place your code here}6-6 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Creating a New Component}}<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 6-7ID031910Non-Confidential
Creating a New Component6.3 Behavior section6.3.1 View the SerialData protocolThe functionality of the component is expressed by behaviors. In the SerialCharDoublercomponent, you must manage two types of behavior:Port behaviorsThe implementations of behaviors supported by the used protocol. Slaveports implement slave port behaviors while master port behaviors areimplemented for master ports.Special-purpose behaviorsCertain reserved behaviors with a special meaning in components.Examine the default SerialData protocol that is used by the master and slave ports:1. Select the Protocols tab in the Component window.2. Double-click on the SerialData protocol.3. The protocol source is displayed in the Workspace window:protocol SerialData{...slave behavior dataTransmit(unit16_t data);slave behavior dataReceive():unit16_t;slave behavior signalsSet(uint8_t signal);slave behavior signalsGet():uint8_t;}4. The following characteristics apply to the SerialData protocol:• All behaviors are slave behaviors.• None of the behavior statements contains the keyword optional. The slavemust therefore implement all of the behaviors.6.3.2 Adding the new behavior to the SerialCharDoubler slave portThe slave port must alter the standard behavior for the transmit direction so thatcharacters are doubled.The receive direction is not changed and this requires only a call to the same behaviorof master port out to simply transfer the data from the slave port to the master port.6-8 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Creating a New ComponentThe modification of the transmitted data is implemented in slave behaviordataTransmit. Select the Source tab to display the LISA source code forSerialCharDoubler.lisa, and modify the SerialData slave port dataTransmit behavior asshown in Example 6-3:Example 6-3 Slave port behaviorslave port in{behavior dataTransmit(uint16_t data){// start of escape sequence?if(data == '\33'){inEscape = true;}if(inEscape){// leave escape sequences untouched (only send one char)out.dataTransmit(data);}else{// duplicate char on outputout.dataTransmit(data);out.dataTransmit(data);}// end of escape sequence?if(isalpha(data)){inEscape = false;}}...}The data is not doubled for escape sequences but is doubled for other characters. Theend of escape sequences is detected by the occurrence of an alphabetic character and theresource inEscape is reset.The dataReceive() behavior calls the respective behavior of the master port as shown inExample 6-4 on page 6-10. Modify the behavior as shown:<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 6-9ID031910Non-Confidential
Creating a New ComponentExample 6-4 Slave port receive behaviorbehavior dataReceive():uint16_t{return out.dataReceive();}Because signals are not effected by the doubling, the behavior to set and get signals arewrappers on the master port behavior as shown in Example 6-5:Example 6-5 Slave port get and set signalsbehavior signalsSet(uint8_t signal){out.signalsSet(signal);}behavior signalsGet():uint8_t{return out.signalsGet();}6.3.3 Master portThe character doubler component requires a master port to initiate incoming requestsfrom the slave port and forward them to the connected slave port of another component.The only action required in the code is declaring the master port:master port out;Remove or comment out any behavior definitions in the master port section inSerialCharDoubler.lisa.The actual connection is done using connection mode in the Block Diagram view.The master port uses the same protocol as the slave port. This is not a requirement, butis useful here because only one behavior is implemented, dataTransmit, and the rest isjust forwarded.6-10 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Creating a New Component6.3.4 Special purpose behaviorsCertain behavior names have a special meaning in components. These special purposebehaviors are called implicitly and automatically in certain simulation phases. SeeTable 6-1 for a list.Table 6-1 Special-purpose behaviorsBehaviorbehavior initbehavior reset(int level)behavior loadApplicationFile(const string& filename)behavior terminateDescriptionThis behavior is called implicitly once when the simulation isstarted. The code in this behavior is executed only once. It isintended to allocate memory and other resources used duringsimulation.This behavior is called whenever the simulation is reset by theuser. Reset might be called multiple times. There are two resetlevels:level=MX_RESETLEVEL_SOFTall state variables must be reset to their resetvalue but memory contents must not becleared.level= MX_RESETLEVEL_HARDall state variables must be reset to their resetvalue and memory contents must also becleared.Memory must not be allocated in this behavior since it mightinvoked several times.This behavior is invoked whenever a user loads an applicationfile into a component using a debugger. The implementationof this behavior must load the application file.This behavior is the counterpart to behavior init and is calledwhen the simulation terminates. It is intended to free anyallocated memory and resources that were allocated inbehavior init.Init behaviorAt system startup, each component is called for several phases of the simulation. Thefirst call is the init phase. The init behavior implements what the component must doat this stage.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 6-11ID031910Non-Confidential
Creating a New ComponentThe SerialCharDoubler component only requires setting the boolean flag that indicatesthat the component is just about to transmit an escape sequence. Place the code inExample 6-6 before the slave port definition in SerialCharDoubler.lisa:Example 6-6 init behaviorbehavior init{inEscape = false;}Reset behaviorThe doubler component init phase performs everything that is required at startup.There is, therefore, no requirement for a reset behavior.Terminate behaviorThe terminate behavior is typically responsible for freeing all resources allocated in theinit phase. The doubler component does not allocate any resources in the init phase, theterminate behavior can therefore be omitted.A different component type, for example a memory component, might allocate memorystructures to represent data or register storage. Allocated structures must be freed in thisphase.6-12 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Creating a New Component6.4 Using the SerialCharDoubler component in the systemThis section describes how to use the SerialCharDoubler component in the dual coresystem.Insert the new component in the dual core system:1. Remove the connection between the uart1a and the term1 component.2. Add the SerialCharDoubler component to the system.Figure 6-4 SerialCharDoubler inserted in dual core system3. Connect the serial_out port of the uart1a component to the in port of theSerialCharDoubler component.4. Connect the out port of the Serialchardoubler component to the serial port of theterm1 component. See Figure 6-4.5. Click the Build button on the toolbar to rebuild the system.6. After the compilation is finished, click the Debug button.7. Follow the steps already described in Debugging the system on page 2-23.8. The output of the Linux terminal is doubled by SerialCharDoubler as shown inFigure 6-5 on page 6-14.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. 6-13ID031910Non-Confidential
Creating a New ComponentFigure 6-5 Linux booting with SerialCharDoubler component6-14 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Appendix ABuilding and Running the EB RTSM ExampleSystemThis appendix describes the steps required to build and run the supplied EB RTSMplatform example. It contains the following sections:• Using System Canvas to build the platform model on page A-2• Connecting to the model on page A-5• Running an application on the system model on page A-13.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. A-1ID031910Non-Confidential
Building and Running the EB RTSM Example SystemA.1 Using System Canvas to build the platform modelThis section describes how to use the System Canvas build an EB RTSM.NoteThis section assumes that you are using version 4.0 or later of System Canvas. Usingother versions might not be successful. File names, interfaces and procedures might bedifferent from those documented in this section.<strong>Model</strong> projects supplied with one version of <strong>Fast</strong> <strong>Model</strong>s are not necessarily compatiblewith a different version.The model build subdirectories are in the %PVLIB_HOME%\examples\RTSM_EB directory.A.1.1Building an EB Real-Time System <strong>Model</strong>This section uses the EB1176 Real-Time System <strong>Model</strong> as an example. If you arebuilding a different model, substitute your model name.1. Start System Canvas for <strong>Fast</strong> <strong>Model</strong>s.2. Click the Open button on the System Canvas toolbar.3. Navigate to the location of the EB1176 Real-Time System <strong>Model</strong> project. This is%PVLIB_HOME%\examples\RTSM_EB\Build_EB1176\RTSM_EB1176.sgproj. Click Opento load the project.4. By default, you generate a Release build of the model. To change to a Debugbuild, select the Select Active Project Configuration drop-down list on theSystem Canvas toolbar and change the configuration.5. Click the Build button on the System Canvas toolbar to build the model.Note• Depending on your preference setting, a system check might be performedand a window might open if warnings or errors occur. Click Proceed to startthe build.• Depending on the speed and processor loading of your computer, builds,particularly Release builds, can take several minutes to finish.• Error messages are generated if there is a problem.6. If you used the default project settings, the build generates aWindows-Release-compiler\cadi_system_Windows-Debug-compiler.dll orLinux-Release-compiler/cadi_system_Linux-Debug-compiler.so object.A-2 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Building and Running the EB RTSM Example SystemA dll object is generated on Windows systems and an so object is generated onLinux systems.compiler is the name of the compiler used.If you created a Debug object, substitute Debug for Release in the directory and filenames.The object can be used with <strong>Model</strong> Shell or <strong>Model</strong> Debugger. See Using <strong>Model</strong>Debugger to run a system model on page A-7.You can also use the object with <strong>ARM</strong> Profiler or RealView Debugger . SeeUsing RealView Debugger to run a system model on page A-10.A.1.2Packaging the system model for distributionIf you are running the model in the same environment where the model was created, allDLLs and support files are already available to the model.If, however, you are packaging the system model for use on a system that does not have<strong>Fast</strong> <strong>Model</strong>s installed, you must include the required DLLs and support files as part ofthe package.NoteWhen the model is built, the output files are placed in a deployment subdirectory in thedirectory that contains the source project file. By default the name of the deploymentsubdirectory matches the build options selected from the Select Active ProjectConfiguration drop-down list on the System Canvas toolbar:• Win32-Debug-VC2005 is a debug version of the model built with VC2005.• Win32-Release-VC2005 is a release version of the model built with VC2005.• Win32-Debug-VC2008 is a debug version of the model built with VC2008.• Win32-Release-VC2008 is a release version of the model built with VC2008.• Linux-Release-GCC-3.4 is a version of the model built with version 3.4 of GCC.• Linux-Release-GCC-4.1 is a version of the model built with version 4.1 of GCC.You can also create your own custom build configuration option. In this case, the nameof the deployment directory matches the name of your custom build configuration.For more information on deployment options for user-supplied files, see File/PathProperties dialog on page 3-46.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. A-3ID031910Non-Confidential
Building and Running the EB RTSM Example SystemPackaging the model for use on LinuxThe following steps must be followed if your model is to be used by others:• Ship any user-defined files such as text files or application files• Ship any shared libraries for custom components you created• Ship the following files from the deployment directory for the model you built:— libMAXCOREInitSimulationEngine.so.2— libarmctmodel.so— libSDL-1.2.so.0.11.2 (required if your model uses the PL041 AACIcomponent or uses any visualization components).• If Ethernet components are used, ensure that the end user has libpcap installed.Packaging the model for use on WindowsThe following steps must be followed if your model is to be used by others:• Ship any user-defined files such as text files or application files• Ship any DLLs for custom components you created• Ship the following files from the deployment directory for the model you built:— libMAXCOREInitSimulationEngine.2.dll— SDL.dll (required if your model uses the PL041 AACI component or usesany visualization components)— armctmodel.dll— pktethernet.dll (if Ethernet components are used).• If Ethernet components are used, ensure that the end user has winpcap installed.• Ensure that the end user has one of the following applications installed:— a compatible version of Microsoft Visual Studio installed for runningDebug builds (VC2005 SP1 or VC2008 SP1)— the Microsoft Visual Studio Redistributable Package (2005 SP1 or 2008SP1) for Release builds.A-4 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Building and Running the EB RTSM Example SystemA.2 Connecting to the modelThis section describes the different ways to connect to a system model:• Using <strong>Model</strong> Shell to run the system model• Using <strong>Model</strong> Debugger to run a system model on page A-7• Using RealView Debugger to run a system model on page A-10.A.2.1Using <strong>Model</strong> Shell to run the system modelTo start the EB RTSM using <strong>Model</strong> Shell, change to the directory that contains yourmodel file and enter the following at the command prompt:model_shell --cadi-server --model model_name [--config-file filename] [-Cinstance.parameter=value] [--application app_filename]where:model_namefilenameis the name of the model file. By default the file name for Debug versionsis typically cadi_system_Windows-Debug-compiler.dll on Windows, orcadi_system_Linux-Debug-compiler.so on Linux, where compiler is thename of the compiler used to build the model.is the name of your optional plain-text configuration file. Configurationfiles simplify managing multiple parameters. See Using a configurationfile on page A-6.instance.parameter=valueis the optional direct setting of a configuration parameter. See Using thecommand line on page A-6.app_filename is the file name of an image to load to your model at startup.NoteOn Windows, it might be necessary to add the directory that contains the <strong>Model</strong> Shellexecutable to your PATH. This location of the directory is typically:C:\Program Files\<strong>ARM</strong>\<strong>Model</strong>Debugger_4.0\binYou can also start <strong>Model</strong> Shell from the System Canvas GUI.For more information on all <strong>Model</strong> Shell options, see the <strong>Model</strong>Shell For <strong>Fast</strong> <strong>Model</strong>s<strong>User</strong> <strong>Guide</strong>.Starting the model opens the Real-Time System <strong>Model</strong> CLCD display as described inUsing the CLCD window on page A-16.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. A-5ID031910Non-Confidential
Building and Running the EB RTSM Example SystemAfter the EB RTSM starts, you can connect to it using a CADI-compliant debugger suchas <strong>Model</strong> Debugger or RealView Debugger. See Connecting to a running <strong>Model</strong> Shellusing <strong>Model</strong> Debugger on page A-7 and Connecting to a running model using RealViewDebugger on page A-12.Using a configuration fileTo configure a model that you start from the command line with <strong>Model</strong> Shell, includea reference to an optional plain text configuration file as described in Using <strong>Model</strong> Shellto run the system model on page A-5.Comment lines in the configuration file must begin with a # character.Each non-comment line of the configuration file contains:• the name of the component instance• the parameter to be modified and its value.Boolean values can be set using either true/false or 1/0. Strings must be enclosedin double quotes if they contain whitespace.A typical configuration file is listed in Example A-1:Example A-1 Configuration file# Disable semihosting using true/false syntaxcoretile.core.semihosting-enable=false## Enable the boot switch using 1/0 syntaxbaseboard.sp810_sysctrl.use_s8=1## Set the boot switch positionbaseboard.eb_sysregs_0.boot_switch_value=1Using the command lineYou can define model parameters when you invoke the model by using the -C switchwhen starting <strong>Model</strong> Shell. You can also use --parameter as a synonym for the -Cswitch. See Using <strong>Model</strong> Shell to run the system model on page A-5. Use the samesyntax as for a configuration file, but each parameter must be preceded by the -C switch.A-6 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Building and Running the EB RTSM Example SystemA.2.2Using <strong>Model</strong> Debugger to run a system modelThis section describes the various ways you can use <strong>Model</strong> Debugger to connect to amodel:• Starting <strong>Model</strong> Debugger from System Canvas• Connecting to a running <strong>Model</strong> Shell using <strong>Model</strong> Debugger• Configuring the system from <strong>Model</strong> Debugger on page A-9.Starting <strong>Model</strong> Debugger from System CanvasYou can start the EB RTSM using <strong>Model</strong> Debugger directly from System Canvas:• Build and load your model project.• Click the Debug button in the System Canvas toolbar.• <strong>Model</strong> Debugger is displayed with the EB RTSM preloaded.• Before the running the model, you can user the Configure <strong>Model</strong> Parametersdialog to define instantiation parameters. See Configuring the system from <strong>Model</strong>Debugger on page A-9.Alternatively you can start <strong>Model</strong> Debugger separately and load the model libraryyourself. If you are using Windows, you must ensure that you have all required DLLson your PATH. See the note at the end of Building an EB Real-Time System <strong>Model</strong> onpage A-2. For more details on using and configuring <strong>Model</strong> Debugger, see the <strong>Model</strong>Debugger for <strong>Fast</strong> <strong>Model</strong>s <strong>User</strong> <strong>Guide</strong>.You can configure certain instantiation-time parameters using the Configure <strong>Model</strong>Parameters dialog before the model starts.Connecting to a running <strong>Model</strong> Shell using <strong>Model</strong> Debugger1. In <strong>Model</strong> Debugger, select File → Connect to <strong>Model</strong>.2. The Connect Remote dialog shown in Figure A-1 on page A-8 is displayed.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. A-7ID031910Non-Confidential
Building and Running the EB RTSM Example SystemFigure A-1 <strong>Model</strong> Debugger Connect remote dialog3. In the Connect Remote dialog, select the entry for the EB RTSM.4. Click Connect.5. The Select Target dialog shown in Figure A-2 is displayed.Figure A-2 <strong>Model</strong> Debugger Select Targets dialog6. Choose the targets to load. By default, the processor corresponding to the <strong>ARM</strong>processor in your EB RTSM is selected, and must be loaded. Click OK.7. <strong>Model</strong> Debugger prompts you to load an application (image) to the model. Selectthe application image from the Load Application dialog and click Open.A-8 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Building and Running the EB RTSM Example SystemYou can now control and debug the model using <strong>Model</strong> Debugger. You can makemultiple debugger connections to a single model instance.To shut down the model, return to the command window that you used to start the modeland press Ctrl + C to stop the CADI server. The <strong>Model</strong> Shell process must be in theforeground before you can shut it down.Configuring the system from <strong>Model</strong> DebuggerIf you load a model in <strong>Model</strong> Debugger, the Configure <strong>Model</strong> Parameters dialog shownin Figure A-3 is displayed to enable you to define instantiation-time parameters.To view the configuration parameters:Figure A-3 Configure <strong>Model</strong> Parameters dialog1. Click Category View to expand the tree view in the left hand Parameter categorypane2. Click a component in the list, for example coretile.core, to highlight theparameter category to modify3. In the right hand pane, select or deselect check boxes for boolean parameters orenter data such as strings or addresses in fields.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. A-9ID031910Non-Confidential
Building and Running the EB RTSM Example SystemHovering the mouse pointer over a parameter shows a description of theparameter and its default value.You can change the numeric display from the default hexadecimal to decimal byclearing the Hexadecimal display for numeric values box in the lower leftcorner.A.2.3Using RealView Debugger to run a system modelSee the following sections for details on the ways you can connect to an EB RTSM:• Starting the model as an RTSM connection in RealView Debugger• Configuring the system from RealView Debugger on page A-11• Connecting to a running model using RealView Debugger on page A-12.NoteYou must not connect to more than one RTSM at any one time in RealView Debugger.If you do, you might experience unexpected behavior or crashes.Starting the model as an RTSM connection in RealView DebuggerFollow the steps below to add the EB RTSM to the RealView Debugger Connect toTarget window under the Real-Time System <strong>Model</strong> (RTSM) debug interfaceconfiguration.1. In RealView Debugger, select Target → Connect to Target... to open theConnect to Target window.2. Click the Add button beside the Real-Time System <strong>Model</strong> (RTSM) debuginterface name. This opens the <strong>Model</strong> Configuration Utility window:• The RTSM models are automatically displayed in the list based on the pathset by the <strong>ARM</strong>_RTSM_PATH variable.• If the <strong>ARM</strong>_RTSM_PATH variable has not been set, click the Browse... button toopen a file browser for locating the EB RTSM. You can find these modelsin:%<strong>ARM</strong>ROOT%\SysGen\PVExamples\4.0\nn\external\lib\environment\Releasewhere:nnis a version numberenvironmentis the name of the platform and compiler.The model file names are of the form:— RTSM_EB_processor.dll on WindowsA-10 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Building and Running the EB RTSM Example System— RTSM_EB_processor.so on Linux.where processor indicates the supplied processor model such, for example,as 1176.• If you have separately installed and built an EB RTSM yourself usingSystem Canvas, you can load the models from theBuild_EBprocessor\platform-build-compiler subdirectory of the%PVLIB_HOME%\examples\RTSM_EB\directory where:processor is one of the supplied processor models. such as <strong>ARM</strong>1176.platform-build-compileris the platform, build type, and compiler, for exampleLinux-Release-GCC-3.4.See Building an EB Real-Time System <strong>Model</strong> on page A-2.3. Select the model to use in the <strong>Model</strong>s pane on the left side of the <strong>Model</strong>Configuration Utility:• Configure the device parameters if required. See Configuring the systemfrom RealView Debugger.• After you have finished, or if no parameters required configuration, clickOK.4. In the RealView Debugger Connect to Target window, double-click on yournewly-created target to connect to it. If you are grouping targets by Configuration,expand the target connection tree view to see your target instance. Connecting toa target opens a CLCD window.Configuring the system from RealView DebuggerIn RealView Debugger, you can configure the EB RTSM parameters before youconnect to the model and start it:• If you are adding the particular EB RTSM to the RealView Debugger Connect toTarget list, the <strong>Model</strong> Configuration Utility dialog box is displayed automatically.• Alternatively you can right click on your existing target in the Connect to Targetlist and select Configure... to open the same dialog.To view the configuration parameters, scroll down the list of devices shown in the upperright pane. Selecting a device populates the lower right pane with the device parameters.To change a parameter value, select a boolean from the drop down list, or enter datasuch as strings or addresses by clicking in the relevant field. Hovering the mouse pointerover a device or parameter shows a description or additional information.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. A-11ID031910Non-Confidential
Building and Running the EB RTSM Example SystemTo change the numeric display from decimal to hexadecimal, right click on theparameter value in the lower right pane and select Hexadecimal Display from thecontext menu.Connecting to a running model using RealView DebuggerYou can use RealView Debugger to connect to an already running <strong>Model</strong> Shell instanceof the EB RTSM. You can make multiple debugger connections to a single modelinstance.1. Start <strong>Model</strong> Shell, if it is not already running, as described in Using <strong>Model</strong> Shellto run the system model on page A-5.2. In RealView Debugger, select Target → Connect to Target... to open theConnect to Target window.3. Click the Add button beside the SoC Designer debug interface name.4. The debugger detects any running CADI servers and displays them in a pop-upwindow. The core tile in your running EB RTSM is automatically selected. ClickOK.5. In the RealView Debugger Connect to Target window, double-click on yournewly-created SoC Designer target to connect to it.A-12 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Building and Running the EB RTSM Example SystemA.3 Running an application on the system modelThis section describes how to load and run an application on a system model. You canuse one of the supplied example system models or a custom model you built byfollowing the examples in Using System Canvas to build the platform model onpage A-2.The brot.axf example application runs on all versions of the EB RTSM.This demo application provides a simple demonstration of rendering an image to theCLCD display.Source code is supplied:• For <strong>Fast</strong> <strong>Model</strong> Portfolio, the examples are in the %PVLIB_HOME%\images directory.• For RVDS, the source code is available in the directory%<strong>ARM</strong>ROOT%\RVDS\Examples\4.0\nn\platform\mandelbrot, where nn is a versionnumber.NoteThese applications are provided for demonstration purposes only and are not supportedby <strong>ARM</strong>. The number of examples or implementation details might change withdifferent versions of the system model.For more information on debugging applications, see Chapter 4 Debugging, the <strong>Model</strong>Debugger for <strong>Fast</strong> <strong>Model</strong>s <strong>User</strong> <strong>Guide</strong>, and the RealView Debugger <strong>User</strong> <strong>Guide</strong>.A.3.1Running the brot application in <strong>Model</strong> DebuggerTo load and run the brot.axf image in <strong>Model</strong> Debugger:1. Start <strong>Model</strong> Debugger and connect to the system model as described in Using<strong>Model</strong> Debugger to run a system model on page A-7.2. Click the Open button on the main toolbar to open the Load Application dialogthat enables you to select the application file to load.3. Browse to the location of the brot.axf image. Click Open to load the image to thetarget.4. Click the Open toolbar button again and browse to the location of the brot.csource file. Click Open to load the source into the <strong>Model</strong> Debugger source pane.5. Click in the source pane and place a breakpoint on the render function on line 154of the source code.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. A-13ID031910Non-Confidential
Building and Running the EB RTSM Example System6. Press F5, or select Run from the Debug menu, until the CLCD window displaysan image similar to that shown in Figure A-4.7. Repeatedly press F5 and notice how the CLCD window changes.Figure A-4 CLCD windowA.3.2Running the brot application in RealView DebuggerThe brot.axf example application runs on all versions of the EB RTSM.This demo application provides a simple demonstration of rendering an image to theCLCD display. Source code is supplied.If you are using the <strong>Fast</strong> <strong>Model</strong> Portfolio, the examples are in the %PVLIB_HOME%\imagesdirectory.In RVDS, the source code is available in the directory%<strong>ARM</strong>ROOT%\Examples\4.0\nn\platform\mandelbrot, where nn is a version number.A-14 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Building and Running the EB RTSM Example SystemNoteThese applications are provided for demonstration purposes only and are not supportedby <strong>ARM</strong>. The number of examples or implementation details might change withdifferent versions of the system model.It might be necessary to build the brot.axf image before loading the application.Instructions and build scripts are in %<strong>ARM</strong>ROOT%\Examples\4.0\nn\platform\mandelbrot,where nn is a version number.To load and run the brot.axf image in RealView Debugger:1. Start RealView Debugger and connect to the system model as described in UsingRealView Debugger to run a system model on page A-10.2. Select Load Image from the Target menu. The Select Local Files to Load dialogis displayed.3. Browse to the location of brot.axf, Select it and click Open.4. Select the brot.c tab in the RealView Debugger main window and place abreakpoint on the render function, as shown in Figure A-5 on page A-16.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. A-15ID031910Non-Confidential
Building and Running the EB RTSM Example SystemFigure A-5 Breakpoint in brot.c5. Press F5, or select Run from the Debug menu, until the CLCD window isdisplayed as shown in Figure A-4 on page A-14.6. Repeatedly press F5 and observe the changes in the CLCD window.A.3.3Using the CLCD windowFor both RealView Debugger and <strong>Model</strong> Debugger, the CLCD window is displayedwhen the RTSM starts. The window title is Real-Time System <strong>Model</strong> CLCD.This window represents the contents of the simulated color LCD framebuffer. Itautomatically resizes to match the horizontal and vertical resolution set in the CLCDperipheral registers. For more information on the CLCD model components and otherperipherals, see the <strong>Fast</strong> <strong>Model</strong> Portfolio Reference Manual.Figure A-6 on page A-17 shows the EB RTSM CLCD window immediately after beingstarted. This is the default state.A-16 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Building and Running the EB RTSM Example SystemFigure A-6 CLCD window at startupThe top section of the CLCD window displays the following status information:USERSWBOOTSWEight white boxes show the state of the EB <strong>User</strong> DIP switches:These represent switch S6 on the EB hardware, USERSW[8:1], that ismapped to bits [7:0] of the SYS_SW register at address 0x10000004.The switches are in the off position by default. Click in the area above orbelow a white box to change its state.Eight white boxes showing the state of the EB Boot DIP switches.These represent switch S8 on the EB hardware, BOOTSEL[8:1], that ismapped to bits [15:8] of the SYS_SW register at address 0x100000004.The switches are in the off position by default.Note<strong>ARM</strong> recommends you configure the Boot DIP switches using theboot_switch model parameter rather than by using the CLCD interface.Changing Boot DIP switch positions while the model is running canresult in unpredictable behavior.S6LEDTotal InstrEight colored boxes indicate the state of the EB <strong>User</strong> LEDs.These represent LEDs D[21:14] on the EB hardware, that are mapped tobits [7:0] of the SYS_LED register at address 0x10000008. The boxescorrespond to the red/yellow/green LEDs on the EB hardware.A counter showing the total number of instructions executed.Because the system model models provide a programmer’s view of thesystem, the CLCD displays total instructions rather than total core cycles.Timing might differ substantially from the hardware because:• the bus fabric is simplified• memory latencies are minimized• cycle approximate core and peripheral models are used.In general bus transaction timing is consistent with the hardware, buttiming of operations within the model is not accurate.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. A-17ID031910Non-Confidential
Building and Running the EB RTSM Example SystemTotal Time A counter showing the total elapsed time, in seconds.This is wall clock time, not simulated time.Rate LimitA feature that disables or enables fast simulation.Because the system model is highly optimized, your code might runfaster than it would on real hardware. This might cause timing issues.If Rate Limit is enabled, the default, simulation time is restricted so thatit more closely matches real time.Click on the square button to disable or enable Rate Limit. The textchanges from ON to OFF and the colored box becomes darker when RateLimit is disabled. Figure A-6 on page A-17 shows the CLCD with RateLimit disabled.NoteYou can control whether Rate Limit is enabled by using therate_limit-enable parameter when instantiating the model.If you click on the Total Instr or Total Time items in the CLCD, the display changesto show two different items as shown in Figure A-7. You can click on the items againto toggle between the original and alternative displays.Figure A-7 CLCD window alternative displayInstr/secPerf IndexShows the number of instructions executed per second of wall clock time.The ratio of real time to simulation time. The larger the ratio, the fasterthe simulation runs. If you enable the Rate Limit feature, the Perf Indexapproaches unity.You can reset the simulation counters by resetting the model.If the CLCD window has focus:• keyboard input is translated to PS/2 keyboard data.• mouse activity over the window is translated into PS/2 relative mouse motiondata. This is then streamed to the KMI peripheral model FIFOs.A-18 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Building and Running the EB RTSM Example SystemNoteThe simulator only sends relative mouse motion events to the model. As a result, thehost mouse pointer does not necessarily align with the target OS mouse pointer.On Windows, you can hide the host mouse pointer by pressing the left Ctrl+Windowskeys. Press the keys again to redisplay the host mouse pointer. Only the Left Ctrl keyis operational and the Ctrl key on the right of the keyboard does not have the sameeffect.If you do not have a Windows key, or prefer to use a different key, use the trap_keyconfiguration option. Refer to the CADI parameter documentation for details in the<strong>Fast</strong> <strong>Model</strong> Portfolio Reference Manual.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. A-19ID031910Non-Confidential
Building and Running the EB RTSM Example SystemA-20 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Appendix BRed Hat Linux DependenciesThis appendix describes the dependencies for Red Hat Linux. It contains the followingsections:• About dependencies on page B-2• Dependencies for Red Hat Enterprise Linux 4.4 on page B-3• Dependencies for Red Hat Enterprise Linux5 on page B-5.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. B-1ID031910Non-Confidential
Red Hat Linux DependenciesB.1 About dependenciesSome library objects or applications have dependencies on other library files.To display the dependencies for a library file on your installation, enter:rpm -qf library_fileFor example, to list the dependencies for /lib/tls/libc.so.6, enter the following at theterminal command line:rpm -qf /lib/tls/libc.so.6The following text is output to indicate that the library is dependent on version2.3.2-95.37 of glibc:glibc-2.3.2-95.37B-2 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Red Hat Linux DependenciesB.2 Dependencies for Red Hat Enterprise Linux 4.4Table B-1 lists dependencies for Red Hat Enterprise Linux 4.The distributor ID for this release is RedHatEnterpriseWS.NoteThe SDL library /usr/lib/libSDL-1.2.so.0 is present, but <strong>ARM</strong> recommends that youdo not use this version and instead change LD_LIBRARY_PATH to include the libSDL fromthe deployed package.Table B-1 Dependencies for Red Hat Enterprise Linux 4.4Library file Dependencies Required for/lib/ld-linux.so.2 glibc-2.3.4-2.25 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/libasound.so.2 alsa-lib-1.0.6-5.RHEL4 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/libdl.so.2 glibc-2.3.4-2.25 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/libgcc_s.so.1 libgcc-3.4.6-3 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/tls/libc.so.6 glibc-2.3.4-2.25 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/tls/libm.so.6 glibc-2.3.4-2.25 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/tls/libpthread.so.0 glibc-2.3.4-2.25 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/tls/librt.so.1 glibc-2.3.4-2.25 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/lib/libncurses.so.5 ncurses-5.4-13 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> only/usr/lib/libstdc++.so.6 libstdc++-3.4.6-3 <strong>Fast</strong> <strong>Model</strong> Portfolio only/usr/lib/libz.so.1 zlib-1.2.1.2-1.2 <strong>Fast</strong> <strong>Model</strong> Portfolio only/usr/X11R6/bin/makedepend XFree86-devel-6.8.2-1.EL.13.36 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> only/usr/X11R6/lib/libICE.so.6 XFree86-libs-6.8.2-1.EL.13.36 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/X11R6/lib/libSM.so.6 XFree86-libs-6.8.2-1.EL.13.36 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/X11R6/lib/libX11.so.6 XFree86-libs-6.8.2-1.EL.13.36 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. B-3ID031910Non-Confidential
Red Hat Linux DependenciesTable B-1 Dependencies for Red Hat Enterprise Linux 4.4 (continued)Library file Dependencies Required for/usr/X11R6/lib/libXcursor.so.1 XFree86-libs-6.8.2-1.EL.13.36 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/X11R6/lib/libXext.so.6 XFree86-libs-6.8.2-1.EL.13.36 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/X11R6/lib/libXrender.so.1 XFree86-libs-6.8.2-1.EL.13.36 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and PortfolioB-4 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Red Hat Linux DependenciesB.3 Dependencies for Red Hat Enterprise Linux5Table B-2 lists the library files and their dependencies for Red Hat Enterprise Linux 5.The distributor ID for this release is RedHatEnterpriseClient.NoteThe SDL library /usr/lib/libSDL-1.2.so.0 is present, but <strong>ARM</strong> recommends that youdo not use this version and instead change LD_LIBRARY_PATH to include the libSDL fromthe deployed package.Table B-2 Dependencies for Red Hat Enterprise Linux 5Library file Dependencies Required for/lib/ld-linux.so.2 glibc-25-12 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/libasound.so.2 alsa-lib-1.0.12-3.el5 <strong>Fast</strong> <strong>Model</strong> Portfolio only/lib/libaudiofile.so.0 audiofile-0.2.6-5 <strong>Fast</strong> <strong>Model</strong> Portfolio only/lib/libc.so.6 glibc-2.5-12 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/libdl.so.2 glibc-2.5-12 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/libgcc_s.so.1 libgcc-4.1.1-52.el5 <strong>Fast</strong> <strong>Model</strong> Portfolio only a/lib/tls/libm.so.6 glibc-2.5-12 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/tls/libpthread.so.0 glibc-2.5-12 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/lib/tls/librt.so.1 glibc-2.5-12 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/bin/makedepend imake-1.0.2-3 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> only/usr/lib/libesd.so.0 esound-0.2.36-3 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/lib/libICE.so.6 libICE-1.0.1-2.1 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/lib/libncurses.so.5 ncurses-5.5-24.20060715 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/lib/libSM.so.6 libSM-1.0.1-3.1 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/lib/libstdc++.so.6 libstdc++-4.1.1-52.el5 <strong>Fast</strong> <strong>Model</strong> Portfolio only/usr/lib/libX11.so.6 libX11-1.0.3-8.el5 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/lib/libXau.so.6 libXau-1.0.1-3.1 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. B-5ID031910Non-Confidential
Red Hat Linux DependenciesTable B-2 Dependencies for Red Hat Enterprise Linux 5 (continued)Library file Dependencies Required for/usr/lib/libXcursor.so.1 libXcursor-1.1.7-1.1 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/lib/libXdmcp.so.6 libXdmcp-1.0.1-2.1 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/lib/libXext.so.6 libXext-1.0.1-2.1 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/lib/libXfixes.so.3 libXfixes-4.0.1-2.1 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/lib/libXrender.so.1 libXrender-0.9.1-3.1 <strong>Fast</strong> <strong>Model</strong> <strong>Tools</strong> and Portfolio/usr/lib/libz.so.1 zlib-1.2.3-3 <strong>Fast</strong> <strong>Model</strong> Portfolio onlya. The libgcc_s.so/libstdc++.so libraries are present in Red Hat Enterprise Linux 5, but <strong>ARM</strong> recommends that youdo not use this version. Copy the versions included in <strong>Fast</strong> <strong>Model</strong>s to the deployment package and setLD_LIBRARY_PATH.B-6 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Appendix CBuilding System <strong>Model</strong>s in Batch ModeThis appendix describes the Simulation Generator (SIMGEN). It contains the followingsection:• Introduction on page C-2• SIMGEN command-line options on page C-3.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. C-1ID031910Non-Confidential
Building System <strong>Model</strong>s in Batch ModeC.1 IntroductionThe Simulation Generator (SIMGEN) is a utility that generates a system model from aproject.Start simgen by either:• pressing the Build icon in System Canvas to build the current project• typing simgen on a command line and specifying the project options.To display help for the command line options, start simgen with no parameters orspecify help:simgen --helpsimgen accepts a system description as input and generates source code for a simulatoras output.The typical usage for building a platform simulator is:simgen -p PROJECTFILE_NAME.sgproj --configuration CONFIGURATION_NAME -bC-2 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Building System <strong>Model</strong>s in Batch ModeC.2 SIMGEN command-line optionsThe command-line options are listed in Table C-1:Table C-1 simgen command-line optionsShortformOptionDescription- --configuration NAME Specify the name for the configuration.- --enable-warning NUM Enable warning number NUM.This overrides the --warning-level LEVEL option.- --disable-warning NUM Disable warning number NUM.This overrides the --warning-level LEVEL option.- --warnings-as-errors Treat LISA parsing and compiler warnings as errors.- --num-comps-file NUM Specify the number of components that are generated into a singlefile. See Using command-line options to decrease compilation timeon page C-4.- --num-build-cpus NUM Specify the number of cpus used during build.-b --build Build targets.-C --clean Clean targets.-D --define SYMBOL Define preprocessor symbol SYMBOL.You can also use SYMBOL=DEF-h --help Print help message that contains this list of command-line options andexit.-I --include INC_PATH Add include path INC_PATH.-p --project-file FILENAME Set simgen project file FILENAME.-v --verbose ARG Set verbosity. ARG can be one of :onsparse (this is the default)off-w --warning-level LEVEL Set warning level to LEVEL.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. C-3ID031910Non-Confidential
Building System <strong>Model</strong>s in Batch ModeC.2.1Using command-line options to decrease compilation timePreviously all components were placed into a single file. Creating multiple files,however, can reduce the compilation time if only one component has changed andrequires recompilation.You can use the num-comps-file option to specify whether a single file or multiple filesis used for components. The default is 1 and all components go into a single file.If the value for num-comps-file is increased to, for example, 10 then the first 10components go into the first file, the second 10 components go into the second file, andso on until all components are in files.For development work where the source is modified frequently, setting num-comps-fileto a value greater than 1 can considerably reduce compilation time because only the filecontaining the changed module is recompiled.NoteIf you are recompiling an existing project that will not be modified, <strong>ARM</strong> recommendssetting the value for num-comps-file to 1.C.2.2Interaction between num-comps-file and num-build-cpusThere is, however, an interaction between the num-comps-file and the num-build-cpusoptions. The value for num-comps-file indicates the maximum number of componentsper file.If, for example, there are 40 components, num-comps-file is set to 25, andnum-build-cpus is set to 4, the following action results:• Four .cpp files are produced because there are four processors• Each .cpp file has 10 components instead of the maximum value of 25.Using only the num-comps-file option to calculate the components per file wouldresult in only two .cpp files with one file containing 25 components and thesecond file containing 15. This split would only use two processors. A lowervalue is therefore used for the actual number of components pre file to enable allfour processors to be used.C.2.3Setting command-line parameters from System CanvasTo change the command-lines options from System Canvas:1. Select Preferences from the File menuC-4 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
Building System <strong>Model</strong>s in Batch Mode2. Add the command-line parameters in the Command arguments text box in theSimulation Generator Executable panel.3. These settings are used if the Build toolbar button in System Canvas is clicked.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. C-5ID031910Non-Confidential
Building System <strong>Model</strong>s in Batch ModeC-6 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910
GlossaryThis section contains a list of terms and their definitions. The majority of the terms arecommon engineering terms, so the definitions tend to define the terms with respect todeveloper suite applications.AHB AMBA ®APBAXI ®ComponentConnectionExternal portEVSAdvanced High-performance Bus, a bus interface defined by the AMBA2 specification.Advanced Microcontroller Bus Architecture, the <strong>ARM</strong> ® open standard for multi-masteron-chip buses that are capable of running with multiple masters and slaves.Advanced Peripheral Bus, a simplified AMBA bus interface designed for use withancillary or general-purpose peripherals.Advanced eXtensible Interface, a bus interface defined by the AMBA3 specification.An individual functional block such as, for example, core, memory, or bus, Acomponent can also be an entire subsystem. In this case, the subsystem is placed intoanother system as a component.A link between two components between one master port and one slave port. There arethree types of connection, clock, signal, and transaction.A port that is used to connect the current system within another system.Exported Virtual System. A <strong>Fast</strong> <strong>Model</strong> Platform exported into SystemC using theSystemC Export feature.<strong>ARM</strong> DUI 0370J Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. Glossary-1ID031910Non-Confidential
GlossaryInternal portLabelMasterCADIObjectProbeProgrammer’s ViewPVA port that communicates with subcomponents and is not visible if the component isused in a higher-level system. Unlike hidden external ports, they are permanentlyhidden.An annotation in the Block Diagram view.A component or port that initiates a transaction or drives a signal.Cycle Accurate Debug Interface, enables reading and writing memory and registervalues and also provides the interface to external debuggers.An object is either: a component, a connection, an external port, or a label.Object inserted on a connection for the purpose of, for example, tracing, monitoring,breakpoints.A level of simulation accuracy that is sufficient to run application code, but is notdetailed enough for hardware analysis. Timing accuracy is sacrificed to achieve fastsimulation execution speeds.See Programmer’s View.Real-Time System <strong>Model</strong>A system model that uses Code Translation (CT) technology to provide fast simulationspeed and accuracy at Programmer’s View level. System Canvas can create RTSMmodels from standard libraries and custom LISA+ source files.Signal connectionSlaveSimulation runSystemSystem CanvasThe signal-based interface is very close to hardware simulators in that it simulates everysignal independently.A component or port that responds to a transaction or signal.This term is used for the combination of loading, running, and closing a system.A system is a collection of components connected to collaborate in a simulation.System Canvas for <strong>Fast</strong> <strong>Model</strong>s is a comprehensive easy-to-use toolset for fastmodelling, simulation and debugging of complex System-on-Chip (SoC) designs.Transaction connectionThe transaction-based interface encapsulates a group of signals into one read or writetransaction.Glossary-2 Copyright © 2007-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0370JNon-ConfidentialID031910