[VTA] VTA on de10 nano

Hi all, After quite a lot of pain, I thought to ask here for some help to get the de10 nano working with the VTA stack. This is a learning project to get myself started with FPGA in the ML world.

What I have achieved

I am able to compile the vta and runtime on the board, and to generate the bitstream on the host.

Where I am stuck

However, when I try to program the board, it hangs for a while and then the board disconnects. There is a python function called program_bitstream that receives the bitstream I generated, which is the one where the interpreter hangs.

Have you ever experienced similar issues? From the guide I read that the zImage might not be suitable. Is it because of the CMA support? How can I use a different zImage on the board? I tried to simply copy the one provided in the example in the boot partition, but it doesn’t work (would have been to easy :slight_smile: )

Any comment, suggestion, ideas are really welcomed!

Thanks, Giuseppe

Hello Giuseppe,

I recently started to deal with VTM. Most likely you have already solved the problem by yourself in a year, but the answer may be useful to someone.

This is the way how I solved this problem. I’m not sure if this is the most correct solution, but it works on my side for the Linux v5 kernel.

To use another zImage:

Make a copy of your /mnt/boot/devicetree…… .dtb, e.g. test.dtb.

Add new section to this test.dtb:

reserved-memory {

    #address-cells = <1>;
    #size-cells = <1>;

    default_cma_pool: default_cma_pool {
        compatible = "shared-dma-pool";
        size = <0x18000000>;
        alignment = <0x10000>;

Take cma kernel module cma.ko (I can not attach it).

Copy zImage and test.dtb to /mnt/boot on de10nano

Copy cma.ko to you /home directory (or to another, so you should use it when run insmod : $ sudo insmod /your_dir/cma.ko)

$ sudo reboot

select uBoot from the menu

=> setenv linux_kernel_image zImage; setenv linux_fdt_image test.dtb; run bootcmd

$ sudo insmod cma.ko

And check that cma module was installed:

$ lsmod | grep cma

cma 16384 0

To check available volume of cma:

$ cat /proc/meminfo

Hi @Arina,

Actually, I was looking at this in my spare time when I started to move baby steps in TVM and I didn’t touch it ever since.

But I really hope that this might help someone new in the community to get along with VTA!

Thanks, G