|
| 1 | +from amaranth import * |
| 2 | +from amaranth.build import * |
| 3 | +from amaranth.vendor import IntelPlatform |
| 4 | +from .resources import * |
| 5 | + |
| 6 | +__all__ = ["MiSTPlatform"] |
| 7 | + |
| 8 | + |
| 9 | +class MiSTPlatform(IntelPlatform): |
| 10 | + """MiST is the original Amiga/Atari ST retro FPGA board. It has been |
| 11 | + the inspiration for the MiSTer board. |
| 12 | +
|
| 13 | + More information can be found on the wiki page: |
| 14 | + https://github.com/mist-devel/mist-board/wiki |
| 15 | + """ |
| 16 | + device = "EP3C25" # Cyclone III 25K LEs |
| 17 | + package = "E144" |
| 18 | + speed = "C8" |
| 19 | + default_clk = "clk27" |
| 20 | + resources = [ |
| 21 | + Resource( |
| 22 | + "clk27", 0, Pins("54", dir="i"), |
| 23 | + Clock(27e6), Attrs(io_standard="3.3-V LVTTL"), |
| 24 | + ), |
| 25 | + Resource( |
| 26 | + "clk27", 1, Pins("55", dir="i"), |
| 27 | + Clock(27e6), Attrs(io_standard="3.3-V LVTTL")), |
| 28 | + |
| 29 | + *LEDResources( |
| 30 | + pins="7", |
| 31 | + attrs=Attrs(io_standard="3.3-V LVTTL"), |
| 32 | + ), |
| 33 | + |
| 34 | + VGAResource(0, |
| 35 | + r="135 137 141 142 143 144", |
| 36 | + g="106 110 111 112 113 114", |
| 37 | + b="115 120 121 125 132 133", |
| 38 | + hs="119", vs="136", |
| 39 | + attrs=Attrs(io_standard="3.3-V LVTTL"), |
| 40 | + ), |
| 41 | + |
| 42 | + UARTResource(0, |
| 43 | + rx="31", tx="46", |
| 44 | + attrs=Attrs(io_standard="3.3-V LVTTL"), |
| 45 | + ), |
| 46 | + |
| 47 | + SPIResource(0, |
| 48 | + cs_n="127 91 90", # SS2/FPGA, SS3/OSD, SS4/SD_DIRECT |
| 49 | + clk="126", copi="88", cipo="105", |
| 50 | + attrs=Attrs(io_standard="3.3-V LVTTL"), |
| 51 | + ), |
| 52 | + |
| 53 | + SDRAMResource(0, |
| 54 | + clk="43", cs_n="59", we_n="66", ras_n="60", cas_n="64", |
| 55 | + ba="58 51", a="49 44 42 39 4 6 8 10 11 28 50 30 32", |
| 56 | + dq="83 79 77 76 72 71 69 68 86 87 98 99 100 101 103 104", |
| 57 | + dqm="67 85", |
| 58 | + attrs=Attrs(io_standard="3.3-V LVCMOS"), |
| 59 | + ), |
| 60 | + |
| 61 | + Resource("audio", 0, |
| 62 | + Subsignal("l", Pins("65", dir="o")), |
| 63 | + Subsignal("r", Pins("80", dir="o")), |
| 64 | + Attrs(io_standard="3.3-V LVTTL"), |
| 65 | + ), |
| 66 | + |
| 67 | + Resource("conf_data0", 0, |
| 68 | + Pins("13", dir="i"), |
| 69 | + Attrs(io_standard="3.3-V LVTTL"), |
| 70 | + ), |
| 71 | + ] |
| 72 | + connectors = [] |
| 73 | + |
| 74 | + |
| 75 | +if __name__ == "__main__": |
| 76 | + from .test.blinky import Blinky |
| 77 | + MiSTPlatform().build(Blinky(), do_program=False) |
| 78 | + print(( |
| 79 | + "To use test bitstream on MiST; copy 'build/top.rbf' to file\n" |
| 80 | + "named 'core.rbf' on SD card so it will be loaded by MiST firmware" |
| 81 | + )) |
0 commit comments