RCG: fix out of order calculations, add order check
Two out-of-order bugs are fixed. Closes #325 (closed).
- Ordering simply counts how many inputs of a part of visited. When that number matches the total inputs for the part, the part is visited, but inside a subystem, delays were counted twice. Once on the initial pass looking for signal sources, and again as a normal part.
Parts that took input directly from delays could appear early in the sequence.
This change skips following links form delays as a normal part.
- If a data source, including subsystem inputs, constants, delays, grounds were connected directly to a subsystem output, then parts immediately connected from the output would be added to the subsystem sequence, though they were at a higher level.
This bug could cause these parts to be sequenced out of order.
Change is to check whether a part leading form a data source is in the subsystem. This check is already included when following from normal (non-input) parts.
Test of calculation order that compares tree dump to sequence dump added to RCG. Default behavior is to abort compilation if out of order calculation is detected.