Você está na página 1de 85

Writing Efficient TLM 2.

0 Models
with GreenSocs

GreenSocs Tutorial 2008

Event Sponsors:

1 Enabling the Open SystemC User Community


May 6, 05
Agenda
1.GreenSocs overview
2.GSPM
3.GreenBus
4.GreenControl
5.GreenConfig Techno Zone
6.GreenAV
7.GreenScript
8.VPP/Eclipse
Slides will be 9.Component library
Available from
GreenSocs.com
10.Meta Description
11.Eco-System - mission and future.
12.GreenInterfaces
2 Enabling the Open SystemC User Community
May 6, 05
What is ESL anyway?
• ESL is a design flow to allowing Software development to start earlier in
the design cycle.
• Possibly even putting the horse back in front of the cart - and allowing
hardware to be tuned for software needs!

• SystemC is the standard language to use to exchange models that


enable early S/W development.

• Infrastructure is the common code which in itself is not core to any


company that every company can use to increase their productivity and
help them benefit from a common eco-system.

• TLM 2.0 is a standard infrastructure extension to SystemC specifically


aimed at memory mapped bus interfaces, but with re-usable technology
for other interfaces.

• (If you thought we were going to talk about strangely coloured clothing
accessories - time to leave now!)
3 Enabling the Open SystemC User Community
May 6, 05
GreenSocs : Crossroads for ESL…

Non- core Enabling ESL


Infrastructure interoperability
F/OSS to improve
productivity.
SPECIFIC
IP interfaces

Quick Simple
Industry ready Generic Library
ESL package Components
management

4 Enabling the Open SystemC User Community


May 6, 05
Two faces of GreenSocs
• GreenSocs is an open source • GreenSocs Ltd is a contracting
Project company.
• It provides vendor independent • It provides resources that can
infrastructure for ESL modelling. be used to
• Specifically SystemC Develop new infrastructure.
infrastructure, including model • GreenSocs can also help:
components. • Make use of GreenSocs
• There is a web site, and a infrastructure for proprietary
projects.
community based around that
• Assist other organisations
project with some 500 people develop their SystemC
registered. infrastructure (based on
GreenSocs infrastructure)
• Contributions into the project
• Provide training, support and
have come from both academia maintenance.
and industry.

5 Enabling the Open SystemC User Community


May 6, 05
Business model
• GreenSocs Ltd can be contracted as a sub-contractor to
• Construct items that will be made available through the GreenSocs
project.
• Assist other standards organisations construct their infrastructure
(possibly based on infrastructure available from the GreenSocs
Project)
• Train, support and maintain SystemC infrastructure within
companies.
• Undertake specific preparatory SystemC modelling (outsourcing
model provisioning - possibly based on infrastructure available from
the GreenSocs project)

GreenSocs is “just” a SystemC contractor that bases is activity


around the GreenSocs project.

6 Enabling the Open SystemC User Community


May 6, 05
Ethos : Serve the community
• Providing a legal framework in which competing industrial
partners can collaborate on infrastructure for the benefit of all.
• Developing infrastructure that can enable re-use and
interoperability.
• Enabling academic research to be based on relevant
infrastructure.
• providing a stream of talent.

7 Enabling the Open SystemC User Community


May 6, 05
8 Enabling the Open SystemC User Community
May 6, 05
GSPM

9 Enabling the Open SystemC User Community


May 6, 05
GSPM Features
• “Package management” for ESL -
• Distribute and/or handle multiple (and many versions of) IP’s and tools
• Very simple user interface (gs_use)
• Installable by USER
• Handle all dependencies between packages,
• automatically install required dependencies
• Handle multiple versions or each package
• Including dependencies
• Multiple versions may be present at the same time
• Different “shells” may use different version
• Source distributions are supported
• Can be used in conjunction with existing tool chains.

• Can be used independently of GreenSocs - You may use GSPM


internally (or externally) to distribute your releases.
• Run your own repository (open or closed, with strict password protection)
• (To come - VMWare distributions)
10 Enabling the Open SystemC User Community
May 6, 05
Examples Available from the
GreenSocs repository
• Supported Architectures:
i386, x86_64, (not yet stable: Cygwin, Mac OS X (ppc and i386))
• Packages:
• apt_0.5.28.6-gs3_i386.deb
• archc2.0+beta3-gcc4.0.3-systemc2.2-gs1_i386.deb
• cdt_3.1.0-gs3_i386.deb
• dpkg_1.10.28-gs1_i386.deb
• dust1.0-gcc4.0.3-systemc2.2_1.0-gcc4.0.3-systemc2.2-gs2_i386.deb
• eclipse_3.2-gs2_i386.deb
• gcc4.0.3_4.0.3_i386.deb
• jre_1.5.0-gs2_i386.deb
• libboost-dev_1.33.1-4_i386.deb
• modules_3.2.3-gs2_i386.deb
• pdesigner_1.0.2-gs2_i386.deb
• pdlibrary_1.0.1-gs1_i386.deb
• scv1.0p2-gcc3.3.1-systemc2.1-gs2_i386.deb
• scv1.0p2-gcc3.3.1-systemc2.2-gs2_i386.deb
• scv1.0p2-gcc4.0.3-systemc2.1-gs2_i386.deb
• scv1.0p2-gcc4.0.3-systemc2.2-gs2_i386.deb
• systemc2.1-gcc3.3.1-gs2_i386.deb
• systemc2.1-gcc4.0.3-gs2_i386.deb
• systemc2.2-gcc3.3.1-gs2_i386.deb
• systemc2.2-gcc4.0.3-gs2_i386.deb

11 Enabling the Open SystemC User Community


May 6, 05
Using GSPM
• GSPM uses bash (no choice for now) - make sure you are
running bash.
• Visit: http://www.greensocs.com/Downloads
• 3 step install. NB- sort out your proxies
export http_proxy="http://username:password@host:port/"

• Then:
source gspm.bashrc # enter the world
gs-use gcc/4.0 systemc/2.2 boost gsc greenbus # load packages
cd $GREENBUS/examples/simple
gsc example_simple.cpp -o example.x
./example.x

• Visit project pages on greensocs.com to find new packages to


download,
• For a full list: http://www.greensocs.com/Releases

12 Enabling the Open SystemC User Community


May 6, 05
Green*

13 Enabling the Open SystemC User Community


May 6, 05
Green* overview

GreenScript (Python)

Config PlugIn
User IP 1

GreenControl Core
Config User I/F GreenBus I/F
(Parameter Config)

ESL GreenAV User I/F


GreenAV PlugIn User IP 2
Tools Config User I/F
GreenBus I/F

(Analysis &
Visualization)

Config User I/F


GreenBus I/F
Specific PlugIn User IP 3
Specific User I/F

SystemC

14 Enabling the Open SystemC User Community


May 6, 05
GreenBus
o c k et
Gr een S

15 Enabling the Open SystemC User Community


May 6, 05
GreenBus stops at TLM 2.0!

16 Enabling the Open SystemC User Community


May 6, 05
TLM model anatomy

Protocol specific Protocol specific


Convenience OSCI TLM-2.0 Convenience
User Model of Master User Model of Slave
Socket Interface Socket

Call nb_transport() Implement


