Mustang 1.5 tcpborphserver2 mba mode

see also Mba15DataTransmission

Commands added for mba mode

  1. test commands
    • these aren't really good for anything, just testing various functionalities
    • mba-cmd
      • does nothing - first attempt to add command to mode and test telnet console messages
      • Usage: ?mba-cmd
      • function: mba_test_cmd (mba/commands.c)
    • mba-socket
      • test udp socket connection to vegas-r1
      • Usage: ?mba-socket
      • function: mba_socket_test (mba/commands.c)
    • mba-watch
      • reads 4 bytes (32 bits, as all software registers are) from the ttl_rate register 10 times and reports value
      • Usage: ?mba-watch
      • function: mba_watch_reg (mba/commands.c)
  2. mba-read-bram
    • Reads active bram PING_BRAM or PONG_BRAM indicated by ACTIVE_BRAM_REG then transmits by UDP to UDP_HOST; prints elapsed time for read & transmit
      • PING_BRAM, PONG_BRAM, ACTIVE_BRAM_REG defined in include/mba-registers.h
      • UDP_HOST and UDP_PORT defined in include/mba-config.h, currently tofu
      • Captures data in size BLOCK_SIZE (256 32-bit words) and send out udp in chunks of BRAM_PAYLOAD_SIZE (1024)
    • Usage: ?mba-read-bram
    • function: read_bram_cmd (mba/capturecmds.c) calls run_bram_bare_mba (mba/bram.c) which reads the bram and then calls tx_udp_mba (mba/udp.c)
  3. "capture" commands and helpers
    • This uses the katcp scheduler to run a command at an interval while returning control to the telnet session (usually control returns when command is completed)
    • Shortest interval is 1 msec (even if interval set to a shorter time), not fast enough for our needs so started working on avg_read commands
    • capture-interval - helper fn for capture-start
      • get/set katcp interval in msec to run capture function
      • Usage: ?capture-interval [interval]
      • default interval is 1 msec, set in include/mba-config.h. Tried dividing in half in code but then only reads and transmits one data frame.
      • function: capture_interval_cmd (mba/capturecmds.c)
    • capture-list
      • lists capture instances (capture_mba structures) so you know options for capture-start
      • Usage: ?capture-list
      • function: capture_list_cmd (mba/capturecmds.c)
    • capture-destination
      • get/set the network destination to send captured data over udp
      • Usage: ?capture-destination name [ip] [port] where name is capture instance
      • function: capture_destination_cmd (mba/capturecmds.c)
    • capture-start
      • start a data capture (read brams and transmit over udp); toggles between Shared_BRAM and Shared_BRAM1 based on switch_reg
      • Usage: ?capture-start name [time]
      • Example: ?capture-start brams
      • Optional time to start
      • function: capture_start_cmd (mba/capturecmds.c) *reads and transmits data on a schedule set by the interval
        • calls run_generic_capture_mba (mba/capture.c) which steps through states and calls toggle_bram_mba (mba/bram.c) on a schedule at the interval specified
        • toggle_bram_mba cuts interval in half and registers run_bram_mba (mba/bram.c) with katcp to run on this schedule
    • capture-stop
      • stop a data capture
      • Usage: ?capture-stop name [time]
      • Example: ?capture-stop brams
      • Optional time to stop
      • function: capture_stop_cmd (mba/capturecmds.c)
  4. avg read commands
    • These do not use katcp scheduler, not fast enough
    • avg-pce-read
      • find avg bram read time using pce (katcp poco_core_entry structure)
      • Usage: ?avg-pce-read bram-name num_reads num_packets
      • Example: avg-pce-read brams Shared_BRAM 100 50
      • Tells you total elapsed time and average read time
      • function: avg_pce_read_cmd (mba/capturecmds.c)
    • avg-file-read - under development!
      • find avg bram read time using /proc file for num reads
      • Usage: ?avg-file-read bram-name num
      • Need pid for /proc file path, still working on that part
      • function: avg_file_read_cmd (mba/capturecmds.c)

Example telnet session for mba mode

$ telnet mustang-r1 7147
?mode
#log info 157809773187 roach.mba current\_mode\_now\_mba
!mode ok mba
?help
<lists available commands and their arguments -- very handy!>
?wordwrite ttl_rate 0 1000
!wordwrite ok
?wordwrite reset 0 0
!wordwrite ok
?wordwrite reset 0 1
!wordwrite ok
?wordwrite reset 0 0
!wordwrite ok
?mba-read-bram
#log info 158425539334 roach.mba reading\_bram\_Shared_BRAM1
#log info 158425539342 roach.mba reading\_bram\_done
!mba-read-bram ok
?capture-start brams
#log info 158425988846 roach.mba preparing\_at\_158425988.866577s\_and\_starting\_at\_158425988.886577s
!capture-start ok
#log info 158425988872 roach.mba reading\_bram\_Shared_BRAM
#log info 158425988888 roach.mba capture-start\_brams
?capture-stop brams
#log info 158426004247 roach.mba shutdown\_request\_for\_158426004.247737s
!capture-stop ok
#log info 158426004247 roach.mba capture-stop\_brams
#log info 158426004248 roach.mba sent\_2\_bram\_data\_frames
^]
telnet> quit
Connection closed.
-- PamFord - 2013-08-16
Topic revision: r7 - 2013-08-22, PamFord
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback