Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ram gate
- Memory is split into 32-byte segments, accessible with 1-byte granularity
- One gate up to 1MiB (32768 segments), little endian
- C I O
- T N U
- L T
- 0 0 0 - idle
- 1 C 0 - start of command, C is the command
- Commands:
- 0 aaaaa - read from address (segAddr+aaaaa)
- chunkSize bytes will be read, chunks can cross segment boundary
- 10 aaaaa (dddd dddd)^cs - write chunkSize bytes
- chunks can cross segment boundary
- 01 x^(memLen-1) - set segment (for read/write)
- 11 xx - command
- 11 01 00 xxxx - set memory len (in segments, log2, up to 32767 (1 MiB))
- 11 01 01 xx - set chunk size
- 00 - 1 byte
- 01 - 2 bytes
- 10 - 4 bytes
- 11 - 8 bytes
- 11 01 10 - get memory len
- -> llll -> l -mem len in log2 segments
- -----
- Example communication
- C I O
- T N U
- L T
- 0 0 0
- 0 0 0 - idle
- 1 1 0
- 1 1 0
- 1 0 0
- 1 1 0
- 1 0 0
- 1 1 0 - set chunk size
- 1 1 0
- 0 0 0 - to 4 bytes, also submit
- 0 0 1 - ack from memory
- Example streams
- C starts when CTL goes up
- O starts when CTL went down tick before (ack in example before)
- Starting memory (2 segments)
- 00 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- C -> O
- // safe setup
- 11 01 01 10 -> 1 - set 4 byte chunk
- 11 01 10 -> 1 0001 - get memory len (returns 2)
- 11 01 00 0010 -> 1 - expand memory to 4 segments
- 01 00 00 -> 1 - set segment to 0
- 0 00001 - 1 10101010 00000000 00000000 00000000 - read 4 bytes from address 1 seg 0
- 01 00 01 -> 1 - set segment to 1
- 0 00001 - 1 11111111 11111111 00000000 00000000 - read 4 bytes from address 1 seg 1
- 10 11110 00010001 00010001 00010001 00010010 -> 1 - write 4 bytes from address 30 seg 1
- End memory:
- 00 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11
- 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Add Comment
Please, Sign In to add comment