Procedure for JTAG gateware upgrade for conv-ttl-xxx boards
-------------------------------------------------------------
This procedure is used to upgrade gateware on conv-ttl-xxx boards.
After upgrade a log file will be saved in the ./log folder recording board unique ID, previous and new gateware version and hardware version.

The target version for Golden and Release bitstreams needs to be maually entered in the gw-upgrade.py file, 
by editing the lines:
	# Target version
	gwvers_target = 4.1
	gwvers_gold_target = 0.3

In the same directory, binaries for release and golden bitstreams should be saved in folders ./gw-blo or ./gw-485 depending on which board should be upgraded.

Additionally the file ei2cdefine.py should be edited for local crate used for upgrade:
	# Hostname, username and password
	HNAME    = "cfvm-774-elma3"
	USER     = "admin"
	PWD      = "ADMIN"
	SLOT     = 5

Once the target version and crate information has been entered, follow the procedure below to upgrade board version:

* At the prompt, run script gw-upgrade.py, by running the command:
	>> python gw-upgrade.py

* Type "y"+Enter if you have a board you would like to upgrade gateware for, "n"+Enter if not.
* Place ESD strap on your wrist.
* Take conv-ttl-xxx board carefully out of box and ESD bag.
* Scan with the barcode reader the LHC barcode on the board. Press Enter after scan.
* Place board on slot 5 of Elma crate, without engaging it all the way. 
* Plug the Xilinx Cable on the Xiling connector (JTAG) of the conv-ttl-xxx board.
* Engage the conv-ttl-xx board all the way in the VME crate, and press the front panel handles until they make a clicking noise.
* Type "ok"+Enter on the terminal prompt.

* The script checks the board ID and states whether the board in the slot is a conv-ttl-blo or conv-ttl-rs485. If board information is correct, type "y"+Enter, if not type "n"+Enter and restart the script with the correct board.

* The script then checks the current board hardware and gateware version number. If the the hardware version is older than v4.0 then the script will not be able to identify the exact version number, only that it is v3.0 or earlier.

* The script checks that the gateware version is different than the target upgrade. If it is the same as the target version, then upgrade is not necessary and the script aborts. If the current version does not match target version, than script proceeds with upgrade.

* Once upgrade starts, you need to wait a approx 7 minutes for it to be completed. The script will then display the new gateware version (hardware version WILL NOT change). The information is all saved in the log file.

* The script will ask you to remove the board and type "ok"+Enter. Make sure you are wearing the ESD bracelet. Put the board back in ESD bag and then in the box if any.

* If more boards need upgrading, type "y"+Enter and start the procedure from the top again.
--------------------------------------------------------------------------------------------------------------
Note:
The log file is created with the current date. All tests for the day are appended to the same file.
If you want to restart a new log file, it needs to be manually renamed and the script will write on a new one



