Skip to content
Snippets Groups Projects
Commit da549843 authored by Kia's avatar Kia
Browse files

export parse status output as well into the test harness

parent 5f9c24e3
No related branches found
No related tags found
No related merge requests found
File mode changed from 100644 to 100755
cfg_utils.py 100644 → 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
gearbox.py 100644 → 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -76,7 +76,7 @@ class Cirno(Elaboratable):
# State 1 in the paper
# Bottom of parse stack Expression
[(1, STDMASK, BOTTOM), (0, STDMASK, EXPRESSION)],
[(0, STDMASK, EXPRESSION)],
# state 2 in paper
# TERM
......@@ -236,6 +236,7 @@ class Cirno(Elaboratable):
self.tapir = msm.tapir
self.finalized = msm.parse_complete_out
self.numwritten = msm.last_index_to_smem
self.parse_success = msm.parse_success_out
with m.If(resetted == 0):
m.d.sync += resetted.eq(1)
......@@ -271,6 +272,7 @@ def run_the_sim(parse_me):
m.submodules.baka = nine = Cirno()
trace = []
numwritten = []
parse_success = [0]
def process():
......@@ -292,8 +294,10 @@ def run_the_sim(parse_me):
yield
yield
xz = yield nine.numwritten
parse_success[0] = yield nine.parse_success
numwritten.append(xz)
print("NUM WRITTEN INSIDE", numwritten)
print("PARSE SUCCESS,", parse_success)
break
......@@ -314,9 +318,14 @@ def run_the_sim(parse_me):
for x in trace:
print(x)
print("XXXXXXXXXXXXXXXXXXXXX", numwritten)
print("XXXXXXXXXXXXXXXXXXXXX", numwritten, parse_success)
return (trace, numwritten)
if (parse_success[0] == 1):
success = True
else:
success = False
return (trace, numwritten, success)
top_bit = (1<<16)
......@@ -458,7 +467,11 @@ def do_an_iteration():
parse_me.append(ENDOFPARSE)
(trace, numwritten) = run_the_sim(parse_me)
(trace, numwritten, success) = run_the_sim(parse_me)
if (success == False):
return
numwritten = numwritten[0] - 1
print("NUM WRITTEN = ",numwritten)
......@@ -487,6 +500,6 @@ def do_an_iteration():
exit(1)
for x in range(1024):
for x in range(131072):
do_an_iteration()
skidbuffer.py 100644 → 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
test_fsm.py 100644 → 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment