spacewire remote memory access protocol

40
SpaceWire Remote Memory Access Protocol Steve Parkes Space Technology Centre University of Dundee Scotland, UK

Upload: ringo

Post on 13-Feb-2016

63 views

Category:

Documents


5 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: SpaceWire Remote Memory Access Protocol

SpaceWireRemote Memory Access Protocol

Steve ParkesSpace Technology Centre

University of DundeeScotland, UK

Page 2: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 2222

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

Page 3: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 2223

RMAP Commands

Write With or without acknowledgement Verifying data before writing or writing without verification

Read Read-Modify-Write

Page 4: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 2224

Write Operation

Write Request

Write DataRequest

WriteCommand

WriteReply

Write CompleteConfirmation

RMAPSource

RMAPDestination

Write DataAuthorisation

Write Data

Write DataIndication

USERAPPLICATION

USERAPPLICATION

SpaceWireNetwork

Page 5: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 2225

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

Page 6: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 2226

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

Page 7: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 2227

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.

Page 8: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 2228

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.

Page 9: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 2229

Write Command – Logical Addressing

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

First byte transmitted

Last byte transmitted

Write = 1 Verify data(1)No Verify (0)

Command= 1

Increment/No inc. addr

Ack (1)/No ack (0)

Reserved= 0

Source PathAddress Len = 0

Source PathAddress Len = 0

Bits in Packet Type / Command / Source Path Address Length ByteMSB LSB

Packet Type Command Source Path Address Length

Page 10: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22210

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

Page 11: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22211

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

Page 12: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22212

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

Page 13: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22213

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

Page 14: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22214

Write Reply – Logical Addressing

Source Logical Address Protocol Identifier Packet Type, Command,Source Path Addr Len Status

Destination Logical Address Transaction Identifier (MS) Transaction Identifier (LS) Header CRC

EOP

First byte transmitted

Last byte transmitted

Write = 1 Verify data (1)No Verify (0)

Response = 0

Increment/No inc. addrAck = 1Reserved

= 0

Bits in Packet Type / Command / Source Path Address Length Byte

MSB

Packet Type Command

Source PathAddress Len = 0

Source PathAddress Len =0

LSB

Source Path Address Length

Page 15: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22215

Definitions

Status Status of command Set to zero if command executed correctly Non-zero if there was an error

Page 16: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22216

Write Command – Path Addressing

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

Destination Path Address Destination Path Address

Data Data Data Data

Data Data CRC EOP

First byte transmitted

Last byte transmitted

Write = 1 Verify data(1)No Verify (0)

Command= 1

Increment/No inc. addr

Ack (1)/No ack (0)

Reserved= 0

Source PathAddress Length

Source PathAddress Length

Bits in Packet Type / Command / Source Path Address Length Byte

MSB LSB

Packet Type Command Source Path Address Length

Page 17: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22217

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

Page 18: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22218

Write Reply – Path Addressing

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

Source Path Address Source Path Address

EOP

First byte transmitted

Last byte transmitted

Write = 1 Verify data (1)No Verify (0)

Response= 0

Increment/No inc. addrAck = 1Reserved

= 0

Bits in Packet Type / Command / Source Path Address Length Byte

MSB

Packet Type Command

Source PathAddress Length

Source PathAddress Length

LSB

Source Path Address Length

Page 19: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22219

Write Command Header Error

Write Request

Source Destination

RecordPacketError

WriteCommand

Page 20: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22220

Write Authorisation Rejection

Write Request

Write DataRequest

WriteCommand

Write ReplyError

AuthorisationFailure

Source Destination

Write DataAuthorisationRejection

Page 21: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22221

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

Page 22: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22222

Write Data Error

Write Request

Write DataError Indication

WriteCommandHeader

Write DataError Reply

Write DataFailure

Source Destination

RecordData Error

Write DataRequest

Write DataAuthorisation

WriteCommandData

Page 23: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22223

Write Reply Error

Write RequestWriteCommand

Source Destination

WriteReply

RecordPacketError

Write DataRequest

Write DataAuthorisation

Write Data

Write DataIndication

Page 24: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22224

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.

Page 25: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22225

Read Operation

Read Request

Read DataRequest

ReadCommand

ReadReply

Read DataConfirmation

Source Destination

Read DataResponse

Page 26: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22226

Read Command – Logical Addressing

Read Address (MS) Read Address Read Address Read Address (LS)

Data Length (MS) Data Length Data Length (LS) Header CRC

EOP

First byte transmitted

Last byte transmitted

Destination Logical Address Protocol Identifier Packet Type, CommandSource Path Addr Len Destination Key

