Tutorial: Creating OVP Peripheral Models

How to create OVP Peripheral Models. This tutorial shows the different features of an OVP peripheral model, how to create and how to use them.
OVP T4 TuTorial

1Background to Peripheral models in OVP
The OVP peripheral model allows all the behavior of hardware components to be provided in a virtual platform. This background illustrates the key components of a peripheral model and what they can provide.
2Using iGen to generate Peripheral Models
An OVP peripheral model can be created using iGen. This generated peripheral model provides all the C code that is compiled to provide an executable peripheral model supporting register read/write access but with no additional behavior. Behavior is added in C code using the various OVP APIs.
3Creating structure and registers of a peripheral using iGen
The peripheral model interface is defined to include ports, memory, registers (including bit fields) and signals (reset, interrupts etc). The definition is used by iGen to generate the C files that can then be compiled to produce an initial model. We create the register definitions for the creatingDMAC example.
4Adding behavior, timing and threads of operation in peripherals
The behavior in a peripheral model defines the operations, when a register is accessed or on periodic timed events. Where the behavior is represented as independent operations we show the use of peripheral behavioral threads with events used to control their actions. We add some behavior to the creatingDMAC example.
5Adding peripheral access as a master into the system.
The peripheral can be a master in the system. This tutorial chapter shows how to add master port(s) into the peripheral using an iGen script and how to control master read and write accesses. It explains adding master access to the creatingDMAC example.
6Adding peripheral behavior to create interrupts and generate into the system
Peripherals can generate system interrupts. We use nets to add interrupts into a system. We add an interrupt and show how it can be written to generate interrupts in the creatingDMAC example.
7Using host native code in Peripheral Models to access to host resources
Peripheral models can model behavior using the PPM and BHM APIs but host native code can also be used. Using host native code allows access to host interfaces (keyboard, ethernet, mouse etc.) and also the use of native libraries in creating peripheral behavior. This tutorial section shows some of the mechanisms for the PSE and native code to interact and how native code can read and write into the simulated system. It adds behavior using host native code to the creatingDMAC example
8How to create a dynamically located slave port on a peripheral
The peripheral model slave port can be statically fixed at an address or can be dynamically configured (at any time) during simulation execution. This tutorial section shows an example that dynamically adjusts the location of a peripheral in the system memory space when a register is written with the new address