New designs for the new ARVP sonar system.
Go to file
2023-06-17 21:31:50 +00:00
.devcontainer tweaked container 2023-06-16 16:28:55 -06:00
.vscode add vscode settings to make rust-analyzer work 2023-03-05 19:19:45 -07:00
firmware fw: i2c progress, writing works (???) 2023-06-17 21:31:50 +00:00
gateware gw: add I2C bitbang module 2023-06-17 16:34:17 +00:00
hardware hw: fix silkscreen issue 2023-06-17 15:56:29 +00:00
pysonar start playing around with sampler (not working at all, wb issues I think) 2023-06-17 15:56:11 +00:00
.dockerignore Ignore build outputs in docker context to avoid permissions issues 2023-06-16 14:44:38 -06:00
.gitignore add .venv to gitignore 2023-06-16 16:34:19 -06:00
.gitmodules remove extra submodule I added for testing 2023-04-22 18:41:12 -06:00
BUILDING.md add privileged flag to devcontainer, to flash from vscode 2023-06-16 14:45:25 -06:00
Dockerfile tweaked container 2023-06-16 16:28:55 -06:00
migen.patch Add patch to migen to maybe fix things? 2023-06-03 16:35:39 -06:00
pyproject.toml create python config prompt tool 2023-06-16 16:30:05 -06:00
README.md tweaked container 2023-06-16 16:28:55 -06:00
requirements.txt requirements.tx: amaranth-community-unofficial -> amaranth-farm 2023-03-05 11:47:09 -07:00

Updated Sonar System

This repository contains all the design files for my attempt at an updated and improved passive sonar data acquisition system. The goal of this system is simply to be able to capture pinger data, filtered by the preprocessor board, via ethernet, at significantly faster speed than the previous system.

Pysonar

This provides a library to interface with the FPGA, both pulling data and configuring it. To install, simply cd into this repo and:

pip install ./

A CLI/console to test configuration is provided as sonar_config. Usage can be found with

sonar_config --help

Note: This is a pure python package. In an ideal world, I would have implemented all protocol implementation in rust, and exported via PyO3, to keep potential changes in sync, but it's not worth the implementation effort and potential installation difficulty here.

Hacky hacks to patch into migen

migen.fhdl.simplify.py (line 81): add the attributeerror exception

          for port in mem.ports:
                try:
                    sync = f.sync[port.clock.cd]
                except KeyError:
                    sync = f.sync[port.clock.cd] = []
                except AttributeError:
                    sync = f.sync["sys"]

Repo Layout

firmware/
  hello_world_c - My very first testing code for doing SoC bringup
  TODO - break FW out into multiple crates to provide more functionality
gateware/ - RTL for creating the SoC
hardware/ - Directory for any hardware designs
  pmod/ - A PMOD interface board, using 4 ADCs with LVDS converters to get data across PMOD [Failed Idea]
  colorlight-base/ - Baseboard that attaches to the preprocessor (replases BeagleBone + PruDAQ)
  sonar-footprints.pretty/ - custom KiCAD footprints for this project
  sonar_symbols.kicad_sym - custom KiCAD symbols I create for hardware
  colorlight_pin_extractor.py - a script I used to help in making the kicad symbol for the colorlight module

Design Goals

  • 4x 20MSPS channels @ > 8 bits Reduced to 10MSPS @ 9 bits due to memory resource constraints.
  • Ethernet data channel
  • Simplified software stack (or at least fewer layers of components)
  • Well-documented

RTL Architecture

General SoC architecture and other similar goodies can be found in gateware/docs.

To over simplify, I am creating an SoC with an rv32im core, connected to a single wishbone bus to access all memory and peripherals. All RTL is written in Amaranth.

Firmware Architecture

Given how much I can very simply offload onto the RTL (peak detection, maaaybe DMA, etc.), the firmware will be pretty simple. I will use embassy just to make things easier on myself. All I really have to do is provide some configuration interface over ethernet, set up and read out captures, and push those to the Xavier.

The configuration interface only needs to expose the following functionality:

  • Stop/start capturing
  • Set filter frequency
  • Set capture size and offset
  • Automatic triggering settings
  • Manual triggering

The data channel can be whatever form I want, although if ZMQ is easy to implement I may keep it to reduce changes to the ROS software.

Random notes

You will probably need to un write-protect the flash on the colorlight

Will not be doing LVDS system, because arty doesn't have selectable bank voltage to actually use it.

Switching to use Colorlight i9 board (ECP5 UP5K 45), because it has plenty IO broken out, also provides ethernet (I just need to implement the magnetics and jack), and is cheaper/potentially easier to acquire for ARVP in the future. The LiteX implementation fits in <40% of total resources of the 25K LUT variant, so the 45K should be plenty for what I need. Frankly what I'm implementing is very simple. It can probably even handle doing the FFT on board if I wanted to.

ecpdap: "Error: specified probe not found"

A Reboot fixed it....

Do I have ecpdap installed in two places and one of them doesn't work maybe?

I do have two versions installed. one from oss-cad-suite and one by building it manually.

Pip install makes UNKNOWN package in docker

This is some weird conflict between pip's setuptools and the system setuptools, to solve just set everything up in a venv.