Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD: Automatic finding of USB binds based on instrument IDN #210

Merged
merged 24 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b3b04d6
ENH: Added method to find linux USB binds based on instrument IDN
mjmucha Jan 15, 2024
af9c24a
ENH: Added method to update port/resource name in basil conf based on…
mjmucha Jan 15, 2024
5b3fad9
MAINT: removed unnecessary code
mjmucha Jan 15, 2024
edd182d
Update keithley_2400.yaml
konstantinmauer Feb 15, 2024
efc2467
ENH: Adds function to keithley2400 to return set source current and v…
matthias-schuessler Apr 4, 2024
7576232
Update workflows (#208)
YannickDieter Apr 22, 2024
8c9f630
ENH: added documentation
mjmucha Apr 24, 2024
7f8062d
ENH: removed unnecessary argument
mjmucha Apr 24, 2024
51ff359
ENH: try ASRL ports first
mjmucha Apr 24, 2024
6a73e50
ENH: added saving of found usb ports to basil config
mjmucha Apr 24, 2024
a143733
ADD: added new requirements
mjmucha Apr 24, 2024
85f381e
ENH: PEP8 formatting
mjmucha Apr 24, 2024
7217c62
function names are now more pythonic
mjmucha Apr 30, 2024
2b321b9
use default basil read/write termination
mjmucha Apr 30, 2024
d37beaf
ENH: Adds new functionality to keithley_2634b
matthias-schuessler Apr 11, 2023
a24a256
ENH: Adds functions to change source range.
matthias-schuessler Apr 11, 2023
f411096
ENH: Adds readout for set source voltage and current.
matthias-schuessler Aug 1, 2023
e1fa883
ADD: Adds an example for keithley_2634b connexion using Serial
AntonioT7 Apr 11, 2023
1ab8928
ENH: get_die now outputs the unmodified die position from the prober api
mjmucha Apr 29, 2024
470c8fa
fixed PEP8 formatting
mjmucha Apr 29, 2024
49fe305
fixed missed renaming of functions
mjmucha Apr 30, 2024
23e282c
PEP8 formatting
mjmucha Apr 30, 2024
62e5772
PEP8 formatting
mjmucha Apr 30, 2024
06c4761
removed pyvisa requirement
mjmucha Apr 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [3.11]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{matrix.python-version}}
Expand All @@ -31,32 +31,32 @@ jobs:
tests:

name: Python ${{matrix.python-version}} | ${{matrix.sim}}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
SIM: ${{matrix.sim}}

strategy:
fail-fast: false
matrix:
include:

- sim: icarus
python-version: 3.7
python-version: '3.11'

- sim: icarus
python-version: 3.8
python-version: '3.10'

- sim: verilator
sim-version: v4.106
python-version: 3.8
sim-version: v5.020
python-version: '3.10'
pytest-marker: "-m verilator"

steps:
- uses: actions/checkout@v1
- uses: conda-incubator/setup-miniconda@v2
- name: Set up Anaconda ${{matrix.python-version}}
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
python-version: ${{matrix.python-version}}

- name: Install Conda dependencies
shell: bash -l {0}
Expand All @@ -67,12 +67,12 @@ jobs:
- name: Install Python dependencies
shell: bash -l {0}
run: |
pip install pyvisa pyvisa-sim pytest coveralls pytest-cov cocotb==1.5.2
pip install pyvisa pyvisa-sim pytest coveralls pytest-cov cocotb>=1.8.1 cocotb-bus

- name: Install Verilator
if: matrix.sim == 'verilator'
run: |
sudo apt install -y --no-install-recommends make g++ perl python3 autoconf flex bison libfl2 libfl-dev zlibc zlib1g zlib1g-dev
sudo apt install -y --no-install-recommends make g++ help2man perl autoconf flex bison libfl2 libfl-dev zlib1g zlib1g-dev
git clone https://github.com/verilator/verilator.git -b ${{matrix.sim-version}}
cd verilator
autoconf
Expand Down
4 changes: 2 additions & 2 deletions basil/HL/JtagMaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def scan_ir(self, data, readback=True):
bit_number = self._test_input(data)
self.SIZE = bit_number

if type(data[0]) == BitLogic:
if isinstance(data[0], BitLogic):
data_byte = self._bitlogic2bytes(data)
else:
data_byte = self._raw_data2bytes(data)
Expand Down Expand Up @@ -135,7 +135,7 @@ def scan_dr(self, data, readback=True, word_size=None):
self.WORD_COUNT = bit_number // word_size
self.SIZE = word_size

