Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use interrupt with local ip interrupt controller

Status
Not open for further replies.
I think APB interface in my interrupt, It's ok when I use code below
Code:
void MyINTC_Initialize()
{
	Xil_Out8(sysclr, 0x01);
	Xil_Out8(ier,    0xff);
	Xil_Out8(iscra,  0x55);
	Xil_Out8(iscrb,  0x55);
	Xil_Out8(ipra,   0x10);
	Xil_Out8(iprb,   0x32);
	Xil_Out8(iprc,   0x54);
	Xil_Out8(iprd,   0x76);
	Xil_Out8(ipre,   0x98);
	Xil_Out8(iprf,   0xcc);
}
Then I use XMD console with mrd to read data from my register, result is the same with above code. But have some problem with my interrupt sources
Can you have solotion to resolve this warning from DRC ???

- - - Updated - - -

I don't know why interrupt, interrupt_address and interrupt_ack driven to GND. In the bus tab, bus interrupt's microblaze has connected to my bus interrupt's IP.


h1.png
 

I think APB interface in my interrupt, It's ok when I use code below
Code:
void MyINTC_Initialize()
{
	Xil_Out8(sysclr, 0x01);
	Xil_Out8(ier,    0xff);
	Xil_Out8(iscra,  0x55);
	Xil_Out8(iscrb,  0x55);
	Xil_Out8(ipra,   0x10);
	Xil_Out8(iprb,   0x32);
	Xil_Out8(iprc,   0x54);
	Xil_Out8(iprd,   0x76);
	Xil_Out8(ipre,   0x98);
	Xil_Out8(iprf,   0xcc);
}
Then I use XMD console with mrd to read data from my register, result is the same with above code. But have some problem with my interrupt sources
Can you have solotion to resolve this warning from DRC ???

- - - Updated - - -

I don't know why interrupt, interrupt_address and interrupt_ack driven to GND. In the bus tab, bus interrupt's microblaze has connected to my bus interrupt's IP.


View attachment 101426

this is not how you test that your interupt is working. you should have wrote some code,
and print something or blink led when your interuot processed.

i think you have problem with your mpd file. i think some of your signals are not part of interupt bus, so they should be excluded from bus and connected directly.
compare it to other intc mpd like axi_intc. make sure everything is being connect properly before you try to generate the bsp.
 

I have just connect 3 signal interrupt, interrupt_address, interrupt_ack invidiual, so DRC not warning driven to GND any more

Code:
WARNING:EDK:4180 - PORT: tdi_in, CONNECTOR: bscan_tdi - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 101 
WARNING:EDK:4180 - PORT: reset_in, CONNECTOR: bscan_reset - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 102 
WARNING:EDK:4180 - PORT: shift_in, CONNECTOR: bscan_shift - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 103 
WARNING:EDK:4180 - PORT: update_in, CONNECTOR: bscan_update - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 104 
WARNING:EDK:4180 - PORT: sel_in, CONNECTOR: bscan_sel1 - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 105 
WARNING:EDK:4180 - PORT: drck_in, CONNECTOR: bscan_drck1 - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 106 
WARNING:EDK:4180 - PORT: capture_in, CONNECTOR: bscan_capture - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 107 
WARNING:EDK:4181 - PORT: ext_event, CONNECTOR: ext_event - floating connection - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 37 
WARNING:EDK:4181 - PORT: irq_in, CONNECTOR: irq_in - floating connection - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 39 
WARNING:EDK:4181 - PORT: tdo_out, CONNECTOR: bscan_tdo1 - floating connection - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 108 
WARNING:EDK:4059 - INSTANCE: microblaze_0, Overriding connection of PORT: INTERRUPT, VALUE: interrupt_request_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 105
WARNING:EDK:4059 - INSTANCE: microblaze_0, Overriding connection of PORT: INTERRUPT_ADDRESS, VALUE: interrupt_address_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 105
WARNING:EDK:4059 - INSTANCE: microblaze_0, Overriding connection of PORT: INTERRUPT_ACK, VALUE: interrupt_acknowledge_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 105
WARNING:EDK:4059 - INSTANCE: intc_0, Overriding connection of PORT: req_int, VALUE: interrupt_request_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 276
WARNING:EDK:4059 - INSTANCE: intc_0, Overriding connection of PORT: vect_int, VALUE: interrupt_address_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 276
WARNING:EDK:4059 - INSTANCE: intc_0, Overriding connection of PORT: i, VALUE: interrupt_acknowledge_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 276

- - - Updated - - -

this is not how you test that your interupt is working. you should have wrote some code,
and print something or blink led when your interuot processed.

i think you have problem with your mpd file. i think some of your signals are not part of interupt bus, so they should be excluded from bus and connected directly.
compare it to other intc mpd like axi_intc. make sure everything is being connect properly before you try to generate the bsp.

