寄存器自动化测试说明及时使用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.1 KiB

  1. a=[('core_0_uart_0', 0, 'RBR'), ('core_0_uart_0', 18, 'DLH'), ('core_0_uart_0', 16, 'DLL'), ('core_0_uart_0', 10, 'LSR'), ('core_0_uart_0', 4, 'IIR'), ('core_0_uart_0', 6, 'LCR'), ('core_0_uart_0', 0, 'THR'), ('core_0_uart_0', 4, 'FCR'), ('core_0_uart_0', 2, 'IER'), ('core_0_uart_0', 8, 'MCR'), ('core_0_uart_0', 14, 'SCR'), ('core_0_uart_0', 24, 'PWREMU_MGMT'), ('core_0_timer_0', 0, 'tim'), ('core_0_timer_0', 8, 'tcr'), ('core_0_timer_0', 4, 'prd')]
  2. def sort_list(a):
  3. for i in range(len(a)):
  4. for j in range(i+1,len(a)):
  5. if a[i][0] == a[j][0]:
  6. if a[i][1]>a[j][1]:
  7. a[i],a[j] = a[j],a[i]
  8. res=[]
  9. res1=[]
  10. for i in a:
  11. i=list(i)
  12. res.append(i)
  13. [res1.append(res[i][0]) for i in range(len(res)) if res[i][0] not in res1]
  14. for i in res1:
  15. a=1
  16. for k in res:
  17. if i in k:
  18. testcasenum="testcase{}_({})".format(str(a),i)
  19. k.insert(0,testcasenum)
  20. a+=1
  21. return res
  22. b=sort_list(a)
  23. print(b)
  24. for i in b:
  25. print(i)