Documente Academic
Documente Profesional
Documente Cultură
System
on a
Chip
Manage the Complexity
Higher Levels of SLD
Abstraction
Design Reuse
Millions of Gates
Higher Design Complexity
Requirements
Functional Architectural
Validation Validation
Co-
Software Hardware
Verification
Performance Modeling
– Software
– Architecture
dataflow
SystemC -
A Modeling Environment for
Hardware and Software
SystemC -
A Modeling Environment for
Hardware and Software
&What is SystemC?
&Language overview
&System simulation in SystemC
&Example
&What is SystemC useful for?
SystemC -
A C++ Class Based Approach
Process 1
Process 3
sc_signal
sc_signed
Process 2
sc_ sc_logic
sig
na l
sc_sync sc_async
sc_aproc
&System description:
Multiple concurrent Processes
&Communication: Signals, clocks, reset
&Rich variety of hardware data types
&Model at all levels of abstraction
System Simulation
in SystemC
&SystemC consists of
– Set of header files describing the C++ classes
– Link library that contains a cycle-based
simulation kernel
&An ANSI C++ compliant compiler can
compile SystemC, together with your
program
&The resulting executable serves as a
simulator for the system described
Language Overview:
Modules and Processes
&Synchronous processes
– Timing control statements like wait() implement
synchronization and writing
– Instructions between timing control statements
are executed without delay
&Asynchronous processes
– Instructions are executed without delay
– Local variables are redefined each time the block
is invoked
Various Levels of Abstraction
clock clock
main
int
int sc_main(int
sc_main(int argc,
argc, char
char *argv[])
*argv[]) {{
sc_signal<int>
sc_signal<int> data("DATA");
data("DATA");
sc_signal<bool>
sc_signal<bool> reset;
reset;
sc_clock
sc_clock clock("CLOCK",
clock("CLOCK", 100,
100, 0.5,
0.5, 0.0);
0.0);
Test_Counter
Test_Counter TestBench("TestBench");
TestBench("TestBench");
TestBench
TestBench <<
<< clock
clock <<
<< reset;
reset;
Counter
Counter DUT("ThreeBit");
DUT("ThreeBit");
DUT
DUT <<
<< reset
reset <<
<< data
data <<
<< clock;
clock; connections
sc_clock::start(-1);
sc_clock::start(-1);
return
return 0;
0;
}}
What is SystemC Useful For?
&Source Code
&User Guide
&Reference Manual
&All available from www.SystemC.org
CoCentricTM System Studio
System Studio Overview
DFG
When do I Need Control
Modeling?
FSM
Model Management
Workspace
Browser
Message/Diagnostics Window
Model Implementation Types
&Primitive models
– prim_models
" Actions written in C/C++ style
" Allow to model static and dynamic dataflow and
control
– COSSAP SDS models
– Inline actions to control model states
in C/C++ style
&Hierarchical models
– Dataflow graph (DFG)
– States and transitions in control models
Model Interface
main_action
main_action {{
int
int j;
j; Inp T Outp
TT buffer[BSize];
buffer[BSize]; Reverse
for
for (j
(j == 0;
0; jj << BSize;
BSize; j++)
j++) {{ BlockSize
read
read (Inp);
(Inp);
buffer[j]
buffer[j] == Inp;
Inp;
}}
for
for (j
(j == Bsize-1;
Bsize-1; jj >=
>= 0;
0; j++)
j++) {{
Outp
I/O pattern
Outp == buffer[j];
buffer[j];
write
write (Outp);
(Outp); is static
}}
}}
Example: prim_model
With Dynamic I/O Pattern
prim_model
prim_model select
select {{
type_param
type_param TT == double;
double;
port InTrue
port in
in TT InTrue,
InTrue, InFalse;
InFalse;
port
port out
out TT OutP;
OutP;
port
port in
in bool
bool control;
control;
Outp
main_action
main_action {{
read
read (control);
(control); InFalse
if
if (control)
(control) {{
read control
read (InTrue);
(InTrue);
Outp
Outp == InTrue;
InTrue;
}} else
else {{ Input pattern
read
read (InFalse);
(InFalse); is dynamic
Outp
Outp == InFalse;
InFalse;
}}
write
write (Outp);
(Outp);
}}
Control Model Types
&Receiver:
– Mixed image-text-TDMA signal is filtered and
equalised using a Least Mean Square algorithm
– Equalised signal is demodulated and decoded
Receiver Front-end
Input Matched
Filter
To
Adaptive demodulator
Equalizer
Equal Training
Sequence Reference
Model: Training Sequence
Training sequence
0 time
Dataflow models
Reference
Equal
OR models
OR Model: mux_trainingseq
S1 S2 S3 S2 S3 S2 S3
Training sequence
0 delay high low time
S1 S2 S3
Output port 1st Input port Local variable Parameters 2nd Input port
Example: NCO and Filter With
Controller in 2-Page AND Model
Inline Signals
Code
Input
ports
Example: Dynamic System
Configuration
/* Function of the
parent OR model */ Parent OR
prim_model
prim_model reverse
reverse {{
type_param
type_param TT == double;
double;
param
param int
int BSize
BSize == 4;
4;
port in T Inp;
port in T Inp;
port out T OutP;
port out T OutP;
main_action
main_action {{
int
int j;
j;
TT buffer[BSize];
DFG for
buffer[BSize];
for (j == 0;
(j
read
0; jj << BSize;
read (Inp);
(Inp);
BSize; j++)
j++) {{
buffer[j]
buffer[j] == Inp;
Inp;
}}
for
for (j = Bsize-1; j >=
(j = Bsize-1; j >= 0;
0; j++)
j++) {{
Outp
Outp == buffer[j];
buffer[j];
write
write (Outp);
(Outp);
}}
prim_model }}
Simulation in System Studio
&Control models
– Translated into an Esterel equivalent and then
into sequential C/C++
– Static scheduling domain
&SDS models
– Black box, implementation is already available in
C or Fortran code
– Dynamic scheduling domain
Static vs. Dynamic
Scheduling
&Compilation
Simulation
&TCL/TK Syntax
&Example: set
set ref_value
ref_value "1.0e-06”
"1.0e-06”
for
for {set
{set ii 2}
2} {$i
{$i <=
<= 32}
32} {incr
{incr ii 1}
1} {{
set_parameter
set_parameter wl_data
wl_data $i
$i
Define limit
run_iteration
run_iteration
if
if {{ [expr
[expr $value
$value << $ref_value]
$ref_value] }} {{
exit
exit
Read file.am }}
that was just created }}
Design Reuse: Import from
COSSAP into System Studio
&COSSAP libraries to
System Studio libraries
&Schematics and
hierarchical models to
System Studio DFGs
&Assignment files to
simulation control files
&COSSAP models can be
easily edited and maintained
in System Studio
Design Reuse: Importing
HDL and SystemC Models
&SystemC
– Model hardware and software using C++ classes
and a simulation kernel
– Create, validate and share models
&CoCentricTM System Studio
– Handle complex systems using a graphical user
interface
– Combine dataflow and control in the same
environment