Multiprocessor Architecture Template
To create an SoC Blockset™ model for designing a system with two CPUs connected by Interprocess Data Channel blocks, use the Multiprocessor Architecture template. To create a project using the "Multiprocessor Architecture" template, follow the steps in the topic Create SoC Model Using SoC Blockset Template.
Template Structure
This template models two CPUs that are connected with a pair of interprocess communication channels. Use this template as a guide and replace the algorithms in the reference models. The Task Manager block in CPU1 executes a timer-driven task to run the CPU1 Executable reference model with the output, IPCCh1, sent to the Interprocess Data Channel block. The Task Manager block in CPU2 executes an event-driven task to run the CPU2 Executable reference model after using the input, IPCCh1, which is the output from CPU1. When the event-driven task completes, it outputs data, IPCCh2, to the Interprocess Data Channel block to return the result to CPU1.
Modify Project
Modify CPU1 Processor Model
In the project directory, locate the referencedmodels
folder,
and expand it. To open the referenced CPU1 processor model, double click
soc_multiproc_ref1.slx. The processor wrapper contains a blue
highlighted subsystem representing the user code for the processor algorithm. Open
the Processor Algorithm subsystem and replace the Processor Algorithm
block with your desired algorithm.
Processor Algorithm
— This block has one input and one output, implementing an increment operation. Replace this block with your own processor algorithm. Add inputs and outputs as required.IPC Ch2 Read
— This Interprocess Data Read block reads available data from the Interprocess Data Channel block sent from CPU2.IPC Ch1 Write
— This Interprocess Data Write block writes data to the Interprocess Data Channel block to be read by CPU2.
Modify CPU2 Processor Model
In the project directory, locate the referencedmodels
folder,
and expand it. To open the referenced CPU2 processor model, double click
soc_multiproc_ref2.slx. Double-click the Task1 model block to
open the task. The processor wrapper contains a blue highlighted subsystem
representing the user code for the processor algorithm. Open the Processor Algorithm
wrapper and replace the Processor Algorithm block with your desired
algorithm.
Processor Algorithm
— This block has one input and one output, implementing an increment operation. Replace this block with your own processor algorithm. Add inputs and outputs as required.IPC Ch1 Read
— This Interprocess Data Read block reads available data from the Interprocess Data Channel block sent from CPU1.IPC Ch2 Write
— This Interprocess Data Write block writes data to the Interprocess Data Channel block to be read by CPU1.
Modify IPC Channel
The top model of this template also includes two Interprocess Data Channel blocks, which create a bidirectional communication path between CPU1 and CPU2. If you need to transfer more data between the two CPUs, you can add additional Interprocess Data Channel blocks or bundle data into the existing Interprocess Data Channel blocks.
See Also
Interprocess Data Channel | Task Manager