From a56f4f63e235c7511cccfc291d395481828703f5 Mon Sep 17 00:00:00 2001 From: Samuel O'Brien Date: Tue, 4 Aug 2020 14:48:34 -0500 Subject: 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 --- mpm/python/usrp_mpm/simulator/rfnoc_common.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'mpm/python/usrp_mpm/simulator/rfnoc_common.py') 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: {}}}" \ -- cgit v1.2.3