TLM-2.0 in Action: An Example-based Approach to Transaction-level Modeling and the New World of Model Interoperability



Similar documents
Early Hardware/Software Integration Using SystemC 2.0

High Performance or Cycle Accuracy?

Codesign: The World Of Practice

EE382V-ICS: System-on-a-Chip (SoC) Design

Architectures and Platforms

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

SystemC Tutorial. John Moondanos. Strategic CAD Labs, INTEL Corp. & GSRC Visiting Fellow, UC Berkeley

7a. System-on-chip design and prototyping platforms

Hybrid Platform Application in Software Debug

Operating Systems. Lecture 03. February 11, 2013

Hybrid Simulation Framework for Virtual Prototyping Using OVP, SystemC & SCML

Von der Hardware zur Software in FPGAs mit Embedded Prozessoren. Alexander Hahn Senior Field Application Engineer Lattice Semiconductor

10/100/1000Mbps Ethernet MAC with Protocol Acceleration MAC-NET Core with Avalon Interface

Electronic system-level development: Finding the right mix of solutions for the right mix of engineers.

ESE566 REPORT3. Design Methodologies for Core-based System-on-Chip HUA TANG OVIDIU CARNU

CAPTAN: A Hardware Architecture for Integrated Data Acquisition, Control, and Analysis for Detector Development

I/O. Input/Output. Types of devices. Interface. Computer hardware

OPTIMIZE DMA CONFIGURATION IN ENCRYPTION USE CASE. Guillène Ribière, CEO, System Architect

Achieving Nanosecond Latency Between Applications with IPC Shared Memory Messaging

TCP Servers: Offloading TCP Processing in Internet Servers. Design, Implementation, and Performance

Performance of Software Switching

I/O Device and Drivers

Operating System Overview. Otto J. Anshus

Keil C51 Cross Compiler

High-Level Synthesis for FPGA Designs

KeyStone Architecture Security Accelerator (SA) User Guide

System Architecture Performance Modeling with SystemC

Chapter 13. PIC Family Microcontroller

Virtual Prototyping of NoC-based MPSoC : Fundamentals & Case Studies

Verification. Formal. OneSpin 360 LaunchPad Adaptive Formal Platform. May 2015

Using the TASKING Software Platform for AURIX

Multi-core architectures. Jernej Barbic , Spring 2007 May 3, 2007

Outline. Introduction. Multiprocessor Systems on Chip. A MPSoC Example: Nexperia DVP. A New Paradigm: Network on Chip

COMPUTERS ORGANIZATION 2ND YEAR COMPUTE SCIENCE MANAGEMENT ENGINEERING UNIT 5 INPUT/OUTPUT UNIT JOSÉ GARCÍA RODRÍGUEZ JOSÉ ANTONIO SERRA PÉREZ

Programming PCI-Devices under Linux

Computer Systems Structure Input/Output

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

Eureka Technology. Understanding SD, SDIO and MMC Interface. by Eureka Technology Inc. May 26th, Copyright (C) All Rights Reserved

PowerPC 405 GP Overview

Rapid System Prototyping with FPGAs

Computer Organization & Architecture Lecture #19

Hardware Virtualization for Pre-Silicon Software Development in Automotive Electronics

Chapter 1 Computer System Overview

VoIP Server HW/SW Codesign for Multicore Computing

Virtual Platforms in System-on-Chip Design

Modeling a GPS Receiver Using SystemC

Testing of Digital System-on- Chip (SoC)

Seeking Opportunities for Hardware Acceleration in Big Data Analytics

Application Note 132. Introduction. Voice Video and Data Communications using a 2-Port Switch and Generic Bus Interface KSZ MQL/MVL

Universal Flash Storage: Mobilize Your Data

Application Note: AN00141 xcore-xa - Application Development

WiSER: Dynamic Spectrum Access Platform and Infrastructure

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Router Architectures

Operating Systems 4 th Class

ENGG*44200 Real Time System Design Lab3 Implement VoIP on ARM Outline

Hello, and welcome to this presentation of the STM32 SDMMC controller module. It covers the main features of the controller which is used to connect

Multichannel Voice over Internet Protocol Applications on the CARMEL DSP

M85 OpenCPU Solution Presentation

The Bus (PCI and PCI-Express)

