Guest User

Untitled

a guest
Dec 9th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. Ram gate
  2.  
  3. Memory is split into 32-byte segments, accessible with 1-byte granularity
  4. One gate up to 1MiB (32768 segments), little endian
  5.  
  6. C I O
  7. T N U
  8. L T
  9.  
  10. 0 0 0 - idle
  11. 1 C 0 - start of command, C is the command
  12.  
  13. Commands:
  14.  
  15. 0 aaaaa - read from address (segAddr+aaaaa)
  16. chunkSize bytes will be read, chunks can cross segment boundary
  17. 10 aaaaa (dddd dddd)^cs - write chunkSize bytes
  18. chunks can cross segment boundary
  19. 01 x^(memLen-1) - set segment (for read/write)
  20.  
  21. 11 xx - command
  22.  
  23. 11 01 00 xxxx - set memory len (in segments, log2, up to 32767 (1 MiB))
  24.  
  25. 11 01 01 xx - set chunk size
  26. 00 - 1 byte
  27. 01 - 2 bytes
  28. 10 - 4 bytes
  29. 11 - 8 bytes
  30.  
  31. 11 01 10 - get memory len
  32. -> llll -> l -mem len in log2 segments
  33.  
  34.  
  35. -----
  36.  
  37. Example communication
  38.  
  39. C I O
  40. T N U
  41. L T
  42.  
  43. 0 0 0
  44. 0 0 0 - idle
  45.  
  46. 1 1 0
  47. 1 1 0
  48. 1 0 0
  49. 1 1 0
  50. 1 0 0
  51. 1 1 0 - set chunk size
  52.  
  53. 1 1 0
  54. 0 0 0 - to 4 bytes, also submit
  55.  
  56. 0 0 1 - ack from memory
  57.  
  58. Example streams
  59.  
  60. C starts when CTL goes up
  61. O starts when CTL went down tick before (ack in example before)
  62.  
  63. Starting memory (2 segments)
  64.  
  65. 00 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  66. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  67.  
  68. 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00
  69. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  70.  
  71. C -> O
  72.  
  73. // safe setup
  74. 11 01 01 10 -> 1 - set 4 byte chunk
  75. 11 01 10 -> 1 0001 - get memory len (returns 2)
  76.  
  77. 11 01 00 0010 -> 1 - expand memory to 4 segments
  78.  
  79. 01 00 00 -> 1 - set segment to 0
  80. 0 00001 - 1 10101010 00000000 00000000 00000000 - read 4 bytes from address 1 seg 0
  81. 01 00 01 -> 1 - set segment to 1
  82. 0 00001 - 1 11111111 11111111 00000000 00000000 - read 4 bytes from address 1 seg 1
  83.  
  84. 10 11110 00010001 00010001 00010001 00010010 -> 1 - write 4 bytes from address 30 seg 1
  85.  
  86.  
  87. End memory:
  88.  
  89.  
  90. 00 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  91. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  92.  
  93. 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00
  94. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11
  95.  
  96. 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  97. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  98.  
  99. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  100. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Add Comment
Please, Sign In to add comment