forked from devbisme/skidl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_index_slicing.py
39 lines (31 loc) · 1.15 KB
/
test_index_slicing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import pytest
from skidl import *
from .setup_teardown import *
def test_index_slicing_1():
mcu = Part("GameteSnapEDA", "STM32F767ZGT6", pin_splitters="/()")
mcu.match_pin_regex = False
assert len(mcu["FMC_D[0:15]"]) == 16
assert len(mcu["FMC_D[15:0]"]) == 16
mcu.match_pin_regex = True
assert len(mcu[r".*\(FMC_D[0:15]\).*"]) == 16
assert len(mcu[r".*\(FMC_D[15:0]\).*"]) == 16
assert len(mcu[r".*FMC_D[0:15]\).*"]) == 16
assert len(mcu[r".*FMC_D[15:0]\).*"]) == 16
def test_index_slicing_2():
mem = Part("GameteSnapEDA", "MT48LC16M16A2TG-6A_IT:GTR")
mem.match_pin_regex = False
assert len(mem["DQ[0:15]"]) == 16
assert len(mem["DQ[15:0]"]) == 16
assert len(mem["A[0:15]"]) == 13
assert len(mem["BA[0:15]"]) == 2
mem.match_pin_regex = True
assert len(mem["^A[0:15]"]) == 13
def test_index_slicing_3():
mem = Part("xess", "SDRAM_16Mx16_TSOPII-54")
mem.match_pin_regex = False
assert len(mem["DQ[0:15]"]) == 16
assert len(mem["DQ[15:0]"]) == 16
assert len(mem["A[0:15]"]) == 13
assert len(mem["BA[0:15]"]) == 2
mem.match_pin_regex = True
assert len(mem["^A[0:15]"]) == 13