|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Modelling OCP Interfaces in SystemC: Standards built on top of OSCI's TLM-2
James Aldis, (Texas Instruments France) Mark Burton, (Greensocs Ltd.,)
Robert Günzel, (Greensocs Ltd and TU Braunschweig,) Herve Alexanian, (Sonics Inc) reprinted with permission by OCP-IP - (C) Copyright OCP-IP OSCI has recently published their TLM-2.0 technology which provides for interoperability between SystemC models of electronic components whose primary interfaces are memorymapped busses. This is a very important development in the ESL industry, but it does have some limitations. In particular, TLM-2.0 needs to be extended for some real memory-mapped busses, and TLM-2.0 is only applicable at high levels of timing abstraction: untimed, loosely-timed and very approximately-timed models. These limitations are inevitable given that OSCI can only create technology that is generic in nature and not associated with any specific real component. OCP-IP, as the publisher of a memory-mapped IP core interface, is able to address these limitations and has done so. This paper describes the approach adopted by OCP-IP to providing SystemC modelling interfaces for a real memory-mapped bus family. TLM-2.0 has shown itself to be an effective and efficient base technology for all variants of OCP at all levels of abstraction, from cycleaccurate to untimed. Furthermore, the nature of TLM-2.0 and its use as a base technology for everything means that bridges between different protocols or between different levels of abstraction are very easy and efficient. We even see that in a very large number of cases an OCP component is directly interoperable with the OSCI Base Protocol. The Open Core Protocol (OCP) is a public standard memory-mapped core interface, defined by collaboration between systems houses, EDA vendors and IP suppliers within the OCP International Partnership (www.ocpip.org). The motivations for defining the OCP are to enable better IP reuse and a wide spectrum of common tooling and shared experience. Transaction-level modelling (TLM) is an essential part of all modern system-on-chip development methodologies and where IP is being reused and purchased from third-party suppliers, standard interfaces for TLM models of IPs are as important as standards for the RTL interfaces. Because of this, the OCP-IP provides standard SystemC APIs for modelling OCP interfaces at multiple levels of abstraction. These APIs, along with infrastructure code in the form of SystemC channels, ports, monitors and so on, have been available to the OCP community for more than 5 years. They are mature and widely-used. OCP-IP has shipped many hundreds of thousands of copies each representing many hundreds of thousands of dollars in collective development expertise, and delivering a recognized world-class technical solution for users. This code uses SystemC, the dominant TLM modelling language, as defined by the Open SystemC Initiative (OSCI). In the summer of 2008, following a lengthy process, OSCI released version 2 of its TLM modelling library. OCP-IP members contributed to TLM-2 and have worked hard to ensure its applicability to OCP. Importance of the OSCI TLM-2.0 Standard OSCI’s release of TLM-2.0 marks a seminal point in the life of electronic system-level design. For the first time a non-proprietary modelling technology has been created which offers
Until the release of TLM-2.0 there had been a plethora of different mechanisms used to model bus interconnect. TLM-2.0 will provide commonality of approach for all of these, and enable levels of direct interoperability that were not achievable before. The standard provides for three levels of commonality: 1. Commonality of approach: Interoperability between TLM models is not just about technology, but also about methodology. Understanding whether and how different features of a protocol should be modelled, what sort of structures should be used, who should be expected to provide those structures, and what services should be provided. In this case, simply using the same methodology and approach to modelling greatly assists users in understanding each other and enables the market for providers of both training and IP. 2. Commonality of basic technology: OSCI TLM-2.0 provides a wealth of basic technology, including the Base Protocol for memory mapped busses, but also a host of utility functions and structures which are of use to model interface development across-the-board. Reusing this basic technology not only reduces the burden for organisations like OCP-IP (and others who are providing specific interfaces built on TLM-2.0,) but also greatly assists in ensuring a basic degree of interoperability. Furthermore, OSCI specifies exactly how the basic technology is to be extended, and in doing so, how compatibility can be maintained. Even in cases where direct plug-in interoperability is not possible, use of a common approach and common technology will frequently ensure that simple and efficient bridges can be constructed. 3. Use of the Base Protocol: For IP components whose interfaces are relatively unsophisticated, the OSCI Base Protocol (BP) may provide a complete off-the-shelf solution on how to model them, at an approximately-timed or loosely-timed/untimed level of abstraction. Every BP bus master (initiator) is 100% compatible with every BP bus slave (target). The BP does not include common bus features such as out-of-order processing of transactions, bus locking or semaphores, or sophisticated addressing modes, but even without these features a huge number of components will find it a superset of their bus functionality. For example, all components following the OCP-IP consensus profiles should be able to use the BP unmodified, even though the BP is not in any way OCPspecific. At this level of abstraction the fact that a bus interface is OCP in the hardware becomes irrelevant and TLM models enjoy a much higher degree of interoperability than the hardware they represent. OCP components might plug directly to CoreConnect™ components, for example. Clearly, memory-mapped busses are not the only interfaces on TLM models that need to be standardised in this way before the problem of TLM model interoperability goes away completely.. However, OSCI’s TLM-2.0, by focussing on memory-mapped busses, has managed to solve one part of the problem at the same time as providing a technology framework that can be used for other parts, such as clocks, interrupts, network interfaces, and so on. And, because OCP is just a memory-mapped interface protocol, TLM-2.0 already contains all that is needed for OCP-IP to specify modelling APIs for OCP users. Levels of Abstraction OCP-IP recommends 5 levels of abstraction for memory-mapped busses, as described in Table 1. Table 1
Layered TLM Technology for Multiple Levels of Abstraction In order to make it possible to bridge simply and efficiently between level of abstraction, OCP-IP is developing a layered technology for SystemC modelling. For the 5 levels of abstraction listed above, 3 SystemC APIs are provided by OCP-IP: Table 2
The three SystemC APIs are mutually incompatible, but adapters between them are provided. The goal is to allow fully automatic instantiation of adapters within the components, so that a system model can be assembled from whatever component models are available, while the level of abstraction for each memory-mapped bus connection can be selected independently. The SystemC APIs are quite different from an RTL model of an OCP interface. Whereas in RTL an interface consists exclusively of signals on wires, the SystemC interfaces are all based on the OSCI TLM-2.0 concepts of...
Because of this, bridging between the SystemC APIs and a TL0 (RTL) model of a component is less efficient than bridging between two SystemC APIs. This is not considered an “issue” because models with TL0 bus interfaces are expected to run slowly, anyway. Adapters will of course be available. The layering is illustrated in Figure 1: Click to enlarge Figure 1 In general all technologies used at one level of abstraction are also used at all lower levels. The only exception to this is that the mechanisms for modelling bandwidths and splitting of transactions into chunks are specific to TL2. They are not needed at TL1 where explicit modelling of all beats of bursts, with flow control, is compulsory. OCP-IP Extensions The OCP protocol requires extensions to the OSCI generic protocol in the following areas:
The OSCI TLM-2 GP supports only transactions addressing a contiguous set of addresses in the memory map, possibly with a repeat for accessing FIFOs. A sophisticated protocol will allow forms of transaction outside this scope.
The OSCI TLM-2 GP only supports one form of “write” command, which to be useful, must be assumed to be a “non-posted-write”, meaning that it always has a response and this response indicates effective completion of the write process at the end target.
Most conventional memory-mapped busses have mechanisms for flow control that can be described as “blocking”, in that there is a risk that the wires of the bus will remain occupied by one transaction for a long period, thus preventing other transactions from progressing. OSCI-TLM-2 BP only considers this sort of flow control.
Certain addressing modes do not change the functional interpretation of a entire transaction but do have an effect on performance, if effects internal to the bus burst are considered. For example a “wrapping” burst contains the same sequence of addresses as an “incrementing” burst, but starts with the most critical rather than the lowest address. Such effects cannot be modelled at TL3 or TL4 and so it is unnecessary at those levels of abstraction to distinguish wrapping from incrementing addressing modes.
SystemC APIs. This is trivial at TL3 and TL2, but at TL1 some consideration needs to be given to how these are mapped to binary wires in hardware, so that it is possible to model components that modify such extensions without being aware of their functional purpose. An example would be a network-on-chip, configured to map initiator extensions onto target extensions, whose SystemC model is capable of doing this mapping only as a modification of anonymous bits. Every OCP interface has a configuration, which specifies which memory-mapped bus features it includes. The intersection between the bus Master and bus Slave configurations will determine which of the above extensions is present, optional, or absent from each of the SystemC APIs. As the majority of bus interfaces encountered in real life tend to be simple, extensions should be regarded as uncommon. The OSCI TLM-2 generic protocol unextended is able to cover a wide range of SOC components’ bus interfaces. Configuration and Run-Time Compatibility Testing OCP is not one memory-mapped bus protocol; it is a family of protocols spanning from very simple to highly complex. A component with an OCP interface on it publishes values for a set of around 90 parameters, the combination of which is commonly called the component’s OCP configuration. The parameters describe which commands and addressing modes are used, address and data widths, and so on. In hardware, a component’s OCP configuration is determined by its internal synchronous digital circuitry and the “configuration file” is a documentation of the hardware. The configuration file is used when an SOC (or testbench) is integrated, to confirm the compatibility between an OCP Master and the OCP Slave it is connected. This process is in general, automated. In some cases the OCP configuration of one side of the interface may be used to create the RTL code for the other component. In RTL we refer to OCP “sockets,” but in this case a socket is nothing more than a set of pins on the boundary of a component. Figure 2 In SystemC TLM, on the other hand, the components’ source code may be much more generic. A component may be able to adapt its behaviour to support an externally-supplied OCP configuration, or may even be able to adapt to the OCP configuration of the other OCP component to which it is bound (this possibility exists, but is not shown in the diagram). In SystemC we also refer to OCP “sockets,” but in SystemC the socket has more of a real existence than in RTL. It is a SystemC object containing the SystemC port and SystemC export needed for binding, and it can provide a number of other services to the user-code for the component, such as removing timing annotations, providing memory management for transaction payload objects, instantiating adaptors between abstraction levels and testing configuration during simulation elaboration. In the OSCI TLM-2.0 technology, the sockets are C ++ template classes, for which an interface traits class needs to be specified. This traits class is also known as a protocol, hence the OSCI Base Protocol is a such a traits class, used to determine the type of a TLM-2.0 socket. Only a Base Protocol socket can bind to another Base Protocol socket. The principle behind this is that when extending TLM-2.0 to model some functionality beyond the scope of the Base Protocol, a new traits class should be declared, but the same underlying C++ technology used. The extensions should use the extension mechanism of the OSCI Generic Protocol. This ensures that sockets using incompatible protocols can not accidentally be bound to one another, but that creating a bridge between them is simple and efficient. This mechanism cannot meet all the requirements for modelling OCP, and therefore it has been complemented by an elaboration-time compatibility check between the bound sockets. The reasons for this are:
The OCP family of memory-mapped bus protocols can be effectively modelled using the OSCI-TLM-2.0 technology recently published. OCP-IP is proposing a set of extensions and extra technologies to provide interoperability standards for the OCP at all levels of TLM abstraction. The following technologies from OSCI TLM-2.0 have been used unchanged:
|
Home | Feedback | Register | Site Map |
All material on this site Copyright © 2017 Design And Reuse S.A. All rights reserved. |