diff --git a/Planter.py b/Planter.py index ec7816d..b4f783f 100755 --- a/Planter.py +++ b/Planter.py @@ -27,7 +27,7 @@ warnings.filterwarnings('ignore') # =================== import Planter src =================== -# funtions +# functions from src.functions.figure_to_ASCII import * from src.functions.json_encoder import * from src.functions.project_tree_graph import * @@ -45,12 +45,12 @@ def Planter(iteration = 0): # =================== set argparse for Planter =================== - parser = argparse.ArgumentParser(prog="Please use commend '-h' or '--help' for further information", + parser = argparse.ArgumentParser(prog="Please use command '-h' or '--help' for further information", usage='Planter can embed several ML algorithms to programmable network devices', description='It is a on going work, if you find any bugs, please feel free to contact changgang.zheng@eng.ox.ac.uk, it is really important to us. Thank you.', epilog='Play happy with Planter ~') parser.add_argument("-m", "--manually_config", help="Manually config Planter or not? If not set, please config the following file . If set, the Planter will ask you to input all the necessary configs.", action="store_true") - parser.add_argument("-o", "--auto_optimisation", help="Use auto hyperparameters tunning or not? If set, the Planter will trigger auto optimisation process. Please do not use this mode with other modes, Planter will handle everything.", action="store_true") + parser.add_argument("-o", "--auto_optimisation", help="Use auto hyperparameters tuning or not? If set, the Planter will trigger auto optimisation process. Please do not use this mode with other modes, Planter will handle everything.", action="store_true") parser.add_argument("-t", "--testing_mode", help="Use testing mode or not? If set, the testing mode will only use at most 20000 input data and 5000 testing data.", action="store_true") parser.add_argument("-d", "--draw_project_tree", help="Draw the project tree or not? If set, this mode will output a tree graph of the Planter project.", action="store_true") parser.add_argument("-f", "--draw_function_call_graph", help="Draw function calling dependency graph or not, if set, after running Planter, a function calling dependency graph will be generated under .", action="store_true") @@ -147,19 +147,19 @@ def Planter(iteration = 0): round = 0 while True: round += 1 - # call the function to find best paraemters and generate the config file + # call the function to find best parameters and generate the config file main_functions.config_generator(args, round) - # call Plantrer to verify the generated configs - print('= Begin varifcation for the generated configs. Rounds', round) + # call Planter to verify the generated configs + print('= Begin verification for the generated configs. Rounds', round) args.manually_config = False Planter(round) # reload the config file Planter_config = reload_config('src/configs/Planter_config.json') if Planter_config['optimisation config']['compile result'] == 'y': - print('= Verification seccess. Data plane and control plane codes are generated with best hyperparameters.') + print('= Verification success. Data plane and control plane codes are generated with best hyperparameters.') break else: - print('= Verification fales. Regenerate configs with higher constrained configs') + print('= Verification fails. Regenerate configs with higher constrained configs') exit() # =================== auto config mode config and operations finished =================== # print('= args:', args) diff --git a/src/configs/requirements_pip3.txt b/src/configs/requirements_pip3.txt index 37fc001..8c9ea05 100755 --- a/src/configs/requirements_pip3.txt +++ b/src/configs/requirements_pip3.txt @@ -2,18 +2,16 @@ scipy==1.5.2 joblib==1.0.0 pydotplus==2.0.2 pandas==1.1.3 -xgboost==0.90 +xgboost>=1.5.0 matplotlib==3.3.2 torch==1.4.0 -numpy==1.19.2 +numpy>=1.21.0 category_encoders==2.2.2 -scikit_learn +scikit-learn packaging==21.0 jsonschema==3.2.0 scapy==2.4.3 seaborn==0.11.2 -category_encoders==2.2.2 wget==3.2 -pytorch ipython tqdm diff --git a/src/configs/requirements_sudo_pip3.txt b/src/configs/requirements_sudo_pip3.txt index 5ffbfe5..ae2500c 100755 --- a/src/configs/requirements_sudo_pip3.txt +++ b/src/configs/requirements_sudo_pip3.txt @@ -1,8 +1,8 @@ - numpy==1.19.2 -scikit_learn==1.0 +numpy>=1.21.0 +scikit-learn==1.0 scapy==2.4.3 seaborn==0.11.2 category_encoders==2.2.2 wget==1.20.1 -pytorch==0.4.0 -multiprocess=0.70.12 +torch +multiprocess==0.70.12 diff --git a/src/functions/Range_to_LPM.py b/src/functions/Range_to_LPM.py index 826a7d9..fe90561 100644 --- a/src/functions/Range_to_LPM.py +++ b/src/functions/Range_to_LPM.py @@ -193,11 +193,11 @@ def Table_to_sep_val(table): lasat_lable = table[dict] if dict == 0: Table[dict] = table[dict] # When you get to the end of the for loop, the last value in table and final key is 0 - #This for-loop selects all feature values at bounderies and puts them in Table + #This for-loop selects all feature values at boundaries and puts them in Table #For instance if the first 20 actions of the exact match table were 112111112111211121111121 then Table would be 1121212121 in reverse order #Selects the value before the value change - separation_value = list(Table.keys()) #Selects index of seperation values (starting from highest e.g 99,98,86,77,56,29,6,1) + separation_value = list(Table.keys()) #Selects index of separation values (starting from highest e.g 99,98,86,77,56,29,6,1) return separation_value, separation_value_input diff --git a/src/help/Adding_Your_Own_Design/Adding_model.md b/src/help/Adding_Your_Own_Design/Adding_model.md index c6609e2..ed94e46 100644 --- a/src/help/Adding_Your_Own_Design/Adding_model.md +++ b/src/help/Adding_Your_Own_Design/Adding_model.md @@ -58,7 +58,7 @@ In ```table_generator.py```, there are two compulsory functions to be written, ` ``` sklearn_test_y # data frame/ndarray/list # sklearn (baseline) inference result (output labels) - # generated by funtion test_tables(*) + # generated by function test_tables(*) test_X # data frame/ndarray/list # testing data diff --git a/src/help/Common_Issues/Envronment_Issues.md b/src/help/Common_Issues/Envronment_Issues.md index 0b3f7d6..7eb1bde 100644 --- a/src/help/Common_Issues/Envronment_Issues.md +++ b/src/help/Common_Issues/Envronment_Issues.md @@ -25,7 +25,7 @@ If it turns out that some packages were not installed (even though you have set up the environment based on ```requirements.txt```), install the missing packages manually. -💡 To set up Planter on P4Pi-enabled BMv2, follow the wiki page in [this link](./src/help/Throughput_Test/Planter_throughput_test_P4Pi-BMv2.md). +💡 To set up Planter on P4Pi-enabled BMv2, follow the wiki page in [this link](../Throughput_Test/Planter_throughput_test_P4Pi-BMv2.md). ## Common Running Issues: diff --git a/src/help/Planter_Supports/Planter_Supported_Datasets.md b/src/help/Planter_Supports/Planter_Supported_Datasets.md index 7e52145..cc4ea78 100644 --- a/src/help/Planter_Supports/Planter_Supported_Datasets.md +++ b/src/help/Planter_Supports/Planter_Supported_Datasets.md @@ -16,7 +16,7 @@ Planter currently supports 7 datasets. **4. AWID3** [Link](https://icsdweb.aegean.gr/awid/awid3) - The AWID3 dataset is a network intrusion detection dataset with 13 different attacks. The data is collected from 16 different physical devices and VMs. -**5. Requet** [Link](https://github.com/Wimnet/RequetDataSet) - Requet is a Quality of Experience (QoE) metric detection dataset collected from video streaming services to give the records of video playback information. +**5. Request** [Link](https://github.com/Wimnet/RequetDataSet) - Request is a Quality of Experience (QoE) metric detection dataset collected from video streaming services to give the records of video playback information. **6. Jane Street Market** [Link](https://www.kaggle.com/c/jane-street-market-prediction) - Jane Street Markets is a high-frequency trading dataset with 500 days of historical data. Specifically, it contains 130 features. diff --git a/src/models/Autoencoder/Type_1/readme.md b/src/models/Autoencoder/Type_1/readme.md index 7e3a873..27bb986 100644 --- a/src/models/Autoencoder/Type_1/readme.md +++ b/src/models/Autoencoder/Type_1/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for Autoencoder. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for Autoencoder. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/Autoencoder/Type_LB/readme.md b/src/models/Autoencoder/Type_LB/readme.md index 7e3a873..27bb986 100644 --- a/src/models/Autoencoder/Type_LB/readme.md +++ b/src/models/Autoencoder/Type_LB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for Autoencoder. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for Autoencoder. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/Bayes/Type_1/readme.md b/src/models/Bayes/Type_1/readme.md index 19d16ce..c5bf513 100644 --- a/src/models/Bayes/Type_1/readme.md +++ b/src/models/Bayes/Type_1/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for Bayes. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for Bayes. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/Bayes/Type_2/readme.md b/src/models/Bayes/Type_2/readme.md index 19d16ce..c5bf513 100644 --- a/src/models/Bayes/Type_2/readme.md +++ b/src/models/Bayes/Type_2/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for Bayes. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for Bayes. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/Bayes/Type_3/readme.md b/src/models/Bayes/Type_3/readme.md index 19d16ce..c5bf513 100644 --- a/src/models/Bayes/Type_3/readme.md +++ b/src/models/Bayes/Type_3/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for Bayes. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for Bayes. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/Bayes/Type_LB/readme.md b/src/models/Bayes/Type_LB/readme.md index 19d16ce..c5bf513 100644 --- a/src/models/Bayes/Type_LB/readme.md +++ b/src/models/Bayes/Type_LB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for Bayes. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for Bayes. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/Bayes/Type_LB_Bernoulli/readme.md b/src/models/Bayes/Type_LB_Bernoulli/readme.md index 19d16ce..c5bf513 100644 --- a/src/models/Bayes/Type_LB_Bernoulli/readme.md +++ b/src/models/Bayes/Type_LB_Bernoulli/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for Bayes. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for Bayes. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/DT/Type_1/readme.md b/src/models/DT/Type_1/readme.md index 8b1ff67..2f4f8d9 100644 --- a/src/models/DT/Type_1/readme.md +++ b/src/models/DT/Type_1/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/DT/Type_1/table_generator.py b/src/models/DT/Type_1/table_generator.py index 5cc6649..d4d7ca5 100755 --- a/src/models/DT/Type_1/table_generator.py +++ b/src/models/DT/Type_1/table_generator.py @@ -81,7 +81,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -164,11 +164,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -195,7 +195,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -220,16 +220,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -266,8 +266,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -383,7 +383,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Ternary_Table = json.load(open('Tables/Ternary_Table.json', 'r')) Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/DT/Type_1_xsa/readme.md b/src/models/DT/Type_1_xsa/readme.md index 8b1ff67..2f4f8d9 100644 --- a/src/models/DT/Type_1_xsa/readme.md +++ b/src/models/DT/Type_1_xsa/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/DT/Type_1_xsa/table_generator.py b/src/models/DT/Type_1_xsa/table_generator.py index 3723ac1..aa600fe 100755 --- a/src/models/DT/Type_1_xsa/table_generator.py +++ b/src/models/DT/Type_1_xsa/table_generator.py @@ -81,7 +81,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -164,11 +164,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -195,7 +195,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -220,16 +220,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -264,8 +264,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): textfile, feature_split = find_feature_split(model, tree_index, num_features) g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -381,7 +381,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Ternary_Table = json.load(open('Tables/Ternary_Table.json', 'r')) Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/DT/Type_2/readme.md b/src/models/DT/Type_2/readme.md index 8b1ff67..2f4f8d9 100644 --- a/src/models/DT/Type_2/readme.md +++ b/src/models/DT/Type_2/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/DT/Type_2/table_generator.py b/src/models/DT/Type_2/table_generator.py index 3ed819e..11305f3 100755 --- a/src/models/DT/Type_2/table_generator.py +++ b/src/models/DT/Type_2/table_generator.py @@ -81,7 +81,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -163,11 +163,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -194,7 +194,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -219,16 +219,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -263,8 +263,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): textfile, feature_split = find_feature_split(model, tree_index, num_features) g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -393,7 +393,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Ternary_Table = json.load(open('Tables/Ternary_Table.json', 'r')) Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/DT/Type_3/readme.md b/src/models/DT/Type_3/readme.md index 8b1ff67..2f4f8d9 100644 --- a/src/models/DT/Type_3/readme.md +++ b/src/models/DT/Type_3/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/DT/Type_3/table_generator.py b/src/models/DT/Type_3/table_generator.py index 371bd0a..f5c0778 100755 --- a/src/models/DT/Type_3/table_generator.py +++ b/src/models/DT/Type_3/table_generator.py @@ -82,7 +82,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -167,11 +167,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -200,7 +200,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -227,16 +227,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -273,8 +273,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -420,7 +420,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Ternary_Table = json.load(open('Tables/Ternary_Table.json', 'r')) Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/DT/Type_4/readme.md b/src/models/DT/Type_4/readme.md index 8b1ff67..2f4f8d9 100644 --- a/src/models/DT/Type_4/readme.md +++ b/src/models/DT/Type_4/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/DT/Type_4/table_generator.py b/src/models/DT/Type_4/table_generator.py index f4da52d..cd73fc8 100755 --- a/src/models/DT/Type_4/table_generator.py +++ b/src/models/DT/Type_4/table_generator.py @@ -83,7 +83,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -168,11 +168,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -201,7 +201,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -228,16 +228,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -274,8 +274,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -421,7 +421,7 @@ def test_tables(sklearn_test_y, test_X, test_y): LPM_Table = json.load(open('Tables/LPM_Table.json', 'r')) Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/DT/Type_5/readme.md b/src/models/DT/Type_5/readme.md index 8b1ff67..2f4f8d9 100644 --- a/src/models/DT/Type_5/readme.md +++ b/src/models/DT/Type_5/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/DT/Type_5/table_generator.py b/src/models/DT/Type_5/table_generator.py index d88341e..bf48e98 100755 --- a/src/models/DT/Type_5/table_generator.py +++ b/src/models/DT/Type_5/table_generator.py @@ -84,7 +84,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -167,11 +167,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -198,7 +198,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -223,16 +223,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -269,8 +269,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -415,7 +415,7 @@ def test_tables(sklearn_test_y, test_X, test_y): LPM_Table = json.load(open('Tables/LPM_Table.json', 'r')) Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/DT/Type_DM/readme.md b/src/models/DT/Type_DM/readme.md index 8b1ff67..2f4f8d9 100644 --- a/src/models/DT/Type_DM/readme.md +++ b/src/models/DT/Type_DM/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/DT/Type_DM/table_generator.py b/src/models/DT/Type_DM/table_generator.py index 8e729d2..9d48e7e 100755 --- a/src/models/DT/Type_DM/table_generator.py +++ b/src/models/DT/Type_DM/table_generator.py @@ -228,7 +228,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) diff --git a/src/models/DT/Type_EB/readme.md b/src/models/DT/Type_EB/readme.md index 8b1ff67..2f4f8d9 100644 --- a/src/models/DT/Type_EB/readme.md +++ b/src/models/DT/Type_EB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/DT/Type_EB/table_generator.py b/src/models/DT/Type_EB/table_generator.py index 6db346a..e716e57 100755 --- a/src/models/DT/Type_EB/table_generator.py +++ b/src/models/DT/Type_EB/table_generator.py @@ -82,7 +82,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -167,11 +167,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -200,7 +200,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -227,16 +227,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -273,8 +273,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -420,7 +420,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Ternary_Table = json.load(open('Tables/Ternary_Table.json', 'r')) Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/DT/Type_depth_based_bmv2_only/readme.md b/src/models/DT/Type_depth_based_bmv2_only/readme.md index 8b1ff67..2f4f8d9 100644 --- a/src/models/DT/Type_depth_based_bmv2_only/readme.md +++ b/src/models/DT/Type_depth_based_bmv2_only/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for DT. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/DT/Type_depth_based_bmv2_only/table_generator.py b/src/models/DT/Type_depth_based_bmv2_only/table_generator.py index f25ffb4..42d7c61 100755 --- a/src/models/DT/Type_depth_based_bmv2_only/table_generator.py +++ b/src/models/DT/Type_depth_based_bmv2_only/table_generator.py @@ -223,7 +223,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) diff --git a/src/models/IF/Type_1/readme.md b/src/models/IF/Type_1/readme.md index 6dff52f..907d038 100644 --- a/src/models/IF/Type_1/readme.md +++ b/src/models/IF/Type_1/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for IF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for IF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/IF/Type_1/table_generator.py b/src/models/IF/Type_1/table_generator.py index a9080c2..df67331 100755 --- a/src/models/IF/Type_1/table_generator.py +++ b/src/models/IF/Type_1/table_generator.py @@ -65,7 +65,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file # print(node) ind = n_node_samples[node] clause = clause[:-4] + ' then ' + str(ind) @@ -147,11 +147,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -178,7 +178,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): num_nodes = 0 @@ -205,16 +205,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append([num_nodes, int(num[i][a - 1])]) + classification.append([num_nodes, int(num[i][a - 1])]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -251,16 +251,16 @@ def generate_table(model, tree_index, num_features, g_table, feature_max, leaf_i g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 g_table[tree_index] = generate_code_table(g_table[tree_index], path_to_leaf, num_features) - # print(classfication) + # print(classification) print('\rThe table for Tree: {} is generated'.format(tree_index), end="") - leaf_info['tree '+str(tree_index)]= np.unique(classfication, axis=0) + leaf_info['tree '+str(tree_index)]= np.unique(classification, axis=0) return g_table, leaf_info def _average_path_length(n_samples_leaf): @@ -525,7 +525,7 @@ def test_tables(sklearn_test_y, test_X, test_y): LPM_Table = json.load(open('Tables/LPM_Table.json', 'r')) Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/IF/Type_2/readme.md b/src/models/IF/Type_2/readme.md index 6dff52f..907d038 100644 --- a/src/models/IF/Type_2/readme.md +++ b/src/models/IF/Type_2/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for IF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for IF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/IF/Type_2/table_generator.py b/src/models/IF/Type_2/table_generator.py index 8dfaff1..05dfbe2 100755 --- a/src/models/IF/Type_2/table_generator.py +++ b/src/models/IF/Type_2/table_generator.py @@ -65,7 +65,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file # print(node) ind = n_node_samples[node] clause = clause[:-4] + ' then ' + str(ind) @@ -147,11 +147,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -178,7 +178,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): num_nodes = 0 @@ -205,16 +205,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num_nodes) + classification.append(num_nodes) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -251,15 +251,15 @@ def generate_table(model, tree_index, num_features, g_table, feature_max, leaf_i g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 g_table[tree_index] = generate_code_table(g_table[tree_index], path_to_leaf, num_features) print('\rThe table for Tree: {} is generated'.format(tree_index), end="") - leaf_info['tree '+str(tree_index)]= np.unique(classfication) + leaf_info['tree '+str(tree_index)]= np.unique(classification) return g_table, leaf_info @@ -467,7 +467,7 @@ def test_tables(sklearn_test_y, test_X, test_y): LPM_Table = json.load(open('Tables/LPM_Table.json', 'r')) Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/IF/Type_EB/readme.md b/src/models/IF/Type_EB/readme.md index 6dff52f..907d038 100644 --- a/src/models/IF/Type_EB/readme.md +++ b/src/models/IF/Type_EB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for IF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for IF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/IF/Type_EB/table_generator.py b/src/models/IF/Type_EB/table_generator.py index bfc6d74..cd35bda 100755 --- a/src/models/IF/Type_EB/table_generator.py +++ b/src/models/IF/Type_EB/table_generator.py @@ -65,7 +65,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file # print(node) ind = n_node_samples[node] clause = clause[:-4] + ' then ' + str(ind) @@ -147,11 +147,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -178,7 +178,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): num_nodes = 0 @@ -205,16 +205,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append([num_nodes, int(num[i][a - 1])]) + classification.append([num_nodes, int(num[i][a - 1])]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -251,16 +251,16 @@ def generate_table(model, tree_index, num_features, g_table, feature_max, leaf_i g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 g_table[tree_index] = generate_code_table(g_table[tree_index], path_to_leaf, num_features) - # print(classfication) + # print(classification) print('\rThe table for Tree: {} is generated'.format(tree_index), end="") - leaf_info['tree '+str(tree_index)]= np.unique(classfication, axis=0) + leaf_info['tree '+str(tree_index)]= np.unique(classification, axis=0) return g_table, leaf_info def _average_path_length(n_samples_leaf): @@ -526,7 +526,7 @@ def test_tables(sklearn_test_y, test_X, test_y): LPM_Table = json.load(open('Tables/LPM_Table.json', 'r')) Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/IF/Type_Simplified_EB/readme.md b/src/models/IF/Type_Simplified_EB/readme.md index 6dff52f..907d038 100644 --- a/src/models/IF/Type_Simplified_EB/readme.md +++ b/src/models/IF/Type_Simplified_EB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for IF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for IF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/IF/Type_Simplified_EB/table_generator.py b/src/models/IF/Type_Simplified_EB/table_generator.py index 7bfd676..c2fac00 100755 --- a/src/models/IF/Type_Simplified_EB/table_generator.py +++ b/src/models/IF/Type_Simplified_EB/table_generator.py @@ -65,7 +65,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file # print(node) ind = n_node_samples[node] clause = clause[:-4] + ' then ' + str(ind) @@ -147,11 +147,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -178,7 +178,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): num_nodes = 0 @@ -205,16 +205,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num_nodes) + classification.append(num_nodes) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -251,16 +251,16 @@ def generate_table(model, tree_index, num_features, g_table, feature_max, leaf_i g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 g_table[tree_index] = generate_code_table(g_table[tree_index], path_to_leaf, num_features) - # print(classfication) + # print(classification) print('\rThe table for Tree: {} is generated'.format(tree_index), end="") - leaf_info['tree '+str(tree_index)]= np.unique(classfication) + leaf_info['tree '+str(tree_index)]= np.unique(classification) return g_table, leaf_info @@ -471,7 +471,7 @@ def test_tables(sklearn_test_y, test_X, test_y): LPM_Table = json.load(open('Tables/LPM_Table.json', 'r')) Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/KM/Type_1/readme.md b/src/models/KM/Type_1/readme.md index f63d182..94ed25e 100644 --- a/src/models/KM/Type_1/readme.md +++ b/src/models/KM/Type_1/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for KM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for KM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/KM/Type_EB/readme.md b/src/models/KM/Type_EB/readme.md index f63d182..94ed25e 100644 --- a/src/models/KM/Type_EB/readme.md +++ b/src/models/KM/Type_EB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for KM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for KM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/KM/Type_LB/readme.md b/src/models/KM/Type_LB/readme.md index f63d182..94ed25e 100644 --- a/src/models/KM/Type_LB/readme.md +++ b/src/models/KM/Type_LB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for KM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for KM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/KM/Type_clustreams/readme.md b/src/models/KM/Type_clustreams/readme.md index f63d182..94ed25e 100644 --- a/src/models/KM/Type_clustreams/readme.md +++ b/src/models/KM/Type_clustreams/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for KM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for KM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/KNN/Type_1/readme.md b/src/models/KNN/Type_1/readme.md index 95f7ba1..657eac9 100644 --- a/src/models/KNN/Type_1/readme.md +++ b/src/models/KNN/Type_1/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for KNN. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for KNN. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/KNN/Type_EB/readme.md b/src/models/KNN/Type_EB/readme.md index 95f7ba1..657eac9 100644 --- a/src/models/KNN/Type_EB/readme.md +++ b/src/models/KNN/Type_EB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for KNN. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for KNN. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/NN/Type_1/BinaryNet/config.py b/src/models/NN/Type_1/BinaryNet/config.py index 51c5c8e..9e7e279 100755 --- a/src/models/NN/Type_1/BinaryNet/config.py +++ b/src/models/NN/Type_1/BinaryNet/config.py @@ -11,7 +11,7 @@ class LoaderMeta(type): """Constructor for supporting `!include`. """ def __new__(mcs, __name__, __bases__, __dict__): - """Add include constructer to class.""" + """Add include constructor to class.""" # register the include constructor on the class cls = super().__new__(mcs, __name__, __bases__, __dict__) cls.add_constructor('!include', cls.construct_include) diff --git a/src/models/NN/Type_1/readme.md b/src/models/NN/Type_1/readme.md index 955597d..9f6a8c9 100644 --- a/src/models/NN/Type_1/readme.md +++ b/src/models/NN/Type_1/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for NN. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for NN. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/NN/Type_1/table_generator.py b/src/models/NN/Type_1/table_generator.py index 66a69bb..ffc743e 100755 --- a/src/models/NN/Type_1/table_generator.py +++ b/src/models/NN/Type_1/table_generator.py @@ -239,7 +239,7 @@ def test_tables(sklearn_test_y, test_X, test_y): width = Planter_config['p4 config']["width of inputs"] Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') correct = 0 switch_test_y = [] diff --git a/src/models/NN/Type_2/BinaryNet/config.py b/src/models/NN/Type_2/BinaryNet/config.py index 51c5c8e..9e7e279 100755 --- a/src/models/NN/Type_2/BinaryNet/config.py +++ b/src/models/NN/Type_2/BinaryNet/config.py @@ -11,7 +11,7 @@ class LoaderMeta(type): """Constructor for supporting `!include`. """ def __new__(mcs, __name__, __bases__, __dict__): - """Add include constructer to class.""" + """Add include constructor to class.""" # register the include constructor on the class cls = super().__new__(mcs, __name__, __bases__, __dict__) cls.add_constructor('!include', cls.construct_include) diff --git a/src/models/NN/Type_2/readme.md b/src/models/NN/Type_2/readme.md index 955597d..9f6a8c9 100644 --- a/src/models/NN/Type_2/readme.md +++ b/src/models/NN/Type_2/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for NN. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for NN. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/NN/Type_2/table_generator.py b/src/models/NN/Type_2/table_generator.py index 3ae304d..9b560ea 100755 --- a/src/models/NN/Type_2/table_generator.py +++ b/src/models/NN/Type_2/table_generator.py @@ -274,7 +274,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/NN/Type_DM/BinaryNet/config.py b/src/models/NN/Type_DM/BinaryNet/config.py index 51c5c8e..9e7e279 100755 --- a/src/models/NN/Type_DM/BinaryNet/config.py +++ b/src/models/NN/Type_DM/BinaryNet/config.py @@ -11,7 +11,7 @@ class LoaderMeta(type): """Constructor for supporting `!include`. """ def __new__(mcs, __name__, __bases__, __dict__): - """Add include constructer to class.""" + """Add include constructor to class.""" # register the include constructor on the class cls = super().__new__(mcs, __name__, __bases__, __dict__) cls.add_constructor('!include', cls.construct_include) diff --git a/src/models/NN/Type_DM/readme.md b/src/models/NN/Type_DM/readme.md index 955597d..9f6a8c9 100644 --- a/src/models/NN/Type_DM/readme.md +++ b/src/models/NN/Type_DM/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for NN. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for NN. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/NN/Type_DM/table_generator.py b/src/models/NN/Type_DM/table_generator.py index efa3ff6..c2d7dd6 100755 --- a/src/models/NN/Type_DM/table_generator.py +++ b/src/models/NN/Type_DM/table_generator.py @@ -239,7 +239,7 @@ def test_tables(sklearn_test_y, test_X, test_y): width = Planter_config['p4 config']["width of inputs"] Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') correct = 0 switch_test_y = [] diff --git a/src/models/PCA/Type_1/readme.md b/src/models/PCA/Type_1/readme.md index a85ed65..00ff201 100644 --- a/src/models/PCA/Type_1/readme.md +++ b/src/models/PCA/Type_1/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for PCA. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for PCA. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/PCA/Type_LB/readme.md b/src/models/PCA/Type_LB/readme.md index a85ed65..00ff201 100644 --- a/src/models/PCA/Type_LB/readme.md +++ b/src/models/PCA/Type_LB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for PCA. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for PCA. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_1/readme.md b/src/models/RF/Type_1/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_1/readme.md +++ b/src/models/RF/Type_1/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_1/table_generator.py b/src/models/RF/Type_1/table_generator.py index 4ba0cee..2aedcbd 100755 --- a/src/models/RF/Type_1/table_generator.py +++ b/src/models/RF/Type_1/table_generator.py @@ -64,7 +64,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -147,11 +147,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -178,7 +178,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -203,16 +203,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -249,8 +249,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -429,7 +429,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/RF/Type_1_xsa/readme.md b/src/models/RF/Type_1_xsa/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_1_xsa/readme.md +++ b/src/models/RF/Type_1_xsa/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_1_xsa/table_generator.py b/src/models/RF/Type_1_xsa/table_generator.py index a445732..be3183d 100755 --- a/src/models/RF/Type_1_xsa/table_generator.py +++ b/src/models/RF/Type_1_xsa/table_generator.py @@ -64,7 +64,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -147,11 +147,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -178,7 +178,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -203,16 +203,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -247,8 +247,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): textfile, feature_split = find_feature_split(model, tree_index, num_features) g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -425,7 +425,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/RF/Type_2/readme.md b/src/models/RF/Type_2/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_2/readme.md +++ b/src/models/RF/Type_2/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_2/table_generator.py b/src/models/RF/Type_2/table_generator.py index 0467ac0..d3ce8b2 100755 --- a/src/models/RF/Type_2/table_generator.py +++ b/src/models/RF/Type_2/table_generator.py @@ -64,7 +64,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -146,11 +146,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -177,7 +177,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -202,16 +202,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -246,8 +246,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): textfile, feature_split = find_feature_split(model, tree_index, num_features) g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -458,7 +458,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/RF/Type_3/readme.md b/src/models/RF/Type_3/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_3/readme.md +++ b/src/models/RF/Type_3/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_3/table_generator.py b/src/models/RF/Type_3/table_generator.py index 567b808..97521e2 100755 --- a/src/models/RF/Type_3/table_generator.py +++ b/src/models/RF/Type_3/table_generator.py @@ -65,7 +65,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -150,11 +150,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -183,7 +183,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -210,16 +210,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -256,8 +256,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -481,7 +481,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/RF/Type_4/readme.md b/src/models/RF/Type_4/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_4/readme.md +++ b/src/models/RF/Type_4/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_4/table_generator.py b/src/models/RF/Type_4/table_generator.py index 8071350..6819165 100755 --- a/src/models/RF/Type_4/table_generator.py +++ b/src/models/RF/Type_4/table_generator.py @@ -65,7 +65,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -149,11 +149,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -182,7 +182,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -209,16 +209,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -255,8 +255,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -483,7 +483,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/RF/Type_5/readme.md b/src/models/RF/Type_5/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_5/readme.md +++ b/src/models/RF/Type_5/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_5/table_generator.py b/src/models/RF/Type_5/table_generator.py index 1e53b32..b6f7420 100755 --- a/src/models/RF/Type_5/table_generator.py +++ b/src/models/RF/Type_5/table_generator.py @@ -66,7 +66,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -149,11 +149,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -180,7 +180,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -205,16 +205,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -251,8 +251,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -487,7 +487,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/RF/Type_DM/readme.md b/src/models/RF/Type_DM/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_DM/readme.md +++ b/src/models/RF/Type_DM/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_DM/table_generator.py b/src/models/RF/Type_DM/table_generator.py index d650f94..e3dbffb 100755 --- a/src/models/RF/Type_DM/table_generator.py +++ b/src/models/RF/Type_DM/table_generator.py @@ -228,7 +228,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) diff --git a/src/models/RF/Type_DM_bmv2_only/readme.md b/src/models/RF/Type_DM_bmv2_only/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_DM_bmv2_only/readme.md +++ b/src/models/RF/Type_DM_bmv2_only/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_DM_bmv2_only/table_generator.py b/src/models/RF/Type_DM_bmv2_only/table_generator.py index 17598d8..21464ed 100755 --- a/src/models/RF/Type_DM_bmv2_only/table_generator.py +++ b/src/models/RF/Type_DM_bmv2_only/table_generator.py @@ -225,7 +225,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) diff --git a/src/models/RF/Type_EB/readme.md b/src/models/RF/Type_EB/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_EB/readme.md +++ b/src/models/RF/Type_EB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_EB/table_generator.py b/src/models/RF/Type_EB/table_generator.py index b9dee96..aced5fd 100755 --- a/src/models/RF/Type_EB/table_generator.py +++ b/src/models/RF/Type_EB/table_generator.py @@ -65,7 +65,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -150,11 +150,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(int(feature_max[i]+1)): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -183,7 +183,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -210,16 +210,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -256,8 +256,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -485,7 +485,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/RF/Type_EB_auto/readme.md b/src/models/RF/Type_EB_auto/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_EB_auto/readme.md +++ b/src/models/RF/Type_EB_auto/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_EB_auto/table_generator.py b/src/models/RF/Type_EB_auto/table_generator.py index 2d08009..9799cb5 100755 --- a/src/models/RF/Type_EB_auto/table_generator.py +++ b/src/models/RF/Type_EB_auto/table_generator.py @@ -67,7 +67,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) @@ -152,11 +152,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(int(feature_max[i]+1)): - if nife !=[] : - if len(nife) > count_code: - if j-1 == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j-1 == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -185,7 +185,7 @@ def find_classification(textfile, feature_split, num_features): sign.append(re.findall(r"(<=|>)", line)) num.append(re.findall(r"\d+\.?\d*", line)) f.close() - classfication = [] + classification = [] featuren = {} for i in range(len(fea)): for l in range(num_features): @@ -212,16 +212,16 @@ def find_classification(textfile, feature_split, num_features): for l in range(num_features): feature_n[l].append(featuren[l]) a = len(num[i]) - classfication.append(num[i][a - 1]) + classification.append(num[i][a - 1]) - return feature_n, classfication + return feature_n, classification -def find_path_for_leaf_nodes(feature_n, classfication, num_features): +def find_path_for_leaf_nodes(feature_n, classification, num_features): path_to_leaf = {} - for i in range(len(classfication)): + for i in range(len(classification)): path_to_leaf["path "+str(i)] = {} - path_to_leaf["path " + str(i)]["leaf"] = classfication[i] + path_to_leaf["path " + str(i)]["leaf"] = classification[i] for j in range(num_features): path_to_leaf["path " + str(i)]["feature "+str(j)] = feature_n[j][i] return path_to_leaf @@ -258,8 +258,8 @@ def generate_table(model, tree_index, num_features, g_table, feature_max): g_table[tree_index] = {} g_table[tree_index] = generate_feature_tables(feature_split, num_features, feature_max, g_table[tree_index]) - feature_n, classfication = find_classification(textfile, feature_split , num_features) - path_to_leaf = find_path_for_leaf_nodes(feature_n, classfication, num_features) + feature_n, classification = find_classification(textfile, feature_split , num_features) + path_to_leaf = find_path_for_leaf_nodes(feature_n, classification, num_features) code_width_for_feature = np.zeros(num_features) for i in range(num_features): code_width_for_feature[i] = int(np.ceil(math.log(g_table[tree_index]['feature ' + str(i)][np.max(list(g_table[tree_index]['feature ' + str(i)].keys()))]+1,2))) or 1 @@ -499,7 +499,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/RF/Type_depth_based/readme.md b/src/models/RF/Type_depth_based/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_depth_based/readme.md +++ b/src/models/RF/Type_depth_based/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_depth_based/table_generator.py b/src/models/RF/Type_depth_based/table_generator.py index d650f94..e3dbffb 100755 --- a/src/models/RF/Type_depth_based/table_generator.py +++ b/src/models/RF/Type_depth_based/table_generator.py @@ -228,7 +228,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) diff --git a/src/models/RF/Type_depth_based_bmv2_only/readme.md b/src/models/RF/Type_depth_based_bmv2_only/readme.md index 20b917d..57663ba 100644 --- a/src/models/RF/Type_depth_based_bmv2_only/readme.md +++ b/src/models/RF/Type_depth_based_bmv2_only/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for RF. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/RF/Type_depth_based_bmv2_only/table_generator.py b/src/models/RF/Type_depth_based_bmv2_only/table_generator.py index 4ed138a..8d51f68 100755 --- a/src/models/RF/Type_depth_based_bmv2_only/table_generator.py +++ b/src/models/RF/Type_depth_based_bmv2_only/table_generator.py @@ -227,7 +227,7 @@ def recurse(left, right, child, lineage=None): else: sign = g clause = clause + i[3] + sign + str(i[2]) + ' and ' - # wirte the node information into text file + # write the node information into text file a = list(value[node][0]) ind = a.index(np.max(a)) clause = clause[:-4] + ' then ' + str(ind) diff --git a/src/models/SVM/Type_1/readme.md b/src/models/SVM/Type_1/readme.md index 2fe18a5..2d3e762 100644 --- a/src/models/SVM/Type_1/readme.md +++ b/src/models/SVM/Type_1/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for SVM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for SVM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/SVM/Type_LB/readme.md b/src/models/SVM/Type_LB/readme.md index 2fe18a5..2d3e762 100644 --- a/src/models/SVM/Type_LB/readme.md +++ b/src/models/SVM/Type_LB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for SVM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for SVM. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/XGB/Type_1/readme.md b/src/models/XGB/Type_1/readme.md index b91f444..327a938 100644 --- a/src/models/XGB/Type_1/readme.md +++ b/src/models/XGB/Type_1/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/XGB/Type_1/table_generator.py b/src/models/XGB/Type_1/table_generator.py index 7e5c8f4..6a6f1cc 100755 --- a/src/models/XGB/Type_1/table_generator.py +++ b/src/models/XGB/Type_1/table_generator.py @@ -123,11 +123,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -456,7 +456,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/XGB/Type_2/readme.md b/src/models/XGB/Type_2/readme.md index b91f444..327a938 100644 --- a/src/models/XGB/Type_2/readme.md +++ b/src/models/XGB/Type_2/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/XGB/Type_2/table_generator.py b/src/models/XGB/Type_2/table_generator.py index a641a80..25cb3a4 100755 --- a/src/models/XGB/Type_2/table_generator.py +++ b/src/models/XGB/Type_2/table_generator.py @@ -124,11 +124,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -455,7 +455,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/XGB/Type_2_xsa/readme.md b/src/models/XGB/Type_2_xsa/readme.md index b91f444..327a938 100644 --- a/src/models/XGB/Type_2_xsa/readme.md +++ b/src/models/XGB/Type_2_xsa/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/XGB/Type_2_xsa/table_generator.py b/src/models/XGB/Type_2_xsa/table_generator.py index 812e591..68a63ba 100755 --- a/src/models/XGB/Type_2_xsa/table_generator.py +++ b/src/models/XGB/Type_2_xsa/table_generator.py @@ -124,11 +124,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -459,7 +459,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/XGB/Type_3/readme.md b/src/models/XGB/Type_3/readme.md index b91f444..327a938 100644 --- a/src/models/XGB/Type_3/readme.md +++ b/src/models/XGB/Type_3/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/XGB/Type_3/table_generator.py b/src/models/XGB/Type_3/table_generator.py index 7ad8f97..c8317a5 100755 --- a/src/models/XGB/Type_3/table_generator.py +++ b/src/models/XGB/Type_3/table_generator.py @@ -125,11 +125,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -463,7 +463,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/XGB/Type_EB/readme.md b/src/models/XGB/Type_EB/readme.md index b91f444..327a938 100644 --- a/src/models/XGB/Type_EB/readme.md +++ b/src/models/XGB/Type_EB/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/XGB/Type_EB/table_generator.py b/src/models/XGB/Type_EB/table_generator.py index c5b4abf..a906d00 100755 --- a/src/models/XGB/Type_EB/table_generator.py +++ b/src/models/XGB/Type_EB/table_generator.py @@ -123,11 +123,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(feature_max[i]+1): - if nife !=[] : - if len(nife) > count_code: - if j == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -462,7 +462,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/XGB/Type_EB_auto/readme.md b/src/models/XGB/Type_EB_auto/readme.md index b91f444..327a938 100644 --- a/src/models/XGB/Type_EB_auto/readme.md +++ b/src/models/XGB/Type_EB_auto/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation) for XGB. ```dedicated_p4.py``` generates the P4 code dedicated to this ML model and ```table_generator.py``` generate ML model parameters in the format of table enries. Please refer to ```./Docs/Planter_User_Document.pdf```for further information. diff --git a/src/models/XGB/Type_EB_auto/table_generator.py b/src/models/XGB/Type_EB_auto/table_generator.py index b0ad1b5..1a2134c 100755 --- a/src/models/XGB/Type_EB_auto/table_generator.py +++ b/src/models/XGB/Type_EB_auto/table_generator.py @@ -122,11 +122,11 @@ def generate_feature_tables(split, num_features,feature_max, table): for i in range(num_features): table["feature "+str(i)] = {} count_code = 0 - nife = sorted(split["feature "+str(i)]) + knife = sorted(split["feature "+str(i)]) for j in range(int(feature_max[i]+1)): - if nife !=[] : - if len(nife) > count_code: - if j == nife[count_code]: + if knife !=[] : + if len(knife) > count_code: + if j == knife[count_code]: count_code+=1 table["feature " + str(i)][j] = count_code return table @@ -486,7 +486,7 @@ def test_tables(sklearn_test_y, test_X, test_y): Exact_Table = json.load(open('Tables/Exact_Table.json', 'r')) - print('Test the exact feature table, extact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') + print('Test the exact feature table, exact code and decision table (feel free if the acc to sklearn is slightly lower than 1)') same = 0 correct = 0 error = 0 diff --git a/src/models/readme.md b/src/models/readme.md index 3b3b132..62208c9 100644 --- a/src/models/readme.md +++ b/src/models/readme.md @@ -1 +1 @@ -This folder contains Planter-supported ML modules (training, algortihm mapping, and ML-related P4 generation). Please refer to ```./Docs/Planter_User_Document.pdf```for further information. \ No newline at end of file +This folder contains Planter-supported ML modules (training, algorithm mapping, and ML-related P4 generation). Please refer to ```./Docs/Planter_User_Document.pdf```for further information. \ No newline at end of file diff --git a/src/optimiser/Bayesian/Type_RF_only/optimiser.py b/src/optimiser/Bayesian/Type_RF_only/optimiser.py index d34528d..3e8443b 100644 --- a/src/optimiser/Bayesian/Type_RF_only/optimiser.py +++ b/src/optimiser/Bayesian/Type_RF_only/optimiser.py @@ -56,7 +56,7 @@ def write_config(): Planter_config["test config"]["baseline model"] = "None" Planter_config["test config"]["port"] = "veth7" Planter_config["test config"]["sudo password"] = "12345" - Planter_config["directory config"]["sde-tools existance"] = "y" + Planter_config["directory config"]["sde-tools existence"] = "y" Planter_config["directory config"]["sde-tools config file name"] = "Directory_config.json" # dump the planter config diff --git a/src/targets/alveo_u280/README_alveo_u280.md b/src/targets/alveo_u280/README_alveo_u280.md index 1068873..43e93d9 100644 --- a/src/targets/alveo_u280/README_alveo_u280.md +++ b/src/targets/alveo_u280/README_alveo_u280.md @@ -66,7 +66,7 @@ Installing prerequisites for the ESnet SmartNIC hardware repository (for esnet-s cd Planter/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw git submodule update --init --recursive sudo apt install python3-yaml python3-jinja2 python3-click -pip3 install -r esnet-fpga-library/tools/regio/requirements.txt +pip3 install -r esnet-fpga-library/tools/region/requirements.txt ``` Installing and Configuring the Vivado Runtime Environment (for esnet-smartnic-hw) diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/README.fw.artifacts b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/README.fw.artifacts index b7f0f22..9e38b37 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/README.fw.artifacts +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/README.fw.artifacts @@ -28,7 +28,7 @@ $ dpkg-deb --fsys-tarfile esnet-smartnic1_1.0.0-13540_amd64.deb | tar tf - | tre │   ├── changelog.Debian.gz │   └── copyright └── esnet-smartnic - └── esnet-smartnic-top-ir.yaml <------- PCIe register map definition used to directly read/write registers for debug using regio tool + └── esnet-smartnic-top-ir.yaml <------- PCIe register map definition used to directly read/write registers for debug using region tool 13 directories, 10 files diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/debian/esnet-smartnic1.install b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/debian/esnet-smartnic1.install index 2ab5b02..3bbef57 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/debian/esnet-smartnic1.install +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/debian/esnet-smartnic1.install @@ -1,7 +1,7 @@ usr/lib/*/lib*.so.* usr/lib/*/wireshark/plugins/* usr/share/esnet-smartnic/** -usr/bin/regio +usr/bin/region usr/bin/sn-cli usr/bin/sn-p4-agent usr/bin/sn-p4-cli diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/sn-cli/src/sub-qdma.c b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/sn-cli/src/sub-qdma.c index 06b2065..b859d44 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/sn-cli/src/sub-qdma.c +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/sn-cli/src/sub-qdma.c @@ -199,7 +199,7 @@ static void print_qdma_status(volatile struct qdma_function_block * qdma) // Print a row of values printf("\t\t0x%02x\t", row * 16); for (unsigned int col=0; col < 16; col++) { - // Print the colums for this row + // Print the columns for this row uint32_t qid = qdma->indir_table[row * 16 + col]; printf("%5u ", qid & 0x0000FFFF); } diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/sn-stack/README.INSTALL.md b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/sn-stack/README.INSTALL.md index f96db11..c7f0fc5 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/sn-stack/README.INSTALL.md +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/sn-stack/README.INSTALL.md @@ -69,7 +69,7 @@ The firmware runtime environment exists inside of the `smartnic-fw` container. ``` docker compose exec smartnic-fw bash sn-cli dev version -regio syscfg +region syscfg ``` Using the sn-cli tool @@ -82,7 +82,7 @@ All commands described below are expected to be executed within the `smartnic-fw docker compose exec smartnic-fw bash ``` -The `sn-cli` tool will automatically look for an environment variable called `SN_CLI_SLOTADDR` which can be set to the PCIe BDF address of the device that you would like to interract with. In the `smartnic-fw` container, this value will already be set for you. +The `sn-cli` tool will automatically look for an environment variable called `SN_CLI_SLOTADDR` which can be set to the PCIe BDF address of the device that you would like to interact with. In the `smartnic-fw` container, this value will already be set for you. # Displaying device information with the "dev" subcommand @@ -321,7 +321,7 @@ Where: * Some actions require zero parameters. In this case, omit the optional `--param` option entirely. * `` is the priority to be used to resolve scenarios where multiple matches could occur * The `--priority` option is *required* for tables with CAM/TCAM type matches (prefix/range/ternary) - * The `--priority` option is *prohibited* for tables without CAM/TCAM type mathes + * The `--priority` option is *prohibited* for tables without CAM/TCAM type matches **NOTE**: You can find details about your pipeline structure and valid names by running the `info` subcommand. diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/subprojects/packagefiles/esnet-smartnic-hwapi.overlay/regmap/meson.build b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/subprojects/packagefiles/esnet-smartnic-hwapi.overlay/regmap/meson.build index 87e40de..adfc4ea 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/subprojects/packagefiles/esnet-smartnic-hwapi.overlay/regmap/meson.build +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-fw/subprojects/packagefiles/esnet-smartnic-hwapi.overlay/regmap/meson.build @@ -29,7 +29,7 @@ regmap_c_headers = custom_target( regio_generate_prog, '--file-type', 'top', '--recursive', - '--template-dir', '@SOURCE_ROOT@/regio/templates', + '--template-dir', '@SOURCE_ROOT@/region/templates', '--generator', 'c', '--output-dir', '@OUTDIR@', '@INPUT@' diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/README.md b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/README.md index 6e396bd..e35334a 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/README.md +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/README.md @@ -86,7 +86,7 @@ The platform includes the following repositories: verification. SVunit is used by the SmartNIC platform, but is neither maintained nor distributed by ESnet. - - `ESnet Regio` (https://github.com/esnet/regio.git) + - `ESnet Region` (https://github.com/esnet/region.git) Automation tools for the implementation of FPGA register map logic and software code. @@ -97,7 +97,7 @@ depicted below: esnet-smartnic-hw/ (parent repository) ├── esnet-fpga-library/ (submodule) │ └── tools/ -│ ├── regio/ (submodule) +│ ├── region/ (submodule) │ └── svunit/ (submodule) └── open-nic-shell/ (submodule) @@ -137,7 +137,7 @@ esnet-fpga-library/ This library contains general-purpose FPGA design content. examples/ - Contains SmartNIC application design exaples. A new application directory can be started + Contains SmartNIC application design examples. A new application directory can be started by copying one of the provided example directories, or by modeling portions of the example directory structure. @@ -183,7 +183,7 @@ The following steps guide a new user through the installation of the SmartNIC Hardware Design Repository, beginning with a suitably-configured host running Ubuntu 20.04 LTS Linux. -1. Install the esnet-smartnic-hw respository by creating a clone from github into a local directory: +1. Install the esnet-smartnic-hw repository by creating a clone from github into a local directory: > git clone https://github.com/esnet/esnet-smartnic-hw.git @@ -194,13 +194,13 @@ suitably-configured host running Ubuntu 20.04 LTS Linux. > git submodule update --init --recursive -3. Install the prerequisites required to run the esnet regio tools: +3. Install the prerequisites required to run the esnet region tools: > sudo apt install python3-yaml python3-jinja2 python3-click - > pip3 install -r esnet-fpga-library/tools/regio/requirements.txt + > pip3 install -r esnet-fpga-library/tools/region/requirements.txt - Note: The above instructions and more details about the `regio` tools can be found in the README file - at: `esnet-fpga-library/tools/regio/README.md` + Note: The above instructions and more details about the `region` tools can be found in the README file + at: `esnet-fpga-library/tools/region/README.md` ### Installing and Configuring the Vivado Runtime Environment @@ -258,9 +258,9 @@ From the esnet-smartnic-hw directory: The following steps can be taken by a new user to setup a local application design directory for building the bitfile and artifacts for a custom P4-based SmartNIC application. -1. Install the esnet-smartnic-hw respository (as described above). +1. Install the esnet-smartnic-hw repository (as described above). - Or, alternatively, add the esnet-smartnic-hw respository to an existing git repository as a sub-module: + Or, alternatively, add the esnet-smartnic-hw repository to an existing git repository as a sub-module: > git submodule add https://github.com/esnet/esnet-smartnic-hw.git @@ -380,7 +380,7 @@ Support for these features may be added in a future release. ### Reference Documents: The following reference documents can be accessed from the AMD (Xilinx) Vitis Networking P4 Secure Site -(once access priveleges are approved and granted): +(once access privileges are approved and granted): - *Vitis Networking P4 Installation Guide and Release Notes, UG1307 (v2021.2 Early Access) January 4, 2022.* diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/app_if/src/smartnic_322mhz_app_decoder.yaml b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/app_if/src/smartnic_322mhz_app_decoder.yaml index 5e24f57..0acd954 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/app_if/src/smartnic_322mhz_app_decoder.yaml +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/app_if/src/smartnic_322mhz_app_decoder.yaml @@ -2,7 +2,7 @@ name: smartnic_322mhz_app decoders: p2p_decoder: &p2p_decoder - !include ../examples/p2p/src/p2p/regio/p2p_decoder.yaml + !include ../examples/p2p/src/p2p/region/p2p_decoder.yaml interfaces: - decoder: *p2p_decoder diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/config.mk b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/config.mk index 3b12b8b..6fb7802 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/config.mk +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/config.mk @@ -39,5 +39,5 @@ LIB_DESC := "RTL and verification for P2P SmartNIC application" # LIBRARIES = smartnic=$(SMARTNIC_ROOT)/src -# Specify name of 'common' library (for autogenerating register infrastructure from regio specifications) +# Specify name of 'common' library (for autogenerating register infrastructure from region specifications) COMMON_LIB_NAME = common@smartnic diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/Makefile b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/Makefile index 0917f16..420b03a 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/Makefile +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/Makefile @@ -7,7 +7,7 @@ include $(IP_ROOT)/config.mk # ----------------------------------------------- # Regmap YAML sources -# List regio yaml block and decoder specification sources. +# List region yaml block and decoder specification sources. # RTL is autogenerated for all yaml files listed. # ----------------------------------------------- REG_BLOCK_YAML = p2p.yaml @@ -33,6 +33,6 @@ clean: _clean .PHONY: all reg compile clean # ----------------------------------------------- -# Include regio targets +# Include region targets # ----------------------------------------------- -include $(SCRIPTS_ROOT)/Makefiles/regio.mk +include $(SCRIPTS_ROOT)/Makefiles/region.mk diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/p2p_decoder.yaml b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/p2p_decoder.yaml index 143ea2b..19d759a 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/p2p_decoder.yaml +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/p2p_decoder.yaml @@ -2,7 +2,7 @@ name: p2p blocks: p2p: &p2p - !include ../examples/p2p/src/p2p/regio/p2p.yaml + !include ../examples/p2p/src/p2p/region/p2p.yaml interfaces: - block: *p2p diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/rtl/Makefile b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/rtl/Makefile index b289ddf..d51a114 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/rtl/Makefile +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/rtl/Makefile @@ -25,7 +25,7 @@ SRC_LIST_FILES = # List IP component and external library dependencies # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- -COMPONENTS = p2p.regio.rtl \ +COMPONENTS = p2p.region.rtl \ util.rtl@common@smartnic \ axi4l.rtl@common@smartnic \ axi4s.rtl@common@smartnic diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/tests.smartnic_322mhz/test_base.mk b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/tests.smartnic_322mhz/test_base.mk index a3f723b..b2eacf0 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/tests.smartnic_322mhz/test_base.mk +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p2p/tests.smartnic_322mhz/test_base.mk @@ -39,7 +39,7 @@ SRC_LIST_FILES = $(SVUNIT_SRC_LIST_FILE) # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk for details) # ---------------------------------------------------- COMPONENTS = p2p.rtl \ - p2p.regio.verif \ + p2p.region.verif \ std.verif@common@smartnic \ axi4l.rtl@common@smartnic \ axi4s.rtl@common@smartnic \ diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/app_if/src/smartnic_322mhz_app_decoder.yaml b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/app_if/src/smartnic_322mhz_app_decoder.yaml index da5a983..4a7de19 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/app_if/src/smartnic_322mhz_app_decoder.yaml +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/app_if/src/smartnic_322mhz_app_decoder.yaml @@ -2,7 +2,7 @@ name: smartnic_322mhz_app decoders: p4_and_verilog_decoder: &p4_and_verilog_decoder - !include ../examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog_decoder.yaml + !include ../examples/p4_and_verilog/src/p4_and_verilog/region/p4_and_verilog_decoder.yaml interfaces: - decoder: *p4_and_verilog_decoder diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/config.mk b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/config.mk index 9b2038d..4c91cc8 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/config.mk +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/config.mk @@ -39,5 +39,5 @@ LIB_DESC := "RTL and verification for P4+Verilog SmartNIC application" # LIBRARIES = smartnic=$(SMARTNIC_ROOT)/src -# Specify name of 'common' library (for autogenerating register infrastructure from regio specifications) +# Specify name of 'common' library (for autogenerating register infrastructure from region specifications) COMMON_LIB_NAME = common@smartnic diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/Makefile b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/Makefile index 7194a25..f319871 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/Makefile +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/Makefile @@ -7,7 +7,7 @@ include $(IP_ROOT)/config.mk # ----------------------------------------------- # Regmap YAML sources -# List regio yaml block and decoder specification sources. +# List region yaml block and decoder specification sources. # RTL is autogenerated for all yaml files listed. # ----------------------------------------------- REG_BLOCK_YAML = p4_and_verilog.yaml @@ -33,6 +33,6 @@ clean: _clean .PHONY: all reg compile clean # ----------------------------------------------- -# Include regio targets +# Include region targets # ----------------------------------------------- -include $(SCRIPTS_ROOT)/Makefiles/regio.mk +include $(SCRIPTS_ROOT)/Makefiles/region.mk diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog_decoder.yaml b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog_decoder.yaml index 01ea650..97d7377 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog_decoder.yaml +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog_decoder.yaml @@ -2,7 +2,7 @@ name: p4_and_verilog blocks: p4_and_verilog: &p4_and_verilog - !include ../examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog.yaml + !include ../examples/p4_and_verilog/src/p4_and_verilog/region/p4_and_verilog.yaml interfaces: - block: *p4_and_verilog diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/rtl/Makefile b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/rtl/Makefile index d86bc8d..856c3b9 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/rtl/Makefile +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/rtl/Makefile @@ -25,7 +25,7 @@ SRC_LIST_FILES = # List IP component and external library dependencies # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- -COMPONENTS = p4_and_verilog.regio.rtl \ +COMPONENTS = p4_and_verilog.region.rtl \ vitisnetp4.xilinx_ip \ util.rtl@common@smartnic \ axi4l.rtl@common@smartnic \ diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/verif/Makefile b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/verif/Makefile index 91d1a89..cc6a9dc 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/verif/Makefile +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/verif/Makefile @@ -26,7 +26,7 @@ SRC_LIST_FILES = # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- COMPONENTS = \ - p4_and_verilog.regio.verif \ + p4_and_verilog.region.verif \ std.verif@common@smartnic \ axi4l.verif@common@smartnic \ axi4s.verif@common@smartnic diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/vitisnetp4/verif/include/vitisnetp4_agent.svh b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/vitisnetp4/verif/include/vitisnetp4_agent.svh index f16f56e..f123294 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/vitisnetp4/verif/include/vitisnetp4_agent.svh +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/vitisnetp4/verif/include/vitisnetp4_agent.svh @@ -175,7 +175,7 @@ class vitisnetp4_agent #( end RST_STATE : begin - if (VERBOSE) $display("** Info: Reseting VitisNet IP instance to default state"); + if (VERBOSE) $display("** Info: Resetting VitisNet IP instance to default state"); sdnet_0_pkg::reset_state(CtxPtr); end diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/tests/p4_and_verilog_datapath/p4_and_verilog_datapath_unit_test.sv b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/tests/p4_and_verilog_datapath/p4_and_verilog_datapath_unit_test.sv index ed3dffa..f4d0f30 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/tests/p4_and_verilog_datapath/p4_and_verilog_datapath_unit_test.sv +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_and_verilog/tests/p4_and_verilog_datapath/p4_and_verilog_datapath_unit_test.sv @@ -132,7 +132,7 @@ module p4_and_verilog_datapath_unit_test; string filename; - // variabes for reading expected pcap data + // variables for reading expected pcap data byte exp_data[$][$]; pcap_pkg::pcap_hdr_t exp_pcap_hdr; pcap_pkg::pcaprec_hdr_t exp_pcap_record_hdr[$]; diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_hbm/tests.smartnic_322mhz/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_hbm/tests.smartnic_322mhz/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv index bfc74d0..31c2c68 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_hbm/tests.smartnic_322mhz/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_hbm/tests.smartnic_322mhz/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv @@ -135,7 +135,7 @@ module p4_hbm_datapath_unit_test; string filename; - // variabes for reading expected pcap data + // variables for reading expected pcap data byte exp_data[$][$]; pcap_pkg::pcap_hdr_t exp_pcap_hdr; pcap_pkg::pcaprec_hdr_t exp_pcap_record_hdr[$]; @@ -187,7 +187,7 @@ module p4_hbm_datapath_unit_test; while (rx_pkt_cnt < exp_pcap_record_hdr.size() || ($time < t + 5us)) begin fork begin - // Always monitor for some minumum period, even if no receive packets are expected + // Always monitor for some minimum period, even if no receive packets are expected #5us; end begin diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_hbm/tests/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_hbm/tests/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv index cba42be..a809458 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_hbm/tests/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/examples/p4_hbm/tests/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv @@ -124,7 +124,7 @@ module p4_hbm_datapath_unit_test; string filename; - // variabes for reading expected pcap data + // variables for reading expected pcap data byte exp_data[$][$]; pcap_pkg::pcap_hdr_t exp_pcap_hdr; pcap_pkg::pcaprec_hdr_t exp_pcap_record_hdr[$]; @@ -176,7 +176,7 @@ module p4_hbm_datapath_unit_test; while (rx_pkt_cnt < exp_pcap_record_hdr.size() || ($time < t + 5us)) begin fork begin - // Always monitor for some minumum period, even if no receive packets are expected + // Always monitor for some minimum period, even if no receive packets are expected #5us; end begin diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/scripts/vitisnetp4/gen_vitisnetp4_wrapper.py b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/scripts/vitisnetp4/gen_vitisnetp4_wrapper.py index b2f72c0..02a14b8 100755 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/scripts/vitisnetp4/gen_vitisnetp4_wrapper.py +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/scripts/vitisnetp4/gen_vitisnetp4_wrapper.py @@ -32,7 +32,7 @@ try: for compInst in root.find('spirit:componentInstances', ns).findall('spirit:componentInstance', ns): compRef = compInst.find('spirit:componentRef', ns) - # Check that source file decribes a VitisNet component + # Check that source file describes a VitisNet component compRefName = compRef.get('{' + ns['spirit'] + '}name') if (compRefName == 'vitis_net_p4'): # Retrieve config info diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/app_if/src/smartnic_322mhz_app_decoder.yaml b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/app_if/src/smartnic_322mhz_app_decoder.yaml index 25b1c14..bb40042 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/app_if/src/smartnic_322mhz_app_decoder.yaml +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/app_if/src/smartnic_322mhz_app_decoder.yaml @@ -2,7 +2,7 @@ name: smartnic_322mhz_app decoders: p4_app_decoder: &p4_app_decoder - !include ../src/p4_app/regio/p4_app_decoder.yaml + !include ../src/p4_app/region/p4_app_decoder.yaml interfaces: - decoder: *p4_app_decoder diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/Makefile b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/Makefile index 3ffe1d3..9b6e89f 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/Makefile +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/Makefile @@ -10,7 +10,7 @@ include $(IP_ROOT)/config.mk # ----------------------------------------------- # Regmap YAML sources -# List regio yaml block and decoder specification sources. +# List region yaml block and decoder specification sources. # RTL is autogenerated for all yaml files listed. # ----------------------------------------------- REG_BLOCK_YAML = p4_app.yaml @@ -36,6 +36,6 @@ clean: _clean .PHONY: all reg compile clean # ----------------------------------------------- -# Include regio targets +# Include region targets # ----------------------------------------------- -include $(SCRIPTS_ROOT)/Makefiles/regio.mk +include $(SCRIPTS_ROOT)/Makefiles/region.mk diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app.yaml b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app.yaml index d26368b..ef20b3e 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app.yaml +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app.yaml @@ -15,7 +15,7 @@ regs: access: rw fields: - name: enable - desc: set to 1 to enable rss_config register (activates register ovveride). + desc: set to 1 to enable rss_config register (activates register override). width: 1 init : 0 - name: rss_enable diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app_decoder.yaml b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app_decoder.yaml index 8da479f..ce7d2ec 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app_decoder.yaml +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app_decoder.yaml @@ -2,7 +2,7 @@ name: p4_app blocks: p4_app: &p4_app - !include ../src/p4_app/regio/p4_app.yaml + !include ../src/p4_app/region/p4_app.yaml interfaces: - block: *p4_app diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/rtl/Makefile b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/rtl/Makefile index 3349f0a..1f6012c 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/rtl/Makefile +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/rtl/Makefile @@ -22,7 +22,7 @@ SRC_LIST_FILES = # List IP component and external library dependencies # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- -COMPONENTS = p4_app.regio.rtl \ +COMPONENTS = p4_app.region.rtl \ util.rtl@common \ axi4l.rtl@common \ axi4s.rtl@common diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/tests.smartnic_322mhz/common/tasks.svh b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/tests.smartnic_322mhz/common/tasks.svh index fb31fe9..c347481 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/tests.smartnic_322mhz/common/tasks.svh +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/tests.smartnic_322mhz/common/tasks.svh @@ -55,7 +55,7 @@ string filename; - // variabes for reading expected pcap data + // variables for reading expected pcap data byte exp_data[$][$]; pcap_pkg::pcap_hdr_t exp_pcap_hdr; pcap_pkg::pcaprec_hdr_t exp_pcap_record_hdr[$]; @@ -107,7 +107,7 @@ while (rx_pkt_cnt < exp_pcap_record_hdr.size() || ($time < t + 5us)) begin fork begin - // Always monitor for some minumum period, even if no receive packets are expected + // Always monitor for some minimum period, even if no receive packets are expected #5us; end begin diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/tests/p4_app_datapath/p4_app_datapath_unit_test.sv b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/tests/p4_app_datapath/p4_app_datapath_unit_test.sv index 32cd304..1ffc0b9 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/tests/p4_app_datapath/p4_app_datapath_unit_test.sv +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/tests/p4_app_datapath/p4_app_datapath_unit_test.sv @@ -152,7 +152,7 @@ module p4_app_datapath_unit_test; string filename; - // variabes for reading expected pcap data + // variables for reading expected pcap data byte exp_data[$][$]; pcap_pkg::pcap_hdr_t exp_pcap_hdr; pcap_pkg::pcaprec_hdr_t exp_pcap_record_hdr[$]; diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/verif/Makefile b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/verif/Makefile index 6cb7ee0..ea01c12 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/verif/Makefile +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/p4_app/verif/Makefile @@ -25,8 +25,8 @@ SRC_LIST_FILES = # List IP component and external library dependencies # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- -COMPONENTS = p4_app.regio.rtl \ - p4_app.regio.verif \ +COMPONENTS = p4_app.region.rtl \ + p4_app.region.verif \ std.verif@common \ axi4l.verif@common \ axi4s.verif@common diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/Makefile b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/Makefile index 5871b4b..9059d91 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/Makefile +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/Makefile @@ -10,7 +10,7 @@ include $(IP_ROOT)/config.mk # ----------------------------------------------- # Regmap YAML sources -# List regio yaml block and decoder specification sources. +# List region yaml block and decoder specification sources. # RTL is autogenerated for all yaml files listed. # ----------------------------------------------- REG_BLOCK_YAML = smartnic_322mhz.yaml @@ -44,6 +44,6 @@ smartnic_322mhz_app_decoder.yaml: @cp $(IP_ROOT)/app_if/smartnic_322mhz_app_decoder.yaml ./ # ----------------------------------------------- -# Include regio targets +# Include region targets # ----------------------------------------------- -include $(SCRIPTS_ROOT)/Makefiles/regio.mk +include $(SCRIPTS_ROOT)/Makefiles/region.mk diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_app_sdnet_decoder.yaml b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_app_sdnet_decoder.yaml index 53c9094..3410b53 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_app_sdnet_decoder.yaml +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_app_sdnet_decoder.yaml @@ -10,7 +10,7 @@ blocks: decoders: smartnic_322mhz_app_decoder: &smartnic_322mhz_app_decoder - !include ../src/smartnic_322mhz/regio/smartnic_322mhz_app_decoder.yaml + !include ../src/smartnic_322mhz/region/smartnic_322mhz_app_decoder.yaml interfaces: - decoder: *smartnic_322mhz_app_decoder diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_decoder.yaml b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_decoder.yaml index 71a7262..ae4d403 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_decoder.yaml +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_decoder.yaml @@ -2,23 +2,23 @@ name: smartnic_322mhz blocks: smartnic_322mhz: &smartnic_322mhz - !include ../src/smartnic_322mhz/regio/smartnic_322mhz.yaml + !include ../src/smartnic_322mhz/region/smartnic_322mhz.yaml reg_endian_check: ®_endian_check - !include src/reg/endian/regio/reg_endian_check.yaml + !include src/reg/endian/region/reg_endian_check.yaml axi4s_probe: &axi4s_probe - !include src/axi4s/regio/axi4s_probe.yaml + !include src/axi4s/region/axi4s_probe.yaml decoders: smartnic_322mhz_app_decoder: &smartnic_322mhz_app_decoder - !include ../src/smartnic_322mhz/regio/smartnic_322mhz_app_sdnet_decoder.yaml + !include ../src/smartnic_322mhz/region/smartnic_322mhz_app_sdnet_decoder.yaml fifo: &fifo - !include src/fifo/regio/fifo_core_decoder.yaml + !include src/fifo/region/fifo_core_decoder.yaml axi4s_split_join_decoder: &axi4s_split_join_decoder - !include src/axi4s/regio/axi4s_split_join_decoder.yaml + !include src/axi4s/region/axi4s_split_join_decoder.yaml xilinx_hbm_0: &xilinx_hbm_0 - !include ../src/smartnic_322mhz/regio/xilinx_hbm_0_decoder.yaml + !include ../src/smartnic_322mhz/region/xilinx_hbm_0_decoder.yaml xilinx_hbm_1: &xilinx_hbm_1 - !include ../src/smartnic_322mhz/regio/xilinx_hbm_1_decoder.yaml + !include ../src/smartnic_322mhz/region/xilinx_hbm_1_decoder.yaml interfaces: - block: *smartnic_322mhz diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_0_decoder.yaml b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_0_decoder.yaml index 15e2e23..8d42ea7 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_0_decoder.yaml +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_0_decoder.yaml @@ -2,9 +2,9 @@ name: xilinx_hbm_0 blocks: xilinx_hbm: &xilinx_hbm - !include src/xilinx/hbm/regio/xilinx_hbm.yaml + !include src/xilinx/hbm/region/xilinx_hbm.yaml proxy_reg: &proxy_reg - !include src/reg/proxy/regio/reg_proxy.yaml + !include src/reg/proxy/region/reg_proxy.yaml interfaces: - block: *xilinx_hbm diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_1_decoder.yaml b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_1_decoder.yaml index 8dc8cb5..1a445e6 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_1_decoder.yaml +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_1_decoder.yaml @@ -2,9 +2,9 @@ name: xilinx_hbm_1 blocks: xilinx_hbm: &xilinx_hbm - !include src/xilinx/hbm/regio/xilinx_hbm.yaml + !include src/xilinx/hbm/region/xilinx_hbm.yaml proxy_reg: &proxy_reg - !include src/reg/proxy/regio/reg_proxy.yaml + !include src/reg/proxy/region/reg_proxy.yaml interfaces: - block: *xilinx_hbm diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/Makefile b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/Makefile index bd43dd7..e6af045 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/Makefile +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/Makefile @@ -26,7 +26,7 @@ SRC_LIST_FILES = # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- COMPONENTS = smartnic_322mhz.xilinx_ip \ - smartnic_322mhz.regio.rtl \ + smartnic_322mhz.region.rtl \ reg.endian.rtl@common \ reg.proxy.rtl@common \ xilinx.hbm.rtl@common \ diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/src/smartnic_322mhz_reset.sv b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/src/smartnic_322mhz_reset.sv index e0a290c..219d7b1 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/src/smartnic_322mhz_reset.sv +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/src/smartnic_322mhz_reset.sv @@ -76,7 +76,7 @@ module smartnic_322mhz_reset #( // core clock domain resets are generated from the locally generated AXI-lite reset - // core clock domain is asynnchronous wrt. CMAC domains, and is derived from AXI-lite via a PLL + // core clock domain is asynchronous wrt. CMAC domains, and is derived from AXI-lite via a PLL xpm_cdc_async_rst #( .DEST_SYNC_FF (2), diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tb/Makefile b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tb/Makefile index 3413f19..6ae2e7f 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tb/Makefile +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tb/Makefile @@ -24,13 +24,13 @@ SRC_LIST_FILES = # ---------------------------------------------------- COMPONENTS = smartnic_322mhz.rtl \ smartnic_322mhz.xilinx_ip \ - smartnic_322mhz.regio.verif \ + smartnic_322mhz.region.verif \ std.rtl@common \ std.verif@common \ - reg.endian.regio.verif@common \ + reg.endian.region.verif@common \ axi4l.verif@common \ axi4s.verif@common \ - axi4s.regio.verif@common \ + axi4s.region.verif@common \ xilinx.hbm.verif@common EXT_LIBS = diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tests/common/tasks.svh b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tests/common/tasks.svh index 7762eb6..d53e2d8 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tests/common/tasks.svh +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tests/common/tasks.svh @@ -169,7 +169,7 @@ task automatic run_pkt_stream ( input bit tuser = 0 ); - // variabes for reading pcap data$ + // variables for reading pcap data$ byte pcap_data[$][$]; pcap_pkg::pcap_hdr_t pcap_hdr; pcap_pkg::pcaprec_hdr_t pcap_record_hdr[$]; diff --git a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/vitisnetp4/verif/include/vitisnetp4_agent.svh b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/vitisnetp4/verif/include/vitisnetp4_agent.svh index f16f56e..f123294 100644 --- a/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/vitisnetp4/verif/include/vitisnetp4_agent.svh +++ b/src/targets/alveo_u280/compile/model_test/esnet-smartnic-hw/src/vitisnetp4/verif/include/vitisnetp4_agent.svh @@ -175,7 +175,7 @@ class vitisnetp4_agent #( end RST_STATE : begin - if (VERBOSE) $display("** Info: Reseting VitisNet IP instance to default state"); + if (VERBOSE) $display("** Info: Resetting VitisNet IP instance to default state"); sdnet_0_pkg::reset_state(CtxPtr); end diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/README.fw.artifacts b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/README.fw.artifacts index b7f0f22..9e38b37 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/README.fw.artifacts +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/README.fw.artifacts @@ -28,7 +28,7 @@ $ dpkg-deb --fsys-tarfile esnet-smartnic1_1.0.0-13540_amd64.deb | tar tf - | tre │   ├── changelog.Debian.gz │   └── copyright └── esnet-smartnic - └── esnet-smartnic-top-ir.yaml <------- PCIe register map definition used to directly read/write registers for debug using regio tool + └── esnet-smartnic-top-ir.yaml <------- PCIe register map definition used to directly read/write registers for debug using region tool 13 directories, 10 files diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/debian/esnet-smartnic1.install b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/debian/esnet-smartnic1.install index 2ab5b02..3bbef57 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/debian/esnet-smartnic1.install +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/debian/esnet-smartnic1.install @@ -1,7 +1,7 @@ usr/lib/*/lib*.so.* usr/lib/*/wireshark/plugins/* usr/share/esnet-smartnic/** -usr/bin/regio +usr/bin/region usr/bin/sn-cli usr/bin/sn-p4-agent usr/bin/sn-p4-cli diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/sn-cli/src/sub-qdma.c b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/sn-cli/src/sub-qdma.c index 06b2065..b859d44 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/sn-cli/src/sub-qdma.c +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/sn-cli/src/sub-qdma.c @@ -199,7 +199,7 @@ static void print_qdma_status(volatile struct qdma_function_block * qdma) // Print a row of values printf("\t\t0x%02x\t", row * 16); for (unsigned int col=0; col < 16; col++) { - // Print the colums for this row + // Print the columns for this row uint32_t qid = qdma->indir_table[row * 16 + col]; printf("%5u ", qid & 0x0000FFFF); } diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/sn-stack/README.INSTALL.md b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/sn-stack/README.INSTALL.md index f96db11..c7f0fc5 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/sn-stack/README.INSTALL.md +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/sn-stack/README.INSTALL.md @@ -69,7 +69,7 @@ The firmware runtime environment exists inside of the `smartnic-fw` container. ``` docker compose exec smartnic-fw bash sn-cli dev version -regio syscfg +region syscfg ``` Using the sn-cli tool @@ -82,7 +82,7 @@ All commands described below are expected to be executed within the `smartnic-fw docker compose exec smartnic-fw bash ``` -The `sn-cli` tool will automatically look for an environment variable called `SN_CLI_SLOTADDR` which can be set to the PCIe BDF address of the device that you would like to interract with. In the `smartnic-fw` container, this value will already be set for you. +The `sn-cli` tool will automatically look for an environment variable called `SN_CLI_SLOTADDR` which can be set to the PCIe BDF address of the device that you would like to interact with. In the `smartnic-fw` container, this value will already be set for you. # Displaying device information with the "dev" subcommand @@ -321,7 +321,7 @@ Where: * Some actions require zero parameters. In this case, omit the optional `--param` option entirely. * `` is the priority to be used to resolve scenarios where multiple matches could occur * The `--priority` option is *required* for tables with CAM/TCAM type matches (prefix/range/ternary) - * The `--priority` option is *prohibited* for tables without CAM/TCAM type mathes + * The `--priority` option is *prohibited* for tables without CAM/TCAM type matches **NOTE**: You can find details about your pipeline structure and valid names by running the `info` subcommand. diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/subprojects/packagefiles/esnet-smartnic-hwapi.overlay/regmap/meson.build b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/subprojects/packagefiles/esnet-smartnic-hwapi.overlay/regmap/meson.build index 87e40de..adfc4ea 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/subprojects/packagefiles/esnet-smartnic-hwapi.overlay/regmap/meson.build +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-fw/subprojects/packagefiles/esnet-smartnic-hwapi.overlay/regmap/meson.build @@ -29,7 +29,7 @@ regmap_c_headers = custom_target( regio_generate_prog, '--file-type', 'top', '--recursive', - '--template-dir', '@SOURCE_ROOT@/regio/templates', + '--template-dir', '@SOURCE_ROOT@/region/templates', '--generator', 'c', '--output-dir', '@OUTDIR@', '@INPUT@' diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/README.md b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/README.md index 6e396bd..e35334a 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/README.md +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/README.md @@ -86,7 +86,7 @@ The platform includes the following repositories: verification. SVunit is used by the SmartNIC platform, but is neither maintained nor distributed by ESnet. - - `ESnet Regio` (https://github.com/esnet/regio.git) + - `ESnet Region` (https://github.com/esnet/region.git) Automation tools for the implementation of FPGA register map logic and software code. @@ -97,7 +97,7 @@ depicted below: esnet-smartnic-hw/ (parent repository) ├── esnet-fpga-library/ (submodule) │ └── tools/ -│ ├── regio/ (submodule) +│ ├── region/ (submodule) │ └── svunit/ (submodule) └── open-nic-shell/ (submodule) @@ -137,7 +137,7 @@ esnet-fpga-library/ This library contains general-purpose FPGA design content. examples/ - Contains SmartNIC application design exaples. A new application directory can be started + Contains SmartNIC application design examples. A new application directory can be started by copying one of the provided example directories, or by modeling portions of the example directory structure. @@ -183,7 +183,7 @@ The following steps guide a new user through the installation of the SmartNIC Hardware Design Repository, beginning with a suitably-configured host running Ubuntu 20.04 LTS Linux. -1. Install the esnet-smartnic-hw respository by creating a clone from github into a local directory: +1. Install the esnet-smartnic-hw repository by creating a clone from github into a local directory: > git clone https://github.com/esnet/esnet-smartnic-hw.git @@ -194,13 +194,13 @@ suitably-configured host running Ubuntu 20.04 LTS Linux. > git submodule update --init --recursive -3. Install the prerequisites required to run the esnet regio tools: +3. Install the prerequisites required to run the esnet region tools: > sudo apt install python3-yaml python3-jinja2 python3-click - > pip3 install -r esnet-fpga-library/tools/regio/requirements.txt + > pip3 install -r esnet-fpga-library/tools/region/requirements.txt - Note: The above instructions and more details about the `regio` tools can be found in the README file - at: `esnet-fpga-library/tools/regio/README.md` + Note: The above instructions and more details about the `region` tools can be found in the README file + at: `esnet-fpga-library/tools/region/README.md` ### Installing and Configuring the Vivado Runtime Environment @@ -258,9 +258,9 @@ From the esnet-smartnic-hw directory: The following steps can be taken by a new user to setup a local application design directory for building the bitfile and artifacts for a custom P4-based SmartNIC application. -1. Install the esnet-smartnic-hw respository (as described above). +1. Install the esnet-smartnic-hw repository (as described above). - Or, alternatively, add the esnet-smartnic-hw respository to an existing git repository as a sub-module: + Or, alternatively, add the esnet-smartnic-hw repository to an existing git repository as a sub-module: > git submodule add https://github.com/esnet/esnet-smartnic-hw.git @@ -380,7 +380,7 @@ Support for these features may be added in a future release. ### Reference Documents: The following reference documents can be accessed from the AMD (Xilinx) Vitis Networking P4 Secure Site -(once access priveleges are approved and granted): +(once access privileges are approved and granted): - *Vitis Networking P4 Installation Guide and Release Notes, UG1307 (v2021.2 Early Access) January 4, 2022.* diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/app_if/src/smartnic_322mhz_app_decoder.yaml b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/app_if/src/smartnic_322mhz_app_decoder.yaml index 5e24f57..0acd954 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/app_if/src/smartnic_322mhz_app_decoder.yaml +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/app_if/src/smartnic_322mhz_app_decoder.yaml @@ -2,7 +2,7 @@ name: smartnic_322mhz_app decoders: p2p_decoder: &p2p_decoder - !include ../examples/p2p/src/p2p/regio/p2p_decoder.yaml + !include ../examples/p2p/src/p2p/region/p2p_decoder.yaml interfaces: - decoder: *p2p_decoder diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/config.mk b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/config.mk index 3b12b8b..6fb7802 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/config.mk +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/config.mk @@ -39,5 +39,5 @@ LIB_DESC := "RTL and verification for P2P SmartNIC application" # LIBRARIES = smartnic=$(SMARTNIC_ROOT)/src -# Specify name of 'common' library (for autogenerating register infrastructure from regio specifications) +# Specify name of 'common' library (for autogenerating register infrastructure from region specifications) COMMON_LIB_NAME = common@smartnic diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/Makefile b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/Makefile index 0917f16..420b03a 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/Makefile +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/Makefile @@ -7,7 +7,7 @@ include $(IP_ROOT)/config.mk # ----------------------------------------------- # Regmap YAML sources -# List regio yaml block and decoder specification sources. +# List region yaml block and decoder specification sources. # RTL is autogenerated for all yaml files listed. # ----------------------------------------------- REG_BLOCK_YAML = p2p.yaml @@ -33,6 +33,6 @@ clean: _clean .PHONY: all reg compile clean # ----------------------------------------------- -# Include regio targets +# Include region targets # ----------------------------------------------- -include $(SCRIPTS_ROOT)/Makefiles/regio.mk +include $(SCRIPTS_ROOT)/Makefiles/region.mk diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/p2p_decoder.yaml b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/p2p_decoder.yaml index 143ea2b..19d759a 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/p2p_decoder.yaml +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/regio/p2p_decoder.yaml @@ -2,7 +2,7 @@ name: p2p blocks: p2p: &p2p - !include ../examples/p2p/src/p2p/regio/p2p.yaml + !include ../examples/p2p/src/p2p/region/p2p.yaml interfaces: - block: *p2p diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/rtl/Makefile b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/rtl/Makefile index b289ddf..d51a114 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/rtl/Makefile +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/src/p2p/rtl/Makefile @@ -25,7 +25,7 @@ SRC_LIST_FILES = # List IP component and external library dependencies # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- -COMPONENTS = p2p.regio.rtl \ +COMPONENTS = p2p.region.rtl \ util.rtl@common@smartnic \ axi4l.rtl@common@smartnic \ axi4s.rtl@common@smartnic diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/tests.smartnic_322mhz/test_base.mk b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/tests.smartnic_322mhz/test_base.mk index a3f723b..b2eacf0 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/tests.smartnic_322mhz/test_base.mk +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p2p/tests.smartnic_322mhz/test_base.mk @@ -39,7 +39,7 @@ SRC_LIST_FILES = $(SVUNIT_SRC_LIST_FILE) # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk for details) # ---------------------------------------------------- COMPONENTS = p2p.rtl \ - p2p.regio.verif \ + p2p.region.verif \ std.verif@common@smartnic \ axi4l.rtl@common@smartnic \ axi4s.rtl@common@smartnic \ diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/app_if/src/smartnic_322mhz_app_decoder.yaml b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/app_if/src/smartnic_322mhz_app_decoder.yaml index da5a983..4a7de19 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/app_if/src/smartnic_322mhz_app_decoder.yaml +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/app_if/src/smartnic_322mhz_app_decoder.yaml @@ -2,7 +2,7 @@ name: smartnic_322mhz_app decoders: p4_and_verilog_decoder: &p4_and_verilog_decoder - !include ../examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog_decoder.yaml + !include ../examples/p4_and_verilog/src/p4_and_verilog/region/p4_and_verilog_decoder.yaml interfaces: - decoder: *p4_and_verilog_decoder diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/config.mk b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/config.mk index 9b2038d..4c91cc8 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/config.mk +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/config.mk @@ -39,5 +39,5 @@ LIB_DESC := "RTL and verification for P4+Verilog SmartNIC application" # LIBRARIES = smartnic=$(SMARTNIC_ROOT)/src -# Specify name of 'common' library (for autogenerating register infrastructure from regio specifications) +# Specify name of 'common' library (for autogenerating register infrastructure from region specifications) COMMON_LIB_NAME = common@smartnic diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/Makefile b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/Makefile index 7194a25..f319871 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/Makefile +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/Makefile @@ -7,7 +7,7 @@ include $(IP_ROOT)/config.mk # ----------------------------------------------- # Regmap YAML sources -# List regio yaml block and decoder specification sources. +# List region yaml block and decoder specification sources. # RTL is autogenerated for all yaml files listed. # ----------------------------------------------- REG_BLOCK_YAML = p4_and_verilog.yaml @@ -33,6 +33,6 @@ clean: _clean .PHONY: all reg compile clean # ----------------------------------------------- -# Include regio targets +# Include region targets # ----------------------------------------------- -include $(SCRIPTS_ROOT)/Makefiles/regio.mk +include $(SCRIPTS_ROOT)/Makefiles/region.mk diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog_decoder.yaml b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog_decoder.yaml index 01ea650..97d7377 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog_decoder.yaml +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog_decoder.yaml @@ -2,7 +2,7 @@ name: p4_and_verilog blocks: p4_and_verilog: &p4_and_verilog - !include ../examples/p4_and_verilog/src/p4_and_verilog/regio/p4_and_verilog.yaml + !include ../examples/p4_and_verilog/src/p4_and_verilog/region/p4_and_verilog.yaml interfaces: - block: *p4_and_verilog diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/rtl/Makefile b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/rtl/Makefile index d86bc8d..856c3b9 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/rtl/Makefile +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/rtl/Makefile @@ -25,7 +25,7 @@ SRC_LIST_FILES = # List IP component and external library dependencies # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- -COMPONENTS = p4_and_verilog.regio.rtl \ +COMPONENTS = p4_and_verilog.region.rtl \ vitisnetp4.xilinx_ip \ util.rtl@common@smartnic \ axi4l.rtl@common@smartnic \ diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/verif/Makefile b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/verif/Makefile index 91d1a89..cc6a9dc 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/verif/Makefile +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/p4_and_verilog/verif/Makefile @@ -26,7 +26,7 @@ SRC_LIST_FILES = # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- COMPONENTS = \ - p4_and_verilog.regio.verif \ + p4_and_verilog.region.verif \ std.verif@common@smartnic \ axi4l.verif@common@smartnic \ axi4s.verif@common@smartnic diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/vitisnetp4/verif/include/vitisnetp4_agent.svh b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/vitisnetp4/verif/include/vitisnetp4_agent.svh index f16f56e..f123294 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/vitisnetp4/verif/include/vitisnetp4_agent.svh +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/src/vitisnetp4/verif/include/vitisnetp4_agent.svh @@ -175,7 +175,7 @@ class vitisnetp4_agent #( end RST_STATE : begin - if (VERBOSE) $display("** Info: Reseting VitisNet IP instance to default state"); + if (VERBOSE) $display("** Info: Resetting VitisNet IP instance to default state"); sdnet_0_pkg::reset_state(CtxPtr); end diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/tests/p4_and_verilog_datapath/p4_and_verilog_datapath_unit_test.sv b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/tests/p4_and_verilog_datapath/p4_and_verilog_datapath_unit_test.sv index ed3dffa..f4d0f30 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/tests/p4_and_verilog_datapath/p4_and_verilog_datapath_unit_test.sv +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_and_verilog/tests/p4_and_verilog_datapath/p4_and_verilog_datapath_unit_test.sv @@ -132,7 +132,7 @@ module p4_and_verilog_datapath_unit_test; string filename; - // variabes for reading expected pcap data + // variables for reading expected pcap data byte exp_data[$][$]; pcap_pkg::pcap_hdr_t exp_pcap_hdr; pcap_pkg::pcaprec_hdr_t exp_pcap_record_hdr[$]; diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_hbm/tests.smartnic_322mhz/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_hbm/tests.smartnic_322mhz/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv index bfc74d0..31c2c68 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_hbm/tests.smartnic_322mhz/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_hbm/tests.smartnic_322mhz/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv @@ -135,7 +135,7 @@ module p4_hbm_datapath_unit_test; string filename; - // variabes for reading expected pcap data + // variables for reading expected pcap data byte exp_data[$][$]; pcap_pkg::pcap_hdr_t exp_pcap_hdr; pcap_pkg::pcaprec_hdr_t exp_pcap_record_hdr[$]; @@ -187,7 +187,7 @@ module p4_hbm_datapath_unit_test; while (rx_pkt_cnt < exp_pcap_record_hdr.size() || ($time < t + 5us)) begin fork begin - // Always monitor for some minumum period, even if no receive packets are expected + // Always monitor for some minimum period, even if no receive packets are expected #5us; end begin diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_hbm/tests/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_hbm/tests/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv index cba42be..a809458 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_hbm/tests/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/examples/p4_hbm/tests/p4_hbm_datapath/p4_hbm_datapath_unit_test.sv @@ -124,7 +124,7 @@ module p4_hbm_datapath_unit_test; string filename; - // variabes for reading expected pcap data + // variables for reading expected pcap data byte exp_data[$][$]; pcap_pkg::pcap_hdr_t exp_pcap_hdr; pcap_pkg::pcaprec_hdr_t exp_pcap_record_hdr[$]; @@ -176,7 +176,7 @@ module p4_hbm_datapath_unit_test; while (rx_pkt_cnt < exp_pcap_record_hdr.size() || ($time < t + 5us)) begin fork begin - // Always monitor for some minumum period, even if no receive packets are expected + // Always monitor for some minimum period, even if no receive packets are expected #5us; end begin diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/scripts/vitisnetp4/gen_vitisnetp4_wrapper.py b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/scripts/vitisnetp4/gen_vitisnetp4_wrapper.py index b2f72c0..02a14b8 100755 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/scripts/vitisnetp4/gen_vitisnetp4_wrapper.py +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/scripts/vitisnetp4/gen_vitisnetp4_wrapper.py @@ -32,7 +32,7 @@ try: for compInst in root.find('spirit:componentInstances', ns).findall('spirit:componentInstance', ns): compRef = compInst.find('spirit:componentRef', ns) - # Check that source file decribes a VitisNet component + # Check that source file describes a VitisNet component compRefName = compRef.get('{' + ns['spirit'] + '}name') if (compRefName == 'vitis_net_p4'): # Retrieve config info diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/app_if/src/smartnic_322mhz_app_decoder.yaml b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/app_if/src/smartnic_322mhz_app_decoder.yaml index 25b1c14..bb40042 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/app_if/src/smartnic_322mhz_app_decoder.yaml +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/app_if/src/smartnic_322mhz_app_decoder.yaml @@ -2,7 +2,7 @@ name: smartnic_322mhz_app decoders: p4_app_decoder: &p4_app_decoder - !include ../src/p4_app/regio/p4_app_decoder.yaml + !include ../src/p4_app/region/p4_app_decoder.yaml interfaces: - decoder: *p4_app_decoder diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/Makefile b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/Makefile index 3ffe1d3..9b6e89f 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/Makefile +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/Makefile @@ -10,7 +10,7 @@ include $(IP_ROOT)/config.mk # ----------------------------------------------- # Regmap YAML sources -# List regio yaml block and decoder specification sources. +# List region yaml block and decoder specification sources. # RTL is autogenerated for all yaml files listed. # ----------------------------------------------- REG_BLOCK_YAML = p4_app.yaml @@ -36,6 +36,6 @@ clean: _clean .PHONY: all reg compile clean # ----------------------------------------------- -# Include regio targets +# Include region targets # ----------------------------------------------- -include $(SCRIPTS_ROOT)/Makefiles/regio.mk +include $(SCRIPTS_ROOT)/Makefiles/region.mk diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app.yaml b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app.yaml index d26368b..ef20b3e 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app.yaml +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app.yaml @@ -15,7 +15,7 @@ regs: access: rw fields: - name: enable - desc: set to 1 to enable rss_config register (activates register ovveride). + desc: set to 1 to enable rss_config register (activates register override). width: 1 init : 0 - name: rss_enable diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app_decoder.yaml b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app_decoder.yaml index 8da479f..ce7d2ec 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app_decoder.yaml +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/regio/p4_app_decoder.yaml @@ -2,7 +2,7 @@ name: p4_app blocks: p4_app: &p4_app - !include ../src/p4_app/regio/p4_app.yaml + !include ../src/p4_app/region/p4_app.yaml interfaces: - block: *p4_app diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/rtl/Makefile b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/rtl/Makefile index 3349f0a..1f6012c 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/rtl/Makefile +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/rtl/Makefile @@ -22,7 +22,7 @@ SRC_LIST_FILES = # List IP component and external library dependencies # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- -COMPONENTS = p4_app.regio.rtl \ +COMPONENTS = p4_app.region.rtl \ util.rtl@common \ axi4l.rtl@common \ axi4s.rtl@common diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/tests.smartnic_322mhz/common/tasks.svh b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/tests.smartnic_322mhz/common/tasks.svh index fb31fe9..c347481 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/tests.smartnic_322mhz/common/tasks.svh +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/tests.smartnic_322mhz/common/tasks.svh @@ -55,7 +55,7 @@ string filename; - // variabes for reading expected pcap data + // variables for reading expected pcap data byte exp_data[$][$]; pcap_pkg::pcap_hdr_t exp_pcap_hdr; pcap_pkg::pcaprec_hdr_t exp_pcap_record_hdr[$]; @@ -107,7 +107,7 @@ while (rx_pkt_cnt < exp_pcap_record_hdr.size() || ($time < t + 5us)) begin fork begin - // Always monitor for some minumum period, even if no receive packets are expected + // Always monitor for some minimum period, even if no receive packets are expected #5us; end begin diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/tests/p4_app_datapath/p4_app_datapath_unit_test.sv b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/tests/p4_app_datapath/p4_app_datapath_unit_test.sv index 32cd304..1ffc0b9 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/tests/p4_app_datapath/p4_app_datapath_unit_test.sv +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/tests/p4_app_datapath/p4_app_datapath_unit_test.sv @@ -152,7 +152,7 @@ module p4_app_datapath_unit_test; string filename; - // variabes for reading expected pcap data + // variables for reading expected pcap data byte exp_data[$][$]; pcap_pkg::pcap_hdr_t exp_pcap_hdr; pcap_pkg::pcaprec_hdr_t exp_pcap_record_hdr[$]; diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/verif/Makefile b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/verif/Makefile index 6cb7ee0..ea01c12 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/verif/Makefile +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/p4_app/verif/Makefile @@ -25,8 +25,8 @@ SRC_LIST_FILES = # List IP component and external library dependencies # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- -COMPONENTS = p4_app.regio.rtl \ - p4_app.regio.verif \ +COMPONENTS = p4_app.region.rtl \ + p4_app.region.verif \ std.verif@common \ axi4l.verif@common \ axi4s.verif@common diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/Makefile b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/Makefile index 5871b4b..9059d91 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/Makefile +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/Makefile @@ -10,7 +10,7 @@ include $(IP_ROOT)/config.mk # ----------------------------------------------- # Regmap YAML sources -# List regio yaml block and decoder specification sources. +# List region yaml block and decoder specification sources. # RTL is autogenerated for all yaml files listed. # ----------------------------------------------- REG_BLOCK_YAML = smartnic_322mhz.yaml @@ -44,6 +44,6 @@ smartnic_322mhz_app_decoder.yaml: @cp $(IP_ROOT)/app_if/smartnic_322mhz_app_decoder.yaml ./ # ----------------------------------------------- -# Include regio targets +# Include region targets # ----------------------------------------------- -include $(SCRIPTS_ROOT)/Makefiles/regio.mk +include $(SCRIPTS_ROOT)/Makefiles/region.mk diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_app_sdnet_decoder.yaml b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_app_sdnet_decoder.yaml index 53c9094..3410b53 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_app_sdnet_decoder.yaml +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_app_sdnet_decoder.yaml @@ -10,7 +10,7 @@ blocks: decoders: smartnic_322mhz_app_decoder: &smartnic_322mhz_app_decoder - !include ../src/smartnic_322mhz/regio/smartnic_322mhz_app_decoder.yaml + !include ../src/smartnic_322mhz/region/smartnic_322mhz_app_decoder.yaml interfaces: - decoder: *smartnic_322mhz_app_decoder diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_decoder.yaml b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_decoder.yaml index 71a7262..ae4d403 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_decoder.yaml +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/smartnic_322mhz_decoder.yaml @@ -2,23 +2,23 @@ name: smartnic_322mhz blocks: smartnic_322mhz: &smartnic_322mhz - !include ../src/smartnic_322mhz/regio/smartnic_322mhz.yaml + !include ../src/smartnic_322mhz/region/smartnic_322mhz.yaml reg_endian_check: ®_endian_check - !include src/reg/endian/regio/reg_endian_check.yaml + !include src/reg/endian/region/reg_endian_check.yaml axi4s_probe: &axi4s_probe - !include src/axi4s/regio/axi4s_probe.yaml + !include src/axi4s/region/axi4s_probe.yaml decoders: smartnic_322mhz_app_decoder: &smartnic_322mhz_app_decoder - !include ../src/smartnic_322mhz/regio/smartnic_322mhz_app_sdnet_decoder.yaml + !include ../src/smartnic_322mhz/region/smartnic_322mhz_app_sdnet_decoder.yaml fifo: &fifo - !include src/fifo/regio/fifo_core_decoder.yaml + !include src/fifo/region/fifo_core_decoder.yaml axi4s_split_join_decoder: &axi4s_split_join_decoder - !include src/axi4s/regio/axi4s_split_join_decoder.yaml + !include src/axi4s/region/axi4s_split_join_decoder.yaml xilinx_hbm_0: &xilinx_hbm_0 - !include ../src/smartnic_322mhz/regio/xilinx_hbm_0_decoder.yaml + !include ../src/smartnic_322mhz/region/xilinx_hbm_0_decoder.yaml xilinx_hbm_1: &xilinx_hbm_1 - !include ../src/smartnic_322mhz/regio/xilinx_hbm_1_decoder.yaml + !include ../src/smartnic_322mhz/region/xilinx_hbm_1_decoder.yaml interfaces: - block: *smartnic_322mhz diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_0_decoder.yaml b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_0_decoder.yaml index 15e2e23..8d42ea7 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_0_decoder.yaml +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_0_decoder.yaml @@ -2,9 +2,9 @@ name: xilinx_hbm_0 blocks: xilinx_hbm: &xilinx_hbm - !include src/xilinx/hbm/regio/xilinx_hbm.yaml + !include src/xilinx/hbm/region/xilinx_hbm.yaml proxy_reg: &proxy_reg - !include src/reg/proxy/regio/reg_proxy.yaml + !include src/reg/proxy/region/reg_proxy.yaml interfaces: - block: *xilinx_hbm diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_1_decoder.yaml b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_1_decoder.yaml index 8dc8cb5..1a445e6 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_1_decoder.yaml +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/regio/xilinx_hbm_1_decoder.yaml @@ -2,9 +2,9 @@ name: xilinx_hbm_1 blocks: xilinx_hbm: &xilinx_hbm - !include src/xilinx/hbm/regio/xilinx_hbm.yaml + !include src/xilinx/hbm/region/xilinx_hbm.yaml proxy_reg: &proxy_reg - !include src/reg/proxy/regio/reg_proxy.yaml + !include src/reg/proxy/region/reg_proxy.yaml interfaces: - block: *xilinx_hbm diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/Makefile b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/Makefile index bd43dd7..e6af045 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/Makefile +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/Makefile @@ -26,7 +26,7 @@ SRC_LIST_FILES = # (see $SCRIPTS_ROOT/Makefiles/dependencies.mk) # ---------------------------------------------------- COMPONENTS = smartnic_322mhz.xilinx_ip \ - smartnic_322mhz.regio.rtl \ + smartnic_322mhz.region.rtl \ reg.endian.rtl@common \ reg.proxy.rtl@common \ xilinx.hbm.rtl@common \ diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/src/smartnic_322mhz_reset.sv b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/src/smartnic_322mhz_reset.sv index e0a290c..219d7b1 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/src/smartnic_322mhz_reset.sv +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/rtl/src/smartnic_322mhz_reset.sv @@ -76,7 +76,7 @@ module smartnic_322mhz_reset #( // core clock domain resets are generated from the locally generated AXI-lite reset - // core clock domain is asynnchronous wrt. CMAC domains, and is derived from AXI-lite via a PLL + // core clock domain is asynchronous wrt. CMAC domains, and is derived from AXI-lite via a PLL xpm_cdc_async_rst #( .DEST_SYNC_FF (2), diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tb/Makefile b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tb/Makefile index 3413f19..6ae2e7f 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tb/Makefile +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tb/Makefile @@ -24,13 +24,13 @@ SRC_LIST_FILES = # ---------------------------------------------------- COMPONENTS = smartnic_322mhz.rtl \ smartnic_322mhz.xilinx_ip \ - smartnic_322mhz.regio.verif \ + smartnic_322mhz.region.verif \ std.rtl@common \ std.verif@common \ - reg.endian.regio.verif@common \ + reg.endian.region.verif@common \ axi4l.verif@common \ axi4s.verif@common \ - axi4s.regio.verif@common \ + axi4s.region.verif@common \ xilinx.hbm.verif@common EXT_LIBS = diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tests/common/tasks.svh b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tests/common/tasks.svh index 7762eb6..d53e2d8 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tests/common/tasks.svh +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/smartnic_322mhz/tests/common/tasks.svh @@ -169,7 +169,7 @@ task automatic run_pkt_stream ( input bit tuser = 0 ); - // variabes for reading pcap data$ + // variables for reading pcap data$ byte pcap_data[$][$]; pcap_pkg::pcap_hdr_t pcap_hdr; pcap_pkg::pcaprec_hdr_t pcap_record_hdr[$]; diff --git a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/vitisnetp4/verif/include/vitisnetp4_agent.svh b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/vitisnetp4/verif/include/vitisnetp4_agent.svh index f16f56e..f123294 100644 --- a/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/vitisnetp4/verif/include/vitisnetp4_agent.svh +++ b/src/targets/alveo_u280/hardware/model_test/esnet-smartnic-hw/src/vitisnetp4/verif/include/vitisnetp4_agent.svh @@ -175,7 +175,7 @@ class vitisnetp4_agent #( end RST_STATE : begin - if (VERBOSE) $display("** Info: Reseting VitisNet IP instance to default state"); + if (VERBOSE) $display("** Info: Resetting VitisNet IP instance to default state"); sdnet_0_pkg::reset_state(CtxPtr); end diff --git a/src/use_cases/performance_ASCII/common_p4.py b/src/use_cases/performance_ASCII/common_p4.py index 588e6cf..16a1ad3 100755 --- a/src/use_cases/performance_ASCII/common_p4.py +++ b/src/use_cases/performance_ASCII/common_p4.py @@ -116,7 +116,7 @@ def common_headers(fname, config): headers.write("header extractData_h {\n" " bit <16> data; \n" - " bit <32> seperator;\n" + " bit <32> separator;\n" "}\n") headers.write("header result_h {\n" diff --git a/src/use_cases/standard_ASCII/common_p4.py b/src/use_cases/standard_ASCII/common_p4.py index 4c9288d..66da783 100755 --- a/src/use_cases/standard_ASCII/common_p4.py +++ b/src/use_cases/standard_ASCII/common_p4.py @@ -116,7 +116,7 @@ def common_headers(fname, config): headers.write("header extractData_h {\n" " bit <16> data; \n" - " bit <32> seperator;\n" + " bit <32> separator;\n" "}\n") headers.write("header result_h {\n" diff --git a/src/use_cases/standard_UDP/common_p4.py b/src/use_cases/standard_UDP/common_p4.py index df7adbf..5c1dd94 100755 --- a/src/use_cases/standard_UDP/common_p4.py +++ b/src/use_cases/standard_UDP/common_p4.py @@ -116,7 +116,7 @@ def common_headers(fname, config): headers.write("header extractData_h {\n" " bit < 32 > data; \n" - # " bit < 8 > seperator;\n" + # " bit < 8 > separator;\n" "}\n") headers.write("header result_h {\n"