Or Nb_transport()
Or

} {
B_transport
Depending on your need B_transport()
For handling pipelining Depending on your
accuracy. need to call wait(),
and how much of
the pipeline you
model.

Convenience sockets should have:


Memory management,
Configuration,
Conversion from B to NB
And be built on the OSCI Convenience sockets.

17 Enabling the Open SystemC User Community


May 6, 05
TLM model anatomy
•GreenSocs will provide Convenience sockets that are extensions of the OSCI
socket, providing additional services (as the GreenBus socket did)
•GreenSocs is currently developing protocol specific socket for OCP-IP (among
others)

Call nb_transport() Implement


Or Nb_transport()
Or

} {
B_transport
Depending on your need B_transport()
For handling pipelining Depending on your
accuracy. need to call wait(),
and how much of
the pipeline you
model.

GreenSocs sockets will be Consistent.


They will provide full services based on other Green* components,
and will make use of the Interface Repository (see later)

GreenSocs is the obvious place to get a protocol convenience socket developed


and published.

18 Enabling the Open SystemC User Community


May 6, 05
GreenSocket
• GreenSocket will inherit from the TLM 2.0 Convince sockets and
provide the following features:
• Full tool independent TLM 2.0 compatibility.
• Security (access functions to the payload)
• Memory management (memory pooling, ref-counting)
• Simple Time management (PEQ)
• Local data (local "state" for each transaction)
• Runtime Bindability and error reporting (run time "probing" of connected -
compatible - sockets)
• Configuration and configuration sharing (GreenConfig, + distributing config
options along the bus)
• Combinatorial time management (ensuring combinatorial paths are handled
"safely")
• Analysis (GreenAnalysis connection direct from a GreenSocket).
• Multi-porting (* provided by the OSCI socket)
• b_ <-> nb_ bridging (* provided by the OSCI socket)

• First release shortly after DAC…

19 Enabling the Open SystemC User Community


May 6, 05
GreenSocs Three Phase Protocol
• Based on GreenBus, Compatible with TLM-2.0
• Accurately model real protocols, including their bursting
mechanisms :
• AXI, PLB, PCIe, and OCP-IP (Only some configurations, and can
only be made available to other OCP-IP members).
Send request
Receive Acknowledge
Send Data
Receive Acknowledge
Send Response
Receive Acknowledge

Request Phase Response Phase time


Data Phase
Start Start
Start
Request Phase Response Phase
Data Phase
End End
End

20 Enabling the Open SystemC User Community


May 6, 05
GreenBus was, TLM 2.0 is…
• Flexible toolkit for the implementation of any interface.
• Core mechanisms adopted by OSCI for TLM 2.0d2.
• Used for all interfaces (model model, and model tool)
• Inter-operability
• Simple API between models, Defined Data structures
• Safety
• Automatic memory management for data structures
• Event semantics between models.
• Speed
• Data passed by Shared pointers
• Only required events used
• Model free to use methods (rather than wait() calls)
• Other features of GreenBus:
• Open Source
• Built for/on proposed TLM 2.0 standard
• Efficient (0.5 million atoms per second)
• Multiple abstraction levels
• Native support for other user API’s (OCP-IP etc)
• Generator from IPXACT available

21 Enabling the Open SystemC User Community


May 6, 05
Gamma Correction Block Diagram

1 year?
1 Month?
1 Week?
…?

22 Enabling the Open SystemC User Community


May 6, 05
1 hour…

#include <ImageMagick.h>
// my nb_transport for the Gamma port
MyGamma(tlm_generic_payload &t, sc_time &time) {
image* i = reinterpret_cast<image*>(t.get_data_ptr());
i.gamma(reg.red, reg.green, reg.blue);
time+=4;
return TLM_COMPLETED
}
SC_MODULE(myImageProcessor) {
GB_GenericTargetPort myGammaPort(MyGamma)
GB_GenericTargetPort myOtherPorts…(…);

}

23 Enabling the Open SystemC User Community


May 6, 05
Know your users….
Data “unit” of data of
Abstraction Level interest
What are they
interested in?
Event Ordered (UT) Transaction

Transaction Request/Response Model that!


Accurate (LT)
Bus Accurate (AT) Bus phases LEAVE OUT
THE DETAIL…
Cycle Accurate cycles

24 Enabling the Open SystemC User Community


May 6, 05
Choose your timing….

Initiator calls Target returns

Ordered or
Transaction b_transport TLM_COMPLETED
Accurate
Bus Accurate or
nb_transport TLM_ACCEPTED
Cycle Accurate

25 Enabling the Open SystemC User Community


May 6, 05
Know your technology…

Presentations about TLM 2.0 Blocking


void b_transport(transaction &,time)
technology coming
to a EDA show near you….

GET some training… Non-blocking


status nb_transport_fw(transaction &,
Phase, time)
Receive “events”
(using nb_transport_bw again)

Target Initiator
NB, the transaction itself stays the same, no matter which function call is used,
the non-blocking calls just add phase.

26 Enabling the Open SystemC User Community


May 6, 05
Choice for Targets…
• Write your model to be either more or less timing accurate
• Use the nb_ interface to do this as documented by TLM 2.0.

DON’T WRITE THIS


Get your bus/socket nb_transport(…) {
provider or GreenSocs • If you need to “synchronise” use the
to do it! return status of the call

Return TLM_COMPLETED

or

Return TLM_ACCEPTED
Your bus/socket provider }
may provide you with an
interface more appropriate for
the bus in question…

27 Enabling the Open SystemC User Community


May 6, 05
Choice for Initiators…
• Write your model to be either more or less timing accurate
• Use the “blocking” or “non-blocking” interface to do this as
documented by TLM 2.0.

DON’T WRITE THIS


get your bus/socket provider
or GreenSocs to do it…
b_transport(transaction) make sure is supports
or memory management etc

nb_transport…
Your bus/socket provider
may provide you a
bus specific API…

28 Enabling the Open SystemC User Community


May 6, 05
My protocol isn’t like the BP…
ARE YOU SURE???
Overview….

BP Data BP Timing
phases

“non-Ignorable Additional
extensions? Extensions Phases
Extensions
Extensions
“Ignorable Extensions
Extensions
extensions?
MY PROTOCOL

29 Enabling the Open SystemC User Community


May 6, 05
Rolling your own Protocol?
• Things to remember:
• Think about extensions - Do you need them? If so, get them
right!
• Data extensions for data, Phase extensions for timing.
• Use the GreenSocs sockets and add to them
• Use already published data and timing extensions wherever you
can!
• Make your life as esy as possible!

30 Enabling the Open SystemC User Community


May 6, 05
Ignorable extensions and all that….
• An extension must be important to somebody !!!
• If it does not effect a block, it is “ignorable” for that block.
• Re-use IP when all extensions are “ignorable” for that block.
• YOU HAVE TO DECIDE -- sorry.
• YOU HAVE TO DOCUMENT -- sorry.
• Please make use of GreenSocs to publish your extensions, and
to find extensions other people are suggesting - if the semantics
match, use them.

• RULE: Try to think how the semantics of your protocol match the
semantics of the BP.
• DON’T add an extension because the name is different, or the
encoding doesn’t match!

Look for a semantic match


Don’t re-invent the wheel

31 Enabling the Open SystemC User Community


May 6, 05
GP Timing Extensions…
• These can be ignorable !

• Phases just add timing detail to your model.

• Indicating an e.g. “split possible” phase to a standard TLM 2.0 GP


model will have no functional effect.
• If an arbiter knows about the split phase, it can show more of the
timing effects - it can add fidelity to the model.

• RULE: Always use phases when the semantic is about


timing (ie speed of transmission - something like burst)

32 Enabling the Open SystemC User Community


May 6, 05
GreenControl

33 Enabling the Open SystemC User Community


May 6, 05
GreenControl Framework
• Used for
• Configuration
• Analysis
• Control.
• Tool independent (Plug-ins
available for vendor tools)

• Supports multiple
configuration parsers, e.g.
Spirit IPXACT, LUA,
command line, etc.
• Supports:
• Dynamic config parameter
change
• Dynamic Parameter arrays
• Parameter change
notification call-backs
• Etc,etc….

34 Enabling the Open SystemC User Community


May 6, 05
GreenConfig

Part of GreenControl

35 Enabling the Open SystemC User Community


May 6, 05
Using GreenControl
• Download and install:
gs_use greencontrol

• User code in SystemC models:


#include "greencontrol/api/gs_param/gs_param.h".

class MyClass: public sc_module {
public: (or private:)
gs_param < unsigned int > my_param ;
public:
MyClass(sc_module_name name)
: sc_module (name), port("PortName"),
my_param ("my_param", 100) // gs_param with initial value
{ [...] } };

• Types of parameters: C (POD) and SystemC and user defined

36 Enabling the Open SystemC User Community


May 6, 05
Using arrays
• Simple arrays (an array as a parameter) Optional, 10 by default
(auto-resized when set by config file)

gs_param <int *> my_int_array("my_int_array” ,3) ;



Access via my_int_array[3]…

• “complex” arrays (hierarchical arrays of named parameters)


gs_param_array myTopArr ;
gs_param<int> *myMemberPar = new gs_param<int>
("myMemberPar", "10", &myTopArr);
gs_param_array *subArr0 = new gs_param_array
("myArray0", &myTopArr);

• “iterators” for arrays


gs_param_array::iterator it;
for (it = myArr.begin(); it != myArr.end(); ++it) {
cout << (*it).getName() << "=" << (* it).getString() << endl;
}

37 Enabling the Open SystemC User Community


May 6, 05
Finding parameters
• To find a parameter, registered with the GreenControl, from a
different place in the hierarchy, use:

gs_param_base *int_par = m_configAPI.getPar("Owner.int_param");

• This will allow call back registration, analysis registration etc.

38 Enabling the Open SystemC User Community


May 6, 05
gs_param callbacks
Syntax:
SC_MODULE(ObserverModule){
GC_HAS_CALLBACKS();
~ObserverModule() {
GC_UNREGISTER_CALLBACKS();
}
void main_action() {// Test param
gs_param<int> myparam("myparam");

// Register Callback simple


GC_REGISTER_PARAM_CALLBACK(&my_param,
ObserverModule, config_callback);

}
// Callback function with default signature.
void config_callback(gs_param_base& par) {...}
};

• Mostly used behind the scenes for GreenAV and GreenConfig.


• gs_params with no call back cost 1 ‘if’ (highly predictable) for writes.

39 Enabling the Open SystemC User Community


May 6, 05
Tool independent config fabric.
• Uses gs_params
• Maybe set via configuration plugins
• Plugins exist for SCML (CoWare), Lua, a simple config file
reader, a simple config command line argument reader and a
simple interactive tool during simulation.

• gs_params may be set during runtime, if the tool supports that.

• Arrays, variable sized arrays, etc are supported (to support


Lua).

• Full user manual and tutorial available.

40 Enabling the Open SystemC User Community


May 6, 05
Using Lua
• Lua is a scripting language which is ideally suited to describing
configurations.
• It has the full range of flow-control, and is dynamically typed.

• Lua code is very simple:


TestIP = {param1 = 132,param2 = 234,}

• Visit http://www.lua.org/ for more information.

41 Enabling the Open SystemC User Community


May 6, 05
Full config example

#include <systemc.h>
#include "greencontrol/all.h"    // complete GreenControl package
int sc_main(int argc, char *argv[])
{
 tlm::gc::GC_Core core("ControlCore");  // GreenControl Core instance
 tlm::gc::config::ConfigDatabase *db = new gc::config::ConfigDatabase("ConfigDatabase");
  tlm::gc::config::ConfigPlugin configPlugin("ConfigPlugin", db);

  // Configuration with GreenConfig config files


 tlm::gc::config::ConfigFile_Tool configTool("ConfigFileTool");
  configTool.parseCommandLine(argc, argv); // parses the command line for --configfile
  configTool.config("my_config.cfg");   // reads in a config file

  // Configuration with Lua config files


 tlm::gc::config::LuaFile_Tool luaTool("LuaFileTool");
 luaTool.parseCommandLine(argc, argv); // parses the command line for --luafile
 luaTool.config("my_config.lua");   // reads in a lua config file

  // Instantiate and bind SystemC modules...


}

42 Enabling the Open SystemC User Community


May 6, 05
GreenAV

Part of GreenControl

43 Enabling the Open SystemC User Community


May 6, 05
Green Analysis and Visualisation
• Fabric for analysis and visualisation.
• Built on gs_params
• Allows all I/O to be “channelled”
• Basic concept is that output is always a result of changes to a
parameter (even if that parameter is a string, getting a new
string value).

• Highly flexible way of controlling what data to extract, and when


(e.g. trigger conditions and calculators)

• Output plugins for STDOUT, File, SCV and CSV, etc etc…

44 Enabling the Open SystemC User Community


May 6, 05
Using GreenAV
• In order to register and use GreenAV output plugins:
// Parameters to output (local one or get out of hierarchy)
gs_param_base *uint_par = m_configAPI.getPar("Owner.uint_param");
gs_param_base *str_par = m_configAPI.getPar("Owner.str_param");
gs_param<unsigned int> *int_par = new gs_param<int>("int_par");

// Use default output plugins


m_analysisAPI.add_to_default_output(FILE_OUTPUT_PLUGIN, *int_par);
m_analysisAPI.add_to_default_output(FILE_OUTPUT_PLUGIN, *str_par);
m_analysisAPI.add_to_default_output(SCV_OUTPUT_PLUGIN, *int_par);

// Create additional output plugins


OutputPlugin_if* fileOP = m_analysisAPI.create_OutputPlugin(
FILE_OUTPUT_PLUGIN, "secondFile.log");
m_analysisAPI.add_to_output(fileOP, *str_par);
m_analysisAPI.add_to_output(fileOP, *int_par);

• This code can be in sc_main

45 Enabling the Open SystemC User Community


May 6, 05
GreenAV Calculators and Triggers
• Process data before extracting it to output:
Statistics object (StatCalc) consists of a trigger and a calculator

• The Calculator allows building a formula with gs_params


• Usual operators supported
• User may add own operators (e.g. in sc_main)

• The Trigger activates a re-calculation of the formula


• Can trigger on several activation events:
• on each calculator‘s input parameter change (default)
• on an sc_event
• on an repeated time sample interval (sc_time)
• Trigger can be guarded by a bool condition (gs_param<bool>)

• The result (gs_param) can be outputted by the user.

46 Enabling the Open SystemC User Community


May 6, 05
GreenAV Calculators and Triggers
• Calculator
Calculator<double> c(“c");
// most flexible notation:
c.calc("+", par1, c.calc("-", par2, par3)); // = par1 + (par2 - par3)
// more convenient notation (available for +,-,*,/ using gs_param_bases):
c(par1_base + c(par2_base - par3_base)); // = par1 + (par2 - par3)

• Trigger
// sc_event trigger // trigger with condition guard
sc_event trigger_ev; gs_param<bool> condition("cond");
Trigger t(trigger_ev); Trigger t(condition);

• Combine to StatCalc
// Statistics Calculator with default trigger
StatCalc<double> stc("StatCalc", &c);
// Statistics Calculator with special trigger
StatCalc<double> stc2("StatCalcTr", &t, &c);

47 Enabling the Open SystemC User Community


May 6, 05
GreenScript

48 Enabling the Open SystemC User Community


May 6, 05
GreenScript
• “System Python”, ability to run SystemC style code from within
Python.
• Mixed simulations of Python scripting code and SystemC
models.
• SystemC services such as events made available to script

• Rapid prototyping.
• Rapid test bench generation

• Full availability of GreenControl parameters within scripting


environment.

• Interfaces language neutral, e.g. Tcl, Perl, etc. (SWIG)

49 Enabling the Open SystemC User Community


May 6, 05
Using GreenScript: simple adder

Python SystemC

import gs
class adder:

def doit(self):
// declare named signals,
   A = gs.sc_signal("A")
// to be used in the module
   B = gs.sc_signal("B")
sc_signal A("A");
   C = gs.sc_signal("C")
sc_signal B("B");
   while True:
sc_signal C("C");
    gs.wait(A.write_event()
GreenScriptModule gs_module("name");
| B.write_event())
gs_module.load("adder.py");
     C.write(A.read() + B.read())

def __init__(self):
   gs.spawn(self.doit)

NOTE: Signals facilitate the communication between script and SystemC

50 Enabling the Open SystemC User Community


May 6, 05
Eclipse VPP

An Eclipse project run by GreenSocs

51 Enabling the Open SystemC User Community


May 6, 05
Eclipse?
• A toolkit for constructing tools user interfaces.
• Based on Java (platform independent)
• Huge user community
• Large industrial support
• Widely used for ESL tools

The Eclipse logo is the trademarks of Eclipse Foundation, Inc.

52 Enabling the Open SystemC User Community


May 6, 05
Eclipse for ESL
Support for
IP Component Model Construction
development
i.e. with SystemC, UML…

Support for
IP Component
assembly
Model Integration
i.e. with IPXACT

User “platform” Support for


Tool.
Model Use
i.e
User interaction
all user interactions

We need it all: We need the ability to plug-n-play different


tools/models at different places in the flow…

53 Enabling the Open SystemC User Community


May 6, 05
Purpose of VPP
• “What ESL needs in Eclipse”

• To enable the construction of virtual platform prototypes with a


heterogeneous set of both models and tools

• Another way of putting this:


• For each interface that can support user interaction, provide
an exemplar GUI component for Eclipse, and the
infrastructure necessary to connect to it from the ESL world
e.g. SystemC.
Nb, some of these interfaces are B2B - I.e. IPXACT, and SystemC.
• 2 current focal points:
• Immediate prioritization and co-ordination of Eclipse bug fixes, and
review of how to best support and use ESL languages inside Eclipse
(I.e. IPXACT)
• Exemplar plugins and additions to Eclipse to support ESL languages
and environments (I.e. SystemC, IPXACT, etc)

54 Enabling the Open SystemC User Community


May 6, 05
VPP “Vision”
• Complete tools made from combinations of components
• Interfaces between components must be agreed.
• E.g. simulation services (start stop) - etc.

Complete tool

Model UI
Tool Component component

55 Enabling the Open SystemC User Community


May 6, 05
Proposed IPXACT server
• Focus - enabling IPXACT use within Debug.
• This is a proposed project, get in touch if your interested:
EDA
IPXACT tool
editor
EDA EDA
tool Eclipse tool

IPXACT
Server

TGI - Sprint standard Interface

IPXACT
files

56 Enabling the Open SystemC User Community


May 6, 05
Current GreenSocs Eclipse

• SystemC-specific features and extensions include:


• Project management
• Configuration
• Visualization
• Model execution
• Inherited CDT functionality
• Syntax highlighting
• Module tree viewer
• Structural representation

57 Enabling the Open SystemC User Community


May 6, 05
Component Library

58 Enabling the Open SystemC User Community


May 6, 05
Component library - Exemplar IP
• Not all IP is valuable.
• Not all IP is monolithic.

• GreenSocs holds a store of common parts, and sub parts.


• All parts make use of GreenSocs infrastructure.

• Existing parts include Graphics components, UARTs etc.

• NB The UART model has just been updated by CircuitSutra -


one part of the Eco-System….

59 Enabling the Open SystemC User Community


May 6, 05
Software services to semiconductor industry

SystemC Modeling Services


Existing Expertise with TLM 2.0 d2, Greenbus and hence TLM2.0
•Modeling of complete SoC and individual IP blocks at various abstraction
levels
•Virtual platform creation for embedded software development
•Virtual platform creation for architectural exploration
•Creation of reference models for RTL verification
•Verification of SystemC Models
•Creation of instruction set simulator (ISS) model of processors

Outsourced EDA Tool development

Embedded semiconductor software


Meta Description for Silicon Based
Functionality
This years Project…

61 Enabling the Open SystemC User Community


May 6, 05
Parts of a SystemC model

Protocol State Machine Registers User Model


Address Maps
Standard Bus Interface

lt at

Registers with functional side effects

And in reverse too!

62 Enabling the Open SystemC User Community


May 6, 05
Parts of a SystemC model

Protocol State Machine Registers User Model


Should more of
Address Maps this be
Protocol should be Registers defined
defined in IPXACT Generated too?
In IPXACT
Standard Bus Interface

How should this


connection work
in IPXACT?
OSCI lt at
TLM 2.0
User codes using
Generator uses
Generator targets Green* kit in
Green* kit and
SystemC typedefs Green* kit for SystemC
SystemC typedefs
Provided by SystemC Registers with functional side effects
GreenSocs

And in reverse too!

Generated “Convenience” Socket Generated “user” Code Users model

63 Enabling the Open SystemC User Community


May 6, 05
DRF - Device Register Framework

Work In Progress
• GreenSocs will be amalgamating a Device Register framework
with the existing Green* kit
• DRF was initially written by Jason Patrick
• Useful for describing Registers, Devices, State machines, etc.
• Will be Integrated with Green* (state variables will use
gs_params etc, etc, etc…)

• Is DRF the “whole story”?

64 Enabling the Open SystemC User Community


May 6, 05
Meta Description for SbF
• IPXACT will describe structural and definitional parts of a
System.
• IPXACT could describe the structure and definitional parts of a
silicon based function component (whether that component
was built from software, hardware, or a combination)

• BUT - IPXACT is not great at describing semantics…. What


should be used to capture those semantics?

• Some initial thoughts:


1. We must work to improve IPXACTS utility for SbF.
2. We must provide a convenient simulation language in SystemC for
SbF (hence DRF).
3. We probably need to do other things as well
BOF? (all meanings!)

65 Enabling the Open SystemC User Community


May 6, 05
Eco System

66 Enabling the Open SystemC User Community


May 6, 05
Adopting ESL - “use the force”
• Need Interfaces
• Common methodology
• Common deliverables

Entrenched
Existing IP Ground up
“perfect”
solutions

Requires :
• Clear PROCESS
• SUPPORT

• Build migration plans


• Require assistance to align business processes

67 Enabling the Open SystemC User Community


May 6, 05
The pillars of successful ESL

Infrastructure, Libraries of IP
Interfaces

Tools
Successful ESL Methodology Requires these 3 things +
Underlying understanding training, and deployment

The GreenSocs partnership includes the experts in ESL


deployment. - use the Force

68 Enabling the Open SystemC User Community


May 6, 05
ESL/TLM 2.0 Experience for Hire
ESLX
 Xtreme ESL Worldwide
• Adoption Planning
• Methodology & Flow
• Schedule Acceleration
• Mentors/Quick Ramp (best value)
• Training
• Turnkey SystemC/TLM 2 Modeling
 History
• Consultancy focused on ESL
• Founded 2003
• Work with OSCI (e.g. TLM 2
• Wrote book, “SystemC: From the Ground Up”
 Contact
• Email: info@eslx.com
• Phone: 888-467-4609
• Web: http://www.ESLX.com

69
©2008 ESLX, Inc.
Eco-System underlying commonality
In order for different businesses,
(models, tools, s/w, h/w)
OR different parts of the same business
to work together - requires

development
Training

Algorithm/sw

System Common infrastructure.

developmen

Tools

Flows
Library

70 Enabling the Open SystemC User Community


May 6, 05
Eco system - MISSION
• Building the ESL Eco-System is GreenSocs main mission.
• Proving open source infrastructure enables the Eco system.
• Universities are enabled to better focus on relevant topics
• Companies need not expend engineering effort on zero-value add activities
• Commonality and interoperability is enhanced.

• The GreenSocs partnership includes those sponsoring this meeting:


• CoFluent Design - providing advanced architectural exploration tools
• CircuitSutra - partners in IP creation
• ESLX - The experts in ESL deployment
• Virtutech - High speed platforms for software engineering

• Also… GreenSocs chairs the OCP-IP SLD WG, are active members of the OSCI
TLM WG, members of SPIRIT, and are becoming involved in Power.org and MIPI.

71 Enabling the Open SystemC User Community


May 6, 05
ESL Deployment Chain

IP Component
development

IP Component
assembly

User “platform”
Tool.

User interaction

72 Enabling the Open SystemC User Community


May 6, 05
Heterogeneous environments

simulations are mixed.


Different tools have different
specialities
Users want to make best use
of each
SystemC is “glue” - it is C++
it links nicely with other tools
BUT - so many interfaces -
this makes it harder to
integrate models Now - Today,
And its getting
MORE common

With COMMON INFRASTRUCTRE


It Works!
73 Enabling the Open SystemC User Community
May 6, 05
CoFluent Studio www.cofluentdesign.com

 HW/SW ESL modeling & simulation Timed-Behavioral Platform


• Input = graphics + ANSI C/C++ Modeling Architecting
• Output = TLM SystemC code (TL3)
 Easy characterization of new features
& subsystems and integration of
existing ones Mapping
 Architecture exploration
& performance prediction
• Loads, power, memory, cost
 Continuous validation of use cases Architecture
and designs Exploration

 Enabling innovation Behavioral use case + application


 Optimizing architectures model with time
Generic HW performance models
 Delivering executable specifications
 Optimizing design supply chain No hardware IPs needed
No embedded software needed
No ISS

6/16/08 Copyright © CoFluent Design - CONFIDENTIAL 74


SystemC and CoFluent Studio
• Architectural Exploration tool, based on SystemC for execution
is very easily integrated with other SystemC models.
• The wrapper that has been used will work well for TLM 2.0
models, meaning CoFluent s tool suit will be able to facilitate
the exploration of systems including fixed IP blocks.
• CoFluent graphical abstraction also facilitates the description
(behavioural model with time) of new IP blocks to be integrated
to virtual platform/prototyping environment.

Graphical and Textural


Language used for
design and
architectural
exploration

75 Enabling the Open SystemC User Community


May 6, 05
Simics value point

IP Component
development

IP Component
assembly

User “platform”
Tool.

User interaction

76 Enabling the Open SystemC User Community


May 6, 05
Simics Architecture

User program User program Middleware

Target operating system GUI

Target hardware drivers Target boot code Scripting

Built-in
Inspection Debugger
Target ISA decoder
Control
Features Memory JIT Devices
Devices Devices
Networks
Devices
Memory Interpreter VMP Devices
Compiler and IO
Processor
Processors

Target Machine(s) External


world
Configuration Core Services Event queue Multithreading connections
management API Simics and time and scaling
Core
Simics
Ethernet

Model library
DML, C, Serial
C++, Python,
Keyboard
Simics
script,
Device Network CPU SoC Intercon Intercon
Config Mouse
SystemC model model nect scripts
nect Ext. Debuggers
...
SystemC and Simics

Forward calls to
simics
SystemC model systemC TLM
devices
device model
TLM model may
Optionally post SystemC
advance events and use
time Spy on SystemC API
SystemC
events
Event queue,
and simulation
Allow SystemC
kernel wheel
kernel to advance
when events are OSCI SystemC kernel
ready to process

Bridge SystemC world

Simics kernel

Single Thread

BUT - the interface was hard…..

78 Enabling the Open SystemC User Community


May 6, 05
GreenSocs Interface Repository

79 Enabling the Open SystemC User Community


May 6, 05
Interoperability needs ALL interfaces
Simulator kernel and services

Simulation models

[A]
External apps [C] m1 m2
[D]
Hardware models
a1 S1
[B]
m3
[E]
Non-Hardware models
a2

A – Model to model. Hardware oriented channel.


B – Model to model. Non-hardware oriented channel.
C – Model to service.
D – External application to service.
E – External application to model.

80 Enabling the Open SystemC User Community


May 6, 05
Under the Hood (Simplified)
usbotg asiminterface SoC fiodev fiodev fiodev
xxx gsmbs gsmbs gsmbs
sahara xxx xxx fiodev fiodev fiodev
auart Serial_port fiodev fiodev fiodev gsmbs gsmbs gsmbs
fiodev xspi
auart Serial_port xgpio xxx fiodev fiodev fiodev gsmbs gsmbs gsmbs
iomux xxxx xxx fiodev fiodev fiodev

xdog xdog owb battery Platform llc

xxx sndcp
xgpio
xxx
xpit
xpit
xxx
xint
xuart
xuart
Interfaceflash
Serial_port
Serial_port
interfaces
xxx
xxx
gsmrfi
wcdmabs rlcmac

l2cache xxx xgpt xkypd everywhere….


xxx xxx
arm xxx xrtr xxx xxx
dummy
asiminterface xitc xxx xxx wcdmarfi xhandset
xxx rtc
xxx xxx xspi xspi

pinlogic pinlogic Call


xspi xspi xxx
sc4 Processing
xxx xtimer xtimer xxx

keypad xhandset xhandset ptfif ptfif ptfif


simslirp
Graphical Handset

81 Enabling the Open SystemC User Community


May 6, 05
GreenSocs Interface Repository
• All interfaces used by GreenSocs are recorded in an interface
repository.
• The repository holds any information: •ONLINE repository.
• SystemC implementation •Free Access
• SPIRIT identifier •Updated Instantly
• Formal description •YOU HAVE WRITE
• The Repository works at several levels: ACCESS!!!
• Protocol description •“Gardened” by
• Broken into Attributes GreenSocs
• Paravitulisation (Software view)
• TLM view
• Model-Tool
• This provides an easily accessible resource for all designers.
• The repository is open to all to contribute. GreenSocs engineers
ensure that there are no overlaps or errors.

82 Enabling the Open SystemC User Community


May 6, 05
What is an Interface?
• Structural Definition -- using SPIRIT IPXACT
• Both Data and Timing information for the protocol

• Implementation Definition
• In SystemC - aligned with TLM 2.0, must provide “traits classes”
etc.
Protocol.h
Protocol.vhdl
• Exemplar components …..

• Example routers, or other appropriate components

• Example USER INTERFACE components - Plugged into Eclipse.

GUI components

83 Enabling the Open SystemC User Community


May 6, 05
Putting it all together.

Interface repository YOUR ESL


IPXACT Exemplar Rich infrastructure support
Definition IP
components

SystemC
Definition Exemplar
Eclipse
Components Free Choice of Vendor

84 Enabling the Open SystemC User Community


May 6, 05
Thankyou

For more information, please visit


http://www.greensocs.com/

Or contact
Mark.Burton@greensocs.com

85 Enabling the Open SystemC User Community


May 6, 05

Você também pode gostar