WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2009-Jun-16 12:45:42

s2haile
Member
Registered: 2008-Jan-23
Posts: 14

Adding WARPxilnet to MSS file

I am integrating parts of WARPLAB to parts of the real-time reference design to allow data transfer between MATLAB and the FPGA while leaving the real-time signal processing in the FPGA. Using two WARP nodes, commands issued from MATLAB can trigger either FPGA to initiate wireless transmission among other things. This is near completed, but I have ran into an issue I can't seem to fix. The hardware compiles fine, but there is an issue with the software. When I add the WARPxilnet library to the MSS file I get the following error:

C:\WARP\Reference_Designs\OFDM_ReferenceDesign_v11_2_chanMem\system.mss line
   239 - Peripheral instance Ethernet_MAC is not a valid IP for PARAMETER
   emac_instname !

This is with reference to the emac_instname parameter in the library, which is the same name as the hardware instance in the MHS file. I tried commenting it out and adding the xilnet headers manually but I ran into more problems. The WARPxilnet library is version 2.00.a, the emaclite driver is version 1.13.a (and also uses the same instance name) and the EMAC h/w block is version 2.00.b. Are there any other configuration files I would need to change?

Thanks,
SH

Offline

 

#2 2009-Jun-16 13:25:20

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

Re: Adding WARPxilnet to MSS file

It looks like you did everything right; I'm not sure what the problem is.

Try this- in the mss file, remove the line " PARAMETER emac_instname = Ethernet_MAC". Then open the Software Platform Settings window, select OS and Libraries and expand WARPxilnet. In the drop-down for emac_instance, is Ethernet_MAC an option?

Offline

 

#3 2009-Jun-16 14:28:33

s2haile
Member
Registered: 2008-Jan-23
Posts: 14

Re: Adding WARPxilnet to MSS file

I commented the emac_instname parameter out and tried to compile... it correctly copied over the xilnet source files from the repository to the project space but it generated an error because the driver didn't have a handle to the emac. When I expanded warpxilnet from the Software Platform Settings dialog box the emac_instname parameter came up empty under both conditions (emac_instname commented and uncommented). I am not sure why this is so, has anyone on your team ran into something like this?

Thanks,
SH

Offline

 

#4 2009-Jun-16 14:39:56

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

Re: Adding WARPxilnet to MSS file

In your WARPxilnet MLD file (sw_services/WARPxilnet_v2_00_a/data/WARPxilnet_v2_1_0.mld), does the "PARAM name = emac_instname" line include "xps_ethernetlite" (like the latest version in the repository)? This line tells XPS which EMAC cores satisfy the library's requirements.

Offline

 

#5 2009-Jun-16 15:09:25

s2haile
Member
Registered: 2008-Jan-23
Posts: 14

Re: Adding WARPxilnet to MSS file

Yes, it includes xps_ethernetlite as a supported type... I even tried to change the default to the instance name and commented out the parameter in the MSS file to no avail. If you think of anything else that could cause the problem that would be great... for now I guess I'll post it on the Xilinx forum.

Thanks,
SH

Offline

 

#6 2009-Jun-16 16:07:05

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

Re: Adding WARPxilnet to MSS file

Double check that XPS is reading the copy of WARPxilnet you think it is (by renaming the folder or changing the library version number). Maybe it's reading a different copy that doesn't have xps_ethernetlite as an option?

Offline

 

#7 2009-Jun-16 17:09:15

s2haile
Member
Registered: 2008-Jan-23
Posts: 14

Re: Adding WARPxilnet to MSS file

Good suggestion, you were spot on! It turned out EDK was pointing to an outdated repository. It compiles properly now.

Thanks a lot,
SH

Offline

 

#8 2009-Jun-18 13:45:01

s2haile
Member
Registered: 2008-Jan-23
Posts: 14

Re: Adding WARPxilnet to MSS file

Though the compilation problem is fixed, I am going to continue on this thread because there is an issue with the situation I had described in the first post. As I stated, I am integrating parts of warplab and the ref design. From a PC I load up data generated from matlab to either node's txbuffer and I initiate data transmission from MATLAB. I added shared memories to the ofdm sysgen model which store the channel estimates, and I can read that into MATLAB from either node. In effect the MAC does not do carrier sensing, it just polls the ethernet and responds to various commands (i.e. load tx data, txstart, read channel estimates).

I am seeing through chipscope that whenever I initiate a wireless transfer the bad header interrupt asserts and the payload is corrupted. Through chipscope the I/Q data coming out of the ADC is really low in amplitude (i.e. 0.08 peak). The channel estimates from the receiving node look pretty bad as well. I have ruled out a lot of factors (agc, radios, init code) and I am thinking maybe it's the way I load the MATLAB data into the ofdm phy txbuffer. I use the warplab_writeSMRO/warplab_pktSend matlab routines to load up the txbuffer (the data is scaled to [-1 1], and cast converted) and then in the FPGA I use the following command to copy it over:

