Skip to content

Commit

Permalink
nested pipelines, fixing start condition
Browse files Browse the repository at this point in the history
  • Loading branch information
sylefeb committed Dec 5, 2023
1 parent 1830b0c commit 08c80a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/Algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4270,15 +4270,15 @@ std::string Algorithm::fsmPipelineFirstStageDisable(const t_fsm_nfo *fsm) const

// -------------------------------------------------

std::string Algorithm::fsmNextState(std::string prefix,const t_fsm_nfo *) const
std::string Algorithm::fsmNextState(std::string prefix,const t_fsm_nfo *fsm) const
{
std::string next;
if (m_AutoRun) { // NOTE: same as isNotCallable() since hasNoFSM() is false
next = std::string("( ~") + prefix + ALG_AUTORUN + " ? " + std::to_string(toFSMState(&m_RootFSM, entryState(&m_RootFSM)));
next = std::string("( ~") + prefix + ALG_AUTORUN + " ? " + std::to_string(toFSMState(fsm, entryState(fsm)));
} else {
next = std::string("( ~") + ALG_INPUT + "_" + ALG_RUN + " ? " + std::to_string(toFSMState(&m_RootFSM, entryState(&m_RootFSM)));
next = std::string("( ~") + ALG_INPUT + "_" + ALG_RUN + " ? " + std::to_string(toFSMState(fsm, entryState(fsm)));
}
next += std::string(" : ") + FF_D + prefix + fsmIndex(&m_RootFSM) + ")";
next += std::string(" : ") + FF_D + prefix + fsmIndex(fsm) + ")";
return next;
}

Expand Down
16 changes: 11 additions & 5 deletions tests/pipeline29.si
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@ algorithm main(output uint8 leds)

__display("[B] before (%d)",n);
// stage 1
uint5 j = 0;
while (j!=4) {
uint5 j = 0;
uint1 done = 0;
while (~done) {
// nested pipeline
__display("[B,A] %d,%d",n,j);
j = j + 1;
uint8 q = j + 10;
j = j + 1;
->
__display("[B,B] %d,%d",n,j);
__display("[B,B] %d,%d",n,q);
q = q + 100;
->
__display("[B,C] %d,%d",n,q);
if (j == 3) { done = 1; }
}
++: ////////////////////////////// breaks without, why?
++: ////////////////////////////// breaks without, why?
__display("[B] after (%d)",n);

->
Expand Down

0 comments on commit 08c80a6

Please sign in to comment.