serial-portgatewaycan-busautosarpdu

Difference between Signal based routing and PDU based routing in AUTOSAR


Trying to understand difference in performance of signal based routing and PDU based routing in AUTOSAR.

As per my understanding,

  1. Signal based routing -> The signal need to be converted to I-PDU and routed
  2. PDU based routing -> The PDU directly routed

What is the difference in performance between these two.Because anyway routing is handled as PDU. Some note could see that signal based routing having low latency. Why so? Whether signal based routing is overhead or not?


Solution

  • If my understanding is correct, there is a huge difference between PDU-based routing and signal-based routing. The PDU-based should be much faster.

    Signal based routing -> The signal need to be converted to I-PDU and routed
    PDU based routing -> The PDU directly routed

    Seems pretty correct to me, so let's check an example with a CAN FD frame with several PDUs.

      Byte  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16
           XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
       PDU [-------PDU_1------]    [--PDU_2--]
    Signal II             II          II
         Signal_1     Signal_2      Signal_3
           4 bits       3 bits        1 bit 
    
    static uint32_t GW_GetSignal_1 (uint8_t *Data)
    {
      uint32_t Byte_0 = Data[0];
      uint32_t Bytes  = (Byte_0 >> 3);
      uint32_t SignalValue = (Bytes & 0xF); /* 0000.1111 */
      return SignalValue;
    }
    
    static uint32_t GW_GetSignal_2 (uint8_t *Data)
    {
      uint32_t Byte_0 = Data[0];
      uint32_t Bytes  = (Byte_0 >> 0);
      uint32_t SignalValue = (Bytes & 0x7); /* 0000.0111 */
      return SignalValue;
    }
    
    static float Raw32ToPhysical (uint32_t RawValue, float Factor, float Offset)
    {
      float PhysicalValue = ((float)RawValue) * Factor + Offset;
      return PhysicalValue; 
    }