memcpy((u8 *)warpphy_getBuffAddr(controlStruct.txBuffIndex)+NUM_HEADER_BYTES, (unsigned int *)(receivePtr32 + 3), (bytesReceived));

Do you see any problem with this? Maybe it overwrites some of the header data and/or training symbols? Or even maybe the casting done in the phy is incorrect? I try to add a printf to read the bytes that I am storing in the buffer but it doesn't print anything to the screen.

SH

Offline

 

#9 2009-Jun-19 00:43:11

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

Re: Adding WARPxilnet to MSS file

When you say txbuffer, is it the usual xps_bram_block from the reference design? If so, are you also loading a valid header in the first 24 bytes of the txbuffer? The Tx PHY uses 3 bytes in the header (2 for length, 1 for modulation rate) when transmitting a packet. If these aren't valid, the behavior isn't well defined (i.e. I have no idea what it will do, but it won't be anything useful). Also, are you setting the numFullRateSymbols register before initiating the transmission? This is usually handed in the warpmac_prepPhyForXmit function. Again, this register value must be consistent with the packet length and modulation fields in the header.

Are you also calling warpphy_init() in your C code? This sets a bunch of default values in the PHY (like number of header bytes, training symbols, AGC thresholds, etc.). The noMac.c code is a good example of the minimum setup required to use WARPMAC and the PHY.

Are you measuring anything besides channel estimates? If not, you can actually skip loading any payload and just send header-only packets. The channel training is the same for any packet (long or short), so you can safely transmit the same short packet over and over, extracting the receiver's channel estimates for each one.

Offline

 

#10 2009-Jun-25 13:25:02

s2haile
Member
Registered: 2008-Jan-23
Posts: 14

Re: Adding WARPxilnet to MSS file

The txBuffer is the usual xps_bram_block from the reference design. I call warphy_init and I set the numFullRateSymbols register before initiating the transmission, by calling the following three warpmac_xmit functions that are usually called in the emac rx interrupt handler.

Here's a weird observation. If I send header-only packets (ACK) then I get the good header interrupt. Normally I would be satisfied with only using header packets since I am only interested in channel estimates but I find that the shared memory block I use to store the channel estimates gets overwritten with bad data after the packet has been processed. I confirm this by comparing estimates seen on chipscope to those I read into MATLAB.  I am pretty sure it is not the memory itself since I simulate the model and confirm that the estimates are stored correctly. I am thinking maybe the write enable signal I have going into the memory gets asserted for some reason after the packet has been processed. A colleague of mine who is doing something similar mentioned that it is better to use data packets for this since the I can read the estimates in the goodHeader interrupt handler and can still be certain that they will be correct since the PHY needs the estimates to process the rest of the payload.

Now, if I send data packets then I get the bad header interrupt and the estimates are overwritten anyways since the PHY resets after a bad header interrupt. After some debugging I confirm that I am correctly copying the header and payload into the tx packet buffer correctly (using memcpy and printf's). One thing I did is I probed the contents of the header from the tx packet buffer before and after wireless transmission for both ACK and DATA packets. Before transmission the header contents for both ACK&DATA packets were all zeroes for all 24 bytes. This is to be expected I guess. After transmission though it gets a little interesting.

The ACK packets were setup the following way:

ackPacket.header.length = 0;
ackPacket.header.pktType = ACKPACKET;
ackPacket.header.fullRate = QPSK;
ackPacket.header.codeRate = CODE_RATE_NONE;

The ACK header contents are below:
header[0] = 2
header[1] = 3
header[2] = 0
header[3] = 18
header[4..23] = 0

The DATA packets were set up the following way:

txBuffer.header.length = bytesReceived-12;
txBuffer.header.fullRate = pktFullRate;
txBuffer.header.codeRate = pktCodeRate;
txBuffer.header.pktType = DATAPACKET;
txBuffer.header.currReSend = 0;

The DATA header contents are below:
header[0] = 2
header[1] = 3
header[2] = 0
header[3] = 18
header[4] = 1
header[5..23] = 0

I don't see where the length field is set for the DATA packet, the only difference between the header contents is header[4], which I presume is for packet type. I don't exactly know how the header fields are formed into the packet, so can you please tell me is you see anything fishy with the DATA header contents.

Thanks,
SH

Offline

 

#11 2009-Jun-25 13:59:52

s2haile
Member
Registered: 2008-Jan-23
Posts: 14

Re: Adding WARPxilnet to MSS file

Nevermind my last post, I know why. Without knowing I was setting the length to zero for DATA packet, which caused the PHY to believe it was transmitting an ACK packet instead. By setting the packetType to DATA I may have screwed with the CRC calculation resulting in bad header interrupt. Everything works once I fixed that mistake.

Thanks,
SH

Offline

 

Board footer