The Motherboard Chapter #5

Multiprocessor System-on-Chip

A case study of mobile SoC architecture design based on transaction-level modeling

Fastboot Techniques for x86 Architectures. Marcus Bortel Field Application Engineer QNX Software Systems

Application Note. Windows 2000/XP TCP Tuning for High Bandwidth Networks. mguard smart mguard PCI mguard blade

MPSoC Virtual Platforms

Outline: Operating Systems

13. Publishing Component Information to Embedded Software

Priority Based Implementation in Pintos

Embedded & Real-time Operating Systems

The Advanced JTAG Bridge. Nathan Yawn 05/12/09

Have both hardware and software. Want to hide the details from the programmer (user).

Introduction to Routing and Packet Forwarding. Routing Protocols and Concepts Chapter 1

AN1229. Class B Safety Software Library for PIC MCUs and dspic DSCs OVERVIEW OF THE IEC STANDARD INTRODUCTION

Introduction to Exploration and Optimization of Multiprocessor Embedded Architectures based on Networks On-Chip

Chapter 13 Embedded Operating Systems

What is a System on a Chip?

The POSIX Socket API

Operating System Tutorial

CSC 2405: Computer Systems II

A SystemC Transaction Level Model for the MIPS R3000 Processor

Reconfigurable Architecture Requirements for Co-Designed Virtual Machines

TCP Offload Engines. As network interconnect speeds advance to Gigabit. Introduction to

Best Practises for LabVIEW FPGA Design Flow. uk.ni.com ireland.ni.com

MeshBee Open Source ZigBee RF Module CookBook

SystemC - NS-2 Co-simulation using HSN

Accellera Systems Initiative completes SystemC AMS 2.0 standard for mixed-signal design of electronic systems

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

CGI-based applications for distributed embedded systems for monitoring temperature and humidity

CHAPTER 3 STATIC ROUTING

Operating Systems Design 16. Networking: Sockets

Datacenter Operating Systems

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

SD Specifications Part A2 SD Host Controller Simplified Specification

Transcription:

DVCon 2009 TLM-2.0 in Action: An Example-based Approach to Transaction-level Modeling and the New World of Model Interoperability John Aynsley, Doulos

TLM Introduction CONTENTS What is TLM and SystemC? Creating a virtual platform model The OSCI TLM-2.0 standard Achieving speed and interoperability

Transaction Level Modeling RTL Functional Model Pin Accurate Function Call write(address,data) RTL Functional Model Simulate every event! 100-10,000 X faster simulation! 3

Reasons for using TLM Accelerates product release schedule Firmware / software Software development Fast TLM Ready before RTL Performance analysis RTL Hardware verification Test bench TLM = golden model 4

Multiple Languages Firmware / software Mixed language environments TLM SystemC used as golden reference RTL VHDL, Verilog, SystemVerilog Home grown C++ / SystemC Test bench VHDL, Verilog for design 5

Reasons for using SystemC Industry standard IEEE 1666 Robust open source proof-of-concept C++ simulator Only requires a C++ compiler Flexibility re platforms and licensing Tool vendors add value Easy integration Common language across disciplines Builds bridges between system, s/w and h/w 6

TLM Introduction CONTENTS What is TLM and SystemC? Creating a virtual platform model The OSCI TLM-2.0 standard Achieving speed and interoperability

Use Cases FUNCTIONAL VIEW Untimed Algorithm developer ARCHITECTURE VIEW Approximately-timed Tuning the platform PROGRAMMERS VIEW Software developer Loosely-timed VERIFICATION VIEW Functional verification Untimed through Cycle Accurate RTL Implementation 8

Typical Use Case: Virtual Platform Multiple software stacks Software Software CPU ROM RAM DMA DSP ROM RAM Bridge Interrupt Timer I/O Bridge Interrupt Timer A/D Multiple buses and bridges I/O Memory interface RAM DMA Custom peripheral D/A Digital and analog hardware IP blocks 9

Virtual Platform Characteristics 1 Register accurate, functionally complete No clock, no pins, no implementation detail Loose or approximate timing only Fast enough to boot software O/S in seconds Available months before RTL Accurate enough to stay in use post-rtl Copyright 2007-2009 by Open SystemC Initiative and Doulos. All rights reserved. 10

Virtual Platform Characteristics 2 Instruction Set Simulator or software stubs Transaction-Level Model RTL Available early Available early Much later Fast enough to run applications Fast enough to run applications Too slow to run applications Little or no hardware detail Register-accurate Register-accurate and pin-accurate No timing information Some timing information Cycle-accurate timing 11

Transaction-Level Modeling Concurrent simulation environment Transaction + timing Simple functional models, e.g. C programs 12

SystemC / TLM is the Glue! Transaction-level modeling is communication-centric ISS VHDL Verilog 13

TLM Introduction CONTENTS What is TLM and SystemC? Creating a virtual platform model The OSCI TLM-2.0 standard Achieving speed and interoperability

OSCI TLM-2.0 Standard Transaction-level memory-mapped bus modeling Based on SystemC Released in June 2008 OSCI LRM in 2009 comparable to ISS between TLM models of IP blocks Copyright 2007-2009 by Open SystemC Initiative and Doulos. All rights reserved. 15

Coding Styles and Mechanisms Use cases Software development Software performance Architectural analysis Hardware verification TLM-2 Coding styles (just guidelines) Loosely-timed Approximately-timed Mechanisms (definitive API for TLM-2.0 enabling interoperability) Blocking transport DMI Quantum Sockets Generic payload Phases Non-blocking transport Copyright 2007-2009 by Open SystemC Initiative and Doulos. All rights reserved. 16

Coding Styles Loosely-timed = as fast as possible Only sufficient timing detail to boot O/S and run multi-core systems Processes can run ahead of simulation time (temporal decoupling) Each transaction completes in one function call Uses direct memory interface (DMI) Approximately-timed = just accurate enough for performance modeling aka cycle-approximate or cycle-count-accurate Sufficient for architectural exploration Processes run in lock-step with simulation time Each transaction has 4 timing points (extensible) Copyright 2007-2009 by Open SystemC Initiative and Doulos. All rights reserved. 17

Interoperability Layer 1. Core interfaces and sockets Initiator Target 2. Generic payload Command Address Data Byte enables Response status Extensions 3. Base protocol BEGIN_REQ END_REQ BEGIN_RESP END_RESP Maximal interoperability for memory-mapped bus models Copyright 2007-2009 by Open SystemC Initiative and Doulos. All rights reserved. 18

Example Initiator & Target Sockets struct Initiator: sc_module { tlm_utils::simple_initiator_socket<initiator> socket; Default: 32-bits wide, base protocol }; SC_CTOR(Initiator) : socket("socket") { SC_THREAD(thread_process); }... Construct and name socket struct Target: sc_module { tlm_utils::simple_target_socket<target> socket; }; SC_CTOR(Target) : socket("socket") { socket.register_b_transport (this, &Target::b_transport); } virtual void b_transport( tlm::tlm_generic_payload& trans, sc_time& delay );... Blocking transport Sockets 19

Example Socket Binding struct Top: sc_module { Initiator *initiator; Target *target; SC_CTOR(Top) { initiator = new Initiator ("initiator"); target = new Target ("target"); }; } initiator->socket.bind( target->socket ); Sockets 20

Example - Initiator void thread_process() { tlm::tlm_generic_payload* trans; sc_time delay;... trans = m_mm.allocate(); trans->acquire(); Get transaction object from pool trans->set_command( tlm::tlm_write_command ); 8 attributes you must set trans->set_data_length( 4 ); trans->set_streaming_width( 4 ); trans->set_byte_enable_ptr( 0 ); trans->set_address( addr ); trans->set_data_ptr( (unsigned char*)( &word ) ); trans->set_dmi_allowed( false ); trans->set_response_status( tlm::tlm_incomplete_response ); init_socket->b_transport( *trans, delay ); if ( trans->get_response_status() <= 0 ) SC_REPORT_ERROR("TLM-2", trans->get_response_string().c_str()); } trans->release();... Generic payload Blocking transport 21

