Skip to content

Commit 3df350d

Browse files
committed
Merge branch 'spinler-fix-python_style' into 'devel'
Fix Python codestyle See merge request ndk/ndk-fpga!253
2 parents 5e1609d + e0dbfa7 commit 3df350d

File tree

20 files changed

+160
-118
lines changed

20 files changed

+160
-118
lines changed

build/scripts/multi_ver/multi_ver.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
import os
88
from os import system
99
from importlib.machinery import SourceFileLoader
10-
from random import randint
1110
import time
1211
from multi_ver_utils import reduce_combinations, create_setting_from_combination
1312

1413

1514
FAIL = False
1615

16+
1717
# Modify package file according to setting
1818
def apply_setting(pkg_file, setting, sed_str):
1919
env = {}
@@ -30,8 +30,6 @@ def apply_setting(pkg_file, setting, sed_str):
3030

3131
# Run Modelsim with the current test_pkg file
3232
def run_modelsim(fdo_file, test_name, manual=False, gui=False, coverage=False, env={}):
33-
global FAIL
34-
3533
logfile_name = f"transcript_{test_name}"
3634

3735
command = f"do {fdo_file};"

build/scripts/multi_ver/multi_ver_cocotb.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
import os
77
from os import system
88
from importlib.machinery import SourceFileLoader
9-
from random import randint
109
import time
1110
import os.path as op
1211
from multi_ver_utils import reduce_combinations, create_setting_from_combination
1312

1413
FAIL = False
1514

15+
1616
def junit(testResults: str, allowEmptyResults: bool = False) -> bool:
1717
if not op.exists(testResults):
1818
if allowEmptyResults:
@@ -41,6 +41,7 @@ def find_venv() -> str | None:
4141

4242
return None
4343

44+
4445
def run_modelsim(settings: dict, venv: str | None = None, gui=False):
4546
command = ""
4647

@@ -73,6 +74,7 @@ def run_modelsim(settings: dict, venv: str | None = None, gui=False):
7374
# Parsing script arguments
7475
##########
7576

77+
7678
parser = argparse.ArgumentParser()
7779

7880
parser.add_argument("settings_file", help="Name of verification settings \".py\" file containing \"SETTINGS\" dictionary variable")

build/scripts/multi_ver/multi_ver_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from random import randint
77

8+
89
# RANDOMLY reduce number of combination to a certain percentage
910
def reduce_combinations(combinations, reduction_perc=100):
1011
if reduction_perc >= 100:

comp/axis_tools/flow/switch/top/python/common/hdr_info.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
'name' : Ether._name,
1616
'width' : 14,
1717
'fields': {
18-
( 47, 0): 'dst',
19-
( 95, 48): 'src',
18+
(47, 0): 'dst',
19+
(95, 48): 'src',
2020
(111, 96): 'type',
2121
}
2222
}
@@ -51,18 +51,22 @@
5151
2: HDR_VLAN_1AD,
5252
}
5353

54-
def get_protocol_class(protocol:int) -> object|None:
54+
55+
def get_protocol_class(protocol: int) -> object | None:
5556
return HDR_DB[protocol]['class'] if protocol in HDR_DB else None
5657

57-
def field_is_supported(protocol:int, range_high:int, range_low:int) -> bool:
58+
59+
def field_is_supported(protocol: int, range_high: int, range_low: int) -> bool:
5860
return protocol in HDR_DB and (range_high, range_low) in HDR_DB[protocol]['fields']
5961

60-
def get_field_id(protocol:int, range_high:int, range_low:int) -> str:
62+
63+
def get_field_id(protocol: int, range_high: int, range_low: int) -> str:
6164
if field_is_supported(protocol, range_high, range_low):
6265
return HDR_DB[protocol]['fields'][(range_high, range_low)]
6366
return ''
6467

65-
def get_field_info_str(protocol:int, range_high:int, range_low:int) -> str:
68+
69+
def get_field_info_str(protocol: int, range_high: int, range_low: int) -> str:
6670
if field_is_supported(protocol, range_high, range_low):
6771
return HDR_DB[protocol]['name'] + ' - ' + get_field_id(protocol, range_high, range_low)
6872
return ''

0 commit comments

Comments
 (0)