Skip to content

Commit

Permalink
Add images for fastrpc architecture and workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Ekansh Gupta <[email protected]>
  • Loading branch information
quic-ekangupt committed May 24, 2024
1 parent 7516547 commit cdc18c9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 56 deletions.
Binary file added Docs/images/FastRPC_architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/FastRPC_workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/Term_definitions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 14 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,74 +11,32 @@ FastRPC interfaces are defined in an IDL file, and they are compiled using the Q
FastRPC architecture
The following diagram depicts the major FastRPC software components on the CPU and DSP.

+----------------------------+-----------------------------+
| CPU | DSP |
| +-----------------------+ | +------------------------+ |
| | Application | | | User PD | |
| | | | | | |
| | +--------------+ | | | +-----------------+ | |
| | | Stub | | | | | Skel | | |
| | +--------------+ | | | +-----------------+ | |
| | | | | | |
| | +--------------+ | | | +-----------------+ | |
| | | FastRPC user | | | | | FastRPC DSP user| | |
| | | driver | | | | | driver | | |
| | +--------------+ | | | +-----------------+ | |
| | | | | | |
| +-----------------------+ | +------------------------+ |
| | |
+----------------------------+-----------------------------+
| Kernel space | |
| | |
| +--------------+ | +-----------------+ |
| |FastRPC kernel| | | FastRPC DSP | |
| | driver | | | driver | |
| +--------------+ | +-----------------+ |
| |
| +-----------------------+ |
| | Shared Memory Driver | |
| +-----------------------+ |
+----------------------------------------------------------+
![FastRPC architecture](Docs/images/FastRPC_architecture.png)

Stub and skel are generated by IDL compiler. Other modules are part of the software stack on device.

Definition of the terms in the diagram:

Term Description
Application User mode process that initiates the remote invocation
Stub Auto-generated code that takes care of marshaling parameters and runs on the CPU
FastRPC user driver on CPU User mode library that is used by the stub code to do remote invocations
FastRPC Kernel Driver Receives the remote invocations from the client, queues them up with the FastRPC DSP driver, and then waits for the response after signaling the remote side
FastRPC DSP Driver Dequeues the messages sent by the FastRPC kernel driver and dispatches them for processing
FastRPC user driver on DSP User mode code that includes a shell executable to run in the user protection domain (PD) on the DSP and complete the remote invocations to the skel library
Skel Auto-generated code that un-marshals parameters and invokes the user-defined implementation of the function that runs on the DSP
User PD User protection domain on the DSP that provides the environment to run the user code
FastRPC workflow
The FastRPC framework is a typical proxy pattern. The interface object stub and the implementation skeleton objects are on different processors. FastRPC clients are directly exposed to the stub object, and the skeleton object is called by the FastRPC framework on the DSP.
![Term definitions](Docs/images/Term_definitions.png)

The FastRPC framework consists of the following components.

+------------------------------------------------------+ +------------------------------------------------------------+
| ARM/APSS | | DSP |
| +-----------+ +------+ +-------------------+ | | +-----------------------+ +------+ +----------------+ |
| | user code |-->| stub |-->| FastRPC Framework |----|-|->| fastRPC DSP Framework |-->| stub |-->| Implementation | |
| +-----------+ +------+ +-------------------+ | | +-----------------------+ +------+ +----------------+ |
+------------------------------------------------------+ +------------------------------------------------------------+
![FastRPC workflow](Docs/images/FastRPC_workflow.png)

except fastRPC framework, user is responsible for other modules.
Except fastRPC framework, user is responsible for other modules.

Workflow:

The CPU process calls the stub version of the function. The stub code converts the function call to an RPC message.
The stub code internally invokes the FastRPC framework on the CPU to queue the converted message.
The FastRPC framework on the CPU sends the queued message to the FastRPC DSP framework on the DSP.
The FastRPC DSP framework on the DSP dispatches the call to the relevant skeleton code.
The skeleton code un-marshals the parameters and calls the method implementation.
The skeleton code waits for the implementation to finish processing, and, in turn, marshals the return value and any other output arguments into the return message.
The skeleton code calls the FastRPC DSP framework to queue the return message to be transmitted to the CPU.
The FastRPC DSP framework on the DSP sends the return message back to the FastRPC framework on the CPU.
The FastRPC framework identifies the waiting stub code and dispatches the return value.
The stub code un-marshals the return message and sends it to the calling User mode process.
1. The CPU process calls the stub version of the function. The stub code converts the function call to an RPC message.
2. The stub code internally invokes the FastRPC framework on the CPU to queue the converted message.
3. The FastRPC framework on the CPU sends the queued message to the FastRPC DSP framework on the DSP.
4. The FastRPC DSP framework on the DSP dispatches the call to the relevant skeleton code.
5. The skeleton code un-marshals the parameters and calls the method implementation.
6. The skeleton code waits for the implementation to finish processing, and, in turn, marshals the return value and any other output arguments into the return message.
7. The skeleton code calls the FastRPC DSP framework to queue the return message to be transmitted to the CPU.
8. The FastRPC DSP framework on the DSP sends the return message back to the FastRPC framework on the CPU.
9. The FastRPC framework identifies the waiting stub code and dispatches the return value.
10. The stub code un-marshals the return message and sends it to the calling User mode process.

## Features supported

Expand Down

0 comments on commit cdc18c9

Please sign in to comment.