Simics SystemC* Library provides support for creating and running SystemC models in Simics. SystemC, as standardized by IEEE-1666, is a C++ class library and a methodology that can be used to create cycle-accurate or transaction-level models of hardware. When choosing to develop models in SystemC for use in Simics it is important to be aware that there exists some fundamental differences in vocabulary, methodology, and features compared to writing models directly to the Simics API. While SystemC Library attempts to minimize those differences it cannot do so completely.
SystemC Library provides three basic capabilities. It makes it possible to run SystemC models in Simics with only a few minor changes compared to running a stand-alone SystemC simulation. Note that none of these changes are to the SystemC model itself. SystemC Library also provides awareness and inspection capabilities of SystemC models running in Simics by connecting SystemC concepts, such as the object hierarchy and the sc_report mechanism to the corresponding Simics concepts. Support for tracing and breaking on SystemC ports and exports as well as signals is provided. Finally, SystemC Library provides a mechanism to connect SystemC models with traditional Simics models through the use of interface gaskets.
SystemC was originally designed to supplement or replace RTL and HDL modeling with languages such as Verilog or VHDL. One of the goals with SystemC 2.0 was to enable system-level modeling at a higher level of abstraction than RTL. In this tradition the SystemC kernel implements an event based timing model with delta-cycles similar to VHDL where there is an "outer" simulation loop that drives time forward and an "inner" loop that stabilizes all signals during the delta-cycles.
Systems modeled in SystemC are made up of a number of SystemC modules (C++ classes) that are connected at compile-time using ports and signals and implement their functionality in processes (C++ methods) and threads (coroutines). A SystemC module is simply a C++ class derived from sc_module
provided by the SystemC kernel. The module includes processes and threads that are simply member functions of the class that may be "registered" as sensitive to a specific port. A port can represent different "activation signals"; such as the rising and falling of a clock's edge or, at a higher level of abstraction, an arbitrary C++ type being passed from one module to another via a signal connected to a port.
To further support system-level modeling the Transaction-level Modeling (TLM) standard was proposed as an addition to SystemC. SystemC TLM 2.0 (hereafter TLM2) extends SystemC with a set of core interfaces, a global quantum for temporal decoupling, initiator and target sockets, a generic payload and base protocol, and some utilities.
This document assumes that the reader has a basic knowledge of Simics. It is recommended to be familiar with the contents of the Simics User's Guide and to have performed the introductory steps in Getting Started with Simics. It is useful if the reader is able to find relevant information in the API Reference Manual. At the very least, the reader should be familiar with starting Simics and loading a configuration.
It is also recommended to be familiar with basic Simics Model Builder concepts, such as building a module, creating a module test, as well as familiarity with the C++ API. Please refer to the Model Builder User's Guide and the C++ Device API Programming Guide for more information. The reader is expected to be familiar with SystemC and Transaction-level Modeling (TLM).
This document describes how to run SystemC models in Simics and how to integrate them with Simics models written for the Simics API. It does not try to cover how to write good SystemC models. For more details about SystemC, refer to the IEEE-1666 standard.
This document serves multiple purposes and has been constructed to try to meet these requirements. It starts out with a brief introduction to SystemC Library and a quick tutorial on how to get started. This is followed up by a chapter on how to connect SystemC models with Simics. That chapter starts off with a hands-on example highlighting all the building blocks including testing and configuration. The chapter follows up with some guidelines before it goes into details on how the gaskets work and how users can write their own. The chapter is rounded off by describing two common gaskets. The next chapter covers all the features. More advanced topics about how SystemC models are executed in the Simics simulator is described next. All known major limitations are listed as a separate chapter. Last chapter is about the compile-time requirements.
The document can be used both as a tutorial and as reference. It has not been written in such a way that it would make sense to read it from cover to cover.