Version 2.0
User’s Guide
Update for SystemC 2.0.1
Copyright (c) 1996-2002
by all Contributors.
All Rights reserved.
Copyright Notice
Copyright (c) 1996-2002 by all Contributors. All Rights reserved. This software
and documentation are furnished under the SystemC Open Source License (the
License). The software and documentation may be used or copied only in
accordance with the terms of the License agreement.
Right to Copy Documentation
The License agreement permits licensee to make copies of the documentation.
Each copy shall include all copyrights, trademarks, service marks, and
proprietary rights notices, if any.
Destination Control Statement
All technical data contained in this publication is subject to the export control
laws of the United States of America. Disclosure to nationals of other countries
contrary to United States law is prohibited. It is the reader’s responsibility to
determine the applicable regulations and comply to them.
Disclaimer
THE CONTRIBUTORS AND THEIR LICENSORS MAKE NO WARRANTY
OF ANY KIND WITH REGARD TO THIS MATERIAL, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Trademarks
SystemC and the SystemC logo are trademarks of Synopsys, Inc.
Bugs and Suggestions
Please report bugs and suggestions about this document to
http://www.systemc.org
SystemC 2.0 User’s Guide iii
Contents
CHAPTER 1 Introduction 1
Using Executable Specifications 2
SystemC Highlights 3
Current System Design Methodology 4
SystemC Design Methodology 5
Compatibility with Earlier Versions of SystemC 7
CHAPTER 2 Starting with a Simple Example 9
Simplex Data Protocol 9
C/C++ Model 11
SystemC Model 15
User Defined Packet Type 16
Transmit Module 17
Channel Module 22
Receiver Module 25
iv SystemC 2.0 User’s Guide
Display Module 28
Timer Module 29
Putting it all together - The main routine 31
Compiling the Example for UNIX 35
Compiling the Example for Windows 36
Executing the Example 37
CHAPTER 3 Modules and Hierarchy 39
Module Ports 40
Module Signals 41
Internal Data Storage 44
Processes 46
Module Constructors 47
TestBenches 49
CHAPTER 4 Processes 53
Basics 54
Method Process 54
Thread Processes 56
Clocked Thread Process 59
Wait Until 63
Watching 64
Local Watching 67
CHAPTER 5 Ports and Signals 71
Reading and Writing Ports and Signals 74
Array Ports and Signals 74
Resolved Logic Vectors 75
Resolved Vector Signals 77
Signal Binding 78
SystemC 2.0 User’s Guide v
Clocks 80
CHAPTER 6 Data Types 83
Type sc_bit 84
Type sc_logic 85
Fixed Precision Unsigned and Signed Integers 87
Speed Issues 90
Arbitrary Precision Signed and Unsigned Integer Types 91
Arbitrary Length Bit Vector 93
Arbitrary Length Logic Vector 95
Logic Vector Speed Issues 97
User Defined Type Issues 97
CHAPTER 7 Fixed Point Types 101
Word Length and Integer Word Length 103
Quantization Modes 105
SC_RND 106
SC_RND_ZERO 108
SC_RND_MIN_INF 110
SC_RND_INF 112
SC_RND_CONV 114
SC_TRN 117
SC_TRN_ZERO 119
Overflow Modes 121
MIN and MAX 121
SC_SAT 122
SC_SAT_ZERO 124
SC_SAT_SYM 126
SC_WRAP 128
SC_WRAP, n_bits = 0 128
SC_WRAP, n_bits > 0 130