Skip to content

Commit

Permalink
Prepared template for Openflow programming
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomelo9 committed Jun 28, 2024
1 parent 548d7ab commit 69ae00b
Showing 1 changed file with 7 additions and 30 deletions.
37 changes: 7 additions & 30 deletions pyfpga/templates/openflow-prog.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,12 @@

set -e

###############################################################################
# Things to tuneup
###############################################################################
DOCKER="docker run --user $(id -u):$(id -g) --rm -v $HOME:$HOME -w $PWD"

FAMILY={family}
PROJECT={project}
{% if FAMILY == 'ice40' %}
$DOCKER --device /dev/bus/usb hdlc/prog iceprog {{ PROJECT }}.bit
{% endif %}

#
# Tools configuration
#

OCI_ENGINE="{oci_engine}"

CONT_ICEPROG="{cont_iceprog}"
CONT_OPENOCD="{cont_openocd}"

TOOL_ICEPROG="{tool_iceprog}"
TOOL_OPENOCD="{tool_openocd}"

###############################################################################
# Programming
###############################################################################

if [[ $FAMILY == "ice40" ]]; then
$OCI_ENGINE $CONT_ICEPROG $TOOL_ICEPROG $PROJECT.bit
elif [[ $FAMILY == "ecp5" ]]; then
$OCI_ENGINE $CONT_OPENOCD $TOOL_OPENOCD \
-f /usr/share/trellis/misc/openocd/ecp5-evn.cfg \
-c "transport select jtag; init; svf $PROJECT.svf; exit"
else
echo "ERROR: unsuported tool" && exit 1
fi
{% if FAMILY == 'ecp5' %}
$DOCKER --device /dev/bus/usb hdlc/prog openocd -f /usr/share/trellis/misc/openocd/ecp5-evn.cfg -c "transport select jtag; init; svf {{ PROJECT }}.svf; exit"
{% endif %}

0 comments on commit 69ae00b

Please sign in to comment.