The link library lets users write Simics link models. A link is used to connect devices in different cells, even in different processes, so that they can exchange non-instantaneous messages in a deterministic way. Typical links include Ethernet and other network connections, but also simpler signal links and more abstract communication channels.
Much of the functionality of links is the same for different kinds of links; that commonality is encapsulated in the link library. This makes it simpler to create new link types, since a minimum of new code is required for each new link type.
Before going further, it is important to realize when not to use the link library:
datagram_link might well suffice.
It allows simple byte strings to be passed from one sender to one or multiple receivers via the simple datagram_link interface.datagram_link might be the easiest way forward, as it provides just that.The link library, however, is available for more complex usage: multiple message types across the link (such as link speed, link status, etc.), special addressing (unicast or multicast groups, switching, etc.), special types of devices (such as sender and receiver for the signal-link). All of these requirements will be more easily expressed, and provide better simulation performance, by creating a special-purpose link based on the link library.
The rest of this document describes how to create a new link type, using the provided datagram_link as an example.
The reader is expected to know how to develop Simics modules in C.
Further information can be found in the Model Builder User’s Guide.