Basic project with Vivado 2014.3 and Ubuntu 14.04

Just about everything about Red Pitaya
pavel-demin
Posts: 33
Joined: Tue Dec 23, 2014 10:52 pm

Basic project with Vivado 2014.3 and Ubuntu 14.04

Post by pavel-demin » Wed Dec 24, 2014 12:10 am

Hi,

For my experiments with the Red Pitaya, I’d like to use a more recent Vivado version and to run a Debian based OS on the Red Pitaya.

As I could not find any ready made solution, I've put together my own one. I'm sharing it in case somebody else might also find it useful.

The source code is available at

https://github.com/pavel-demin/red-pitaya-notes

This repository contains the following components:
  • Makefile that builds everything (almost)
  • cfg directory with constraints and board definition files
  • cores directory with IP cores written in Verilog
  • projects directory with Vivado projects written in Tcl
  • scripts directory with
    • Tcl scripts for Vivado and SDK
    • shell script that builds a bootable SD card with the Ubuntu distribution
I've also written some basic notes on how to use this code and to build a bootable SD card with the Ubuntu distribution and with a basic LED blinker FPGA bitstream file:

http://pavel-demin.github.io/red-pitaya ... ed-blinker

Cheers,

Pavel
Last edited by pavel-demin on Thu Jan 29, 2015 10:37 pm, edited 1 time in total.

john k2ox
Posts: 39
Joined: Sun Oct 05, 2014 6:47 pm
Location: New York
Contact:

Re: Basic project with Vivado 2014.3 and Debian Wheezy

Post by john k2ox » Wed Dec 24, 2014 4:27 am

Wow. This is awsome.
I tried to install Vivado 13.X a while back on Debian with no luck. Nice to here someone using new tools. Please keep us up to date. I'm looking forward to trying it again on Linux.

Thanks,
John

pavel-demin
Posts: 33
Joined: Tue Dec 23, 2014 10:52 pm

Re: Basic project with Vivado 2014.3 and Debian Wheezy

Post by pavel-demin » Wed Dec 24, 2014 10:39 am

Hi John,

Thanks for your comment.

A small clarification:

My development machine is running Ubuntu 14.04.1 and Vivado Suite 2014.3.1. According to the Vivado Suite release notes, this combination is supported by Xilinx. I can just confirm that it works without any problem.

Debian Wheezy is installed on my Red Pitaya. This way, I have access to all the additional libraries, scripting languages and other tools from the Debian repository without having to compile them myself.

Regards,

Pavel

pavel-demin
Posts: 33
Joined: Tue Dec 23, 2014 10:52 pm

Re: Basic project with Vivado 2014.3 and Ubuntu 14.04

Post by pavel-demin » Thu Jan 29, 2015 10:53 pm

Some updates...

I've recently discovered that for easier cross compilation it's better to run the same Ubuntu distribution on the development machine and on the Red Pitaya card and replaced Debian Wheezy with Ubuntu 14.04 on my Red Pitya.

I've switched from Verilog top files to Tcl top files for my projects and added some IP cores that simplify building data processing chains using Vivado IP Integrator and Xilinx DSP IP cores (CIC, CORDIC, DDS, FIR, FFT, etc)

The scripts, the instructions, the title of this thread and my initial post are updated to reflect these changes.

Arnold
Posts: 54
Joined: Wed Mar 11, 2015 3:07 pm

Re: Basic project with Vivado 2014.3 and Ubuntu 14.04

Post by Arnold » Mon May 11, 2015 10:08 pm

Hi Pavel,

I saw you changed to Vivado 2015.... is it ready to build the led example?

i have some issues to run the led example... any idea?
ERROR: [Common 17-70] Application Exception: Not found in path: gmake
....
http://paste.ubuntu.com/11085594/

i added /usr/share/bash-completion/completions/ to PATH:
PATH=$PATH:/usr/share/bash-completion/completions
export PATH

ls -la /usr/share/bash-completion/completions/gmake
lrwxrwxrwx 1 root root 4 May 5 07:52 /usr/share/bash-completion/completions/gmake -> make

Arnold
Posts: 54
Joined: Wed Mar 11, 2015 3:07 pm

Re: Basic project with Vivado 2014.3 and Ubuntu 14.04

Post by Arnold » Fri May 22, 2015 10:10 pm

thanks for your help @pavel-demin!

i have a question to /dev/uio0 in https://github.com/pavel-demin/red-pitaya-notes
i added uio_pdrv_genirq.of_id=xlnx,axi-cfg-register-1.0 to the kernel boot arguments and generated the device tree for the cfg_test project...

the cfg_test project generates the file called "pl.dtsi" for the device tree, which is included by system.dts:

Code: Select all

/*
 * CAUTION: This file is automatically generated by Xilinx.
 * Version: HSI 2015.1
 * Today is: Sat May 23 11:07:06 2015
*/


