The present invention discloses a method for estimating the
workload of a data flow based on COStream, and belongs to the field of task
workload estimation of a data flow
compiler. The method includes: obtaining the number of
clock cycles of basic operations and basic operations of different data types in the COStream data flow language; generating a
syntax analysis tree from the program statement structure to be tested, traversing all nodes in the
syntax analysis tree, and calculating the
workload of each node respectively, and the workload of the program statement structure to be tested is the sum of the workloads of all nodes; the present invention uses the
clock cycle as a unit to estimate the workload of the program statement in a fine-grained manner, and the workload
estimation method is more accurate. In addition, when performing the workload
estimation, the actual execution path of the COStream
compiler after optimization is taken into account, and the corresponding workload is not calculated for the program statement that will not be executed after the
compiler is optimized, which further improves the accuracy of the workload estimation in the COStream data flow language.