From d130a8756edd0096f253850330548a29c8730c82 Mon Sep 17 00:00:00 2001 From: karthikmurakonda Date: Thu, 18 Aug 2022 11:26:01 +0530 Subject: [PATCH] added supporting files for assignment-1 --- .../__pycache__/evaluate.cpython-310.pyc | Bin 0 -> 2209 bytes assignment-1/supporting_files/emulator.jar | Bin 0 -> 20578 bytes assignment-1/supporting_files/evaluate.py | 113 ++++++++++++++++++ .../program_templates/descending_template.asm | 16 +++ .../program_templates/even-odd_template.asm | 8 ++ .../program_templates/fibonancci_template.asm | 7 ++ .../program_templates/palindrome_template.asm | 7 ++ .../program_templates/prime_template.asm | 8 ++ .../test_cases/descending_1.expected | 10 ++ .../test_cases/descending_1.input | 12 ++ .../test_cases/even-odd_1.expected | 1 + .../test_cases/even-odd_1.input | 3 + .../test_cases/fibonacci_1.expected | 12 ++ .../test_cases/fibonacci_1.input | 3 + .../test_cases/palindrome_1.expected | 1 + .../test_cases/palindrome_1.input | 3 + .../test_cases/prime_1.expected | 1 + .../supporting_files/test_cases/prime_1.input | 3 + assignment-1/supporting_files/test_each.py | 6 + assignment-1/supporting_files/test_zip.py | 35 ++++++ 20 files changed, 249 insertions(+) create mode 100644 assignment-1/supporting_files/__pycache__/evaluate.cpython-310.pyc create mode 100755 assignment-1/supporting_files/emulator.jar create mode 100755 assignment-1/supporting_files/evaluate.py create mode 100755 assignment-1/supporting_files/program_templates/descending_template.asm create mode 100755 assignment-1/supporting_files/program_templates/even-odd_template.asm create mode 100755 assignment-1/supporting_files/program_templates/fibonancci_template.asm create mode 100755 assignment-1/supporting_files/program_templates/palindrome_template.asm create mode 100755 assignment-1/supporting_files/program_templates/prime_template.asm create mode 100755 assignment-1/supporting_files/test_cases/descending_1.expected create mode 100755 assignment-1/supporting_files/test_cases/descending_1.input create mode 100755 assignment-1/supporting_files/test_cases/even-odd_1.expected create mode 100755 assignment-1/supporting_files/test_cases/even-odd_1.input create mode 100755 assignment-1/supporting_files/test_cases/fibonacci_1.expected create mode 100755 assignment-1/supporting_files/test_cases/fibonacci_1.input create mode 100755 assignment-1/supporting_files/test_cases/palindrome_1.expected create mode 100755 assignment-1/supporting_files/test_cases/palindrome_1.input create mode 100755 assignment-1/supporting_files/test_cases/prime_1.expected create mode 100755 assignment-1/supporting_files/test_cases/prime_1.input create mode 100755 assignment-1/supporting_files/test_each.py create mode 100755 assignment-1/supporting_files/test_zip.py diff --git a/assignment-1/supporting_files/__pycache__/evaluate.cpython-310.pyc b/assignment-1/supporting_files/__pycache__/evaluate.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b48afc1565e00bbe9f2d45f232397e6a4674c7d GIT binary patch literal 2209 zcmZ`)&1)M+6rWk`N~_iC%T^-UaT@i5wuV}YDTNZ6(%_I&69NgeEKS9FXCkk?AM(sd zw#6(2(o>)%|3E=H7JBI=wAcO_d+jOzLQZ`%D>XheT1NBU%85X6O)}uz`{=UD-P+DGM;$ zkY`KwWU+Su5nF2p*&|3r@H=2_>DU86!^-Inu+{X+w~FJxv+1rnv%ShiWLe*&vS`W* z*;eNP425^C@F4!0ytcysE}CRVR*D_4uPgk!Z=t?QZ_jD*}Og&3d+SO z@HyqfH+cA3y|_6Zv0@&~%Y!hPOvSu9pyv}B2ugB%e(&)cd~4ph?}thMK8;g$(LYEN zK@-7qd=s!k5l;p_k8^xBw+4cqi@94Yrc(iQxq0l*{CRor`}ll+JU911%&w7_xgY@0 zGiB_xrNp4QUA@(Rc<0fh_vaO`?)hOfuPNC|b^msMe#7Y(wEeZlzDWB4C{h9e&;h`q zawu6NZ})fGc`2evZt+PJirh$fUWr0b5VG7%Cu%2%QciR0jD>>c4xb)QSQ=2ybL*i3 zF!ke^nl*n8G(qp7&pD1fcZD1!eoVcZNQEDbVxOIG&*eeNfUEHA zV9G|Cs=jVa;kLBcFd2`0LKqa}HE2RE`^{J%>xj|QDdZ-(sq}m8gr1Fj&S`uYT@+l7 zz8@=IbZ#W3)P0snk|e-FwG$4RU%_3*8|w?E|5$s}b$wM*5+hpVh~FuBO> zwWI#=_@D4)8YXTSA7c}q7VcmhZ^MduYepQn)%=TPsz0 GUE^PN(MuNq literal 0 HcmV?d00001 diff --git a/assignment-1/supporting_files/emulator.jar b/assignment-1/supporting_files/emulator.jar new file mode 100755 index 0000000000000000000000000000000000000000..80440aaaf1fadcfef5aa48349d55000eee0dd866 GIT binary patch literal 20578 zcmaHS19&H0(r;|rnb_up6Wg|JJ2SCu+qP}nwv&mS+|0gr@9w_)-LIdg|K0uX(|u0Y zsXA5lt14LuU=S1l2nYy(LS0}ffPdRi06+kwgcSK`#H5Akr1+%8goP9oX{CfeMgahB zrN+l3C1_}8U?pfMC&#DiC2P%(qgP59N1DaZ71;KJ3_;NMo(QR(C;k5n4yJ6QWpP&I#QOBorF(>hpSjuKIit z=z858GmMoq_-q+lx#T{|yxq9HgO1__)CK=2At0_Mu+l&_ZrnevG}8$28O;b(_ZiH4 zvEz=JtFY9+dXgi$fSP|KvEhtult5e3SIy?TaA>tqJ&6OtUYKN#t2iL9pv_hhAJdc(H}d_W6_$I{ENO&Z z*jS6tB~+Nisi|as$%#6`;3zpz8t{Zck~4>x==g``hNT0@hNx+?dbR+hBuU{-i@(VR z1u58tquBRN9Y%-ozzz4+f+-}r9_3DdqjZeM&`Rq9x0}Ss$^8PXW2GSLB-8gZ zOoqdsA<@%xnf1AAAYy~d^b~gi;268^`FpAvfi@B-4*fK2j$+Hxe&!Mn62t8{`&3)J zN($E*lt39>b&s*Mhqt7%Q1>y+g~Y2#O00)WP;*R)T&;R38=Hi5 z)S-uCPzp=#81ds9onFtwts#3B8>1kG0WC_0lC?66U8(Rn9tumfZt9_1U!sMfQg0hM z!?AWRd|7xo6kOkZ`!-|;Fb{GlNHSI zi5OA%!_a4f5YmA+2w>J$jHQI`A>v$BOtQgY=m8>{ZIdvV`oi$};cfs5R^rzZ>_n%I}yNo}bl=c1O zUnuEX0XF;Cht3Mnelm!gDC-lQf+#-^ltz!qT&0FjtlLz==}Rs`Ub(0?AlyPQ`Mm=Y z*Y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hSEtwN;l24UN0mFkORx-ZVh)P;n9q%)_+^iobUlS#$r z^ekVaRI=`0Jwe(Ql{$>A#1{jSqzMJhrK7osD{zV@_enEULLfz6QhKi zB;C$;Of@j;zh0OzOHk2NuuG!}8OptWyBE`SFNzSZ)4MaYK&!{u!=Dx~ z+?{F}S`Zp@>BenzUU@pjbG`47Z|Rz`xSwWyUu&ebHA{0VRohap_Oh(}HwwpgtlweL z|7k))aVmJoTSv<1R!T3uOrMz=B&)>d!MyPfm-T=U*&fjuHh1c9kHxq5HzuQF^_ zt8JONZC=NF#&H_`S5=dG@XXV?am{~9PG}n45NytG>k7L^yIKADDc&eflPHhe($G zY~xk`9zDa!wWs zy9x(_?u##nqyW=SA$=o^eD;fQiDCt{Ba#SAk%Y2TVJOMNL~zb3(jH7Lf_zgLEt_Hc z|4FMvl7a~g(BT_K$CedImk$yYfda!wD;61{Uzod)@jFlZ|i YEcYhutRb~B3MI+@@vTFljB(K2fAg9mIRF3v literal 0 HcmV?d00001 diff --git a/assignment-1/supporting_files/evaluate.py b/assignment-1/supporting_files/evaluate.py new file mode 100755 index 0000000..ff4179b --- /dev/null +++ b/assignment-1/supporting_files/evaluate.py @@ -0,0 +1,113 @@ +#!/bin/python + +import os +import shutil +import sys +import subprocess +from threading import Timer + +def evaluate(submitted_program): + + jarfile = "./emulator.jar" + testcases_directory = "./test_cases/" + + l = len(submitted_program.split("/")) + program_name = submitted_program.split("/")[l-1].split("_")[0].split(".")[0] + total_marks = 0 + scored_marks = 0 + for cur_file in os.listdir(testcases_directory): + if program_name in cur_file and ".input" in cur_file: + total_marks = total_marks + 1 +#find starting and ending address + expected_file = open(testcases_directory + cur_file.split(".")[0] + ".expected") + starting_address = "x" + ending_address = "x" + memory_required = False + for line in expected_file: + if memory_required == True: + if len(line.split(":")) > 1: + if starting_address == "x": + starting_address = line.split(":")[0].split()[0] + else: + ending_address = line.split(":")[0].split()[0] + if "Main Memory Contents" in line: + memory_required = True + expected_file.close() + + if starting_address == "x": + starting_address = "0" + ending_address = "0" + if ending_address == "x": + ending_address = starting_address +#create new assembly file based on test case + new_assembly_file = open("./tmp.asm", 'w') + input_file = open(testcases_directory + cur_file) + for line in input_file: + new_assembly_file.write(line) + input_file.close() + + text_encountered = False + submitted_file = open(submitted_program) + for line in submitted_file: + if ".text" in line: + text_encountered = True + if text_encountered == True: + new_assembly_file.write(line) + submitted_file.close() + new_assembly_file.close() +# spawn emulator + stdout_file = open("./tmp.output", 'w') + popen_args = ["java", "-Xmx1g", "-jar", jarfile, "./tmp.asm", starting_address, ending_address] + proc = subprocess.Popen(popen_args, stdout = stdout_file, stderr = stdout_file) + timer = Timer(5, proc.kill) + try: + timer.start() + stdout, stderr = proc.communicate() + finally: + timer.cancel() + stdout_file.close() +# evaluate against expected output + expected_file = open(testcases_directory + cur_file.split(".")[0] + ".expected") + result_file = open("./tmp.output") + expected_line = expected_file.readline() + first_line_found = False + evaluation = True + for line in result_file: + if first_line_found == True and line != expected_line: + evaluation = False + break + if expected_line == line: + first_line_found = True + expected_line = expected_file.readline() + if expected_line == None or expected_line == "": + break + if first_line_found == False: + evaluation = False + + expected_file.close() + result_file.close() + + if evaluation == True: + scored_marks = scored_marks + 1 + print(cur_file + "\t: PASS!") + else: + print(cur_file + "\t: Fail") +#debug print + debug = False + if debug == True: + print("testcase = " + cur_file) + print("\n output expected to contain = ") + expected_file = open(testcases_directory + cur_file.split(".")[0] + ".expected") + for line in expected_file: + print(line) + expected_file.close() + print("\n obtained output = ") + output_file = open("./tmp.output") + for line in output_file: + print(line) + output_file.close() + + os.remove("./tmp.asm") + os.remove("./tmp.output") + + return [total_marks, scored_marks] diff --git a/assignment-1/supporting_files/program_templates/descending_template.asm b/assignment-1/supporting_files/program_templates/descending_template.asm new file mode 100755 index 0000000..b101748 --- /dev/null +++ b/assignment-1/supporting_files/program_templates/descending_template.asm @@ -0,0 +1,16 @@ + .data +a: + 70 + 80 + 40 + 20 + 10 + 30 + 50 + 60 +n: + 8 + .text +// your code here +// you may change the numbers in the array, and the size of the array; but allow the name of the array to remain as 'a', and size as 'n' +// remove these comments! diff --git a/assignment-1/supporting_files/program_templates/even-odd_template.asm b/assignment-1/supporting_files/program_templates/even-odd_template.asm new file mode 100755 index 0000000..d08577b --- /dev/null +++ b/assignment-1/supporting_files/program_templates/even-odd_template.asm @@ -0,0 +1,8 @@ + .data +a: + 10 + .text +// your code here to check if the number 'a' is even or odd. If yes, write 1 to x10. Else write -1. +// you may change the value of 'a' +// remove these comments! + diff --git a/assignment-1/supporting_files/program_templates/fibonancci_template.asm b/assignment-1/supporting_files/program_templates/fibonancci_template.asm new file mode 100755 index 0000000..a999cbd --- /dev/null +++ b/assignment-1/supporting_files/program_templates/fibonancci_template.asm @@ -0,0 +1,7 @@ + .data +n: + 10 + .text +// your code here to get the first 'n' Fibonacci numbers +// you may change the value of 'n' +// remove these comments! diff --git a/assignment-1/supporting_files/program_templates/palindrome_template.asm b/assignment-1/supporting_files/program_templates/palindrome_template.asm new file mode 100755 index 0000000..2979620 --- /dev/null +++ b/assignment-1/supporting_files/program_templates/palindrome_template.asm @@ -0,0 +1,7 @@ + .data +a: + 10 + .text +// your code here to check if 'a' is a palindrome +// you may change the value of 'a' +// remove these comments! diff --git a/assignment-1/supporting_files/program_templates/prime_template.asm b/assignment-1/supporting_files/program_templates/prime_template.asm new file mode 100755 index 0000000..395f0f8 --- /dev/null +++ b/assignment-1/supporting_files/program_templates/prime_template.asm @@ -0,0 +1,8 @@ + .data +a: + 10 + .text +// your code here to check if the number 'a' is prime. If yes, write 1 to x10. Else write -1. +// you may change the value of 'a' +// remove these comments! + diff --git a/assignment-1/supporting_files/test_cases/descending_1.expected b/assignment-1/supporting_files/test_cases/descending_1.expected new file mode 100755 index 0000000..7a6878a --- /dev/null +++ b/assignment-1/supporting_files/test_cases/descending_1.expected @@ -0,0 +1,10 @@ +Main Memory Contents: + +0 : 80 +1 : 70 +2 : 60 +3 : 50 +4 : 40 +5 : 30 +6 : 20 +7 : 10 diff --git a/assignment-1/supporting_files/test_cases/descending_1.input b/assignment-1/supporting_files/test_cases/descending_1.input new file mode 100755 index 0000000..c41a03f --- /dev/null +++ b/assignment-1/supporting_files/test_cases/descending_1.input @@ -0,0 +1,12 @@ + .data +a: + 70 + 80 + 40 + 20 + 10 + 30 + 50 + 60 +n: + 8 diff --git a/assignment-1/supporting_files/test_cases/even-odd_1.expected b/assignment-1/supporting_files/test_cases/even-odd_1.expected new file mode 100755 index 0000000..2e7e5d3 --- /dev/null +++ b/assignment-1/supporting_files/test_cases/even-odd_1.expected @@ -0,0 +1 @@ +x10 : -1 diff --git a/assignment-1/supporting_files/test_cases/even-odd_1.input b/assignment-1/supporting_files/test_cases/even-odd_1.input new file mode 100755 index 0000000..2a7d973 --- /dev/null +++ b/assignment-1/supporting_files/test_cases/even-odd_1.input @@ -0,0 +1,3 @@ + .data +a: + 10 diff --git a/assignment-1/supporting_files/test_cases/fibonacci_1.expected b/assignment-1/supporting_files/test_cases/fibonacci_1.expected new file mode 100755 index 0000000..9accc8e --- /dev/null +++ b/assignment-1/supporting_files/test_cases/fibonacci_1.expected @@ -0,0 +1,12 @@ +Main Memory Contents: + +65526 : 34 +65527 : 21 +65528 : 13 +65529 : 8 +65530 : 5 +65531 : 3 +65532 : 2 +65533 : 1 +65534 : 1 +65535 : 0 diff --git a/assignment-1/supporting_files/test_cases/fibonacci_1.input b/assignment-1/supporting_files/test_cases/fibonacci_1.input new file mode 100755 index 0000000..cad0e0d --- /dev/null +++ b/assignment-1/supporting_files/test_cases/fibonacci_1.input @@ -0,0 +1,3 @@ + .data +n: + 10 diff --git a/assignment-1/supporting_files/test_cases/palindrome_1.expected b/assignment-1/supporting_files/test_cases/palindrome_1.expected new file mode 100755 index 0000000..d5d7827 --- /dev/null +++ b/assignment-1/supporting_files/test_cases/palindrome_1.expected @@ -0,0 +1 @@ +x10 : 1 diff --git a/assignment-1/supporting_files/test_cases/palindrome_1.input b/assignment-1/supporting_files/test_cases/palindrome_1.input new file mode 100755 index 0000000..fcbb54a --- /dev/null +++ b/assignment-1/supporting_files/test_cases/palindrome_1.input @@ -0,0 +1,3 @@ + .data +a: + 12321 diff --git a/assignment-1/supporting_files/test_cases/prime_1.expected b/assignment-1/supporting_files/test_cases/prime_1.expected new file mode 100755 index 0000000..2e7e5d3 --- /dev/null +++ b/assignment-1/supporting_files/test_cases/prime_1.expected @@ -0,0 +1 @@ +x10 : -1 diff --git a/assignment-1/supporting_files/test_cases/prime_1.input b/assignment-1/supporting_files/test_cases/prime_1.input new file mode 100755 index 0000000..2a7d973 --- /dev/null +++ b/assignment-1/supporting_files/test_cases/prime_1.input @@ -0,0 +1,3 @@ + .data +a: + 10 diff --git a/assignment-1/supporting_files/test_each.py b/assignment-1/supporting_files/test_each.py new file mode 100755 index 0000000..c1c6835 --- /dev/null +++ b/assignment-1/supporting_files/test_each.py @@ -0,0 +1,6 @@ +#!/bin/python + +import sys +from evaluate import evaluate + +evaluate(sys.argv[1]) diff --git a/assignment-1/supporting_files/test_zip.py b/assignment-1/supporting_files/test_zip.py new file mode 100755 index 0000000..dc0f7f6 --- /dev/null +++ b/assignment-1/supporting_files/test_zip.py @@ -0,0 +1,35 @@ +#!/bin/python + +import sys +import os +import zipfile +from evaluate import evaluate +import shutil + +zip_file = sys.argv[1] + +l = len(zip_file.split("/")) +print("Students :\t" + zip_file.split("/")[l-1].split("_")[0] + " and " + zip_file.split("_")[1].split(".")[0]) +print("") + +submissions_temp_dir = "./submissions/" + +if not os.path.exists(submissions_temp_dir): + os.mkdir(submissions_temp_dir) + +zip_ref = zipfile.ZipFile(zip_file, 'r') +zip_ref.extractall(submissions_temp_dir) +zip_ref.close() + +total_marks = 0 +scored_marks = 0 +for asm_file in os.listdir(submissions_temp_dir): + if ".asm in file": + [t,s] = evaluate(submissions_temp_dir + asm_file) + print(asm_file + ";\tscore = " + str(s) + " out of " + str(t)) + total_marks = total_marks + t + scored_marks = scored_marks + s + +shutil.rmtree(submissions_temp_dir) + +print("total score = " + str(scored_marks) + " out of " + str(total_marks))