# 2026-04-21 PS/2 Hotplug Incremental Route Release

## Status

This release is built from the joystick-port-swap incremental route tree and adds PS/2 hotplug recovery for the mouse and keyboard ports.

Source tree:

```text
/home/ranko/Documents/Edge/edge-minimigaga-vga-hdmi-osd-joy-swap-ps2-hotplug-incremental-route/edge-minimigaga-vga-hdmi
```

Base tree:

```text
/home/ranko/Documents/Edge/edge-minimigaga-vga-hdmi-osd-joy-swap-incremental-route/edge-minimigaga-vga-hdmi
```

Previous release referenced:

```text
/home/ranko/Documents/Edge/edge-minimigaga-vga-hdmi-osd-joy-swap-ps2-hotplug-incremental-route/edge-minimigaga-vga-hdmi/releases/2026-04-19_joystick-port-swap-incremental-route
```

## Functional change

The PS/2 low-level handling is FPGA Verilog, not ARM firmware. No ARM firmware files were changed.

Changed files:

```text
rtl/minimig/userio_ps2mouse.v
rtl/minimig/ciaa_ps2keyboard.v
fpga/edgeartix7/edgeartix7_v0/xc7a35t/ps2.xdc
```

The mouse logic now times out partial transactions, restarts the mouse initialization command sequence after timeout, and detects mouse BAT/status bytes or invalid first packet bytes after a replug so reporting gets re-enabled.

The keyboard logic now times out LED command ACK waits and partial receive-frame waits. The keyboard PS/2 clock/data inputs also have internal pullups enabled to match the mouse port behavior.

## Inherited fixes

- Joystick physical port swap from the 2026-04-19 release.
- Turbo Kick AutoConfig/overlay gating stability fix.
- TG68K cacheline clear on Turbo Kick transition.
- OSD joystick2 release fix.
- Incremental routing from the last user-tested stable route.

## Build result

- Bitstream: `minimig_edge_top.bit`
- SPI flash image: `minimig_edge_top.bin`
- Vivado status: `write_bitstream Complete`
- Hardware JTAG test: programmed successfully into `xc7a35t_0`

Final timing:

- WNS: `0.256 ns`
- TNS: `0.000 ns`
- WHS: `0.016 ns`
- THS: `0.000 ns`

All user specified timing constraints are met.

## Incremental reuse

Reference checkpoint:

```text
/home/ranko/Documents/Edge/edge-minimigaga-vga-hdmi-osd-joy-incremental-stable-route/edge-minimigaga-vga-hdmi/project_1/project_1.runs/impl_1/minimig_edge_top_routed.dcp
```

Reuse summary:

- Placement cells reused: `98.49%`
- Route report net reuse: `91.83%`
- Router log fully reused nets: `20796` (`91.93%`)

This reuse is lower than the 2026-04-19 joystick-only release because this build changes PS/2 RTL state machines, not just package-pin constraints.
