I plan to write some more prose-like on the architecture of midgetv,
For now, here is a short description of how to program blinky
to an
iceboard40-hx1k.
To program blinky
we need to:
- assemble blinky.S to blinky.bin
- transform
blinky.bin
to a format that can be included easily in Verilog, the result file isice40loaderprog.hv
, a file containinglocalparam
. This is done by an utilitymidgetv_bin2ebr
. - Compile the Verilog code, and
- Upload the Verilog code.
When this is the very first time any instance of midgetv is compiled,
there are some additional steps. Midgetv depends on microcode, the
file ucode.h
must be transformed to Verilog. This is done by an
utility midgetv_indirectEBR
. That utility must itself be
compiled. Also, the utility midgetv_bin2ebr
mentioned above must be
compiled. Performing these steps linearly may look like this:
- Assume you have downloaded
midgetv-x.y.z
. Assume you have downloaded a riscv gcc, and programming tools for iceboard40-hx1k. - tar -xzf midgetv-2.0.1.tar.gz (unpack)
- cd midgetv-2.0.1/code
- make
(This produces a Verilog file../obj_dir/m_2ebr.v
) - cd ../util/
- make
(This produces the utility../bin/midgetv_bin2ebr
) - mkdir ../obj_dir/first
(I need to enhance my make file. This directory must be made by hand now) - cd ../sw/hwexamples/blinky/
- make
(This produces a verilog include file../../../hwtst/iceblink40-hx1k/ice40loaderprog.hv
) - cd ../../../hwtst/iceblink40-hx1k/
- apio clean
- apio build (Compile the Verilog code)
- apio upload