Lecroy Oscilloscope Interface

class LecroyScope
__init__(self, scope_ip='TCPIP0::192.168.1.79::inst0::INSTR'):

Create a LecroyScope object

Parameters:

scope_ip – The IP of the scope that you want to connect to

__del__(self):

Close the scope on object deletion.

Returns:

None

open(self, scope_ip, scope_timeout=5000):

Opens a Lecroy scope using the PyVisa library

Parameters:
  • scope_ip – The ip of the Lecroy scope

  • scope_timeout – The amount of time to wait for the Lecroy until timeout

Returns:

None

close(self):

Closes the Lecroy scope using the PyVisa library

Returns:

None

setup(self, v_div, timebase, samplerate, duration, v_offset, channel):

Sets up the Lecroy scope for trace capture

Parameters:
  • v_div – voltage scale per division

  • timebase – the timescale for the scope

  • samplerate – the rate in which measurements are sampled

  • duration – the duration of capture

  • v_offset – the voltage offset for the measurement

  • channel – the channel to capture the traces on

Returns:

None

set_trigger(self, delay, level, channel='C1'):

Set the trigger for the trace capture

Parameters:
  • delay – the trigger delay

  • level – the trigger level

  • channel – the trigger channel

Returns:

None

start_trigger(self)

Tells the LecroyScope to start the trigger based on the parameters set in LecroyScope.set_trigger

get_trigger(self):

Returns the trigger status

Returns:

A string representing the trigger status

wait_for_trigger(self):

Waits for the Lecroy trigger

Returns:

True if successful, False if the trigger timeout

get_channel(self, samples, short, channel='C3'):

Get the measurement data from the Lecroy from specified channel

Parameters:
  • samples – The number of samples to record

  • short

  • channel – The channel to collect data from

Returns:

The data from the scope

reset(self):

Resets the scope

scope_setup(channel='C3', trig_channel='C1', num_of_samples=200, sample_rate=500E6, short=False, v_div=2.5E-3, trg_delay="0", trg_level="1.65V", v_offset='0'):

Higher level setup function. Sets up a Lecroy Scope object for power trace collection.

Parameters:
  • channel – the channel that records power trace measurements

  • trig_channel – the trigger channel

  • num_of_samples – the number of samples to capture

  • sample_rate – the rate in which samples are captured

  • short

  • v_div – the voltage scale per division

  • trg_delay – the trigger delay

  • trg_level – the trigger level

  • v_offset – the voltage offset

Returns:

the fully configured scope object

dut_setup(board='CW305', fpga_id='100t', bitfile=None)

Sets up a target board for trace capture :param board: The DUT type (CW305 or pico) :param fpga_id: the FPGA id for CW305 target :param bitfile: the bitfile for CW305 target :return: The configured target

capture_cw305(scope, target, num_of_samples=600, short=False, channel='C3', plaintext=None, key=None):

Captures traces on the CW305 target board

Parameters:
  • scope – The configured LecroyScope object

  • target – The configured CW305 target board

  • num_of_samples – The number of samples to capture

  • short

  • channel – The channel to collect traces on

  • plaintext – The plaintext for the encryption algorithm

  • key – The key for the encryption algorithm

Returns:

the recorded trace and algorithm output