RPi pico(正確にはpico1の方)で使われているRP2040チップを使ってROM emulatorを構成したGitHubのプロジェクトを見つけたので既報かもしれませんが以下に示します↓
git cloneでプロジェクトを取得したところ回路図はKiCADバージョンも有り、パターンも開示されており、ファームウェアも同様に公開されており、MITライセンスなので個々人での追試には宜しいかと思います。
概要はRP2040のPIO機能を活用して32Pin EPROM(2Mbit)のemulationを行う構成で、tacc<100nsを実現している様です。LVC245を使って5V系の回路でも使用可能らしい。
以下にGitHubの情報を引用:
PicoROM is an 8-bit ROM emulator in a DIP-32 compatible form factor. It's main use case (the reason I made it) is for rapid iteration when experimenting with arcade hardware. The PicoROM can emulate ROMs up to 2MBit (256Kbytes) in size and speeds of 100ns.
The PicoROM is based around the Raspberry Pi RP2040 microcontroller. A vertically mounted USB-C connector is used for power and communication with the host PC. The vertical orientation might seem awkward, but it ensures that all the hardware stays within the DIP-32 form factor and won't interfere with any adjacent hardware.
The pinout used is compatible with a 27C020 EPROM, which I believe follows a JEDEC standard and is common to a lot of ROM and RAM ICs.
KiCad project files are located in the
hardware/
directory.The firmware is written in C/C++ using the Pico C SDK. The firmware is responsible for the ROM emulation, managing communication with the host PC and facilitating communication between the host PC and the target device.
The RP2040 has 264KByte of static RAM and 256KBytes of that are used to store the ROM data. The external flash is not fast enough for these purposes. It is used for store the firmware itself, config settings and a copy of the ROM image that gets loaded at startup. The ROM emulation itself is achieved using a combination core1 and the PIO state machines. A small assembly loop running on core1 interprets the address lines, reads the data from memory and presents it on the data pins. Core1 is given high priority bus access, so it can always read and write in a single cycle. The PIO is used to interpret the chip and output enable signals.
The
firmware/
directory contains the firmware source code.Software on a host PC is used to upload ROM data to the PicoROM. The
picorom
command line tool has the ability to list the PicoROMs currently connected, give them unique names and upload new data to them. It is common for data to be split across multiple ROMs, especially in 16-bit systems. So giving a PicoROM names likecpu_high
orsprite1
allows you to have multiple PicoROMs connected at once without any confusion about where you are sending the data.There is also a Python module called
pypicorom
which provides all the same functionality as the command line tool. It also supportsread
andwrite
methods for communicating with the software that is accessing the ROM data.The host PC software is written in Rust and is in the
host/
directory.I personally find it useful to build test software that supports some kind of command system for doing things on the system I am experimenting with. This allows me to write scripts in a high level language, like python, that can read/write memory, trigger other hardware on the system, etc.
To support this the firmware allows a specified region of ROM memory to be used to both send and receive a byte stream to/from the host PC. The software on the target system can read from a known address to get the latest byte from the host, and it can read from one of 256 other addresses to send a byte to the host PC. Through this system about 5Kbytes/sec can be sent and received.
引用おわり。
個人的にはどこかの中華ボード屋がコピー品をAmazon等で販売してくれたら(既にされているかも)助かるなぁ、emulator作るのが目的ではないので(PIOの実用サンプルという意味では興味ありですが)。
なので firmware/PIO関連のコードをちょこちょこ勉強の為に見始めた処です。前にも書いたかもしれませんが当方、PIOの如きプログラマブルマイクロシーケンサ的な物は好物故、pico(1/2含めて)の特徴の一つであるPIOには着目しております。
と、もう既に財団の虜(信者)になっているのかもしれないがそれも由:)