Skip to content

Commit

Permalink
Rel. v2.4.2
Browse files Browse the repository at this point in the history
- Rearranged GUI to fit in standard 768-pixel height screens.
- Addressed an issue reported by Dennis Han, re: Touchstone files with very low fmin.
  • Loading branch information
capn-freako committed Sep 13, 2018
1 parent ecb226c commit cb2d605
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion conda.recipe/pybert/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "pybert" %}
{% set version = "2.4.1" %}
{% set version = "2.4.2" %}

package:
version: '{{ version }}'
Expand Down
2 changes: 1 addition & 1 deletion pybert/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@
#
# __all__ = ['pybert', 'pybert_view', 'pybert_cntrl', 'pybert_util', 'dfe', 'cdr']

__version__ = '2.4.1'
__version__ = '2.4.2'

12 changes: 8 additions & 4 deletions pybert/pybert.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@

import pybert

debug = True

gDebugStatus = False
gDebugOptimize = False
gMaxCTLEPeak = 20. # max. allowed CTLE peaking (dB) (when optimizing, only)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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__))

Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions pybert/pybert_cntrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions pybert/pybert_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions pybert/pybert_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cb2d605

Please sign in to comment.