def __init__(self, executable, in_samples=None, start_msgs=None, in_raw=None, sendnth=config.default_sendnth, width=config.default_width, output_msgs=True): super(TestBenchIcarusOuter, self).__init__() self.executable = executable self.in_samples = in_samples self.start_msgs = start_msgs self.in_raw = in_raw if (in_raw is not None) and (in_samples is not None or start_msgs is not None): raise ValueError( "Cannot specify both (in_samples and/or start_msgs) and in_raw" ) self.sendnth = sendnth self.width = width self.output_msgs = output_msgs # Set the MyHDL drivers self.drivers = [ self.clk_driver, self.get_output, self.send_input, self.prerun, self.check_error ] # Generate the raw data to send in. if self.in_raw is None: self.in_raw = [] if self.start_msgs is not None: self.in_raw += self.start_msgs # Subtracting 1 from width since we use 1st bit as a header. self.in_raw += [ c_to_int(d, self.width / 2 - 1) for d in self.in_samples ]
def __init__(self, executable, in_samples, in_ms=None, start_msgs=None, sendnth=config.default_sendnth, width=config.default_width, mwidth=config.default_mwidth): TestBenchIcarusBase.__init__(self) self.executable = executable self.in_samples = in_samples if in_ms is not None: assert (len(in_samples) == len(in_ms)) self.in_ms = in_ms else: self.in_ms = [0] * len(in_samples) self.start_msgs = start_msgs self.sendnth = sendnth self.width = width self.mwidth = mwidth # Output arrays self.out_samples = [] self.out_ms = [] self.out_msgs = [] # Set the MyHDL drivers self.drivers = [ self.clk_driver, self.get_output, self.check_error, self.send_input, self.prerun, self.get_message_stream ] # ??? self.in_raw = [c_to_int(d, self.width / 2) for d in self.in_samples]
def __init__(self, fpgaimage, in_samples=None, start_msgs=None, width=config.default_width, in_raw=None, output_msgs=True): self.fpgaimage = fpgaimage self.in_samples = in_samples self.start_msgs = start_msgs self.width = width self.in_raw = in_raw self.output_msgs = output_msgs # Generate the raw data to send in. if in_raw is None: if self.start_msgs is not None: self.in_raw = self.start_msgs else: self.in_raw = [] # Subtracting 1 from width since we use 1st bit as a header. self.in_raw += [c_to_int(d, self.width/2-1) for d in self.in_samples] self.out_samples = [] self.out_ms = [] self.out_msgs = []
def __init__(self, executable, in_samples=None, start_msgs=None, in_raw=None, sendnth=config.default_sendnth, width=config.default_width, output_msgs=True): super(TestBenchIcarusOuter, self).__init__() self.executable = executable self.in_samples = in_samples self.start_msgs = start_msgs self.in_raw = in_raw if (in_raw is not None) and (in_samples is not None or start_msgs is not None): raise ValueError("Cannot specify both (in_samples and/or start_msgs) and in_raw") self.sendnth = sendnth self.width = width self.output_msgs = output_msgs # Set the MyHDL drivers self.drivers = [self.clk_driver, self.get_output, self.send_input, self.prerun, self.check_error] # Generate the raw data to send in. if self.in_raw is None: self.in_raw = [] if self.start_msgs is not None: self.in_raw += self.start_msgs # Subtracting 1 from width since we use 1st bit as a header. self.in_raw += [c_to_int(d, self.width/2-1) for d in self.in_samples]
def __init__(self, executable, in_samples, in_ms=None, start_msgs=None, sendnth=config.default_sendnth, width=config.default_width, mwidth=config.default_mwidth): TestBenchIcarusBase.__init__(self) self.executable = executable self.in_samples = in_samples if in_ms is not None: assert(len(in_samples) == len(in_ms)) self.in_ms = in_ms else: self.in_ms = [0] * len(in_samples) self.start_msgs = start_msgs self.sendnth = sendnth self.width = width self.mwidth = mwidth # Output arrays self.out_samples = [] self.out_ms = [] self.out_msgs = [] # Set the MyHDL drivers self.drivers = [self.clk_driver, self.get_output, self.check_error, self.send_input, self.prerun, self.get_message_stream] # ??? self.in_raw = [c_to_int(d, self.width/2) for d in self.in_samples]