Skip to content

hbjamin/casb-firmware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Central Analog Summing Board (CASB) Firmware

A repository for version control of the CASB firmware, created by B. Harris and based on similar work by A. Nikola (QPIX) and N. Barros (CTB).

Related CASB Repositories

  • CASB Control - Software for programming the CASB and communicating with the DAQ
  • CASB Calibration - Storage and processing of CASB calibration test results

Technical Overview

Hardware Platform

  • Z-turn Board: MYS-7Z020-V2
    • Built around Xilinx Zynq-7020 (XC7Z020) SoC
    • Combines dual-core ARM Cortex-A9 processor (PS) with Xilinx 7-series FPGA fabric (PL)
    • Chosen for its pin count, customizable logic capabilities, and reasonable price

Development Tools

  • Firmware Development: Vivado 2023.2

    • Creates configurable logic for trigger determination
    • Implements i2c bus and memory-mapped registers for channel masks
    • Outputs:
      • .bit file (programs the PL/FPGA)
      • .xsa file (contains hardware platform description)
  • Operating System: PetaLinux 2023.2

    • Embedded Linux SDK for FPGA-based SoC designs
    • Automatically generates device trees and bootloaders from Vivado outputs
    • Outputs:
      • BOOT.bin (bootloaders + FPGA bitstream)
      • boot.scr (U-Boot script)
      • image.ub (Linux kernel + device tree)
      • rootfs (root filesystem)

Development Workflow

  1. Create a new branch from your experiment's main branch
  2. Modify the Vivado project
  3. Rebuild PetaLinux
  4. Deploy to Z-turn board
  5. Verify functionality
  6. Submit a pull request to the experiment's main branch

Branch Management

The repository maintains separate main branches for each experiment:

  • eos - Latest stable version for Eos experiment

IMPORTANT: Never push changes directly to these main experiment branches. If you do I will turn into Liam Neeson from Taken.

Building the Project

Prerequisites

  • Install Vivado (follow tutorials/install-vivado.md)
  • Set up Vivado (follow tutorials/setup-vivado.md)
  • Install PetaLinux (follow tutorials/install-petalinux.md)
  • Set up PetaLinux (follow tutorials/setup-petalinux.md)

Part 1: Vivado Build

  1. Clone this repository:
git clone git@github.com:hbjamin/casb-firmware.git
  1. Checkout appropriate branch:
cd casb-firmware
git checkout <branch_name>
  1. Open Vivado:
vivado_2023
cd firmware
vivado
  1. Execute the project creation script:
source ./create_project.tcl
  1. Generate the bitstream

  2. Export bitstream to casb-firmware/petalinux/casb_tester/casb_tester.bit

    • Click FileExportExport Bitstream
  3. Export hardware to casb-firmware/petalinux/casb_tester/casb_tester.xsa

    • Click FileExportExport HardwareInclude bitstream

Part 2: PetaLinux Build

  1. Build PetaLinux (follow tutorials/build-petalinux.md)

Part 3: Deployment

  • To deploy on a new SD card: Follow 'tutorials/deploy-new-sd.md'
  • To manually deploy on an already partitioned SD card: Follow tutorials/deploy-manual.md
  • To remotely deploy on an already partitioned SD card: Follow tutorials/deploy-remote.md

Making Changes

  1. Start from your experiment's main branch:
git checkout <experiment_name>
  1. Create a new feature branch:
git checkout -b <experiment_name+change_implemented>
  1. Open setup.tcl and update the project name

  2. Build the Vivado project (see "Part 1" of "Building the Project" section)

  3. Make your changes

  4. Build the PetaLinux project (see "Part 2" of "Building the Project" section)

  5. Deploy the firmware (see "Part 3" of "Building the Project" section)

  6. Verify functionality

  7. Update Changelog.md with your changes

  8. Regenerate the board design:

  • Open block design in Vivado
  • Click FileExportExport Block Design
  • Export to casb-firmware/firmware/src/bd
  1. Add board design (and constraints if modified) to git and commit:
git add casb-firmware/firmware/src/bd/casb.tcl
git add casb-firmware/firmware/src/constrs/top.xdc
git commit -m "Description of changes"
  1. Verify you're on the correct branch:
git branch
  1. Push changes:
git push --set-upstream origin <your_branch_name>
  1. Submit a pull request through GitHub

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published