Commit 9a4de25d authored by Denia Bouhired-Ferrag's avatar Denia Bouhired-Ferrag

separated gw flasing into golden and release separately

parent 8cf29a42
......@@ -82,15 +82,17 @@ CSR_GWVERS_OFS = 0
CSR_HWVERS_OFS = 22
# Target version
gwvers_target = 4.0
gwvers_target = 4.1
gwvers_gold_target = 0.3
##-------------------------------------------------------------------------------------------------
## Method to check hardware and gateware version
##-------------------------------------------------------------------------------------------------
def gw_hw_version():
hwvers = testelma.read(slot, SRREG) & 0x3F00 >> CSR_HWVERS_OFS
gwvers = testelma.read(slot, SRREG) & 0xFF >> CSR_GWVERS_OFS
hwvers = (testelma.read(slot, SRREG) & 0x0fc00000) >> CSR_HWVERS_OFS
gwvers = (testelma.read(slot, SRREG) & 0xFF) >> CSR_GWVERS_OFS
#print ("maj is %d, min is %d" % int(hwvers >> 2), int(hwvers & 0x03))
hwvers = int(hwvers >> 2)+float(hwvers & 0x03)/10
gwvers = int(gwvers >> 4)+float(gwvers & 0xF)/10
......@@ -215,7 +217,7 @@ if __name__ == "__main__":
print "=============================================\n"
print "Loading FPGA bitstream... \n"
#ret = subprocess.call(["cd ./" + gwpath + "; ./flash;"], shell=True, stdout=None, stderr=None)
ret = subprocess.call(["cd ./" + gwpath + "; xc3sprog -c xpc flash_load.bit; xc3sprog -c xpc -I golden-v0.2_release-v" + str(gwvers_target) +".bin:w:0:bin"], shell=True, stdout=None, stderr=None)
ret = subprocess.call(["cd ./" + gwpath + "; xc3sprog -c xpc flash_load.bit; xc3sprog -c xpc -I golden-v" + str(gwvers_gold_target)+".bin:w:0:bin; xc3sprog -c xpc flash_load.bit; xc3sprog -c xpc -I release-v" + str(gwvers_target) +".bin:w:1507328:bin"], shell=True, stdout=None, stderr=None)
print "Bitstream successfully loaded... \n"
print "Crate restarting... \n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment