WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2015-Mar-25 02:12:49

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Time consumed by some warpmac functions

Hello ,

I'm trying to make the following communication between two boards:
On the transmitting side:
1.randomly select one of the channels (0,1,2) with rand() % 3 and put that information in header
2.go to that channel and perform sensing
3.put that information in header of request packet
4.go back to control channel,send request packet and start timer
On the receiving side:
1. receive request and extract information about channel
2. go to that channel and perform sensing
3. put that information in reply packet header
4. go back to control channel and send that packet back

First i set timeout to be 120 microseconds and every time reply packet was coming after timeout. After that i set 300 microseconds and again reply is coming after timeout. At the end i put 10000 microseconds and receive reply in timeout.

Is it possible that all this processing needs so much time? I don't know now how much exactly but certainly it takes more than 300 microseconds which is very long. Am i doing something wrong?

Offline

 

#2 2015-Mar-25 10:03:03

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Time consumed by some warpmac functions

I'm not sure, you will need to dig in an try to see how much time you expect each operation to take.

Just remember, that, for WARPv3, this code is running on an single threaded processor running at 160 MHz and does not use interrupts.  This means that the processor executes 160 clock cycles per microsecond, which can do a lot but you have to take that into account when you are thinking about timing.  Also, the fact that the processor is single threaded and does not use interrupts means that everything is executed serially.  If you poll for a register to change, the processor doesn't do anything else until that poll completes.  In a fully polled system, like the OFDM reference design, you should always just do the minimum amount to check that something needs to be done and not block the processor execution until that something needs to be done (ie use a loop to wait on a condition).

Offline

 

#3 2015-Mar-26 07:19:12

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Re: Time consumed by some warpmac functions

I'm not using any kind of loops. Just several if statements and rand() function. I asked earlier about warpphy_setChannel execution time and got answer that it takes approximately 25 microseconds. I change channel two times so that should take about 50 microseconds. What is the value of DIFS in sensing logic. How much time does warpmac_carrierSense() take to complete.

Offline

 

#4 2015-Mar-26 09:25:03

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: Time consumed by some warpmac functions

warpmac_carrierSense() should be fast. It's just a single register read (see source). Each of the steps you have listed above can be characterized to figure out exactly how much time each is taking. You'll need to perform that characterization to narrow down what is going on. One option would be to use the "warpmac_setDebugGPIO()" function and explicitly measure the duration of each step using an oscilloscope probing the debug pins of the board. Another option is to instantiate a timer core and explicitly timestamp the moments in between those steps and then print them out. Either of those two approaches will help you figure out which step is taking the most time.

Offline

 

#5 2015-Mar-30 15:51:18

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Re: Time consumed by some warpmac functions

I managed to get my boards to communicate. Using printfs i can see that control packets are being exchanged. Also data and ack packets. This communication comes from default traffic from host. My transmitter is 10.0.0.2 and receiver 10.0.0.1. Using wireshark i can see that data from 10.0.0.2 is coming to 10.0.0.1. But when i try ping i get Destination host unreachable and i disabled firewall. I can't figure out what is the problem. Can you help me with this?

Also i would like to know how to print current value of timer.

Thank you

Last edited by juvebogdan (2015-Mar-30 15:53:23)

Offline

 

#6 2015-Mar-31 09:07:42

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Time consumed by some warpmac functions

If you look in the XPS project, you can see that the OFDM reference design uses an XPS timer.  Therefore, it is easy to find the timer documentation to see how to read the current value of the timer.

To help debug, you should first start by having both PCs on a common switch (ie take the wireless link out of the equation) and make sure that the two PCs can communicate.  For your OS, there are a number of on-line resources to help resolve communication issues.  Once the two PCs can successfully communicate, then add in the wireless link and see if they still able to communicate.  If they cannot, then you need to be careful that you are not filtering out IMCP messages or changing the packet as it flows through the node.

Offline

 

#7 2015-Apr-01 00:37:46

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Re: Time consumed by some warpmac functions

Thank you.

I saw in warpmac.h that TIMERCLK_CYCLES_PER_USEC is set to 80. Shouldn't that be 160 since processor clock is 160MHz?

Offline

 

#8 2015-Apr-01 00:55:29

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Time consumed by some warpmac functions

You have to look at the clock that is being fed to the timer itself.  There are a number of clocks within the design (160 MHz, 80 MHz, 40 MHz, etc.  see clock_generator_ProcBusSamp_Clocks in the MHS file).

Inside the system.mhs file for the OFDM reference design, you can see how the timer is connected:

Code:

BEGIN xps_timer
 PARAMETER INSTANCE = xps_timer_0
 PARAMETER HW_VER = 1.02.a
 PARAMETER C_BASEADDR = 0x83c00000
 PARAMETER C_HIGHADDR = 0x83c0ffff
 BUS_INTERFACE SPLB = plb_secondary_80MHz
END

Given that you are not explicitly connecting the clock port, the timer defaults to the speed of the bus interface (i.e. 80 MHz).  Therefore, the cycles per usec is 80.

Offline

 

#9 2015-Apr-02 16:33:00

juvebogdan
Member
Registered: 2013-Sep-17
Posts: 76

Re: Time consumed by some warpmac functions

Ok.
I have this strange problem. As soon as i power on my board phyRx_badHeader_callback is getting called all the time although i power on only one board.

Offline

 

Board footer