cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
332 Views
Registered: ‎01-23-2018

Interrupt handling with UIO

hello, I'm trying to port a baremetal design, in which I have a simple HLS IP that performs vector additions, that triggers an interrupt when it finishes its computation.


This is my Vivado block design:

Schermata da 2019-06-14 15-35-00.png

Then after the bitstream generation I exported the hdf and I generated the Petalinux project based on it, in which I specified "generic-uio" in the compatible field as follows:

amba_pl: amba_pl {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "simple-bus";
		ranges ;
		&irq_gen_0: irq_gen@43c00000 {
			clock-names = "ap_clk";
			clocks = <&clkc 15>;
			compatible = "generic-uio";
			interrupt-names = "interrupt";
			interrupt-parent = <&intc>;
			interrupts = <0 29 4>;
			reg = <0x43c00000 0x10000>;
			xlnx,s-axi-axilites-addr-width = <0xb>;
			xlnx,s-axi-axilites-data-width = <0x20>;
		};
	};

After booting Linux on my Zedboard, I can see the uio device, and the interrupt:

Schermata da 2019-06-14 15-39-05.png

then I created a simple application that starts my IP, using the UIO drivers generated through Vivado HLS:

int a[N];
	int b[N];

	for(int i = 0; i < N; ++i) {
		a[i] = i;
		b[i] = i;
	}

	XIrq_gen HLSdevice;
	XIrq_gen_Initialize(&HLSdevice, "irq_gen");
	XIrq_gen_Write_a_Words(&HLSdevice, 0, a, N);
	XIrq_gen_Write_b_Words(&HLSdevice, 0, b, N);

	XIrq_gen_Start(&HLSdevice);

	while(!XIrq_gen_IsDone(&HLSdevice));

	XIrq_gen_Release(&HLSdevice);

Finally after this program finish its execution if I check /proc/interrupts, I don't see any interrupt generated by the HLP IP, I don't think that is a design issue, because the same example works on baremetal.

Could anyone help? thanks 

0 Kudos
0 Replies