Source Logical Address Transaction Identifier (MS) Transaction Identifier (LS) Extended Read Address

Read = 0 Read = 0Command= 1

Increment/No inc. addr

Read = 1(Ack/No_Ack)

Reserved= 0

Bits in Packet Type / Command / Source Path Address Length Byte

MSB

Packet Type Command

Source PathAddress Len = 0

Source PathAddress Len = 0

LSB

Source Path Address Length

Page 27: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22227

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

Page 28: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22228

Read Reply – Logical Addressing

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

First byte transmitted

Last byte transmitted

Read = 0 Read = 0Response= 0

Increment/No inc. addr

Read = 1(Ack/No Ack)

Reserved= 0

Bits in Packet Type / Command / Source Address Path Length Byte

MSB

Packet Type Command

Source PathAddress Length

Source PathAddress Length

LSB

Source Path Address Length

Page 29: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22229

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.

Page 30: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22230

Read-Modify-Write Operation

RMW Request

RMW DataRequest

RMWCommand

RMWReply

RMW CompleteConfirmation

Source Destination

Data Read and WriteAuthorisation

Write Data

Write DataIndication

Page 31: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22231

Example Read-Modify-Write Operation

1 0 0 0 1 0 0 0

1 0 0 0 1 1 1 0

1 1 1 0 0 0 1 1

Data in command (Data)

Mask in command (Mask)

Data read from destination memory and returned to source (Read)

1 1 1 0 1 0 0 1 Data written to destination memory= (Mask AND Data) OR (NOT Mask.Read)

Page 32: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22232

Read-Modify-Write Command – Logical

Read = 0 Verify DataBefore Wr = 1

Command= 1

Incr. address= 1

Ack/No_Ack= 1

Reserved= 0

Bits in Packet Type / Command / Source Address Path Length Byte

MSB

Packet Type Command

Destination Logical Address Protocol Identifier Packet Type, CommandSource 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)

Data/Mask CRC EOP

First byte transmitted

Last byte transmitted

Mask (MS) Mask Mask Mask (LS)

Source PathAddress Len = 0

Source PathAddress Len = 0

LSB

Source Path Address Length

Page 33: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22233

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

Page 34: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22234

Read-Modify-Write Reply – Logical

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

First byte transmitted

Last byte transmitted

Read = 0 Verify DataBefore Wr = 1

Response= 0

Inc. address= 1

Ack/No_Ack= 1

Reserved= 0

Bits in Packet Type / Command / Source Path Address Length Byte

MSB

Packet Type Command

Source PathAddress Len = 0

Source PathAddress Len = 0

LSB

Source Path Address Length

Page 35: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22235

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

Page 36: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22236

Write to Memory with DMA

SpaceWireInterface

RMAPInterface

DMA Controller Memory

MemPtr = 001000h

DataCtr = 000010hData

Data

SpaceWire

SpaceWire-RMAP Interface Destination Application

Page 37: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22237

Example RMAP command writing to memoryField No. Bytes ValueDestination Path Address 0 -Destination Logical Address 1 54hProtocol Identifier 1 01hPacket Type 01bCommand 1 1011bExtra Source Path Address Length 00bExtra Source Path Address 0 -Destination Key 1 42hSource Logical Address 1 76hTransaction Identifier 2 0004hExtended Write Address 1 00hWrite Address 4 0000 1000hData Length 3 00 0010hHeader CRC 1 8dhData 16 0001h 0203h 0405h 0607h

0809h 0a0bh 0c0dh 0e0fh

Data CRC 1 8dhTOTAL 33

Page 38: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22238

Write to Mailbox with DMA

SpaceWireInterface

RMAPInterface

SpaceWire-RMAP Interface Destination Application

Mailbox DMA

Mailbox Base PtrMailbox Current PtrMailbox Max Size

Mailbox Status

Mailbox Data Size

Memory

Mailbox MemoryMailbox Memory

Mailbox Memory

Page 39: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22239

Example RMAP command writing to mailboxField No. Bytes ValueDestination Path Address 0 -Destination Logical Address 1 54hProtocol Identifier 1 01hPacket Type 01b

Command 1 1010bExtra Source Path Address Length 00b

Extra Source Path Address 0 -Destination Key 1 99hSource Logical Address 1 76hTransaction Identifier 2 0006hExtended Write Address 1 01hWrite Address 4 0000 0000hData Length 3 00 0010hHeader CRC 1 a5hData 16 0001h 0203h 0405h 0607h

0809h 0a0bh 0c0dh 0e0fhData CRC 1 8dh

TOTAL 33

Page 40: SpaceWire Remote Memory Access Protocol

Parkes MAPLD2006 22240

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