WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2012-Oct-30 17:42:44

JaeYoung Kim
Member
Registered: 2012-May-07
Posts: 17

how to code interrupt service routine in the MAC code?

Hello.

I'm WARPv.2 user.

I would like to transmit a packet at the exact predefined time. One of methods I'm thinking about is that using one of timers provided, I like to make interrupt service routine which starts transmission when designated timer is expired.

Current reference code provides polling methods only and so, it's difficult to find reference code design of interrupt service routine in the WARP.

So, my question is where or how can I find useful reference code to do what I described in the above?

Offline

 

#2 2012-Oct-30 21:22:05

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: how to code interrupt service routine in the MAC code?

You could add an interrupt controller and xps_timer to the WARPLab design without changing any of the other cores. This would probably be the easiest way to get an interrupt-based timer working.

What would trigger the timers? Another option would be to implement a delay Tx in the WARPLab Sysgen core itself. You could add a large counter that is started by the normla WARPLab trigger, then trigger the Tx/Rx state machines after the counter hits its target. This would be even lower-jitter than an interrupt-based timer, since software wouldn't be involved. The downside here would be leaving the radio Tx enabled the whole time (i.e. the WARPLab core would drive zeros until the counter expired, but the MAX2829 and PA would be on the whole time).

Offline

 

#3 2012-Oct-30 22:19:15

JaeYoung Kim
Member
Registered: 2012-May-07
Posts: 17

Re: how to code interrupt service routine in the MAC code?

Thanks for your reply. My purpose is like this. Node wants to transmit a packet exactly at a specified time ( us precision ). So, I set up a timer and doing my normal routine ( processing received packets. etc ). When the timer expires, ISR routine executes and starts packet transmission. The reason why I want to use ISR is that transmit packets at exact time is most important thing in my design. So, If I'm doing this as in the reference design by polling base, then sometimes, time slips too much before transmitting packets.

Actually, I'm working on WARP real-time reference design (not the WARPLab). My design is somewhat modified from reference but basically, based on OFDM reference design. So, could you explain a little bit more specifically based on MAC code of reference design? (maybe you can link some example codes for ISR routine or reference tutorials). I don't know where to start making ISR routine.

Offline

 

#4 2012-Oct-30 23:24:37

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: how to code interrupt service routine in the MAC code?

Ah, sorry; I shouldn't have assumed WARPLab.

Adding an interrupt controller to the OFDM ref design is also doable. You'd have to instantiate an xps_intc and xps_timer and connect the xps_timer interrupt output to the intc. Then you'd need to add the interrupt controller and timer setup code to your MAC. I don't have an easy reference for this- our MAC designs have been polling-based for a long time (primarily to minimize latency in reacting to Rx events, at the cost of higher jitter). The xps_timer driver includes some sample code for an interrupt based design. Look in EDK_root/sw/XilinxProcessorIPLib/drivers/tmrctr_X/examples/.

Another option would be to skip the interrupt controller entirely, and trigger the OFDM transmission entirely from hardware. The OFDM core supports this via the Ext_TxEn port. Driving this port high is equivalent to starting a transmission from software. We added this logic to support our cooperative designs, so we could perfectly synchronize simultaneous transmissions from two nodes to establish a baseline for later over-the-air synchronization.

You could modify the warp_timer core to add a top-level output that asserts when one of the sub-timers expires, then tie this output to the PHY Tx input. The xps_timer core might have a top-level output too (maybe even its interrupt output; I'm not sure).

You would need to be careful about software state. In this flow the PHY would transmit without software "knowing". If the software attempts new transmission while one is already running, bad state could result. You can check the PHY state with warpphy_waitForTx(). Stopping the timer before attempting a software Tx would work too.

Offline

 

Board footer