ARM SocDesigner includes Canvas tool to create model and build system and Simulator too to simulate the system in TLM (transaction level modeling).
SocDesigner provides three types of ports, MXSI for inter-component communication within a system, MXDI for debugging, and MXPI for profiling.
In this example, we use SoCDesigner Component Wizard to create a component and then modify component code. Next we will build a simulation environment in socdesigner and run fw-hw cosim.
The example we use is a simple interrupt generator. It is a APB slave module. When fw (aka arm7 processor) writes a counter expire number to it, its internal counter starts. When counter reaches this expire number, counter stops and this module sends an interrupt to arm7. Arm7 processes this interrupt and write expire number to this module again.
First open SoCDesigner Component Wizard, fill in the module name.
Use “Other” for component type.
For component port information, add a APB port with “APB transaction slave port” as port type. Also add a signal master port for interrupt to arm7.
Add two registers to this component. Each is 32bit. No memory needed.
Save and tool will check and display component information with any error and warning.
Tool also generates C++ project template for this component. You can use Visual Studio to open and modify it.
There are mainly two functions, communicate() and update(), for SOCD modeling.
In APB port read(), add access to two registers.
MXDI is generated by tool. For debug purpose, we can add a MXPI port:
Save and this slave component is created and ready to use.