diff --git a/model/py/builder.py b/model/py/builder.py index 0ea1e2b9b44a59bb80a9a8fa5e3c841eba1a59e4..8dc124bb96b24927197a7b634d09799daa378be1 100644 --- a/model/py/builder.py +++ b/model/py/builder.py @@ -19,10 +19,10 @@ def main(argv): packets = 1 random.seed(seed) + print(f"Generating {packets} packets using seed: {seed}") for i in range(packets): # Generate expected output in 512 bit chunks cfg_size = random.randint(0,pow(2,14)) - print(cfg_size) cfg_size_bin = "{0:b}".format(cfg_size) # Pad Size to 64 bits cfg_size_str = "0"*(64-len(cfg_size_bin)) + str(cfg_size_bin) @@ -30,16 +30,12 @@ def main(argv): data = "{0:b}".format(random.getrandbits(cfg_size)) chunked_data_words = chunkstring(str(data),512) - print(len(chunked_data_words)) - print(len(chunked_data_words[-1])) in_data_words = chunked_data_words.copy() in_data_words[-1] = in_data_words[-1] + "0"*(512-len(in_data_words[-1])) - print(in_data_words[-1]) in_data_words_last = [] out_data_words = chunked_data_words.copy() out_data_words_last = [] last_len = len(chunked_data_words[-1]) - print(last_len) if (last_len == 512): out_data_words.append("1" + "0"*447 + cfg_size_str) else: @@ -61,17 +57,26 @@ def main(argv): out_data_words_last.append("1") # Ouptut Input Data Stimulus to Text File - input_header = ["cfg_size", "cfg_scheme", "cfg_last", "data_in", "data_in_last"] - with open("input_builder_stim.csv", "w", encoding="UTF8", newline='') as f: + input_header = ["input_data", "input_data_last"] + with open("input_data_builder_stim.csv", "w", encoding="UTF8", newline='') as f: writer = csv.writer(f) # Write Header Row writer.writerow(input_header) for idx, word in enumerate(in_data_words): - writer.writerow([cfg_size_str, "00", "1", word, in_data_words_last[idx]]) + writer.writerow([word, in_data_words_last[idx]]) + + # Ouptut Input Data Stimulus to Text File + input_header = ["input_cfg_size", "input_cfg_scheme", "input_cfg_last"] + with open("input_cfg_builder_stim.csv", "w", encoding="UTF8", newline='') as f: + writer = csv.writer(f) + # Write Header Row + writer.writerow(input_header) + for idx, word in enumerate(in_data_words): + writer.writerow([cfg_size_str, "00", "1"]) # Output Expected output to text file - output_header = ["data_in", "data_in_last"] - with open("output_builder_stim.csv", "w", encoding="UTF8", newline='') as f: + output_header = ["output_data", "output_data_last"] + with open("output_data_builder_stim.csv", "w", encoding="UTF8", newline='') as f: writer = csv.writer(f) # Write Header Row writer.writerow(output_header) diff --git a/model/py/input_builder_stim.csv b/model/py/input_builder_stim.csv deleted file mode 100644 index c66aaf0ebc34b93e7c319c932739880654753cd7..0000000000000000000000000000000000000000 --- a/model/py/input_builder_stim.csv +++ /dev/null @@ -1,10 +0,0 @@ -cfg_size,cfg_scheme,cfg_last,data_in,data_in_last -0000000000000000000000000000000000000000000000000001000100110010,00,1,11001001010110001110101110000011100010000011111101000010101011100001110000100010000101001111010000010000110100100110001110100100000000011111000110001101110100001011000100001010110000010001010000011110100010101101010011110110000001000000001100111000001011111110010100001011000010110001000101011110101111001010111111110110010001001100011111011110011111011101100000101000010101100101010110001101001101011110001101001110101001011110110001011001111111010011110101010011111100001111110101011100111010111100011000111111,0 -0000000000000000000000000000000000000000000000000001000100110010,00,1,00001001101001111010111011111101111010011110100010010110001001010001101101001100010101010001011001010000110101111011010100001000001111011011101010110011101111111011011001011110111001100001000101010111101011000101111100110010100100001110011000011111000100100001101001110001101111010111100000010011110111100000010001101011010101111010101111101101001110001000101000100100010010110110010001101101000011001011001001011001011010010101111001000000101011010010001111100010111110000110111111011010010100101110110001010000,0 -0000000000000000000000000000000000000000000000000001000100110010,00,1,00110010011011111011111111101011000110001000101101110000111101010001001001100010011111001001101000001110001101000100101100110101110101110101000010100100010111110101010110001001101001101101010011000111100011101001100001001100111111101111101011010101110011001001001010100101011101001000000011110001101011100110101000111110100111000000011011000000111111001110000011111011001101100000011110011010001011001111101111001101100010111101011101110111110111010100100011111110010000000001101000110100010110110101101100001000,0 -0000000000000000000000000000000000000000000000000001000100110010,00,1,01010100111110111111110010010011100001111010011101011100010110011001100111010100011100101010001000110110111010100010101010010101110000010111101101011111000111110110111000000101000011110111100101010010011110000010010111110000000111101101100001101110000100101011101001011110110111001010000000110011111101101111111100001011101010011001100001010000100011101010001011001101000101111100101111000110110000111000110011001100110011110001111111010010001101101011001110101001111101100000101001000110010110100100011100111001,0 -0000000000000000000000000000000000000000000000000001000100110010,00,1,11100101001000111111010101001000010101000111100001101011001101011100000101001111001101010100010101100010010111010000001011000000001011001011101011110110100101111100010011101100101001010001011110010000010101010111100111100011001001010111101110111010110101000100100101001010011000010110011010111100010011010001110000000001000001000101010011010110101000101111100100011110100111011000110100001000111011111010110000111111111010010100000000011101110101011011011000011100110001101100010000011010010001010011111101110110,0 -0000000000000000000000000000000000000000000000000001000100110010,00,1,11000110100010100111100000110110100111111111011110111000000011001011001101010000011000011100000011110100010001111001110001100000011001000111111011000011100010010101110001011110000000111011011110011011110000111101110011101000101111001111000000110110000001111110101001111010111111000000100110000110001000010001101110111001100001110110111111010111110111101011001111111100101100001100101101001100111001111111000011001100010001010110110011111000001101100000101000100101000000010010110110100000100111111100010101001101,0 -0000000000000000000000000000000000000000000000000001000100110010,00,1,00000001000011110101001100100100010100111110111010000011010000011100111101011100100000101101101101110011011100011000001111101010010111110110111000101000101000011000100011001001111100110110000111111001100111001000110100010101110001111000111111111000111111101010000101010001010010111010101011101010011000001001110101001000000101001001100011100110101000100011111100011010110111000101101101101100011111110010001000010111000111101010000110111001000000100111001010010110110110010001000100001101001011000000000001000101,0 -0000000000000000000000000000000000000000000000000001000100110010,00,1,00000010110100110110001000110010001110001010110011100001100100100110010011000010110011011100000010000111001110110011011101100100111010010100001100110001111001010100000101000110111010101111101001011001110110010111001001011000001101100111001100000011101000001110001111010100001111100111001000010110010000010000110000000011100101110100011000011010110111111100110010010110111001001111010011100011000010110011000010010111001110110100101101010011011001110110011000001101101111000111001010001000001100001011100110001000,0 -0000000000000000000000000000000000000000000000000001000100110010,00,1,11101100010100011110000101100111001101111010001000111111011010100110101010111101100011110001011111110101110001001010000010100110000110100001111000001000000100111110001001101000111000011100001101011101111000100110011010110000100111110001100001101100011110001011010101101111110010001101101110101100001001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,1 diff --git a/model/py/input_cfg_builder_stim.csv b/model/py/input_cfg_builder_stim.csv new file mode 100644 index 0000000000000000000000000000000000000000..d478c884c7897d524dbec8f926f54e1954c85253 --- /dev/null +++ b/model/py/input_cfg_builder_stim.csv @@ -0,0 +1,10 @@ +input_cfg_size,input_cfg_scheme,input_cfg_last +0000000000000000000000000000000000000000000000000001000100110010,00,1 +0000000000000000000000000000000000000000000000000001000100110010,00,1 +0000000000000000000000000000000000000000000000000001000100110010,00,1 +0000000000000000000000000000000000000000000000000001000100110010,00,1 +0000000000000000000000000000000000000000000000000001000100110010,00,1 +0000000000000000000000000000000000000000000000000001000100110010,00,1 +0000000000000000000000000000000000000000000000000001000100110010,00,1 +0000000000000000000000000000000000000000000000000001000100110010,00,1 +0000000000000000000000000000000000000000000000000001000100110010,00,1 diff --git a/model/py/input_data_builder_stim.csv b/model/py/input_data_builder_stim.csv new file mode 100644 index 0000000000000000000000000000000000000000..20092d799449807decf60a3a7811393dfd26acb6 --- /dev/null +++ b/model/py/input_data_builder_stim.csv @@ -0,0 +1,10 @@ +input_data,input_data_last +11001001010110001110101110000011100010000011111101000010101011100001110000100010000101001111010000010000110100100110001110100100000000011111000110001101110100001011000100001010110000010001010000011110100010101101010011110110000001000000001100111000001011111110010100001011000010110001000101011110101111001010111111110110010001001100011111011110011111011101100000101000010101100101010110001101001101011110001101001110101001011110110001011001111111010011110101010011111100001111110101011100111010111100011000111111,0 +00001001101001111010111011111101111010011110100010010110001001010001101101001100010101010001011001010000110101111011010100001000001111011011101010110011101111111011011001011110111001100001000101010111101011000101111100110010100100001110011000011111000100100001101001110001101111010111100000010011110111100000010001101011010101111010101111101101001110001000101000100100010010110110010001101101000011001011001001011001011010010101111001000000101011010010001111100010111110000110111111011010010100101110110001010000,0 +00110010011011111011111111101011000110001000101101110000111101010001001001100010011111001001101000001110001101000100101100110101110101110101000010100100010111110101010110001001101001101101010011000111100011101001100001001100111111101111101011010101110011001001001010100101011101001000000011110001101011100110101000111110100111000000011011000000111111001110000011111011001101100000011110011010001011001111101111001101100010111101011101110111110111010100100011111110010000000001101000110100010110110101101100001000,0 +01010100111110111111110010010011100001111010011101011100010110011001100111010100011100101010001000110110111010100010101010010101110000010111101101011111000111110110111000000101000011110111100101010010011110000010010111110000000111101101100001101110000100101011101001011110110111001010000000110011111101101111111100001011101010011001100001010000100011101010001011001101000101111100101111000110110000111000110011001100110011110001111111010010001101101011001110101001111101100000101001000110010110100100011100111001,0 +11100101001000111111010101001000010101000111100001101011001101011100000101001111001101010100010101100010010111010000001011000000001011001011101011110110100101111100010011101100101001010001011110010000010101010111100111100011001001010111101110111010110101000100100101001010011000010110011010111100010011010001110000000001000001000101010011010110101000101111100100011110100111011000110100001000111011111010110000111111111010010100000000011101110101011011011000011100110001101100010000011010010001010011111101110110,0 +11000110100010100111100000110110100111111111011110111000000011001011001101010000011000011100000011110100010001111001110001100000011001000111111011000011100010010101110001011110000000111011011110011011110000111101110011101000101111001111000000110110000001111110101001111010111111000000100110000110001000010001101110111001100001110110111111010111110111101011001111111100101100001100101101001100111001111111000011001100010001010110110011111000001101100000101000100101000000010010110110100000100111111100010101001101,0 +00000001000011110101001100100100010100111110111010000011010000011100111101011100100000101101101101110011011100011000001111101010010111110110111000101000101000011000100011001001111100110110000111111001100111001000110100010101110001111000111111111000111111101010000101010001010010111010101011101010011000001001110101001000000101001001100011100110101000100011111100011010110111000101101101101100011111110010001000010111000111101010000110111001000000100111001010010110110110010001000100001101001011000000000001000101,0 +00000010110100110110001000110010001110001010110011100001100100100110010011000010110011011100000010000111001110110011011101100100111010010100001100110001111001010100000101000110111010101111101001011001110110010111001001011000001101100111001100000011101000001110001111010100001111100111001000010110010000010000110000000011100101110100011000011010110111111100110010010110111001001111010011100011000010110011000010010111001110110100101101010011011001110110011000001101101111000111001010001000001100001011100110001000,0 +11101100010100011110000101100111001101111010001000111111011010100110101010111101100011110001011111110101110001001010000010100110000110100001111000001000000100111110001001101000111000011100001101011101111000100110011010110000100111110001100001101100011110001011010101101111110010001101101110101100001001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,1 diff --git a/model/py/output_builder_stim.csv b/model/py/output_data_builder_stim.csv similarity index 99% rename from model/py/output_builder_stim.csv rename to model/py/output_data_builder_stim.csv index 2274bb2fc01e466d576f1b30d522620c6eeefb3b..f7a56727ba92502a8b39d607bca6c886ee0d4dd7 100644 --- a/model/py/output_builder_stim.csv +++ b/model/py/output_data_builder_stim.csv @@ -1,4 +1,4 @@ -data_in,data_in_last +output_data,output_data_last 11001001010110001110101110000011100010000011111101000010101011100001110000100010000101001111010000010000110100100110001110100100000000011111000110001101110100001011000100001010110000010001010000011110100010101101010011110110000001000000001100111000001011111110010100001011000010110001000101011110101111001010111111110110010001001100011111011110011111011101100000101000010101100101010110001101001101011110001101001110101001011110110001011001111111010011110101010011111100001111110101011100111010111100011000111111,0 00001001101001111010111011111101111010011110100010010110001001010001101101001100010101010001011001010000110101111011010100001000001111011011101010110011101111111011011001011110111001100001000101010111101011000101111100110010100100001110011000011111000100100001101001110001101111010111100000010011110111100000010001101011010101111010101111101101001110001000101000100100010010110110010001101101000011001011001001011001011010010101111001000000101011010010001111100010111110000110111111011010010100101110110001010000,0 00110010011011111011111111101011000110001000101101110000111101010001001001100010011111001001101000001110001101000100101100110101110101110101000010100100010111110101010110001001101001101101010011000111100011101001100001001100111111101111101011010101110011001001001010100101011101001000000011110001101011100110101000111110100111000000011011000000111111001110000011111011001101100000011110011010001011001111101111001101100010111101011101110111110111010100100011111110010000000001101000110100010110110101101100001000,0