diff options
author | Samuel O'Brien <sam.obrien@ni.com> | 2020-08-04 14:48:34 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-10-28 15:25:48 -0500 |
commit | a56f4f63e235c7511cccfc291d395481828703f5 (patch) | |
tree | c4b7bc71417bc5bdacc91f6a0f5d3fd9cabca62e /mpm/python/usrp_mpm/simulator/rfnoc_common.py | |
parent | 5df8202c0cb88fb5c7629fbf0ce5bed32c96e70d (diff) | |
download | uhd-a56f4f63e235c7511cccfc291d395481828703f5.tar.gz uhd-a56f4f63e235c7511cccfc291d395481828703f5.tar.bz2 uhd-a56f4f63e235c7511cccfc291d395481828703f5.zip |
sim: Implement Sim > UHD Flow Control
This commit adds flow control support when streaming data from the
Simulator to UHD. It no longer ignores STRS packets.
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
Diffstat (limited to 'mpm/python/usrp_mpm/simulator/rfnoc_common.py')
-rw-r--r-- | mpm/python/usrp_mpm/simulator/rfnoc_common.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/mpm/python/usrp_mpm/simulator/rfnoc_common.py b/mpm/python/usrp_mpm/simulator/rfnoc_common.py index d7f61a4c1..b1dab559f 100644 --- a/mpm/python/usrp_mpm/simulator/rfnoc_common.py +++ b/mpm/python/usrp_mpm/simulator/rfnoc_common.py @@ -153,6 +153,8 @@ class StreamSpec: self.sample_rate = None self.dst_epid = None self.addr = None + self.capacity_packets = 0 + self.capacity_bytes = 0 def set_timestamp_lo(self, low): """Set the low 32 bits of the initial timestamp""" @@ -182,19 +184,6 @@ class StreamSpec: assert self.sample_rate != 0 return self.packet_samples / self.sample_rate - def seq_num_iter(self): - """Returns a generator which returns an incrementing integer - for each packet that should be sent. This is useful to set the - seq_num of each transmitted packet. - """ - i = 0 - while True: - if not self.is_continuous: - if i >= self.total_samples: - return - yield i - i += 1 - def __str__(self): return "StreamSpec{{total_samples: {}, is_continuous: {}, packet_samples: {}," \ "sample_rate: {}, dst_epid: {}, addr: {}}}" \ |