Tlm-2.0 Language Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
OSCI TLM-2.0 LANGUAGE REFERENCE MANUAL July 2009 OSCI TLM-2.0 LANGUAGE REFERENCE MANUAL Software version: TLM 2.0.1 Document version: JA32 Copyright © 2007-2009 by the Open SystemC Initiative (OSCI) All rights reserved OSCI TLM-2.0 LANGUAGE REFERENCE MANUAL OSCI TLM-2.0 LANGUAGE REFERENCE MANUAL Contributors The TLM-2.0 standard was created under the leadership of the following individuals: Bart Vanthournout, CoWare, TLM Working Group Chair James Aldis, Texas Instruments, TLM Working Group Vice-Chair Previous TLM Working Group Chairs: Trevor Wieman, Intel Frank Ghenassia, ST Microelectronics Mark Burton, GreenSocs This document was authored by: John Aynsley, Doulos The following is a list of active technical participants in the OSCI TLM Working Group at the time of release of this standard: Tom Aernoudt, CoWare Robert Guenzel, GreenSocs James Aldis, Texas Instruments Andrea Kroll, Jeda Guillaume Audeon, ARM Laurent Maillet-Contoz, ST Microelectronics John Aynsley, Doulos Kiyoshi Makino, Mentor Graphics David Black, XtremeEDA Marcelo Montoreano, Synopsys Mark Burton, GreenSocs Bart Vanthournout, CoWare Jerome Cornet, ST Microelectronics Yossi Veller, Mentor Graphics Ross Dickson, Virtutech Trevor Wieman, Intel Jakob Engblom, Virtutech Charles Wilson, XtremeEDA Alan Fitch, Doulos The following people have also contributed to the development of this standard within the OSCI TLM Working Group: Mike Andrews, Mentor Graphics Bobby Bhattacharya, ARM Matthew Ballance, Mentor Graphics Axel Braun, University of Tuebingen Geoff Barrett, Broadcom Herve Broquin, ST Microelectronics Ryan Bedwell, Freescale Bill Bunton, ESLX Bishnupriya Bhattacharya, Cadence Jack Donovan, XtremeEDA Copyright © 2007-2009 by the Open SystemC Initiative (OSCI) iii OSCI TLM-2.0 LANGUAGE REFERENCE MANUAL Adam Erickson, Cadence Rishiyur Nikhil, Bluespec Othman Fathy, Mentor Graphics David Pena, Cadence George Frazier, Cadence Victor Reyes, NXP Michel Genard, Virtutech Nizar Romdhane, ARM Frank Ghenassia, ST Microelectronics Adam Rose, Mentor Graphics Mark Glasser, Mentor Graphics Olaf Scheufen, Synopsys Andrew Goodrich, Forte Design Stefan Schmermbeck, Chipvision Serge Goosens, CoWare Kolja Schneider, Fraunhofer Thorsten Groetker, Synopsys Shiri Shem-Tov, Freescale Karthick Gururaj, NXP Jean-Philippe Strassen, ST Microelectronics Kamal Hashmi, SpiraTech Alan Su, ITRI & Springsoft Gino Van Hauwermeiren, NXP Stuart Swan, Cadence Atsushi Kasuya, Jeda Tsutomu Takei, STARC Holger Keding, Synopsys Jos Verhaegh, NXP Devon Kehoe, Mentor Graphics Maurizio Vitale, Philips Semiconductors Anna Keist, ESLX Vincent Viteau, Summit Design Wolfgang Klingauf, GreenSocs Thomas Wilde, Infineon Tim Kogel, CoWare Hiroyuki Yagi, STARC David Long, Doulos Kaz Yoshinaga, STARC Mike Meredith, Forte Design Eugene Zhang, Jeda iv Copyright © 2007-2009 by the Open SystemC Initiative (OSCI) OSCI TLM-2.0 LANGUAGE REFERENCE MANUAL Contents 1 OVERVIEW ....................................................................................................... 1 1.1 Scope ...................................................................................................................................................... 2 1.2 Source code and documentation .......................................................................................................... 2 2 REFERENCES .................................................................................................. 4 2.1 Bibliography .......................................................................................................................................... 4 3 INTRODUCTION ............................................................................................... 5 3.1 Background ........................................................................................................................................... 5 3.2 Transaction-level modeling, use cases and abstraction ..................................................................... 5 3.3 Coding styles ......................................................................................................................................... 6 3.3.1 Untimed coding style ...................................................................................................................... 7 3.3.2 Loosely-timed coding style and temporal decoupling .................................................................... 7 3.3.3 Synchronization in loosely-timed models....................................................................................... 8 3.3.4 Approximately-timed coding style ................................................................................................. 9 3.3.5 Characterization of loosely-timed and approximately-timed coding styles .................................... 9 3.3.6 Switching between loosely-timed and approximately-timed modeling .......................................... 9 3.3.7 Cycle-accurate modeling ...............................................................................................................10 3.3.8 Blocking versus non-blocking transport interfaces........................................................................10 3.3.9 Use cases and coding styles ...........................................................................................................11 3.4 Initiators, targets, sockets, and transaction bridges .........................................................................11 3.5 DMI and debug transport interfaces .................................................................................................13 3.6 Combined interfaces and sockets .......................................................................................................13 3.7 Namespaces ..........................................................................................................................................14 3.8 Header files and version numbers ......................................................................................................14 3.8.1 Software version information ........................................................................................................14 3.8.1.1 Definitions .................................................................................................................................14 3.8.1.2 Rules ..........................................................................................................................................15 4 TLM-2.0 CORE INTERFACES ........................................................................ 16 4.1 Transport interfaces ............................................................................................................................16 Copyright © 2007-2009 by the Open SystemC Initiative (OSCI) v OSCI TLM-2.0 LANGUAGE REFERENCE MANUAL 4.1.1 Blocking transport interface ..........................................................................................................16 4.1.1.1 Introduction ...............................................................................................................................16 4.1.1.2 Class definition ..........................................................................................................................17 4.1.1.3 The TRANS template argument ................................................................................................17 4.1.1.4 Rules ..........................................................................................................................................17 4.1.1.5 Message sequence chart – blocking transport ............................................................................18 4.1.1.6 Message sequence chart – temporal decoupling ........................................................................19 4.1.1.7 Message sequence chart – the time quantum .............................................................................20 4.1.2 Non-blocking transport interface ...................................................................................................21 4.1.2.1 Introduction ...............................................................................................................................21 4.1.2.2 Class definition ..........................................................................................................................21 4.1.2.3 The TRANS and PHASE template arguments ..........................................................................22 4.1.2.4 The nb_transport_fw and nb_transport_bw calls .......................................................................22 4.1.2.5 The trans argument ....................................................................................................................23 4.1.2.6 The phase argument ...................................................................................................................23 4.1.2.7 The tlm_sync_enum return value ..............................................................................................24 4.1.2.8 tlm_sync_enum summary ..........................................................................................................25 4.1.2.9 Message sequence chart – using the backward path ..................................................................26 4.1.2.10 Message sequence chart – using the return path ....................................................................27 4.1.2.11 Message sequence chart – early completion ..........................................................................28