if type(data[0]) == BitLogic:
if isinstance(data[0], BitLogic):
data_byte = self._bitlogic2bytes(data)
else:
data_byte = self._raw_data2bytes(data)
Expand Down
10 changes: 7 additions & 3 deletions basil/HL/SentioProber.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ def goto_first_die(self):

def get_die(self):
''' Get chip index '''
print("Check if return order of col and row is correct and consistent with other pc drivers.")
values = self._intf.query("map:die:get_current_index").split(",")
print(int(values[-2]), int(values[-1]))
reply = self._intf.query("map:die:get_current_index").strip()
if reply == '0:' or reply == '':
reply = self._intf.query("map:die:get_current_index")

values = reply[2:].split(',')

return (int(values[0]), int(values[1]))

def contact(self):
''' Move chuck to contact z position'''
Expand Down
4 changes: 3 additions & 1 deletion basil/HL/SignatoneProber.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ def get_die(self):
reply = self._intf.query('GETCR')
else:
break

reply = re.sub(r'[a-zA-Z]', r'', reply)
values = reply.split(',')
return (abs(int(values[0])), abs(int(values[1])))

return (int(values[0]), int(values[1]))

def contact(self):
''' Move chuck to contact z position'''
Expand Down
8 changes: 8 additions & 0 deletions basil/HL/keithley_2400.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ identifier : KEITHLEY INSTRUMENTS INC.,MODEL 2400
on : OUTP ON
off : OUTP OFF
get_on: OUTP?
get_source_current: SOUR:CURR?
get_current : SENSE:FUNC 'CURR';:READ?
set_current : SOUR:CURR
get_source_voltage: SOUR:VOLT?
set_voltage : SOUR:VOLT
get_voltage : SENSE:FUNC 'VOLT';:READ?
set_current_limit : SENS:CURR:PROT
Expand All @@ -23,3 +25,9 @@ get_autorange : SOUR:CURR:RANG:AUTO?
four_wire_on: SYST:RSEN ON
four_wire_off: SYST:RSEN OFF
get_remote_sense: SYST:RSEN ?
# Special keyword for formatting query results to allow direct conversions to numeric types (e.g. float(get_current()))
__scpi_query_fmt:
fmt_sep: ','
fmt_method:
get_voltage: '{0}'
get_current: '{1}'
83 changes: 80 additions & 3 deletions basil/HL/keithley_2634b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,99 @@ identifier : Keithley Instruments Inc., Model 2634B
channel 1:
on : smua.source.output = 1
off : smua.source.output = 0
get_on : print(smua.source.output)
get_current : print(smua.measure.i())
set_voltage : smua.source.levelv =
set_current : smua.source.leveli =
get_source_current : print(smua.source.leveli)
get_voltage : print(smua.measure.v())
set_voltage : smua.source.levelv =
get_source_voltage : print(smua.source.levelv)
set_current_limit : smua.source.limiti =
get_current_limit : print(smua.source.limiti)
set_voltage_limit : smua.source.limitv =
get_voltage_limit : print(smua.source.limitv)
source_volt : smua.source.func = smua.OUTPUT_DCVOLTS
source_current : smua.source.func = smua.OUTPUT_DCAMPS
get_source_mode : print(smua.source.func)
set_voltage_range: smua.source.rangev =
get_voltage_range: print(smua.source.rangev)
set_voltage_autorange_on: smua.source.autorangev = smua.AUTORANGE_ON
set_voltage_autorange_off: smua.source.autorangev = smua.AUTORANGE_OFF
set_current_range: smua.source.rangei =
get_current_range: print(smua.source.rangei)
set_current_autorange_on: smua.source.autorangei = smua.AUTORANGE_ON
set_current_autorange_off: smua.source.autorangei = smua.AUTORANGE_OFF
four_wire_on: smua.sense = smua.SENSE_REMOTE
four_wire_off: smua.sense = smua.SENSE_LOCAL
set_current_sense_range: smua.measure.rangei =
get_current_sense_range: print(smua.measure.rangei)
set_voltage_sense_range: smua.measure.rangev =
get_voltage_sense_range: print(smua.measure.rangev)
set_mode_measure_current : display.smua.measure.func = display.MEASURE_DCAMPS

