1 / 40

SpaceWire Remote Memory Access Protocol

SpaceWire Remote Memory Access Protocol. Steve Parkes Space Technology Centre University of Dundee Scotland, UK. Aims of RMAP. Remote Memory Access Protocol Provide a means of Writing to Reading from Registers or memory on a SpaceWire node Over a SpaceWire network

ringo
Download Presentation

SpaceWire Remote Memory Access Protocol

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SpaceWireRemote Memory Access Protocol Steve Parkes Space Technology Centre University of Dundee Scotland, UK

  2. Aims of RMAP • Remote Memory Access Protocol • Provide a means of • Writing to • Reading from • Registers or memory on a SpaceWire node • Over a SpaceWire network • Registers are considered to be memory mapped • Simple and effective • Flexible • encompassing diverse applications

  3. RMAP Commands • Write • With or without acknowledgement • Verifying data before writing or writing without verification • Read • Read-Modify-Write

  4. Write Request Write Command Write Data Request Write Data Authorisation Write Data Write Reply Write Data Indication Write Complete Confirmation Write Operation RMAP Destination RMAP Source USER APPLICATION USER APPLICATION SpaceWire Network

  5. Write Commands • Write non-acknowledged, non-verified • Writes zero or more bytes to memory in a destination node • Command header is checked using a CRC before the data is written • Data is not checked before it is written • No acknowledgement given to indicate that the command has been successfully executed • Used for writing large amounts of data to a destination • Where it can be safely assumed that • The write operation completed successfully • Or that is not critical if it does not succeed • E.g. writing camera images to a temporary working buffer

  6. Write Commands • Write non-acknowledged, verified • Writes zero or more bytes to memory in a destination node • Command and data are both checked using CRCs before the data is written • Limits the amount of data that can be transferred in a single write operation • Owing to limited buffer space in destination • Erroneous data cannot be written to memory • No acknowledgement given to indicate that the command has been successfully executed • Used for writing command registers and small amounts of data to a destination • where it can be safely assumed that • the write operation completed successfully • or where errors are detected in a different way • E.g. writing many commands to different configuration registers in a device and then checking for an error using a status register

  7. Write Commands • Write acknowledged, non-verified • Writes zero or more bytes to memory in a destination node • Command is checked using a CRC before the data is written • Data is not checked before it is written • Acknowledgement sent to indicate that the command has been successfully executed • used for writing large amounts of data to a destination • where it can be safely assumed that • the write operation completed successfully, • but an acknowledgement is required. • For example writing sensor data to memory.

  8. Write Command • Write acknowledged, verified • Writes zero or more bytes to memory in a destination node • Command and data are both checked using CRCs before the data is written • Limits the amount of data that can be transferred in a single write operation • Owing to limited buffer space in destination • Erroneous data cannot be written to memory • Acknowledgement sent to indicate that the command has been successfully executed • Used for writing small amounts of data to a destination • where it is important to have confirmation that • the write operation was executed successfully. • For example writing to command or configuration registers.

  9. Write Command – Logical Addressing First byte transmitted Destination Logical Address Protocol Identifier Packet Type, Command, Source Path Addr Len Destination Key Source Logical Address Transaction Identifier (MS) Transaction Identifier (LS) Extended Write Address Write Address (MS) Write Address Write Address Write Address (LS) Data Length (MS) Data Length Data Length (LS) Header CRC Data Data Data Data Data Data Data Data Data Data CRC EOP Last byte transmitted Bits in Packet Type / Command / Source Path Address Length Byte MSB LSB Reserved = 0 Command = 1 Write = 1 Verify data(1) No Verify (0) Ack (1)/ No ack (0) Increment/ No inc. addr Source Path Address Len = 0 Source Path Address Len = 0 Packet Type Command Source Path Address Length

  10. Definitions • Destination Logical Address • SpaceWire logical address of destination • Protocol Identifier • 01h for RMAP protocol • Packet Type/Command/Source Path Length • Packet type: 2-bit field • 00 = reply • 01 = command • 10 = Reserved • 11 = Reserved • Command: 4-bit field • Contains the RMAP command code • Source Path Address Length: 2-bit field • For logical addressing these two bits are always 00

  11. Definitions • Destination Key • One byte key • Must be matched by the user application • For command to be authorised • Source Logical Address • SpaceWire logical address of the source of the RMAP command • Needed in a command so that the destination knows where to send reply • Transaction Identifier • Two byte identifier • Allows source to send out multiple commands • Each with distinct transaction identifier • Transaction identifier included in reply • Allows source to associate • Reply • With command that caused the reply

  12. Definitions • Extended Write Address • Extends 32-bit write address to 40-bits • May be used to differentiate memory spaces in a destination • E.g. • 00h may indicate register addresses • 01h may indicate memory bank one • Write Address • 32-bit destination memory address • Where data is to be written • Note that registers etc are memory mapped • Data Length • Length of data to be written in bytes • Header CRC • CRC8 • 8 bit CRC covering the header • Starting with and including the destination logical address

  13. Definitions • Data • The data to be written into memory/registers • At the destination • Data CRC • CRC8 • 8-bit CRC • Covers all data • Not useful for long packets • EOP • SpaceWire End of Packet Marker

  14. Write Reply – Logical Addressing First byte transmitted Source Logical Address Protocol Identifier Packet Type, Command, Source Path Addr Len Status Destination Logical Address Transaction Identifier (MS) Transaction Identifier (LS) Header CRC Last byte transmitted EOP Bits in Packet Type / Command / Source Path Address Length Byte LSB MSB Source Path Address Len = 0 Source Path Address Len =0 Reserved = 0 Response = 0 Write = 1 Verify data (1) No Verify (0) Ack = 1 Increment/ No inc. addr Packet Type Command Source Path Address Length

  15. Definitions • Status • Status of command • Set to zero if command executed correctly • Non-zero if there was an error

  16. Write Command – Path Addressing First byte transmitted Destination Path Address Destination Path Address Destination Path Address Destination Logical Address Protocol Identifier Packet Type, Command, Source Path Addr Len Destination Key Source Path Address Source Path Address Source Path Address Source Path Address Source Logical Address Transaction Identifier (LS) Transaction Identifier (MS) Extended Write Address Write Address (MS) Write Address Write Address Write Address (LS) Data Length (MS) Data Length Data Length (LS) Header CRC Data Data Data Data Data Data Data Data Data Data CRC EOP Last byte transmitted Bits in Packet Type / Command / Source Path Address Length Byte MSB LSB Reserved = 0 Command = 1 Write = 1 Verify data(1) No Verify (0) Ack (1)/ No ack (0) Increment/ No inc. addr Source Path Address Length Source Path Address Length Packet Type Command Source Path Address Length

  17. Definitions • Destination Path Address • SpaceWire path address from source to destination • Source Path Address • SpaceWire path address from destination back to source • Multiple of 4 bytes • Leading zero bytes are ignored • Example • 00 00 01 03 results in path address 01 03 • Source Path Address Length Field • Number of 32-bit words needed to hold source path address • Example • Five byte source address requires two 32-bit words • E.g. 00 00 00 01 02 03 04 05 • Source path address then set to 10b

  18. Write Reply – Path Addressing First byte transmitted Source Path Address Source Path Address Source Path Address Source Logical Address Protocol Identifier Packet Type, Command, Source Path Addr Len Status Destination Logical Address Transaction Identifier (MS) Transaction Identifier (LS) Header CRC Last byte transmitted EOP Bits in Packet Type / Command / Source Path Address Length Byte LSB MSB Source Path Address Length Source Path Address Length Reserved = 0 Response = 0 Write = 1 Verify data (1) No Verify (0) Ack = 1 Increment/ No inc. addr Packet Type Source Path Address Length Command

  19. Write Request Write Command Write Command Header Error Destination Source Record Packet Error

  20. Write Request Write Command Write Data Request Write Data Authorisation Rejection Write Reply Error Authorisation Failure Write Authorisation Rejection Destination Source

  21. Command Authorisation • Destination user application • Can refuse to authorise command for any reason • E.g. • Write address not 32-bit aligned • Length not a multiple of four bytes • Address range falls partially or completely outside an acceptable region

  22. Write Request Write Command Header Write Data Request Write Command Data Write Data Authorisation Write Data Error Reply Write Data Error Indication Write Data Failure Write Data Error Destination Source Record Data Error

  23. Write Request Write Command Write Data Request Write Data Authorisation Write Data Write Reply Write Data Indication Write Reply Error Destination Source Record Packet Error

  24. Read Command • Read command • Reads zero, one or more bytes of data • From specified area of memory in a destination node • Data read is returned in a reply packet.

  25. Read Request Read Command Read Data Request Read Data Response Read Reply Read Data Confirmation Read Operation Destination Source

  26. First byte transmitted Destination Logical Address Protocol Identifier Packet Type, Command Source Path Addr Len Destination Key Source Logical Address Transaction Identifier (MS) Transaction Identifier (LS) Extended Read Address Read Address (MS) Read Address Read Address Read Address (LS) Data Length (MS) Data Length Data Length (LS) Header CRC Last byte transmitted EOP Bits in Packet Type / Command / Source Path Address Length Byte MSB LSB Reserved = 0 Command = 1 Read = 0 Read = 0 Read = 1 (Ack/No_Ack) Increment/ No inc. addr Source Path Address Len = 0 Source Path Address Len = 0 Packet Type Command Source Path Address Length Read Command – Logical Addressing

  27. Definitions • Extended Read Address • Extends 32-bit read address to 40-bits • May be used to differentiate memory spaces in a destination • E.g. • 00h may indicate register addresses • 01h may indicate memory bank one • Read Address • 32-bit destination memory address • From which data is to be read • Note that registers etc are memory mapped

  28. First byte transmitted Source Logical Address Protocol Identifier Packet Type, Command, Source Path Addr Len Status Destination Logical Address Transaction Identifier (MS) Transaction Identifier (LS) Reserved = 0 Data Length (MS) Data Length Data Length (LS) Header CRC Data Data Data Data Data Data Data Data Data Data CRC EOP Last byte transmitted Bits in Packet Type / Command / Source Address Path Length Byte LSB MSB Reserved = 0 Response = 0 Read = 0 Read = 0 Read = 1 (Ack/No Ack) Increment/ No inc. addr Source Path Address Length Source Path Address Length Packet Type Command Source Path Address Length Read Reply – Logical Addressing

  29. Read-Modify-Write Command • Read-modify-write command • Reads a register (or memory) • Returns its value • Writes a new value, specified in the command, to the register. • Mask can be included, in the command • So that only certain bits of the register are written • Provides an atomic operation that can be used for semaphores and other handshaking operations.

  30. RMW Request RMW Command RMW Data Request Data Read and Write Authorisation Write Data RMW Reply Write Data Indication RMW Complete Confirmation Read-Modify-Write Operation Destination Source

  31. Example Read-Modify-Write Operation 1 0 0 0 1 0 0 0 Data in command (Data) 1 0 0 0 1 1 1 0 Mask in command (Mask) Data read from destination memory and returned to source (Read) 1 1 1 0 0 0 1 1 1 1 1 0 1 0 0 1 Data written to destination memory = (Mask AND Data) OR (NOT Mask.Read)

  32. First byte transmitted Destination Logical Address Protocol Identifier Packet Type, Command Source Path Addr Len Destination Key Source Logical Address Transaction Identifier (MS) Transaction Identifier (LS) Extended RMW Address RMW Address (MS) RMW Address RMW Address RMW Address (LS) Data +Mask Length (MS) = 00h Data + Mask Length = 00h Data + Mask Length (LS) = 00h, 02h, 04h, 06h or 08h Header CRC Data (MS) Data Data Data (LS) Mask (MS) Mask Mask Mask (LS) Data/Mask CRC EOP Last byte transmitted Bits in Packet Type / Command / Source Address Path Length Byte MSB LSB Reserved = 0 Command = 1 Read = 0 Verify Data Before Wr = 1 Ack/No_Ack = 1 Incr. address = 1 Source Path Address Len = 0 Source Path Address Len = 0 Packet Type Command Source Path Address Length Read-Modify-Write Command – Logical

  33. Definitions • Data + Mask Length • Length of data and mask information • 00, 02, 04, 06, or 08h. • Data • Up to four bytes of data to be combined with • Data in addressed memory and • Mask • Then written into addressed memory • Value originally in addressed memory will be returned • Mask • Up to four bytes of information that determine • How data is to be used • To update addressed memory

  34. First byte transmitted Source Logical Address Protocol Identifier Packet Type, Command, Source Path Addr Len Status Destination Logical Address Transaction Identifier (MS) Transaction Identifier (LS) Reserved = 0 Data Length (MS) = 0 Data Length = 0 Data Length (LS) = 01h, 02h, 03h or 04h Header CRC Data Data Data Data Data CRC EOP Last byte transmitted Bits in Packet Type / Command / Source Path Address Length Byte LSB MSB Reserved = 0 Response = 0 Read = 0 Verify Data Before Wr = 1 Ack/No_Ack = 1 Inc. address = 1 Source Path Address Len = 0 Source Path Address Len = 0 Packet Type Command Source Path Address Length Read-Modify-Write Reply – Logical

  35. Partial Implementation of RMAP • Partial implementations are permitted • For example: • Support of write and read but not RMW commands • Support of 32-bit data lengths only • If destination receives command it does not support • Or command with options not supported • It refuses to authorise the command • Command is not executed • If reply requested then it will contain Authorisation Failure error code

  36. Write to Memory with DMA SpaceWire Interface RMAP Interface DMA Controller Memory SpaceWire MemPtr = 001000h Data DataCtr = 000010h Data Destination Application SpaceWire-RMAP Interface

  37. Memory Mailbox DMA Mailbox Status Mailbox Base Ptr Mailbox Memory Mailbox Current Ptr Mailbox Memory Mailbox Max Size Mailbox Memory Mailbox Data Size Write to Mailbox with DMA SpaceWire Interface RMAP Interface SpaceWire-RMAP Interface Destination Application

  38. Summary • RMAP provides: • A consistent means of reading and writing • Registers and memory • Over SpaceWire network • Is very flexible • Partial implementation permitted • Is being implemented in • ESA Router ASIC • ESA Remote Terminal Computer • JAXA devices • Draft E of standard has been extensively reviewed • Will become ECSS-E50-11 • Currently being implemented in at least two ASICs

More Related