accelerator_loop_test.ds 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. incdir "tests"
  2. include "dsp_base.inc"
  3. test_main:
  4. ; Test parameters
  5. lri $AC0.M, #0x0000 ; start
  6. lri $AC0.L, #0x0000 ; start
  7. lri $AC1.M, #0x0000 ; end
  8. lri $AC1.L, #0x0011 ; end
  9. ; Reset some registers
  10. lri $AC0.H, #0xffff
  11. sr @0xffda, $AC0.H ; pred scale
  12. sr @0xffdb, $AC0.H ; yn1
  13. sr @0xffdc, $AC0.H ; yn2
  14. ; Set the sample format
  15. lri $AC0.H, #0x0
  16. sr @0xffd1, $AC0.H
  17. ; Set the starting and current address
  18. srs @ACSAH, $AC0.M
  19. srs @ACCAH, $AC0.M
  20. srs @ACSAL, $AC0.L
  21. srs @ACCAL, $AC0.L
  22. ; Set the ending address
  23. srs @ACEAH, $AC1.M
  24. srs @ACEAL, $AC1.L
  25. call load_hw_reg_to_regs
  26. call send_back ; check the accelerator regs before a read
  27. bloopi #40, end_of_loop
  28. lr $IX3, @ARAM
  29. call load_hw_reg_to_regs
  30. call send_back ; after a read
  31. end_of_loop:
  32. nop
  33. jmp end_of_test
  34. load_hw_reg_to_regs:
  35. lr $AR0, @0xffd1 ; format
  36. lr $AR1, @0xffd2 ; unknown
  37. lr $AR2, @0xffda ; pred scale
  38. lr $AR3, @0xffdb ; yn1
  39. lr $IX0, @0xffdc ; yn2
  40. lr $IX1, @0xffdf ; unknown accelerator register
  41. lri $AC0.H, #0
  42. lrs $AC0.M, @ACSAH
  43. lrs $AC0.L, @ACSAL
  44. lri $AC1.H, #0
  45. lrs $AC1.M, @ACEAH
  46. lrs $AC1.L, @ACEAL
  47. lrs $AX0.H, @ACCAH
  48. lrs $AX0.L, @ACCAL
  49. lrs $AX1.H, @ACCAH
  50. lrs $AX1.L, @ACCAL
  51. lrs $AX1.H, @ACCAH
  52. lrs $AX1.L, @ACCAL
  53. ret