WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2015-Dec-01 06:03:59

linron
Member
Registered: 2015-Dec-01
Posts: 9

obtain a timestamp in the OFDM reference design

Hi,

I want to get a RX timestamp (say RX_TIME) when receive a frame  and then transmit another frame at RX_TIME+X (where X is a positive Integer), based on the OFDM reference design. It seems that the OFDM reference design does not support such operations, because there is no API in warp_phy.c or warp_mac.c.  (BTW, the 802.11 reference project seems can do so.)

How should I do if I want to realize it (based on OFDM reference design)?

Thank you.

Last edited by linron (2015-Dec-01 06:06:02)

Offline

 

#2 2015-Dec-01 09:45:05

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

Re: obtain a timestamp in the OFDM reference design

You're right -- that's easy to do in the 802.11 reference design but more challenging in the old OFDM reference design. You'd need to add logic to the OFDM receiver that captures the output of a counter at the time of a reception and provides that value to code via a register.

Is there any particular reason you are sticking with the OFDM Reference Design? If you are able to, I highly suggest moving to the 802.11 Reference Design. It's a significant upgrade in performance and usability as compared to the older OFDM Reference Design.

Offline

 

#3 2015-Dec-02 01:39:11

linron
Member
Registered: 2015-Dec-01
Posts: 9

Re: obtain a timestamp in the OFDM reference design

Thank you for your reply.

The reason is that I plan to design my customized MAC layer based upon "no mac.c", which is a good start for me to understand the whole system and to modify it. Actually, the MAC I want to design is rather simple: Receive a frame and get the timestamp of the reception,  send another frame at a specified time using the timestamp, receive the next frame and get its timestamp ...so on and so forth.

In fact, I mainly focus on the physical layer, in which I verify and implement my new decoding method (I also need to redesign some hardware logics in FPGA in the next step). Therefore, I firstly modify the TX-RX scheme in MAC layer, and then work on the second.   

BTW, I use the nomac.c to send out a frame, and modify the function warpmac_prepPhyForXmit in the warpmac.c, as below:

void warpmac_prepPhyForXmit(Macframe* packet, unsigned char buffer, Xuint32 payload_len, unsigned char* tx_payload) {
...
memcpy( (void *) warpphy_getBuffAddr(buffer), (void *) packet, (size_t) (NUM_HEADER_BYTES));
warpmac_waitForDMA();
XDmaCentral_SetControl(&DmaCentralInst, XDMC_DMACR_DEST_INCR_MASK);
tx_pktBufPtr = (void *)warpphy_getBuffAddr(controlStruct.pktBuf_phyTx)+NUM_HEADER_BYTES;
        XDmaCentral_Transfer(&DmaCentralInst,
                        (u8 *) tx_payload,
                        (u8 *) tx_pktBufPtr,
                        payload_len);
...
}
where *tx_payload is the pointer of the payload I want to send and payload_len is its length in byte. Rather strangely, DMA seems not work at all (The receive only receives the header but without payload). If I use the memcpy to replace the DMA, it can work properly, as following:
memcpy( (void *) warpphy_getBuffAddr(controlStruct.pktBuf_phyTx)+NUM_HEADER_BYTES, (void *) tx_payload, (size_t) (payload_len));

Can you tell me the reason for that? Thank you.

Last edited by linron (2015-Dec-02 01:54:06)

Offline

 

#4 2015-Dec-02 07:55:11

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

Re: obtain a timestamp in the OFDM reference design

The reason is that I plan to design my customized MAC layer based upon "no mac.c", which is a good start for me to understand the whole system and to modify it. Actually, the MAC I want to design is rather simple: Receive a frame and get the timestamp of the reception,  send another frame at a specified time using the timestamp, receive the next frame and get its timestamp ...so on and so forth.

We also provide a nomac implementation for the 802.11 reference design. It implements the same behavior as the nomac in the OFDM ref design - every Tx packet passed down from above is transmitted immediately, every Rx packet is passed up the stack without filtering. If you're using WARP v3 hardware, I would *strongly* encourage you to use the 802.11 design for your application. As Chris mentioned the 802.11 design already implements microsecond timestamps for all Tx/Rx events, which would definitely simplify your design.

Rather strangely, DMA seems not work at all (The receive only receives the header but without payload). If I use the memcpy to replace the DMA, it can work properly,

What memory section is the "tx_payload" array allocated in? The DMA cannot access the DLMB (data local memory bus); the LMB memories are attached directly to the MicroBlaze core and cannot be accessed by master devices on the AXI interconnects.

Offline

 

#5 2015-Dec-03 04:00:09

linron
Member
Registered: 2015-Dec-01
Posts: 9

Re: obtain a timestamp in the OFDM reference design

Okay, I see. I briefly viewed the wlan_mac_nomac.c in 802.11 reference design. I think it is helpful for my application. I decide to move to this reference design.

For the data transfer via DMA, "tx_payload" has been assigned in the nomac.c, such as "char *tx_payload = "abcd". According to your explanation, the DMA cannot access the LMB, so such operation fails. In addition, since the memcpy may not be applicable for a large payload and a fast data transfer, the sole choice is to use Ethernet in my subsequent work (in the 802.11 reference design).

Offline

 

#6 2015-Dec-03 08:26:01

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

Re: obtain a timestamp in the OFDM reference design

In addition, since the memcpy may not be applicable for a large payload and a fast data transfer, the sole choice is to use Ethernet in my subsequent work (in the 802.11 reference design).

The 802.11 ref design uses the WARP v3 DRAM, providing a large memory block for various functions. Most of the DRAM is reserved for the Tx queue and the wlan_exp log.

However the design reserves 14MB of the DRAM as "user scratch" space, available for use by new applications. This allocation is defined in wlan_mac_high.h. You can assign pointers to the scratch space address using the USER_SCRATCH_BASE macro. Be careful not to write memory above the scratch space (> USER_SCRATCH_HIGH ), to avoid corrupting the Tx queue or log.

The entire DRAM is accessible by the DMAs in the 802.11 hardware design (central DMA for moving data to/from packet buffers, axi_dma for moving data to/from ETH A).

Offline

 

Board footer