This document provides an introduction and overview of electronic system level (ESL) design using SystemC. It begins with background on ESL design basics, system on chip design flows, and SystemC. It then provides 3 examples of SystemC code: a counter, traffic light, and simple bus. The counter example shows a basic module with clocked process. The traffic light demonstrates a finite state machine. The bus example illustrates an interface, master/slave devices, and memory mapped components communicating over a bus. Overall, the document serves as an introductory tutorial for designing and modeling electronic systems using the SystemC language.
2. Outline
• Electronic System Level (ESL) Design Basics
• Hardware architecture
• SoC Design Flow (系統晶片設計流程)
• SystemC background
• SystemC Syntax by Example
– ex1: Counter
– ex2: Traffic Light
– ex3: Simple Bus
3. Why learn ESL
• if you are an undergraduate student, and/or
• if you are a C.S. student, and/or
• if you still do not know in which areas you are
really interested,
• when you still do not know what ESL is?
4. Because
• This is one of the best ways to start your
learning of C++,
• This is the best way for a C.S. student to study
SoC design,
• This is the biggest advantage C.S. students can
take over E.E. students in SoC related areas,
• This is one of the best ways to learn lots of
tools and languages in HW/SW designs.
5. What is ESL?
• ESL = Electronic System Level
• ESL doesn’t specify which levels of design should
be employed. It focuses on the concepts of
designing a system, instead of specific
components.
• Then, what is Electronic System Level design flow?
• Design, debug, verify the system using ESL
methodologies, languages, tools and CONCEPTS.
6. What does level mean?
• In HW design, level means the degree of the
design details, or the level of abstraction, of the
model of the target design. For example,
– Transistor level
– Gate level
– Register transfer level (RTL)
– Transaction level
– Behavior level
– Architecture level
– Algorithmic level
– …. And so on.
7. Before the answer is made
• Let’s ask “Why ESL design flow is needed?”
– Huge system
– Extraordinarily high complexity
– Design reuse
– Slow simulation speed
– Difficulty in integration
– Mixed/multiple disciplines
– HW/SW co-design/co-simulation/co-….
– And so on.
– Most importantly, time-to-market
9. These are not reasons
• They are just problems. Imagine
– You have a system with 10 processor cores, each
having its own memory system. There are shared
memory spaces for the cores. 20 different peripherals
to control. There are 20 programmers using 8 different
languages to develop 30 different applications on this
system which needs to support 2 different OS. And the
biggest problem is
• To cope with these problems, what do we need?
10. We need
• A super fast simulator
• A simulator supports mixed abstraction level
designs
• An integrated HW/SW co-development
environment
• A super fast simulation environment
• … and so on.
• To do this, what are the first few steps?
11. Hareware? FPGA? MCU?
• Microcontroller:
– CPU, Memory, …, etc.
– Software program
• (.C->.asm->.out)
• FPGA:
– Verlog code, VHDL code.
– Hardware program
• (.v->.bit)
18. Detailed Flow: Early stage 交互驗證
TLM/ESL Modeling stage
Final Integration Stage
Three stage pipeline design:
A. SW model: high abstraction level
model
B. TLM model:very close to
architecture
C. HW model :HDL
23. SystemC Library
Data types
Application
Written by the end user
SystemC verification library, bus models, TLM interface
4-valued logic type
4-valued logic vectors
Bit vectors
Arbitrary-precision integers
Fixed-point types
Core Language
Module
Ports
Processes
Interfaces
Channels
Events
Methodology- and technology-specific libraies
Predefined channels
Signals, clock, FIFO,
Mutext, semaphore
Utilities
Vector, strings,
traceing
Programming Language C++
24. Module (模組)
• A Module
– A CPU
– A Gate
• With
– Port (埠口)
– Process (排程)
– Sub-module (子模組)
Top Module
Module 1 Module 1
Process Port Port Process Port Port
33. 紅綠燈
red
green
cthread on
yellow
clk
on method
on
light “red”
light “green”
method
light “yellow”
red
green
yellow method
fsm“fsm”
34. 執行結果
0 ps: red
10000 ps: green
20000 ps: yellow
22000 ps: red
32000 ps: green
42000 ps: yellow
44000 ps: red
54000 ps: green
64000 ps: yellow
66000 ps: red
76000 ps: green
86000 ps: yellow
88000 ps: red
36. Methods
• Methods behaves like a function
• Sensitive list signals which trigger a process
can be a signal or local variable or port.
37. Threads
• Thread Process can be suspended.
• The Thread Process can contain wait() functions that
suspend process execution until an event occurs on
one of the signals the process is sensitive to.
• The process will continue to execute until the next
wait()
38. Clocked Threads
• SC_CTHREAD can have only one bit wide ports
as trigger.
51. Open Source: GreenSoc (not so open)
User IP 1 GreenBus I/F
GreenScript
SystemC
User IP 2
User IP 3
Config User I/F
GreenBus I/F
GreenBus I/F
Config User I/F
Config User I/F
Config PlugIn
GreenAV PlugIn
Specific PlugIn
GreenControl Core
GreenAV User I/F
Specific User I/F
ESL
Tools