Example - Target virtual void b_transport( tlm::tlm_generic_payload& trans, sc_core::sc_time& t ) { tlm::tlm_command cmd = trans.get_command(); sc_dt::uint64 adr = trans.get_address(); unsigned char* ptr = trans.get_data_ptr(); unsigned int len = trans.get_data_length(); unsigned char* byt = trans.get_byte_enable_ptr(); unsigned int wid = trans.get_streaming_width(); 6 attributes you must check Target supports 1-word transfers if ( byt!= 0 len > 4 wid < len ) { trans.set_response_status( tlm::tlm_generic_error_response ); return; } if ( cmd == tlm::tlm_write_command ) memcpy( &m_storage[adr], ptr, len ); else if ( cmd == tlm::tlm_read_command ) memcpy( ptr, &m_storage[adr], len ); Execute command } trans.set_response_status( tlm::tlm_ok_response ); Successful completion Generic payload Blocking transport 22

Initiators, Targets and Interconnect Initiator socket Target socket Initiator socket Target socket Initiator Forward path Backward path Interconnect component 0, 1 or many Forward path Backward path Target Transaction object Single transaction object Copyright 2007-2009 by Open SystemC Initiative and Doulos. All rights reserved. Generic payload Sockets 23

Core Interfaces Initiator Initiator socket Interface methods Forward path b_transport () nb_transport_fw() get_direct_mem_ptr() transport_dbg() Target socket Target Backward path nb_transport_bw() invalidate_direct_mem_ptr() Sockets group interfaces, bind both paths with one call, and are strongly typed Copyright 2007-2009 by Open SystemC Initiative and Doulos. All rights reserved. 24

TLM Introduction CONTENTS What is TLM and SystemC? Creating a virtual platform model The OSCI TLM-2.0 standard Achieving speed and interoperability

Interoperability versus Internals Interoperability layer Initiator Target Coding Style Loosely- or Approximately-timed Core interfaces Sockets Generic payload Base protocol Utilities Convenience sockets Quantum keeper (LT) Payload event queues (AT) Instance-specific extensions (GP) 26

Loosely-timed Initiators Process scheduling and context switching Ticks Cycle-accurate simulation Quantum Quantum Temporally decoupled simulation Each initiator runs ahead to quantum boundary before context switching Limited synchronization between initiators Used with DMI to bypass interconnect Blocking transport Quantum DMI 27

Approximately-timed 0 10 20 30 40 50 Process 1 Annotated delays Process 2 Process 3 Transactions are annotated with delays Each process is synchronized using the SystemC scheduler A transaction has multiple phases Copyright 2007-2009 by Open SystemC Initiative and Doulos. All rights reserved. Non-blocking transport Phases 28

b/nb Conversion LT Initiator simple_initiator_socket simple_target_socket socket.register_b_transport b_transport LT Target AT Initiator Interconnect b_transport nb_transport_fw nb_/b_transport adaptor Models should be performance-matched Sockets Blocking transport Non-blocking transport 29

The Generic Payload Typical attributes of memory-mapped busses reads, writes, byte enables, single word transfers, burst transfers, streaming Off-the-shelf general purpose payload used with the Base Protocol for abstract bus modeling ignorable extensions allow full interoperability Used to model specific bus protocols mandatory extensions can only bind sockets with same protocol type (compile-time check) use the same generic payload machinery low implementation cost when bridging protocols Copyright 2007-2009 by Open SystemC Initiative and Doulos. All rights reserved. Generic payload 30

Extensions Generic Payload Extension Generic Payload Extension Initiator Target Base Protocol Router Initiator Interconnect Target Generic Payload Generic Payload Generic Payload Extension Private extension Extension Extension 31

Kinds of Extension Generic payload extensions can be Ignorable compliant to the base protocol Mandatory necessitates a new protocol type Private only used by a single module (hence ignorable) Instance-specific usually private (hard to access elsewhere) Sticky remain when transaction is returned to a pool Auto freed when transaction is returned to a pool Base protocol phases BEGIN_REQ, END_REQ, BEGIN_RESP, END_RESP Extended phases 32

Kinds of Interoperability Base protocol, generic payload + ignorable extensions Functional incompatibilities still possible Initiator Interconnect Target New protocol, generic payload + extensions Cannot bind sockets of differing protocols Generic payload and base protocol still exploited for consistency of coding style Generic payload extension mechanism exploited for ease-of-adaption Initiator Adaptor Target 33

Levels of Use 1. Buy models with the TLM-2.0 sticker 2. Write LT components Beware: nb_transport & endianness 3. Write AT components 4. Support LT/AT switching 34