|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
SYSTEMC: FROM THE GROUND UP
By
David C. Black and Jack Donovan
Eklectic Ally, Inc.
KLUWER ACADEMIC PUBLISHERS
Dedication v
Preface xi
Why this Book xi
Prerequisites for this Book xii
Book Conventions xiii
About the Examples xiv
How to Use this Book xiv
SystemC Background xv
The Evolution of SystemC xv
Open SystemC Initiative xvii
1. An Overview to System Design Using SystemC 1
1.1
1.2
1.3
1.4
1.5
Introduction 1
Language Comparison 2
Design Methods 3
What’s Next 3
Enhancing Productivity with SystemC 3
2. TLM-Based Methodology 11
2.1
2.2
2.3
2.4
2.5
Transaction-Level Modeling Overview 11
Abstraction Models 13
Another Look at Abstraction Models 15
TLM-Based Methodology 16
Summary 23
viii SystemC: From The Ground Up
3. Overview of SystemC 25
3.1
3.2
3.3
3.4
C++ Mechanics for SystemC 26
SystemC: A C++ Class for Hardware 30
Overview of SystemC Components 33
SystemC Simulation Kernel 38
4. Data Types 41
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
Numeric Representation 41
Native Data Types 43
Arithmetic Data Types 43
Boolean and Multi-Value Data Types 45
Fixed-Point Data Types 47
Operators for SystemC Data Types 51
Higher Levels of Abstraction and the STL 52
Choosing the Right Data Type 55
Exercises 56
5. Modules
5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
5.9
57
A Starting Point: sc_main 57
The Basic Unit of Design: SC_MODULE 59
The SC_MODULE Class Constructor: SC_CTOR 60
The Basic Unit of Execution: SystemC Process 61
Registering the Simple Process: SC_THREAD 62
Completing the Simple Design: main.cpp 64
Alternative Constructors: SC_HAS_PROCESS 64
Two Basic Styles 66
Exercises 70
6. A Notion of Time 71
6.1
6.2
6.3
6.4
6.5
6.6
sc_time 71
sc_start() 72
sc_time_stamp () and Time Display 73
wait(sc_time) 74
sc_simulation_time(), Time Resolution and Time Units 75
Exercises 76
7. Concurrency 77
7.1
7.2
7.3
7.4
7.5
7.6
sc_event 78
Simplified Simulation Engine 79
SC_THREAD 81
Dynamic Sensitivity for SC_THREAD::wait() 81
Another Look at Concurrency and Time 83
Triggering Events: .notify() 86
Contents ix
7.7
7.8
7.9
7.10
7.11
7.12
SC_METHOD 90
Dynamic Sensitivity for SC_METHOD: next_trigger() 92
Static Sensitivity for Processes 93
dont_initialize 96
sc_event_queue 97
Exercises 98
8. Basic Channels 99
8.1
8.2
8.3
8.4
8.5
Primitive Channels 100
sc_mutex 100
sc_semaphore 102
sc_fifo 104
Exercises 107
9. Evaluate-Update Channels 109
9.1
9.2
9.3
9.4
9.5
Completed Simulation Engine 111
sc_signal, sc_buffer 113
sc_signal_resolved, sc_signal_rv 116
Template Specializations of sc_signal Channels 118
Exercises 120
10. Structure 121
10.1
10.2
10.3
10.4
10.5
10.6
10.7
10.8
10.9
Module Hierarchy 121
Direct Top-Level Implementation 123
Indirect Top-Level Implementation 124
Direct Sub-Module Header-Only Implementation 125
Indirect Sub-Module Header-Only Implementation 125
Direct Sub-Module Implementation 126
Indirect Sub-Module Implementation 127
Contrasting Implementation Approaches 128
Exercises 128
11. Communication 129
11.1
11.2
11.3
11.4
11.5
11.6
11.7
Communication: The Need for Ports 129
Interfaces: C++ and SystemC 130
Simple SystemC Port Declarations 135
Many Ways to Connect 136
Port Connection Mechanics 138
Accessing Ports From Within a Process 141
Exercises 142
x SystemC: From The Ground Up
12. More on Ports 143
12.1
12.2
12.3
12.4
12.5
12.6
12.7
Standard Interfaces 143
Static Sensitivity Revisited 147
Specialized Ports 149
The sc_port<> Array 154
SystemC Exports 158
Connectivity Revisited 164
Exercises 166
13. Custom Channels and Data 167
13.1
13.2
13.3
13.4
13.5
13.6
13.7
A Review of Channels and Interfaces 167
The Interrupt, a Custom Primitive Channel 168
The Packet, a Custom Data Type for SystemC 170
The Heartbeat, a Custom Hierarchical Channel 174
The Adaptor, a Custom Primitive Channel 176
The Transactor, a Custom Hierarchical Channel 180
Exercises 186
14. Advanced Topics 187
14.1
14.2
14.3
14.4
14.5
14.6
14.7
14.8
14.9
sc_clock, Predefined Processes 187
Clocked Threads, the SC_CTHREAD 189
Programmable Hierarchy 193
Debugging and Signal Tracing 197
Dynamic Processes 199
SC_FORK/SC_JOIN 204
Error and Message Reporting 207
Other Libraries: SCV, ArchC, and Boost 211
Exercises 212
15. Odds & Ends 213
15.1
15.2
15.3
Determinants in Simulation Performance 213
Features of the SystemC Landscape 218
Next Steps 222 |
|