/ {
	amba_pl: amba_pl {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "simple-bus";
		ranges ;
		cfg_0: axi_cfg_register@40000000 {
			compatible = "xlnx,axi-cfg-register-1.0";
			reg = <0x40000000 0x1000>;
		};
	};
};
i would like to know how to generate the same device tree for redpitaya_0_92!?
why cant i see /dev/uio0 when i build the redpitaya_0_92 project with the same kernel boot arguments as the cfg_test project?

Thanks,
A

pavel
Posts: 799
Joined: Sat May 23, 2015 5:22 pm

Re: Basic project with Vivado 2014.3 and Ubuntu 14.04

Post by pavel » Sun May 24, 2015 6:38 pm

Hi Arnold,

I'm afraid that the implementation of the AXI interconnect in the Verilog code from the Red Pitaya developers is not compatible with the Xilinx devicetree generator. So, you can't automatically generate devicetree that would allow you to use the UIO driver.

However, what can't be done automatically can be done manually :-)

I've just tried to take the pl.dtsi file from my cfg_test project and include it into the system.dts file of the default Red Pitaya project. It worked.

Here are the steps to reproduce what I did:
  1. Copy pl.dtsi and system.dts from the following link to tmp/red_pitaya_0_92.tree/
    https://0c2d3ba9cf2a7be9395f36aa24dd591 ... taya_0_92/
  2. Rebuild devicetree.dtb with the following command

    Code: Select all

    tmp/linux-xlnx-xilinx-v2015.1/scripts/dtc/dtc -I dts -O dtb -o devicetree.dtb -i tmp/red_pitaya_0_92.tree tmp/red_pitaya_0_92.tree/system.dts
  3. Copy devicetree.dtb to /boot on the SD card
  4. Reboot Red Pitaya
  5. Test UIO with blink_uio.c that can be found at the following link
    https://0c2d3ba9cf2a7be9395f36aa24dd591 ... taya_0_92/
Cheers,

Pavel

Arnold
Posts: 54
Joined: Wed Mar 11, 2015 3:07 pm

Re: Basic project with Vivado 2014.3 and Ubuntu 14.04

Post by Arnold » Sun May 24, 2015 7:49 pm

i patched it manually and it worked :) do you think it makes sense to add this patch to your repo? ...i can make the size of the reg in uio.dtsi more flexible...

1.) Extend Makefile in /

Code: Select all

tmp/%.tree/system.dts: tmp/%.hwdef $(DTREE_DIR)
	mkdir -p $(@D)
	$(HSI) -source scripts/devicetree.tcl -tclargs $* $(PROC) $(DTREE_DIR)
	patch $@ patches/devicetree.patch
	cp patches/uio.dtsi tmp/$(NAME).tree
	patch $@ patches/devicetree_uio.patch
2.) add uio.dtsi file to /patches (0x1000 should be changed accordingly):

Code: Select all

/ {
	uio0: uio@40000000 {
		compatible = "generic-uio";
		reg = <0x40000000 0x1000>;
	};
};
3.) add devicetree_uio.patch file to /patches:

Code: Select all

--- system.dts	2015-05-23 19:57:00.000000000 +0200
+++ system_new.dts	2015-05-24 18:34:00.000000000 +0200
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 /include/ "zynq-7000.dtsi"
+/include/ "uio.dtsi"
 / {
 	cpus {
 		cpu@0 {
4.) add uio_pdrv_genirq.of_id=generic-uio to kernel boot arguments in /scripts/devicetree.tcl

Code: Select all

set boot_args {console=ttyPS0,115200 root=/dev/mmcblk0p2 ro rootfstype=ext4 earlyprintk rootwait uio_pdrv_genirq.of_id=generic-uio}
5.) call the following command to rebuild the device tree (can be done quicker by running the command @pavel posted):
$ make Name=red_pitaya_0_92 all

6.) copy boot.bin, devicetree.dtb, uImage to the sd card

7.) reboot red pitaya

8.) check if /dev/uio0 is there:
$ ls /dev/uio0

@pavel: my uio.dtsi file looks a bit different than your pl.dtsi file.... what is amba_pl?

@pavel: i saw your correctly modified the offset in the blink example :)

Code: Select all

*(uint32_t *)(ptr + 0x30) ^= (1 << 3);

pavel
Posts: 799
Joined: Sat May 23, 2015 5:22 pm

Re: Basic project with Vivado 2014.3 and Ubuntu 14.04

Post by pavel » Sun May 24, 2015 8:45 pm

do you think it makes sense to add this patch to your repo?
No, thanks. This patch will break all my other projects. They are all compatible with the Xilinx devicetree generator and they don't need any patching.

I think that it makes more sense to add this patch to the RedPitaya repository.

Arnold
Posts: 54
Joined: Wed Mar 11, 2015 3:07 pm

Re: Basic project with Vivado 2014.3 and Ubuntu 14.04

Post by Arnold » Sun May 24, 2015 9:19 pm

"they all break your projects" because you automatically generate the device tree?

i idea would be to only enable the patch for the red_pitaya project in your repo...

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 101 guests