Download CoCentric™ SystemC Compiler Behavioral Modeling Guide

Transcript
General Coding Rule 3
Place at least one wait statement after the reset action and before
the main infinite loop. Do not include either a conditional branch or a
rolled loop in the reset behavior description. For more information
about resets, see “Using Resets” on page 3-46.”
Example 3-7 shows reset statements without a wait statement before
the infinite loop that implements the process behavior. This causes
an HLS-354 error. To correct this error, insert a wait statement, as
shown in bold in Example 3-8.
Example 3-7 Error in Use of General Coding Rule 3
//Initialize and reset if reset asserts
ready_for_data.write(false);
output_data_ready.write(false);
real_out.write(0);
imaginary_out.write(0);
//Error: need wait after reset.
while (true) {
//Implement process behavior
}
Example 3-8 Correct General Coding Rule 3
//Initialize and reset if reset asserts
ready_for_data.write(false);
output_data_ready.write(false);
real_out.write(0);
imaginary_out.write(0);
wait();
while (true) {
// Implement process behavior
}
Behavioral Coding Guidelines
3-15