vcc_layouts.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. """
  2. # TOP Open Source programming suite
  3. #
  4. # TOP853 VCC layout definitions
  5. #
  6. # Copyright (c) 2022 Michael Buesch <m@bues.ch>
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License along
  19. # with this program; if not, write to the Free Software Foundation, Inc.,
  20. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. """
  22. import sys
  23. if __name__ == "__main__":
  24. sys.path.insert(0, sys.path[0] + "/../..")
  25. from libtoprammer.shiftreg_layout import *
  26. class VCCLayout(ShiftregLayout):
  27. # "shiftreg_masks" is a dump of the VCC shiftregister states.
  28. # The array index is the layout ID.
  29. # The array entries are the inverted shift register VCC control outputs.
  30. # All non-VCC control outputs are zero.
  31. # The least significant byte is the first shift register in the chain.
  32. shiftreg_masks = (
  33. 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x00
  34. 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x08
  35. 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x10
  36. 0x2000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, # 0x18
  37. 0x0800, 0x0000, 0x0400, 0x0000, 0x0200, 0x0000, 0x0000, 0x0000, # 0x20
  38. 0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x28
  39. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x30
  40. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x38
  41. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x40
  42. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x48
  43. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x50
  44. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x58
  45. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x60
  46. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x68
  47. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x70
  48. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x78
  49. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x80
  50. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x88
  51. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x90
  52. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0x98
  53. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xA0
  54. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xA8
  55. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xB0
  56. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xB8
  57. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xC0
  58. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xC8
  59. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xD0
  60. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xD8
  61. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xE0
  62. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xE8
  63. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xF0
  64. #0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, # 0xF8
  65. )
  66. # "shreg2zif_map" is a mapping of the shift register outputs
  67. # to the ZIF socket pins
  68. shreg2zif_map = {
  69. # SHREG.PIN : ZIF_PIN
  70. "1.5" : 24, # Q6C
  71. "1.4" : 30, # Q5C + D30C
  72. "1.3" : 32, # Q4C
  73. "1.2" : 34, # Q3C
  74. "1.1" : 36, # Q2C
  75. "1.0" : 40, # Q1C
  76. }
  77. def __init__(self, top=None):
  78. ShiftregLayout.__init__(self, nrZifPins=40, nrShiftRegs=2)
  79. self.top = top
  80. def minVoltage(self):
  81. "Get the min supported voltage"
  82. return 5
  83. def maxVoltage(self):
  84. "Get the max supported voltage"
  85. return 5
  86. def setLayoutID(self, id):
  87. self.top.cmdLoadVCCLayout(id)
  88. if __name__ == "__main__":
  89. print("ZIF socket VCC layouts")
  90. print(VCCLayout())