I really wanna write some interrupt handle for myIP but no ID interrupt source generate in xparameter.h . Can I insert ID interrupt source in xparameter.h ??
About bus interrupt of microblaze. at microblaze version 8.5, 3 signal interrupt, interrupt_address, interrupt_ack is connected as a bus interface. At beginning, 3 signal in myIP dont connect like a bus and can not connect with interrupt bus of Microblaze, so I have inserted some line code in my IP mpb file which merge 3 signal in my IP as a bus interface.
 

I have just connect 3 signal interrupt, interrupt_address, interrupt_ack invidiual, so DRC not warning driven to GND any more

Code:
WARNING:EDK:4180 - PORT: tdi_in, CONNECTOR: bscan_tdi - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 101 
WARNING:EDK:4180 - PORT: reset_in, CONNECTOR: bscan_reset - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 102 
WARNING:EDK:4180 - PORT: shift_in, CONNECTOR: bscan_shift - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 103 
WARNING:EDK:4180 - PORT: update_in, CONNECTOR: bscan_update - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 104 
WARNING:EDK:4180 - PORT: sel_in, CONNECTOR: bscan_sel1 - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 105 
WARNING:EDK:4180 - PORT: drck_in, CONNECTOR: bscan_drck1 - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 106 
WARNING:EDK:4180 - PORT: capture_in, CONNECTOR: bscan_capture - No driver found. Port will be driven to GND - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 107 
WARNING:EDK:4181 - PORT: ext_event, CONNECTOR: ext_event - floating connection - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 37 
WARNING:EDK:4181 - PORT: irq_in, CONNECTOR: irq_in - floating connection - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 39 
WARNING:EDK:4181 - PORT: tdo_out, CONNECTOR: bscan_tdo1 - floating connection - E:\Xilinx\14.6\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\chipscope_icon_v1_06_a\data\chipscope_icon_v2_1_0.mpd line 108 
WARNING:EDK:4059 - INSTANCE: microblaze_0, Overriding connection of PORT: INTERRUPT, VALUE: interrupt_request_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 105
WARNING:EDK:4059 - INSTANCE: microblaze_0, Overriding connection of PORT: INTERRUPT_ADDRESS, VALUE: interrupt_address_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 105
WARNING:EDK:4059 - INSTANCE: microblaze_0, Overriding connection of PORT: INTERRUPT_ACK, VALUE: interrupt_acknowledge_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 105
WARNING:EDK:4059 - INSTANCE: intc_0, Overriding connection of PORT: req_int, VALUE: interrupt_request_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 276
WARNING:EDK:4059 - INSTANCE: intc_0, Overriding connection of PORT: vect_int, VALUE: interrupt_address_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 276
WARNING:EDK:4059 - INSTANCE: intc_0, Overriding connection of PORT: i, VALUE: interrupt_acknowledge_microblaze - which is part of the connected BUSIF: INTERRUPT - E:\Xilinx\14.6\ISE_DS\workspace\PROJECT_TEST_1\system.mhs line 276

- - - Updated - - -



I really wanna write some interrupt handle for myIP but no ID interrupt source generate in xparameter.h . Can I insert ID interrupt source in xparameter.h ??
About bus interrupt of microblaze. at microblaze version 8.5, 3 signal interrupt, interrupt_address, interrupt_ack is connected as a bus interface. At beginning, 3 signal in myIP dont connect like a bus and can not connect with interrupt bus of Microblaze, so I have inserted some line code in my IP mpb file which merge 3 signal in my IP as a bus interface.

i understood now why it didn't connect - you made changes to the mb mpd file itself before so you disconnected it's bus affiliation.

this are the lines you modified in mb :
PORT INTERRUPT = Interrupt, DIR = I, LEVEL = HIGH, SIGIS = INTERRUPT##, BUS = INTERRUPT
PORT INTERRUPT_ADDRESS = Interrupt_Address, DIR = I, VEC = [0:31]##, BUS = INTERRUPT
PORT INTERRUPT_ACK = Interrupt_Ack, DIR = O, VEC = [0:1]##, BUS = INTERRUPT

also i think you still have not connected ports like : ext_event - floating connection, and irq_in - floating connection, which is suspicious.
 
i understood now why it didn't connect - you made changes to the mb mpd file itself before so you disconnected it's bus affiliation.

this are the lines you modified in mb :
PORT INTERRUPT = Interrupt, DIR = I, LEVEL = HIGH, SIGIS = INTERRUPT##, BUS = INTERRUPT
PORT INTERRUPT_ADDRESS = Interrupt_Address, DIR = I, VEC = [0:31]##, BUS = INTERRUPT
PORT INTERRUPT_ACK = Interrupt_Ack, DIR = O, VEC = [0:1]##, BUS = INTERRUPT

also i think you still have not connected ports like : ext_event - floating connection, and irq_in - floating connection, which is suspicious.

PORT INTERRUPT = Interrupt, DIR = I, LEVEL = HIGH, SIGIS = INTERRUPT##, BUS = INTERRUPT
PORT INTERRUPT_ADDRESS = Interrupt_Address, DIR = I, VEC = [0:31]##, BUS = INTERRUPT
PORT INTERRUPT_ACK = Interrupt_Ack, DIR = O, VEC = [0:1]##, BUS = INTERRUPT

so I should uncomment it,right ???
With ext_event,irq_in, you have any solution to resolve it
 

PORT INTERRUPT = Interrupt, DIR = I, LEVEL = HIGH, SIGIS = INTERRUPT##, BUS = INTERRUPT
PORT INTERRUPT_ADDRESS = Interrupt_Address, DIR = I, VEC = [0:31]##, BUS = INTERRUPT
PORT INTERRUPT_ACK = Interrupt_Ack, DIR = O, VEC = [0:1]##, BUS = INTERRUPT

so I should uncomment it,right ???
With ext_event,irq_in, you have any solution to resolve it

i think it's best, and in your ip add back the bus affiliation to the 3 sig.
about ext_event,irq_in - i think you need to sepcify LOC PINS in UCF file.
 

how about ID interrupt source ?
aruipksn

i hope your h/w is working and connected.
as i said before, you need to supply a driver to you custom pcore (intc with some modifications).
as for now you didn't supply any, and if you open the system.mss file you see your driver not exist.
the apb bridge has a generic driver, that allow it to post it's address range to xparameters.h file (using generic.tcl) ,
this is how you manage to write and read to it.
the xilinx intc driver has intc.tcl file that supply the relevant data to xparamers.h. so you need it.
best thing for you to my opinion, is copy xilinx intc to your repositry (and sdk workspace if needed) and change it to your needs.
 
aruipksni,

all signal have connected. now I build application interrupt handle for my SoPC. I have some problem here. I have 1 interrupt interrupt from AXI timer.
Main program: just a simple shift 8 led.
MyINTC_Initialize(): Initialize my interrupt controller ( enable interrupt, detect sensing edge/level, program priority for invidual interrupt )
TIMER_Initialize(): Initialize timer, generate mode, enable timer/interrupt, auto reload value
Interrupt handle:TmrHandler1
just count 0-9 display on led 7 segment when timer overload per 1 seconds.

I have proplem here:
The first, main program run normally until Timer overload, interrupt handle is executed just one time ( led 7 sigment display "1"). Then everything stop, don't run any more. I have clear timer interrupt but MicroBlaze can not return from interrupt. I don't know why it happen.

I hope you can help me this time again.

Thanks in advance

Code:
int main()
  {
        MyINTC_Initialize();
	XGpio_Initialize(&leds,XPAR_LEDS_8BITS_DEVICE_ID);
	XGpio_SetDataDirection(&leds,1,0);

	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,(Xil_ExceptionHandler) TmrHandler1,0x79400000);

        microblaze_enable_interrupts();
        TIMER_Initialize();

        while(1)
         {
       	      TTCD=0x00;
	      for(j=8;j>0;j--)
     		{
			 XGpio_DiscreteWrite(&leds,1,TTCD);
			for(Delay=0;Delay<LED_DELAY;Delay++);
			 TTDC=0x01;
			for(i=0;i<j;i++)
			 {
				 XGpio_DiscreteWrite(&leds,1,TTCD|TTDC);
				 for(Delay=0;Delay<LED_DELAY;Delay++);
				TTDC=TTDC<<1;
 			}
	       TTCD=(TTCD>>1)|0x80;
		 }

         }
}


int TmrHandler1()
{
	u32 ssBuf;
	ssVal++;
	if (ssVal == 10)
	  {
		ssVal = 0;
	  }
	ssBuf = (ssVal) | (ssVal << 4) | (ssVal << 8) | (ssVal << 12);
	Xil_Out32(SS_BASEADDR + bSsgHexData, ssBuf);
	for(Delay=0;Delay<LED_DELAY;Delay++);
	Xil_Out32(TMR1_BASEADDR + 0x00, 0x000001D2); //clear interrupt flag
	return 0;

}

void MyINTC_Initialize()
{
	Xil_Out8(sysclr, 0x03);
	Xil_Out8(ier,    0xff);
	Xil_Out8(iscra,  0x55);
	Xil_Out8(iscrb,  0x55);
	Xil_Out8(ipra,   0x00);
	Xil_Out8(iprb,   0x00);
	Xil_Out8(iprc,   0x00);
	Xil_Out8(iprd,   0x00);
	Xil_Out8(ipre,   0x00);
	Xil_Out8(iprf,   0x00);
}

