You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 5, 2024. It is now read-only.
Merge branch 'schwarz-MVB_HASH_TABLE_SIMPLE_cocotb_Logic_Array' into 'main'
Nahrazení vlastní utility binary utils za LogicArray z cocotb.types v konfiguračním skriptu pro MVB_HASH_TABLE_SIMPLE a oprava stylu pomocí flake8
See merge request ndk/ofm!408
"""Tests the requested hash function for internal collisions caused by the key, where collision is a situation, where same hash is calcuted for one or more
161
-
different keys from the whole range of the key's values. If lot of collisions occur, it's best to consider using a different hash key.
189
+
"""Tests the requested hash function for internal collisions caused by the key, where collision is a situation,
190
+
where same hash is calcuted for one or more different keys from the whole range of the key's values. If lot of
191
+
collisions occur, it's best to consider using a different hash key.
162
192
163
193
Args:
164
194
hash_funtion: reference to a function used for calculating the hash (in other words, the hash function function :D).
"""Tests collisions between two different hash functions, where collision is a situation, where for the same key both hash functions calculate the same hash.
215
+
"""Tests collisions between two different hash functions, where collision is a situation, where for the same key both
216
+
hash functions calculate the same hash.
186
217
187
218
Args:
188
219
hash_function1: reference to a function used for calculating the hash (in other words, the hash function function :D).
"""Main interface of the interactive mode used to input commands. Runs until the 'exit' or 'quit' commands. All the command line commands are prefixed with 'comm'."""
235
+
"""Main interface of the interactive mode used to input commands. Runs until the 'exit' or 'quit' commands.
236
+
All the command line commands are prefixed with 'comm'."""
205
237
206
238
print(f"{colorama.Fore.BLUE+colorama.Style.BRIGHT}MVB HASH TABLE SIMPLE TOOLKIT, version 0.1\nCopyright (C) 2024 CESNET z. s. p. o.\nInput command 'help' for more info.\n{colorama.Style.RESET_ALL}")
207
239
@@ -225,9 +257,11 @@ def comm_add(self, key: int = None, data: int = None, table: str = "toeplitz", r
225
257
"""Adds a value to a chosen table, the position of the value is decided by the hash of the key.
226
258
227
259
Args:
228
-
key: mvb key, to which is the added value to be connected. The hash that decided position of the value in table is calculated from this number.
260
+
key: mvb key, to which is the added value to be connected. The hash that decided position of the value in table
261
+
is calculated from this number.
229
262
data: value to be added to the table.
230
-
table: decided to which table is the value to be added to. Toeplitz table is chosen by default, other option is 'xor' for adding to the simple xor table.
263
+
table: decided to which table is the value to be added to. Toeplitz table is chosen by default, other option is
264
+
'xor' for adding to the simple xor table.
231
265
232
266
"""
233
267
ifkeyisNoneordataisNone:
@@ -408,7 +442,6 @@ def comm_remove(self, mode: str = None, table: str = None, num: int = None, sile
408
442
print(f"{colorama.Fore.RED}Error:{colorama.Style.RESET_ALL} Invalid table. Possible tables are both, toeplitz, xor.")
409
443
return
410
444
411
-
# name = params[0]
412
445
hash_function, keys, hash_table, used=params[1:5]
413
446
414
447
ifmode=="record":
@@ -432,8 +465,8 @@ def comm_remove(self, mode: str = None, table: str = None, num: int = None, sile
0 commit comments