
This project implements a low-area streaming Sobel edge detection accelerator for grayscale image processing.
Pixels are streamed into the chip one by one through the input pins.
The design uses two line buffers and a 3×3 sliding window to perform Sobel convolution in real time without storing the full image frame.
The Sobel operator calculates horizontal gradient (Gx) and vertical gradient (Gy):
Gx = -p00 + p02 - 2p10 + 2p12 - p20 + p22
Gy = p00 + 2p01 + p02 - p20 - 2p21 - p22
The final edge strength is calculated as:
|Gx| + |Gy|
The output is clipped to 8-bit grayscale values (0–255) and streamed out directly.
The design is verified using cocotb and a Python golden reference model. Test patterns include:
No external hardware is required. The design can be tested using simulation only. For physical silicon testing after tapeout, a standard Tiny Tapeout demo PCB can be used.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | pixel_valid | edge_out[0] | pixel_in[0] |
| 1 | edge_out[1] | pixel_in[1] | |
| 2 | edge_out[2] | pixel_in[2] | |
| 3 | edge_out[3] | pixel_in[3] | |
| 4 | edge_out[4] | pixel_in[4] | |
| 5 | edge_out[5] | pixel_in[5] | |
| 6 | edge_out[6] | pixel_in[6] | |
| 7 | edge_out[7] | pixel_in[7] |