for i in range(0, Nosys_commands): p = i * len_dchunk * 16 if count > len_dchunk: new_count = len_dchunk count = count - len_dchunk else: new_count = count #new_count = len(string[p:p+(len_dchunk*16)]) print("new_count1: ", new_count) new_count = gf.int_to_bin( new_count, (gf.SC_len - gf.DADDR_BITS - 9)) #How many words to load print("new_count2: ", new_count) start_add = gf.hydra_Daddr(i * len_dchunk) row = gf.int_to_bin(start_add[0], gf.DADDR_BITS) strip = gf.int_to_bin(start_add[1], 3) tile = gf.int_to_bin(start_add[2], 3) start = row + strip + tile command = new_count + start + cmd commandH = gf.bin_to_hex(command) commandH = gf.formatH_for_roach(commandH) LDprogram = LDprogram + commandH + string[p:p + ( len_dchunk * 16)] + ZERO_WORD_RH + ZERO_WORD_RH else: #If it happens to fit within one packet executing this is shorter start = gf.int_to_bin(0, gf.DADDR_BITS + 6) count = gf.int_to_bin(count, gf.SC_len - gf.DADDR_BITS - 9) #How many words to load
print("nosys_command2: ", Nosys_commands) for i in range (0,Nosys_commands): p=i*len_dchunk*16 if count>len_dchunk: new_count = len_dchunk count = count-len_dchunk else: new_count = count #new_count = len(string[p:p+(len_dchunk*16)]) print ("new_count1: ", new_count) new_count= gf.int_to_bin(new_count,(gf.SC_len-gf.DADDR_BITS-9)) #How many words to load print ("new_count2: ", new_count) start_add = gf.hydra_Daddr(i*len_dchunk) row= gf.int_to_bin(start_add[0],gf.DADDR_BITS) strip= gf.int_to_bin(start_add[1],3) tile= gf.int_to_bin(start_add[2],3) start=row+strip+tile command=new_count+start+cmd commandH = gf.bin_to_hex(command) commandH = gf.formatH_for_roach(commandH) LDprogram=LDprogram+commandH+string[p:p+(len_dchunk*16)]+ZERO_WORD_RH+ZERO_WORD_RH else: #If it happens to fit within one packet executing this is shorter start= gf.int_to_bin(0,gf.DADDR_BITS+6) count= gf.int_to_bin(count,gf.SC_len-gf.DADDR_BITS-9) #How many words to load