WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2015-Oct-06 09:15:23

mcccliii
Member
Registered: 2013-Jun-20
Posts: 38

Automate Loading Two different bitstream in WARP v3

Hi team,
For my experimental setup (AP-STA) , I need to regularly switch between two different bit streams.
1. Earlier I had downloaded the two different bit stream to different SD card slot and manually switch between one to another via DIP switch.
2. But now I would need to switch between two different bit stream at regular interval.
Could you point out the possible way that  I could load one set of bitstream to AP and STA and after executing experiment for certain period flash with next set of bit stream.

Offline

 

#2 2015-Oct-06 12:01:13

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

Re: Automate Loading Two different bitstream in WARP v3

There are two approaches you might take:

1) Create a combined AP-STA project and add a WLAN Exp command that allows you to switch between the functionality of an AP and a STA.  This would be the cleanest approach if you wanted fast switching between AP / STA behaviors. 

2) You can use Impact in batch mode to download bitstreams over JTAG:
    a) Create a "download.bit" file in the "Mango_802.11_RefDes_v1.3.0_hw_platform" directory by programming the FPGA (ie "Xilinx Tools" --> "Program FPGA") with the appropriate CPU High and CPU Low ELF files. 
    b) Rename the "download.bit" file to something more meaningful.  For example:  "w3_802.11_AP_DCF_v1.3.0.bit"
    c) Create a Impact batch command file in the "SDK_Workspace" directory.  For example:  "program_ap_dcf.cmd"
    d) Place Impact commands in the new command file.  For example:

Code:

setmode -bscan
setcable -p auto
identify
assignfile -p 1 -file Mango_802.11_RefDes_v1.3.0_hw_platform\w3_802.11_AP_DCF_v1.3.0.bit
program -p 1
quit

e) Launch a shell from the SDK (ie "Xilinx Tools" --> "Launch Shell") to get a proper environment to execute Xilinx commands
    f) In the new shell, use Impact in batch mode to execute your command file:

Code:

impact -batch program_ap_dcf.cmd

This will go thru similar steps to what the Gui does to program a bitstream using Impact.  You can find more documentation on Impact commands in the Xilinx Impact Users Guide.  You can then create another command file for a STA and then use the Impact commands from other scripts.  However, as you will note, this process takes some amount of time (around 20 - 30 seconds) so depending on your experiment, this approach might not work.

Offline

 

#3 2015-Oct-06 21:51:18

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

Re: Automate Loading Two different bitstream in WARP v3

I agree with Erik's suggestion of creating a CPU High application which implements the AP/STA behavior switching you need. This is the most flexible approach and requires no changes beyond the CPU High C code. It would also allow the fastest switch between modes.

If you really want to trigger re-configuration from the FPGA, I think you can achieve this by modifying the configuraiton CPLD design. The default CPLD design implements the state machine for configuring the FPGA from the SD card. The state machine is triggered at boot and when the program button is pressed.

In addition to the dedicated configuration pins, there are 11 IO connected between the FPGA and CPLD. These IO are not used by the default CPLD design. You could modify the CPLD design to use these IO to select a bitstream (like the DIP switch) and trigger configuration (like the button). The CPLD design ISE project and HDL source are in the repository: /Hardware/WARP_v3/Rev1.1/Config_CPLD. You would need to study the existing CPLD design, then create the custom CPLD design and matching FPGA interface core to implement this. But just to be clear- while I think this modification is possible, we have not tried this ourselves.

Offline

 

#4 2015-Oct-07 06:07:57

mcccliii
Member
Registered: 2013-Jun-20
Posts: 38

Re: Automate Loading Two different bitstream in WARP v3

Thanks Welsh and Murpho for the direction.
My setup is slightly different.
Setup:
I am using two WARP v3 one acting as AP and another as STA separated apart and connected via Gigabit switch. The AP and STA position is fixed. I am only switching between two different reference designs. The log_capture script is controlled by single PC as outlined in the 802.11 Reference Design: Experiment Framework Setup
1.    First I need to load 802.11 WARP reference design and capture logs for certain duration.
2.    Then I need to load 802.11 ref design WURC version on AP and STA and capture logs.
3.    In earlier measurement, I was manually switching between WARP and WURC reference design but now I need to do frequent switching between these two reference designs.
4.     Again since they are different reference design, How can I run the log capture script with different python path.

Offline

 

#5 2015-Oct-07 08:49:09

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

Re: Automate Loading Two different bitstream in WARP v3

While I really like Spyder as an IDE for development, I generally prefer to use the command line to run python scripts.  For Mac, you can just use the Terminal program, just make sure you have an appropriate version of python installed to use with the WLAN Exp framework (use "python -V" to check the version number).  For Windows, I use Cygwin since that allows me to have an environment to easily test the Python versions we support (just make sure you select the Python packages during installation).  When using the command line, you just specify the PYTHONPATH variable in front of the script:

Code:

PYTHONPATH=<Colon delimited paths to python directories you want included in the path> python <script file name> <arguments to the script>

If you would like to continue to run scripts in Spyder, you can use the Python path manager ("Tools" --> "PYTHONPATH Manager") to change the python path.

Offline

 

#6 2015-Oct-07 09:41:53

mcccliii
Member
Registered: 2013-Jun-20
Posts: 38

Re: Automate Loading Two different bitstream in WARP v3

Hi Welsh,
Using iMPACT appears to be a feasible solution for my setup.
But I have a query, How can I load AP bit stream and STA bit stream which area located distance apart. Any suggestion would be valuable.

Offline

 

#7 2015-Oct-07 11:41:12

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

Re: Automate Loading Two different bitstream in WARP v3

Unfortunately, the downside of that approach is that you have to have a JTAG connection to each node.  If you have multiple JTAG programmers, it would be straight forward to use multiple computers for programming the nodes (as long as both computers have the Xilinx tools installed, then you just need the cmd file and bitstreams to program).  I'm not sure what kind of distances you are looking at but if you have to have a host local to each node, then you could also use that host to program the node.  If not, then you will probably have to go the route that murphpo suggested with the CPLD.

Offline

 

#8 2015-Oct-12 09:50:48

mcccliii
Member
Registered: 2013-Jun-20
Posts: 38

Re: Automate Loading Two different bitstream in WARP v3

Hi Team,
Just a query, If I connect two JTAG to different COM port. Are there any command so that I could flash one WARP with AP bitstream and another WARP with STA bitstream.  Both WARP hardware is connected via dedicated JTAG. Or Do i require two PC.

Offline

 

#9 2015-Oct-12 10:35:05

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

Re: Automate Loading Two different bitstream in WARP v3

Just a query, If I connect two JTAG to different COM port. Are there any command so that I could flash one WARP with AP bitstream and another WARP with STA bitstream.  Both WARP hardware is connected via dedicated JTAG. Or Do i require two PC.

Using two JTAG cables on one PC is definitely possible, but I'm not sure what the exact process is. By default iMPACT searches for USB JTAG cables and connects to the first it finds. This is part of the "setcable -p auto" command in the script Erik posted above. I think you can constrain this search by naming a USB port or with the cables serial number. You'll have to dig into the iMPACT documentation to find the specific command arguments for this.

Offline

 

#10 2015-Oct-12 10:39:03

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

Re: Automate Loading Two different bitstream in WARP v3

One idea I forgot to mention- the iMPACT GUI exposes many of these cable-specific settings in its "Cable Setup" menu. It also prints the commands the GUI executes to the console. This might be a good way to identify the commands/arguments you need.

Offline

 

Board footer