Skip to content

// rah communication protocol developed for cpu-fpga link for vaaman rtl part

Notifications You must be signed in to change notification settings

vicharak-in/rah-bit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAH Protocol User Guide

Overview

The RAH (Real-time Application Handler) protocol is designed to facilitate the transfer of data between a CPU and an FPGA, which is developed by Vicharak, And It allows the CPU to run various applications that send data to the FPGA. The RAH Services encapsulate the data into distinguishable data-frames identified by an app_id and deliver these frames to the FPGA. On the FPGA side, the RAH design decodes the data and writes it to the corresponding APP_WR_FIFO. Similarly, during the read cycle, the FPGA writes data into APP_RD_FIFO, which is then encapsulated and delivered back to the CPU where it gets decoded.

This guide includes the capability to generate and manage multiple applications on both the CPU and FPGA using header files.

Block Diagram

rah design

Key Components

  1. CPU Applications: These applications generate data that needs to be sent to the FPGA.
  2. RAH Services: Encapsulates and decapsulates data frames based on the app_id.
  3. FPGA RAH Design: Handles the decoding of incoming data frames and writes to the appropriate FIFO.
  4. APP_WR_FIFO: FIFO buffer where decoded data from CPU is written.
  5. APP_RD_FIFO: FIFO buffer where data generated by FPGA applications is written before being sent to the CPU.

Data Transfer Process

Write Cycle (CPU to FPGA)

  1. CPU Application: Generates data to be sent to the FPGA.
  2. RAH Services on CPU: Encapsulates the data into a data-frame, including the app_id.
  3. RAH Design on FPGA: Receives the data-frame and decodes it.
  4. FPGA Application: Reads the decoded data from the appropriate APP_WR_FIFO.

Read Cycle (FPGA to CPU)

  1. FPGA Application: Writes data to the APP_RD_FIFO.
  2. RAH Design on FPGA: Encapsulates the data from APP_RD_FIFO into a data-frame.
  3. RAH Services on CPU: Receives the data-frame and decodes it.
  4. CPU Application: Processes the received data.

Detailed Instructions

Writing Data from CPU to FPGA

  1. CPU Application:

    • Generate the data you wish to send to the FPGA.
    • Identify the app_id associated with this data.
    • The data width of the encapsulated data-frame is 48-bit (6-bytes).Send the data in multiple of 6-bytes, if the data is not in multiple of 6-bytes then append it with psuedo data bytes and access the data bytes at FPGA side using index of the data-bytes.
  2. Encapsulation by RAH Services:

    • Call the RAH API to encapsulate the data. The API function might look like rah_write(app_id, data, length). Where length is number of bytes.
    • Ensure that the data is correctly encapsulated into a data-frame with the specified app_id.
    • The data will be encapsulated as 6-bytes per data-line of data-frame.
  3. Transmission:

    • The RAH Services will transmit the data-frame to the FPGA.
  4. Decoding by RAH Design on FPGA:

    • The FPGA RAH design will receive the data-frame and decode it.
    • The decoded data will be written to the corresponding APP_WR_FIFO.
  5. Reading from APP_WR_FIFO:

    • FPGA applications can request data from the FIFO using a function like fifo_read(app_id).
    • The data associated with the app_id will be available for the application to process.
    • This is a 48-bit FIFO.

Reading Data from FPGA to CPU

  1. FPGA Application:

    • Generate the data you wish to send to the CPU.
    • Write this data to the APP_RD_FIFO using APP_RD_FIFO_EN signal.
    • This is a 48-bit FIFO.
    • Write data in FIFO in multiple of 6-bytes and is data is not multiple of 6-bytes then append it with psuedo data bytes and access the data at CPU side using index of data bytes.
  2. Encapsulation by RAH Design on FPGA:

    • The RAH design will read the data from APP_RD_FIFO.
    • The data will be encapsulated into a data-frame with the specified app_id.
  3. Transmission:

    • The data-frame will be transmitted to the CPU by the RAH design.
  4. Decapsulation by RAH Services on CPU:

    • The CPU RAH Services will receive the data-frame and decapsulate it.
    • The decapsulated data will be made available to the CPU application.
  5. Processing by CPU Application:

    • The CPU application can access the received data using a function like rah_read(app_id).
    • The data associated with the app_id will be available for the application to process.
    • The data will be received as 6-bytes per data-line.

NOTE: The allignment of the data to be send and recieve through out the RAH protocol is user defined. The user have to make sure that the data is sampled in the same way as it is alligned at the time of transmission. This valids for both (write and read) cycles.

Generating Multiple Applications

Pre-requisite

  1. Enable FPGA Communication from the Vicharak Utility

  2. Install RAH service on the board by,