Visible to Intel only — GUID: mwh1410384258701
Ixiasoft
Visible to Intel only — GUID: mwh1410384258701
Ixiasoft
7.5.5. Using the Monitor Service
Monitor Service
- Determine the host and the memory address range that you want to poll:
set master_index 0 set master [lindex [get_service_paths master] $master_index] set address 0x2000 set bytes_to_read 100 set read_interval_ms 100
With the first host, read 100 bytes starting at address 0x2000 every 100 milliseconds.
- Open the monitor service:
set monitor [lindex [get_service_paths monitor] 0] set claimed_monitor [claim_service monitor $monitor mylib]
The monitor service opens the host service automatically.
- With the monitor service, register the address range and time interval:
monitor_add_range $claimed_monitor $master $address $bytes_to_read monitor_set_interval $claimed_monitor $read_interval_ms
- Add more ranges, defining the result at each interval:
global monitor_data_buffer set monitor_data_buffer [list]
- Gather the data and append it with a global variable:
proc store_data {monitor master address bytes_to_read} {\ global monitor_data_buffer # monitor_read_data returns the range of data polled from the running \ design as a list #(in this example, a 100-element list). set data [monitor_read_data $claimed_monitor $master $address \ $bytes_to_read] # Append the list as a single element in the monitor_data_buffer \ global list. lappend monitor_data_buffer $data }
Note: If this procedure takes longer than the interval period, the monitor service may have to skip the next one or more calls to the procedure. In this case, monitor_read_data returns the latest polled data. - Register this callback with the opened monitor service:
set callback [list store_data $claimed_monitor $master $address $bytes_to_read] monitor_set_callback $claimed_monitor $callback
- Use the callback variable to call when the monitor finishes an interval. Start monitoring:
monitor_set_enabled $claimed_monitor 1
Immediately, the monitor reads the specified ranges from the device and invokes the callback at the specified interval. Check the contents of monitor_data_buffer to verify this. To turn off the monitor, use 0 instead of 1 in the above command.