The delay for a join_any and join_none is different than join

This commit is contained in:
Cary R 2017-12-05 21:48:33 -08:00
parent c38ca2114b
commit 39c14edb76
1 changed files with 24 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2016 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2017 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -2804,12 +2804,27 @@ DelayType NetProc::delay_type() const
DelayType NetBlock::delay_type() const
{
DelayType result = NO_DELAY;
// A join_none has no delay.
if (type() == PARA_JOIN_NONE) return NO_DELAY;
for (const NetProc*cur = proc_first(); cur; cur = proc_next(cur)) {
DelayType dt = cur->delay_type();
if (dt > result) result = dt;
if (dt == DEFINITE_DELAY) break;
DelayType result;
// A join_any has the minimum delay.
if (type() == PARA_JOIN_ANY) {
result = DEFINITE_DELAY;
for (const NetProc*cur = proc_first(); cur; cur = proc_next(cur)) {
DelayType dt = cur->delay_type();
if (dt < result) result = dt;
if (dt == NO_DELAY) break;
}
// A begin or join has the maximum delay.
} else {
result = NO_DELAY;
for (const NetProc*cur = proc_first(); cur; cur = proc_next(cur)) {
DelayType dt = cur->delay_type();
if (dt > result) result = dt;
if (dt == DEFINITE_DELAY) break;
}
}
return result;
@ -2880,9 +2895,10 @@ DelayType NetPDelay::delay_type() const
return DEFINITE_DELAY;
} else {
if (statement_) {
return statement_->delay_type();
return combine_delays(ZERO_DELAY,
statement_->delay_type());
} else {
return NO_DELAY;
return ZERO_DELAY;
}
}
}