void TIMER_Initialize()
{
    Xil_Out32(TMR1_BASEADDR + bTmrTLR0, lTmrLoadVal1);
    Xil_Out32(TMR1_BASEADDR + bTmrTCSR0, bitTmrLoad);
    Xil_Out32(TMR1_BASEADDR + bTmrTCSR0, fsTmrRun);

}
 

aruipksni,

all signal have connected. now I build application interrupt handle for my SoPC. I have some problem here. I have 1 interrupt interrupt from AXI timer.
Main program: just a simple shift 8 led.
MyINTC_Initialize(): Initialize my interrupt controller ( enable interrupt, detect sensing edge/level, program priority for invidual interrupt )
TIMER_Initialize(): Initialize timer, generate mode, enable timer/interrupt, auto reload value
Interrupt handle:TmrHandler1
just count 0-9 display on led 7 segment when timer overload per 1 seconds.

I have proplem here:
The first, main program run normally until Timer overload, interrupt handle is executed just one time ( led 7 sigment display "1"). Then everything stop, don't run any more. I have clear timer interrupt but MicroBlaze can not return from interrupt. I don't know why it happen.

I hope you can help me this time again.

Thanks in advance

Code:
int main()
  {
        MyINTC_Initialize();
	XGpio_Initialize(&leds,XPAR_LEDS_8BITS_DEVICE_ID);
	XGpio_SetDataDirection(&leds,1,0);

	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,(Xil_ExceptionHandler) TmrHandler1,0x79400000);

        microblaze_enable_interrupts();
        TIMER_Initialize();

        while(1)
         {
       	      TTCD=0x00;
	      for(j=8;j>0;j--)
     		{
			 XGpio_DiscreteWrite(&leds,1,TTCD);
			for(Delay=0;Delay<LED_DELAY;Delay++);
			 TTDC=0x01;
			for(i=0;i<j;i++)
			 {
				 XGpio_DiscreteWrite(&leds,1,TTCD|TTDC);
				 for(Delay=0;Delay<LED_DELAY;Delay++);
				TTDC=TTDC<<1;
 			}
	       TTCD=(TTCD>>1)|0x80;
		 }

         }
}


int TmrHandler1()
{
	u32 ssBuf;
	ssVal++;
	if (ssVal == 10)
	  {
		ssVal = 0;
	  }
	ssBuf = (ssVal) | (ssVal << 4) | (ssVal << 8) | (ssVal << 12);
	Xil_Out32(SS_BASEADDR + bSsgHexData, ssBuf);
	for(Delay=0;Delay<LED_DELAY;Delay++);
	Xil_Out32(TMR1_BASEADDR + 0x00, 0x000001D2); //clear interrupt flag
	return 0;

}

void MyINTC_Initialize()
{
	Xil_Out8(sysclr, 0x03);
	Xil_Out8(ier,    0xff);
	Xil_Out8(iscra,  0x55);
	Xil_Out8(iscrb,  0x55);
	Xil_Out8(ipra,   0x00);
	Xil_Out8(iprb,   0x00);
	Xil_Out8(iprc,   0x00);
	Xil_Out8(iprd,   0x00);
	Xil_Out8(ipre,   0x00);
	Xil_Out8(iprf,   0x00);
}

void TIMER_Initialize()
{
    Xil_Out32(TMR1_BASEADDR + bTmrTLR0, lTmrLoadVal1);
    Xil_Out32(TMR1_BASEADDR + bTmrTCSR0, bitTmrLoad);
    Xil_Out32(TMR1_BASEADDR + bTmrTCSR0, fsTmrRun);

}
i'm not a sw expert
it look like registration problem, you can't return - that mean callback info not saved.
i'm not sure about Xil_ExceptionRegisterHandler, are you not to do your own registration code
like XIntc_RegisterHandler() ?
 

I wanna access in a register like a bit. Example :

u32 ISR = Xil_In32(TMR1_BASEADDR + bTmrTCSR0);
if (ISR[8] == 1)
function();
else
fuction1();

But this error "subscripted value is neither array nor pointer nor vector" happen.
 

I know microblaze support fast interrupt mode with 3 signal: interrupt, interrupt_address and interrupt_ack. So I connect these signal to 3 corresspond signal in my interrupt controller. I have some question here:
1)If i wanna use fast interrupt, so interrupt handler has a format below, right ???
Code:
void interrupt_handler_name() __attribute__((fast_interrupt));
2)In my interrupt controller.how range of address, i have to generate for using fast interrupt mode ???
I read microblaze's document, vector address 0x10 - 0x14. so my interrupt must generate vector address range 0x10 - 0x14. Hope your helps

Best Regards,
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top