diff --git a/conda.recipe/pybert/meta.yaml b/conda.recipe/pybert/meta.yaml index f648613..800ceff 100644 --- a/conda.recipe/pybert/meta.yaml +++ b/conda.recipe/pybert/meta.yaml @@ -1,5 +1,5 @@ {% set name = "pybert" %} -{% set version = "2.4.1" %} +{% set version = "2.4.2" %} package: version: '{{ version }}' diff --git a/pybert/__init__.py b/pybert/__init__.py index 7a2c1e7..23fc0bc 100644 --- a/pybert/__init__.py +++ b/pybert/__init__.py @@ -56,5 +56,5 @@ # # __all__ = ['pybert', 'pybert_view', 'pybert_cntrl', 'pybert_util', 'dfe', 'cdr'] -__version__ = '2.4.1' +__version__ = '2.4.2' diff --git a/pybert/pybert.py b/pybert/pybert.py index 74ab648..d885e86 100755 --- a/pybert/pybert.py +++ b/pybert/pybert.py @@ -60,8 +60,6 @@ import pybert -debug = True - gDebugStatus = False gDebugOptimize = False gMaxCTLEPeak = 20. # max. allowed CTLE peaking (dB) (when optimizing, only) @@ -347,6 +345,7 @@ class PyBERT(HasTraits): sweep_num = Int(1) sweep_aves = Int(gNumAve) do_sweep = Bool(False) #: Run sweeps? (Default = False) + debug = Bool(True) #: Log extra info to console when true. (Default = False) # - Channel Control use_ch_file = Bool(False) #: Import channel description from file? (Default = False) @@ -470,7 +469,7 @@ class PyBERT(HasTraits): # About ident = String('PyBERT v{} - a serial communication link design tool, written in Python.\n\n \ David Banas\n \ - December 22, 2017\n\n \ + September 13, 2018\n\n \ Copyright (c) 2014 David Banas;\n \ All rights reserved World wide.'.format(pybert.__version__)) @@ -524,9 +523,14 @@ class PyBERT(HasTraits): def log(self, msg): self.console_log += "\n[{}]: {}\n".format(datetime.now(), msg.strip()) + def dbg(self, msg): + if(self.debug): + print "\n[{}]: {}\n".format(datetime.now(), msg.strip()) + self.log(msg) + def handle_error(self, err): self.log(err.message) - if(debug): + if(self.debug): message(err.message + "\nPlease, check terminal for more information.", 'PyBERT Alert') raise else: diff --git a/pybert/pybert_cntrl.py b/pybert/pybert_cntrl.py index 91da150..6127846 100644 --- a/pybert/pybert_cntrl.py +++ b/pybert/pybert_cntrl.py @@ -184,6 +184,7 @@ def my_run_simulation(self, initial_run=False, update_plots=True): # create the duobinary waveform. We only create it explicitly, above, # so that we'll have an ideal reference for comparison. chnl_h = self.calc_chnl_h() + self.dbg("Channel impulse response is {} samples long.".format(len(chnl_h))) chnl_out = convolve(self.x, chnl_h)[:len(x)] self.channel_perf = nbits * nspb / (clock() - start_time) diff --git a/pybert/pybert_util.py b/pybert/pybert_util.py index 0109838..23d7f9d 100644 --- a/pybert/pybert_util.py +++ b/pybert/pybert_util.py @@ -827,14 +827,13 @@ def import_freq(filename, sample_per, padded=False, windowed=False): F = rf.Frequency.from_f(f / 1e9) # skrf.Frequency.from_f() expects its argument to be in units of GHz. # Form impulse response from frequency response. - ntwk = ntwk.interpolate_from_f(F) - H = sdd_21(ntwk).s[:,0,0] + H = sdd_21(ntwk).interpolate_from_f(F).s[:,0,0] + # ntwk = ntwk.interpolate_from_f(F) # H = np.concatenate((H, np.conj(np.flipud(H[:-1])))) # Forming the vector that fft() would've outputted. H = np.pad(H, (1,0), 'constant', constant_values=1.0) # Presume d.c. value = 1. if(windowed): window = get_window(6.0, 2*len(H))[len(H):] H *= window - # h = np.real(np.fft.ifft(H)) if(padded): h = np.fft.irfft(H, int(1. / (fmin * sample_per)) + 1) diff --git a/pybert/pybert_view.py b/pybert/pybert_view.py index 2e07d59..3624f63 100644 --- a/pybert/pybert_view.py +++ b/pybert/pybert_view.py @@ -221,6 +221,7 @@ def do_load_data(self, info): HGroup( Item(name='thresh', label='Pj Threshold (sigma)', tooltip="Threshold for identifying periodic jitter spectral elements. (sigma)", ), Item(name='impulse_length', label='Impulse Response Length (ns)', tooltip="Manual impulse response length override", ), + Item(name='debug', label='Debug', tooltip='Enable to log extra information to console.', ), label='Analysis Parameters', show_border=True, ), label='Simulation Control', show_border=True,