0387699570
SystemC:
From the Ground Up
2nd Edition Preface
Preface
Acknowledgments
Contents
Chapter 1
Why SYSTEMC: ESL and TLM
1.1 .Introduction
1.2 .ESL Overview
1.2.1 .Design Complexity
1.2.2 .Shortened Design Cycle = Need For Concurrent Design
1.2.2.1 .Traditional System Design Approach
1.3 .Transaction-Level Modeling
1.3.1 .Abstraction Models
1.3.2 .An Informal Look at TLM
1.3.3 .TLM Methodology
1.3.3.1 .Algorithmic Modeling
1.3.3.2 .Architectural Modeling
1.3.3.3 .Virtual Software Development Platform
1.3.3.4 .Hardware Refinement
1.3.3.5 .Functional and Architectural Verification
1.4 .A Language for ESL and TLM: SystemC
1.4.1 .Language Comparisons and Levels of Abstraction
1.4.2 .SystemC: IEEE 1666
1.4.3 .Common Skill Set
1.4.4 .Proper Simulation Performance and Features
1.4.5 .Productivity Tool Support
1.4.6 .TLM Concept Support
1.5 .Conclusion
Chapter 2
Overview of SystemC
2.1 .C++ Mechanics for SystemC
2.2 .SystemC Class Concepts for Hardware
2.2.1 .Time Model
2.2.2 .Hardware Data Types
2.2.3 .Hierarchy and Structure
2.2.4 .Communications Management
2.2.5 .Concurrency
2.2.6 .Summary of SystemC Features for Hardware Modeling
2.3 .Overview of SystemC Components
2.3.1 .Modules and Hierarchy
2.3.2 .SystemC Threads and Methods
2.3.3 .Events, Sensitivity, and Notification
2.3.4 .SystemC Data Types
2.3.5 .Ports, Interfaces, and Channels
2.3.6 .Summary of SystemC Components
2.4 .SystemC Simulation Kernel
Chapter 3
Data Types
3.1 .Native C++ Data Types
3.2 .SystemC Data Types Overview
3.3 .SystemC Logic Vector Data Types
3.3.1 .sc_bv.
3.3.2 .sc_logic and sc_lv.
3.4 .SystemC Integer Types
3.4.1 .sc_int.. and sc_uint.
3.4.2 .sc_bigint.. and sc_biguint.
3.5 .SystemC Fixed-Point Types
3.6 .SystemC Literal and String
3.6.1 .SystemC String Literals Representations
3.6.2 .String Input and Output
3.7 .Operators for SystemC Data Types
3.8 .Higher Levels of Abstraction and the STL
3.9 .Choosing the Right Data Type
3.10 .Exercises
Chapter 4
Modules
4.1 .A Starting Point: sc_main
4.2 . The Basic Unit of Design: SC_MODULE
4.3 .The SC_MODULE Class Constructor: SC_CTOR
4.4 .The Basic Unit of Execution: Simulation Process
4.5 .Registering the Basic Process: SC_THREAD
4.6 .Completing the Simple Design: main.cpp
4.7 .Alternative Constructors: SC_HAS_PROCESS
4.8 .Two Styles Using SystemC Macros
4.8.1 .The Traditional Coding Style
4.8.2 .Recommended Alternate Style
4.9 .Exercises
Chapter 5
A Notion of Time
5.1 .sc_time
5.1.1 .SystemC Time Resolution
5.1.2 .Working with sc_time
5.2 .sc_time_stamp()
5.3 .sc_start()
5.4 .wait(sc_time)
5.5 .Exercises
Chapter 6
Concurrency
6.1 .Understanding Concurrency
6.2 .Simplified Simulation Engine
6.3 .Another Look at Concurrency and Time
6.4 .The SystemC Thread Process
6.5 .SystemC Events
6.5.1 Causing Events
6.6 .Catching Events for Thread Processes
6.7 .Zero-Time and Immediate Notifications
6.8 .Understanding Events by Way of Example
6.9 .The SystemC Method Process
6.10 .Catching Events for Method Processes
6.11 .Static Sensitivity for Processes
6.12 .Altering Initialization
6.13 .The SystemC Event Queue
6.14 .Exercises
Chapter 7
Dynamic Processes
7.1 .Introduction
7.2 .sc_spawn
7.3 .Spawn Options
7.4 .A Spawned Process Example
7.5 .SC_FORK/SC_JOIN
7.6 .Process Control Methods
7.7 . Exercises
Chapter 8
Basic Channels
8.1 .Primitive Channels
8.2 .sc_mutex
8.3 .sc_semaphore
8.4 .sc_fifo
8.5 .Exercises
Chapter 9
Evaluate-Update Channels
9.1 .Completed Simulation Engine
9.2 .SystemC Signal Channels
9.3 .Resolved Signal Channels
9.4 .Template Specializations of sc_signal Channels
9.5 .Exercises
Chapter 10
Structure
10.1 .Module Hierarchy
10.2 .Direct Top-Level Implementation
10.3 .Indirect Top-Level Implementation
10.4 .Direct Submodule Header-Only Implementation
10.5 .Direct Submodule Implementation
10.6 .Indirect Submodule Header-Only Implementation
10.7 .Indirect Submodule Implementation
10.8 .Contrasting Implementation Approaches
10.9 .Exercises
Chapter 11
Communication
11.1 .Communication: The Need for Ports
11.2 .Interfaces: C++ and SystemC
11.3 .Simple SystemC Port Declarations
11.4 .Many Ways to Connect
11.5 .Port Connection Mechanics
11.6 .Accessing Ports From Within a Process
11.7 .Exercises
Chapter 12
More on Ports & Interfaces
12.1 .Standard Interfaces
12.1.1 .SystemC FIFO Interfaces
12.1.2 SystemC Signal Interfaces
12.1.3 sc_mutex and sc_semaphore Interfaces
12.2 .Sensitivity Revisited: Event Finders and Default Events
12.3 .Specialized Ports
12.4 .The SystemC Port Array and Port Policy
12.5 .SystemC Exports
12.6 .Connectivity Revisited
12.7 .Exercises
Chapter 13
Custom Channels and Data
13.1 .A Review of SystemC Channels and Interfaces
13.2 .The Interrupt, a Custom Primitive Channel
13.3 .The Packet, a Custom Data Type for SystemC
13.4 .The Heartbeat, a Custom Hierarchical Channel
13.5 .The Adaptor, a Custom Primitive Channel
13.6 .The Transactor, a Custom Hierarchical Channel
13.7 .Exercises
Chapter 14
Additional Topics
14.1 .Error and Message Reporting
14.2 .Elaboration and Simulation Callbacks
14.3 .Configuration
14.4 .Programmable Structure
14.5 .sc_clock, Predefined Processes
14.6 .Clocked Threads, the SC_CTHREAD
14.7 .Debugging and Signal Tracing
14.8 .Other Libraries: SCV, ArchC, and Boost
14.9 .Exercises
Chapter 15
SCV
15.1 .Introduction
15.2 . Data Introspection
15.2.1 .Components for scv_extension Interface
15.2.2 .Built-In scv_extensions
15.2.3 .User-Defined Extensions
15.3 .scv_smart_ptr Template
15.4.1 .Global Configuration
15.4.2 .Basic Randomization
15.4.3 .Constrained Randomization
15.5 .Callbacks
15.6 .Sparse Arrays
15.7 .Transaction Sequences
15.8 .Transaction Recording
15.9 .SCV Tips
15.10 .Exercises
Chapter 16
OSCI TLM
16.1 .Introduction
16.2 .Architecture
16.3 .TLM Interfaces
16.3.1 .Unidirectional Blocking Interfaces
16.3.2 .Unidirectional Non-Blocking Interfaces
16.3.3 .Bidirectional Blocking Interface
16.4 .TLM Channels
16.5 .Auxiliary Components
16.5.1 .TLM Master
16.5.2 .TLM Slave
16.5.3 .Router and Arbiter
16.6 .A TLM Example
16.7 .Summary
16.8 .Exercises
Chapter 17
Odds & Ends
17.1 .Determinants in Simulation Performance
17.1.1 .Saving Time and Clocks
17.1.2 .Moving Large Amounts of Data
17.1.3 .Too Many Channels
17.1.4 .Effects of Over Specification
17.1.5 .Keep it Native
17.1.6 . C++ Compiler Optimizations
17.1.7 .C++ Compilers
17.1.8 .Better Libraries
17.1.9 .Better and More Simulation Computers
17.2 .Features of the SystemC Landscape
17.2.1 .Things You Wish Would Just Go Away
17.2.2 .Development Environment
17.2.3 .Conventions and Coding Style
17.3 .Next Steps
17.3.1 .Guidelines for Adopting SystemC
There are a number of companies supporting SystemC methodologies. A quick visit to the OSCI web site www.systemc.org can
Appendix A
C++ Basics
A.1 Background of C++
A.2 Structure of a C Program
A.3 Comments
A.4 Streams (I/O)
A.4.1 Streaming vs. printf
A.5 Basic C Statements
A.5.1 Expressions and Operators
A.5.2 Conditional
A.5.3 Looping
A.5.4 Altering Flow
A.6 Data Types
A.6.1 Built-In Data Types
A.6.2 User-Defined Data Types
A.6.2.1 Pointers, Arrays, and References
A.6.2.2 Structures
A.6.2.3 STL
A.6.3 Constants
A.6.4 Declaration vs. Definition
A.7 Functions
A.7.1 Pass By Value and Return
A.7.2 Pass by Reference
A.7.3 Overloading
A.7.4 Constant Arguments
A.7.5 Defaults for Arguments
A.7.6 Operators as Functions
A.8 Classes
A.8.1 Member Data and Member Functions
A.8.2 Constructors and Destructors
A.8.2.1 Initialization
A.8.3 Destructors
A.8.4 Inheritance
A.8.4.1 Adding Members
A.8.4.2 Initialization of a Base Class
A.8.4.3 Overriding Inherited Member Functions
A.8.4.4 Multiple Inheritance
A.8.5 Public, Private and Protected Access
A.8.5.1 Friends
A.8.6 Polymorphism
A.8.6.1 Virtual
A.8.6.2 Abstract and Interface Classes
A.8.7 Constant Members
A.8.8 Static Members
A.9 Templates
A.9.1 Defining Template Functions
A.9.2 Using Template Functions
A.9.3 Defining Template Classes
A.9.4 Using Template Classes
A.9.5 Template Considerations
A.10 Names and Namespaces
A.10.1 Meaningful Names
A.10.2 Ordinary Scope
A.10.3 Defining Namespaces
A.10.4 Using Names and Namespaces
A.10.5 Anonymous Namespaces
A.11 Exceptions
A.11.1 Watching for and Catching Exceptions
A.11.2 Throwing Exceptions
A.11.3 Functions that Throw
A.12 Standard Library Tidbits
A.12.1 Strings
A.12.2 File I/O
A.12.3 Standard Template Library
A.13 Closing Thoughts
A.14 References