@@ -521,12 +521,17 @@ def STATE_GROUP_TO_C_CODE(
521
521
text += " }\n "
522
522
continue
523
523
524
- # At this point the stage is absolutely empty, assume to be delay state for delaying return
525
- #raise Exception("Need assumed delay state for return?")
526
- text += " // ASSUMED EMPTY DELAY STATE FOR RETURN\n "
527
- text += " FSM_STATE = RETURN_REG;\n "
528
- text += " FUNC_CALL_RETURN_FSM_STATE = ENTRY_REG;\n "
529
- text += " }\n "
524
+ # At this point the stage assumed to be returning/done?
525
+ # From a subroutine or main?
526
+ if state_info .sub_func_name is not None :
527
+ text += " // Assumed subroutine returning to scheduled return state\n "
528
+ text += " FSM_STATE = " + state_info .sub_func_name + "_FUNC_CALL_RETURN_FSM_STATE;\n "
529
+ text += " }\n "
530
+ else :
531
+ text += " // ASSUMED EMPTY DELAY STATE FOR RETURN\n "
532
+ text += " FSM_STATE = RETURN_REG;\n "
533
+ text += " FUNC_CALL_RETURN_FSM_STATE = ENTRY_REG;\n "
534
+ text += " }\n "
530
535
531
536
return text
532
537
@@ -995,7 +1000,7 @@ def GET_STATE_TRANS_LISTS(start_state, parser_state, visited_states=None):
995
1000
# print()
996
1001
# visited_states is primarily to resolve loops for user instead of requiring __clk()?
997
1002
if start_state in visited_states :
998
- return [[start_state ]]
1003
+ return [[]] #[[ start_state]]
999
1004
visited_states .append (start_state )
1000
1005
1001
1006
debug = False
@@ -1784,7 +1789,8 @@ def GET_GROUPED_STATE_TRANSITIONS(
1784
1789
return []
1785
1790
state_groups = [None ] * (max (state_to_latest_index .values ()) + 1 )
1786
1791
for state , index in state_to_latest_index .items ():
1787
- # print("Last Index",index,state.name)
1792
+ if debug :
1793
+ print ("Last Index" ,index ,state .name )
1788
1794
if state_groups [index ] is None :
1789
1795
state_groups [index ] = set ()
1790
1796
state_groups [index ].add (state )
0 commit comments