Optimized RTL code generation from coarse-grain dataflow specification for fast HW/SW cosynthesis