Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bdaq53
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
silab
bdaq53
Merge requests
!69
USBPix3 support
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
USBPix3 support
KX1
into
development
Overview
0
Commits
2
Pipelines
11
Changes
62
Closed
Marco Vogt
requested to merge
KX1
into
development
7 years ago
Overview
0
Commits
2
Pipelines
11
Changes
62
Expand
ENH: MIO3/MMC3 + KX1 FPGA board support
Due to hardware limitations, the MIO3/MMC3 base boards only provide 2 MGT transceivers.
For the time being, only 1-lane mode with a single chip is possible. Could be extended to 2-lane mode or 2 chips in 1-lane mode in the future.
A Displayport-to-SMA adapter card or cable is needed.
Edited
7 years ago
by
Marco Vogt
0
0
Merge request reports
Compare
development
version 10
cc44e461
7 years ago
version 9
243e35da
7 years ago
version 8
f6bc7dc3
7 years ago
version 7
5d11533a
7 years ago
version 6
cbff3df5
7 years ago
version 5
7e326155
7 years ago
version 4
e1a39b5d
7 years ago
version 3
08efb242
7 years ago
version 2
470af2e9
7 years ago
version 1
4b6c5c72
7 years ago
development (base)
and
latest version
latest version
9ba244a7
2 commits,
7 years ago
version 10
cc44e461
1 commit,
7 years ago
version 9
243e35da
17 commits,
7 years ago
version 8
f6bc7dc3
16 commits,
7 years ago
version 7
5d11533a
15 commits,
7 years ago
version 6
cbff3df5
13 commits,
7 years ago
version 5
7e326155
12 commits,
7 years ago
version 4
e1a39b5d
11 commits,
7 years ago
version 3
08efb242
6 commits,
7 years ago
version 2
470af2e9
5 commits,
7 years ago
version 1
4b6c5c72
4 commits,
7 years ago
62 files
+
135289
−
180
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
62
Search (e.g. *.vue) (Ctrl+P)
bdaq53/needle_probe_card.py
0 → 100644
+
164
−
0
Options
#
# ------------------------------------------------------------
# Copyright (c) All rights reserved
# SiLab, Institute of Physics, University of Bonn
# ------------------------------------------------------------
#
'''
Slow contol and analog mux functions for the needle probe card
'''
import
logging
from
basil.HL.GPAC
import
GpioPca9554
loglevel
=
logging
.
getLogger
(
'
RD53A
'
).
getEffectiveLevel
()
class
NC_GPIO
(
GpioPca9554
):
'''
GPIO expander
'''
def
__init__
(
self
,
intf
,
conf
,
NC_CHIP_ADDR
=
0x00
,
NC_GPIO_CFG
=
0x00
):
super
(
NC_GPIO
,
self
).
__init__
(
intf
,
conf
)
self
.
logger
=
logging
.
getLogger
(
self
.
__class__
.
__name__
)
self
.
logger
.
setLevel
(
loglevel
)
self
.
PCA9554_ADD
=
NC_CHIP_ADDR
self
.
GPIO_CFG
=
NC_GPIO_CFG
def
_modify_register
(
self
,
mask
,
value
):
#read
reg_read
=
self
.
_read_output_port
()
self
.
logger
.
debug
(
'
register read: %s
'
%
format
(
reg_read
,
'
#010b
'
))
#modify
reg_mod
=
(
reg_read
&
~
mask
)
|
(
value
&
mask
)
self
.
logger
.
debug
(
'
register modify: %s
'
%
format
(
reg_mod
,
'
#010b
'
))
#write
self
.
_write_output_port
(
reg_mod
)
def
_read_port
(
self
,
mask
):
return
self
.
_read_output_port
()
&
mask
class
needle_probe_card
(
GpioPca9554
):
'''
RD53A needle probe card
3x PCA9554 gpio expanders
1x ADG1406 analog multiplexer
'''
_adc_mux_map
=
{
'
VINA
'
:
0x0
,
'
VIND
'
:
0x1
,
'
VDDA
'
:
0x2
,
'
VDDD
'
:
0x3
,
'
GND
'
:
0x4
,
'
IMUX_OUT
'
:
0x5
,
'
VMUX_OUT
'
:
0x6
,
'
IREF_OUT
'
:
0x7
,
'
IREF_IN
'
:
0x8
,
'
VREF_ADC_OUT
'
:
0x9
,
'
VREF_ADC_IN
'
:
0xa
,
'
NC
'
:
0xb
,
'
VINJ_HI
'
:
0xc
,
'
VINJ_MID
'
:
0xd
,
'
SLDO_VREFA
'
:
0xe
,
'
SLDO_VREFD
'
:
0xf
}
_gpio_expander_map
=
{
'''
Register name, chip addr, lsb offset, bits
'''
'
IREF_TRIM
'
:
[
0x02
,
0
,
4
],
#0b00001111],
'
PLL_RST_B
'
:
[
0x02
,
4
,
1
],
#0b00010000],
'
SLDO_COMP_EN_B
'
:
[
0x02
,
5
,
1
],
#0b00100000],
'
SLDO_POR_BG
'
:
[
0x02
,
6
,
1
],
#0b01000000],
'
CHIP_ID
'
:
[
0x01
,
0
,
3
],
#0b00000111],
'
EXT_POR_CAP
'
:
[
0x01
,
3
,
1
],
#0b00001000],
'
ES
'
:
[
0x00
,
0
,
2
],
#0b00000011],
'
VREF_EN
'
:
[
0x00
,
2
,
1
],
#0b00000100],
'
IREF_EN
'
:
[
0x00
,
3
,
1
],
#0b00001000],
'
MUX_SEL
'
:
[
0x00
,
4
,
4
]
#0b11110000]
}
def
__init__
(
self
,
intf
,
conf
):
super
(
needle_probe_card
,
self
).
__init__
(
intf
,
conf
)
self
.
_base_addr
=
conf
[
'
base_addr
'
]
self
.
logger
=
logging
.
getLogger
(
self
.
__class__
.
__name__
)
self
.
logger
.
setLevel
(
loglevel
)
self
.
gpio_0
=
NC_GPIO
(
intf
,
conf
,
NC_CHIP_ADDR
=
0x00
,
NC_GPIO_CFG
=
0x03
)
'''
GPIO expander @ I2C address 0x20 (0x40)
MUX_SEL[3:0], IREF_EN, VREF_EN, ES[2:1]
'''
self
.
gpio_1
=
NC_GPIO
(
intf
,
conf
,
NC_CHIP_ADDR
=
0x02
,
NC_GPIO_CFG
=
0x00
)
'''
GPIO expander @ I2C address 0x21 (0x42)
NC[7:4], EXT_POR_CAP, CHIP_ID[2:0]
'''
self
.
gpio_2
=
NC_GPIO
(
intf
,
conf
,
NC_CHIP_ADDR
=
0x04
,
NC_GPIO_CFG
=
0x00
)
'''
GPIO expander @ I2C address 0x22 (0x44)
NC, SLDO_POR_BG, SLDO_COMP_EN_B, PLL_RST_B, IREF_Trim[3:0]
'''
def
init
(
self
):
self
.
gpio_0
.
init
()
self
.
gpio_1
.
init
()
self
.
gpio_2
.
init
()
def
_calculate_mask
(
self
,
regname
):
mask
=
(
pow
(
2
,
self
.
_gpio_expander_map
[
regname
][
2
])
-
1
)
<<
self
.
_gpio_expander_map
[
regname
][
1
]
return
mask
def
write_gpio_expander
(
self
,
regname
,
value
):
val
=
(
value
<<
self
.
_gpio_expander_map
[
regname
][
1
])
mask
=
self
.
_calculate_mask
(
regname
)
self
.
logger
.
debug
(
'
write_gpio_expander: mask: %s
'
%
format
(
mask
,
'
#010b
'
))
self
.
logger
.
debug
(
'
write_gpio_expander: value: %s, shifted value: %s (%s)
'
%
(
hex
(
value
),
hex
(
val
),
format
(
val
,
'
#010b
'
)))
#select the chip
which_gpio_chip
=
self
.
_gpio_expander_map
[
regname
][
0
]
if
which_gpio_chip
==
0
:
self
.
gpio_0
.
_modify_register
(
mask
,
val
)
elif
which_gpio_chip
==
1
:
self
.
gpio_1
.
_modify_register
(
mask
,
val
)
elif
which_gpio_chip
==
2
:
self
.
gpio_2
.
_modify_register
(
mask
,
val
)
else
:
self
.
logger
.
error
(
'
Invalid GPIO expander chip selected
'
)
def
read_gpio_expander
(
self
,
regname
):
#select the chip
which_gpio_chip
=
self
.
_gpio_expander_map
[
regname
][
0
]
mask
=
self
.
_calculate_mask
(
regname
)
if
which_gpio_chip
==
0
:
value
=
self
.
gpio_0
.
_read_port
(
mask
)
elif
which_gpio_chip
==
1
:
value
=
self
.
gpio_1
.
_read_port
(
mask
)
elif
which_gpio_chip
==
2
:
value
=
self
.
gpio_2
.
_read_port
(
mask
)
else
:
self
.
logger
.
error
(
'
Invalid GPIO expander chip selected
'
)
self
.
logger
.
debug
(
'
read_gpio_expander: mask: %s
'
%
format
(
mask
,
'
#010b
'
))
self
.
logger
.
debug
(
'
read_gpio_expander: value: %s
'
%
format
(
value
,
'
#010b
'
))
#realign bits
value
=
value
>>
self
.
_gpio_expander_map
[
regname
][
1
]
self
.
logger
.
debug
(
'
read_gpio_expander: value: %s (%s)
'
%
(
hex
(
value
),
format
(
value
,
'
#010b
'
)))
return
value
def
get_ES_status
(
self
):
return
self
.
read_gpio_expander
(
'
ES
'
)
def
adc_mux
(
self
,
value
):
hexvalue
=
self
.
_adc_mux_map
[
value
]
self
.
write_gpio_expander
(
'
MUX_SEL
'
,
hexvalue
)
self
.
logger
.
debug
(
'
ADC MUX set to: %s
'
%
value
+
"
(
"
+
hex
(
hexvalue
)
+
"
)
"
)
Loading