Skip to content

Commit

Permalink
patch apio and test
Browse files Browse the repository at this point in the history
  • Loading branch information
znmeb committed Oct 3, 2024
1 parent 3c67e3c commit 879fb0e
Show file tree
Hide file tree
Showing 8 changed files with 1,568 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev_env/pico_ice/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pico-ice-blinky/*
12 changes: 12 additions & 0 deletions dev_env/pico_ice/3_apio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,20 @@ echo "Installing apio"
pip3 install --upgrade apio
echo "Installing packages"
apio install --all

echo "Listing boards, FPGAs, and examples"
apio boards --list > apio-boards.txt
apio boards --fpga > apio-fpgas.txt
apio examples --list > apio-examples.txt

echo "Deactivating virtual environment $APIO_VENV"
deactivate

echo "Patching apio!!"
diff boards.json $APIO_VENV/lib/python3.10/site-packages/apio/resources/boards.json || true
cp boards.json $APIO_VENV/lib/python3.10/site-packages/apio/resources/boards.json || true
diff SConstruct $APIO_VENV/lib/python3.10/site-packages/apio/resources/ice40/SConstruct || true
cp SConstruct $APIO_VENV/lib/python3.10/site-packages/apio/resources/ice40/SConstruct || true

echo ""
echo "Finished"
33 changes: 33 additions & 0 deletions dev_env/pico_ice/4_test_apio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/bash

set -e

echo ""
echo "Setting environment variables"
source ../set_pico_envars

echo "Activating virtual environment $APIO_VENV"
source $ACTIVATE_APIO_VENV

# https://pico-ice.tinyvision.ai/md_programming_the_fpga.html

# Build a new directory with a "blinky" example project inside
rm -fr pico-ice-blinky
mkdir pico-ice-blinky
cd pico-ice-blinky
apio examples -f iCE40-UP5K/blink

# Set the board to "pico-ice"
apio init --top-module rgb_test --sayyes --board pico-ice

# Build the project using yosys/nextpnr
apio build

# Plug your pico-ice board and upload the blinky project to it
apio upload

echo "Deactivating virtual environment"
deactivate

echo ""
echo "Finished"
Loading

0 comments on commit 879fb0e

Please sign in to comment.