channel 2:
on : smub.source.output = 1
off : smub.source.output = 0
get_on : print(smub.source.output)
get_current : print(smub.measure.i())
set_voltage : smub.source.levelv =
set_current : smub.source.leveli =
get_source_current : print(smub.source.leveli)
get_voltage : print(smub.measure.v())
set_voltage : smub.source.levelv =
get_source_voltage : print(smub.source.levelv)
set_current_limit : smub.source.limiti =
get_current_limit : print(smub.source.limiti)
set_voltage_limit : smub.source.limitv =
get_voltage_limit : print(smub.source.limitv)
source_volt : smub.source.func = smub.OUTPUT_DCVOLTS
source_current : smub.source.func = smub.OUTPUT_DCAMPS
get_source_mode : print(smub.source.func)
set_voltage_range: smub.source.rangev =
get_voltage_range: print(smub.source.rangev)
set_voltage_autorange_on: smub.source.autorangev = smub.AUTORANGE_ON
set_voltage_autorange_off: smub.source.autorangev = smub.AUTORANGE_OFF
set_current_range: smub.source.rangei =
get_current_range: print(smub.source.rangei)
set_current_autorange_on: smub.source.autorangei = smub.AUTORANGE_ON
set_current_autorange_off: smub.source.autorangei = smub.AUTORANGE_OFF
four_wire_on: smub.sense = smub.SENSE_REMOTE
four_wire_off: smub.sense = smub.SENSE_LOCAL
set_current_sense_range: smub.measure.rangei =
get_current_sense_range: print(smub.measure.rangei)
set_voltage_sense_range: smub.measure.rangev =
get_voltage_sense_range: print(smub.measure.rangev)
set_mode_measure_current : display.smub.measure.func = display.MEASURE_DCAMPS


on : smua.source.output = 1
off : smua.source.output = 0
get_on : print(smua.source.output)
get_current : print(smua.measure.i())
set_voltage : smua.source.levelv =
set_current : smua.source.leveli =
get_source_current : print(smua.source.leveli)
get_voltage : print(smua.measure.v())
set_voltage : smua.source.levelv =
get_source_voltage : print(smua.source.levelv)
set_current_limit : smua.source.limiti =
get_current_limit : print(smua.source.limiti)
set_voltage_limit : smua.source.limitv =
get_voltage_limit : print(smua.source.limitv)
source_volt : smua.source.func = smua.OUTPUT_DCVOLTS
source_current : smua.source.func = smua.OUTPUT_DCAMPS
get_source_mode : print(smua.source.func)
set_voltage_range: smua.source.rangev =
get_voltage_range: print(smua.source.rangev)
set_voltage_autorange_on: smua.source.autorangev = smua.AUTORANGE_ON
set_voltage_autorange_off: smua.source.autorangev = smua.AUTORANGE_OFF
set_current_range: smua.source.rangei =
get_current_range: print(smua.source.rangei)
set_current_autorange_on: smua.source.autorangei = smua.AUTORANGE_ON
set_current_autorange_off: smua.source.autorangei = smua.AUTORANGE_OFF
four_wire_on: smua.sense = smua.SENSE_REMOTE
four_wire_off: smua.sense = smua.SENSE_LOCAL
set_current_sense_range: smua.measure.rangei =
get_current_sense_range: print(smua.measure.rangei)
set_voltage_sense_range: smua.measure.rangev =
get_voltage_sense_range: print(smua.measure.rangev)
set_mode_measure_current : display.smua.measure.func = display.MEASURE_DCAMPS

2 changes: 1 addition & 1 deletion basil/TL/Socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def close(self):
self._sock.close()

def write(self, data):
if type(data) == bytes:
if isinstance(data, bytes):
cmd = data
else:
cmd = data.encode(self.encoding)
Expand Down
2 changes: 1 addition & 1 deletion basil/firmware/modules/utils/CG_MOD_neg.v
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ input ck_in,enable;
output ck_out;
reg enl;

always @(ck_in or enable)
always_latch
if (ck_in)
enl = enable;
assign ck_out = ck_in | ~enl;
Expand Down
2 changes: 1 addition & 1 deletion basil/firmware/modules/utils/CG_MOD_pos.v
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ wire ck_inb;
reg enl;

assign ck_inb = ~ck_in;
always @(ck_inb or enable)
always_latch
if (ck_inb)
enl = enable;
assign ck_out = ck_in & enl;
Expand Down