Escolar Documentos
Profissional Documentos
Cultura Documentos
0 Models
with GreenSocs
Event Sponsors:
• (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…
Quick Simple
Industry ready Generic Library
ESL package Components
management
• 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
GreenScript (Python)
Config PlugIn
User IP 1
GreenControl Core
Config User I/F GreenBus I/F
(Parameter Config)
(Analysis &
Visualization)
SystemC
} {
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.
} {
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.
1 year?
1 Month?
1 Week?
…?
#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…(…);
…
}
Ordered or
Transaction b_transport TLM_COMPLETED
Accurate
Bus Accurate or
nb_transport TLM_ACCEPTED
Cycle Accurate
Target Initiator
NB, the transaction itself stays the same, no matter which function call is used,
the non-blocking calls just add phase.
Return TLM_COMPLETED
or
Return TLM_ACCEPTED
Your bus/socket provider }
may provide you with an
interface more appropriate for
the bus in question…
nb_transport…
Your bus/socket provider
may provide you a
bus specific API…
BP Data BP Timing
phases
“non-Ignorable Additional
extensions? Extensions Phases
Extensions
Extensions
“Ignorable Extensions
Extensions
extensions?
MY PROTOCOL
• 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!
• 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….
Part of GreenControl
}
// Callback function with default signature.
void config_callback(gs_param_base& par) {...}
};
#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);
Part of GreenControl
• Output plugins for STDOUT, File, SCV and CSV, etc etc…
• 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);
• Rapid prototyping.
• Rapid test bench generation
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)
Support for
IP Component
assembly
Model Integration
i.e. with IPXACT
Complete tool
Model UI
Tool Component component
IPXACT
Server
IPXACT
files
lt at
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…)
Entrenched
Existing IP Ground up
“perfect”
solutions
Requires :
• Clear PROCESS
• SUPPORT
Infrastructure, Libraries of IP
Interfaces
Tools
Successful ESL Methodology Requires these 3 things +
Underlying understanding training, and deployment
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
developmen
Tools
Flows
Library
• 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.
IP Component
development
IP Component
assembly
User “platform”
Tool.
User interaction
IP Component
development
IP Component
assembly
User “platform”
Tool.
User interaction
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
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
Simics kernel
Single Thread
Simulation models
[A]
External apps [C] m1 m2
[D]
Hardware models
a1 S1
[B]
m3
[E]
Non-Hardware models
a2
xxx sndcp
xgpio
xxx
xpit
xpit
xxx
xint
xuart
xuart
Interfaceflash
Serial_port
Serial_port
interfaces
xxx
xxx
gsmrfi
wcdmabs rlcmac
• Implementation Definition
• In SystemC - aligned with TLM 2.0, must provide “traits classes”
etc.
Protocol.h
Protocol.vhdl
• Exemplar components …..
GUI components
SystemC
Definition Exemplar
Eclipse
Components Free Choice of Vendor
Or contact
Mark.Burton@greensocs.com