Close
0%
0%

DECstation2040

A RP2040 based MIPS emulator, running Ultrix/DECwindows in a business card format.

Similar projects worth following
A RP2040 MIPS emulator, running Ultrix/DECwindows. From the README.md on github:

Hardware:

RP2040, running at 1.8v/300 MHz
32 MB of PSRAM
8 MB SPI flash
uSD card socket
Monochrome VGA at 1024 x 864
Ethernet RMII PHY support (socket on rev 1.5, integrated in rev 2.1)
Software:

4 port PSRAM PIO engine
PIO driven VGA, with seperate 16x16 cursor plane overlay
USB HID to DECWindows keyboard and mouse

This is a custom RP2040 based business card that runs Ultrix/DECwindows. Please see the github repo for more details. From the README.md:

Software

PIO:

The PSRAM/HyperRAM PIO engine provides 42/32 MB/s (write/read) of memory bandwidth. Further, four PIO engines are used to provide four seperate read/write memory ports. This allows independent memory access for the emulated CPU, video DMA, and receive/send Ethernet traffic. Note that all 32 instruction slots are used.

The video PIO engine can support up to a sysclk/2 pixel rate. Thus, for the 300 MHz sysclk typically used, it is possible to run 1080p60 at a pixel rate of 148.5 MHz. The default video rate is 1024 x 768 @ 70Hz, as this matches the screen used for development and the pixel rate is an integral divisor from sysclk. Only five PIO instruction slots are used.

DMA:

To drive the video PIO engine, five DMA channels are used. They are allocated as follows:

  • ctrl_dma_chan - points to DMA channel command packets
  • data_dma_chan - executes DMA command packets
  • ps_read_chan - points to PSRAM read data buffer
  • inc_dma_chan - used to generate loop counter indices
  • cur_inc_dma_chan - used as cursor loop counter

This project uses the RP2040 DMA sniffer to dynamically generate PSRAM addresses, which eliminates the need to have a per-line PSRAM command packet. Further, it uses the inc_dma_chan to enable DMA command loops, eliminating per-line DMA commands needed to send commands to the PIO pixel and PSRAM PIO engines. This makes the amount of memory needed to drive video independent of the display format. Currently, 86 DMA command packets are used vs. approximately 2250 required for 1080p if a per-line DMA structure was used.

In order to eliminate the latency from when the PSRAM PIO engine FIFO has read data, and its delivery to SRAM, we use the ps_read_chan. This channel is chained to after a PSRAM DMA command is executed. Without this channel, the PSRAM PIO engine FIFO would be not be emptied until the next DMA command is executed. This impacts the non-video PSRAM channels, as they must wait unitl the video PSRAM command is complete.

USB:

The USB HID code supports (at least) two keyboard/mouse combo types: Rii mini X1 (model: RT-MWK01), purchased at MicroCenter, and Logitech K830.

Emulator:

Dmitry's code at http://dmitry.gr/?r=05.Projects&proj=33.%20LinuxCard was modified to support the RP2040, as well as adding support for video and USB mouse/keyboard input. With overclocking and running the assembly language version of the CPU emulator, Dmitry's Linux image reports a BOGOMIPS rating of 13.44.

2.0) Getting started

2.1) Hardware

Build either rev 1.5 or 2.1, using the appropriate emu_brd directory. Please note that rev 2.1 is still undergoing Ethernet debug, and has exhibited significant packet drops. I use JLCPCB for board fabrication, and there are Digikey BOM spreadsheets in doc/bom. Recommend building two boards: one to use as a 1.8v CMSIS debugger, and the other as the target. Feel free to only populate the RP2040 related components on the CMSIS debugger.

The surface mount parts aren't too troublesome - I find the PSRAM BGA to be much easier to solder than the RP2040 QFN. My technique is to use a hot-air SMT rework tool. Recommended assembly steps:

  1. Solder the voltage regulator, check for 1.8v and 3.3v when done.
  2. Solder all of the passives, the RP2040, flash, and the USB connectors if building rev 2.1. (Note that two bodge wires are needed to connect J5 and J11 D+/D- as my assumption that USB-A could serve as non-host connector was incorrect). When done, use blink_bringup (below) to check connections. (Edit blink.c to enable the pins to check).
  3. Solder the HyperRAM chip, run mem_test to check connections.
  4. Solder the voltage translator chips, edit blink.c and run to check connections.
  5. Solder the connectors.

For rev 1.5: Needs modified waveshare LAN8722 board. In addition to the modifications outlined at: https://github.com/maximeborges/pico-rmii-ethernet...

Read more »

README.md

The README.md from Github

markdown - 10.00 kB - 07/02/2024 at 00:13

Download

  • 1 × RP2040 Raspberry Pi M0+ dual core microprocessor
  • 1 × W958D8NBYA Winbond 256Mb HyperRAM

  • Added DMA CRC support to Ethernet library

    rscott204909/15/2024 at 01:14 0 comments

    Updated the Ethernet library to use the RP2040 DMA sniffer to calculate CRCs. This significantly improve performance:

    Sys Clk Iperf CPU/SRAM Iperf CPU/flash Iperf DMA/SRAM Iperf DMA/flash
    MHz Mbit/sec Mbit/sec Mbit/sec Mbit/sec
    150 11.6 2.9 94.9 70.1
    200 65.4 31.4 94.9 94.9
    250 83.4 69.3 94.9 94.9
    300 94.9 85.9 94.9 94.9

  • Progress: Ethernet library

    rscott204908/29/2024 at 15:23 0 comments

    I just finished updating Sandeep's pico-rmii-ethernet library to enable line-rate Ethernet transmit and receive. The new library is available in Github: https://github.com/rscott2049/pico-rmii-ethernet_nce/tree/main.


    From the readme:

    This library uses DMA driven ring buffers for both transmit and receive. The transmit side is entirely DMA driven, while the receive side uses a per-packet interrupt to finalize a received packet. Performance does vary with system clock speed, and the memory region the executable is placed:

    System Clock MHz Iperf Mbit/sec (SRAM) Iperf Mbit/sec (flash)
    100 1.38 1.27
    150 2.81 Link not established
    200 65.4 31.4
    250 83.4 69.3
    300 94.9 85.9

    The MDIO interface was changed from polled to interrupt driven, thus freeing up more processor time for packet processing.

  • Build log

    rscott204907/01/2024 at 23:57 0 comments

View all 3 project logs

Enjoy this project?

Share

Discussions

Dmitry Grinberg wrote 07/15/2024 at 04:33 point

Super cool to see someone using my code! :D

  Are you sure? yes | no

rscott2049 wrote 07/20/2024 at 18:11 point

Your code made this project possible - I could never have written a MIPS emulator in assembly!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates