Download presentation
Presentation is loading. Please wait.
1
Efficient Software Performance Estimation Methods for Hardware/Software Codesign Kei Suzuki Alberto Sangiovanni-Vincentelli Present: Yanmei Li
2
10/29/2002EE249 Discussion Session Introduction One of the most important purposes of hw/sw codesign is to find the optimum hw/sw partition of a system level specification under particular criteria Criteria Performance(speed, or the number of clock cycles) Cost(number of components, die size, or code size) Estimation At a lower abstraction level easy and accurate, but long design iteration time At a higher abstraction level reduce the exploring time Play an important role in the synthesis and optimization
3
10/29/2002EE249 Discussion Session Software Performance Estimation Cost of a mixed hw/sw system based on a standard micro-processor depends on the hw size Solution: Implement a given functionality with a program on the microprocessor Problem: Software implementation often fails to meet the performance requirement Tradeoff: To implement the critical portion in the program with hardware Software performance estimation is the key
4
10/29/2002EE249 Discussion Session POLIS System CFSMs (Codesign Finite State Machines) Does not discriminate between hw and sw Estimation provides preliminary timing information and also a measure for hw/sw partitioning A partitioning process takes place to identify the candidate components for sw implementation S-Graph (Software graph) To optimize the trade-off between the performance and the code size of the final implementation Estimation is helpful for s-graph optimization and sw module scheduling
5
10/29/2002EE249 Discussion Session Related Work Software performance depends on the structure of the software program as well as on the components of the target system The structure of the software program is more difficult to estimate as the abstraction level rises Most of the results are from the object code level which is the lowest level of abstraction, and are concerned with software that has a limited structure A number of approaches have been proposed A simple prediction method Statistical methods ……
6
10/29/2002EE249 Discussion Session Abstraction Models in POLIS CFSM HW: be mapped into an abstract hardware description format, and synthesized into a combinational circuit and a set of latches SW: be is translated into a data structure called s-graph
7
10/29/2002EE249 Discussion Session Abstraction Models in POLIS S-Graph: A DAG(directed acyclic graph) with one source node and one sink node Represent the control flow of a given behavior Four types of node: BEGIN, END, TEST, ASSIGN
8
10/29/2002EE249 Discussion Session S-Graph Semantics: Start with the BEGIN node Traverse each node along its edge, until reaching the END node At a TEST node, select one corresponding child with the value of the associated predicate P(V) At an ASSIGN node, assign the value of the associated function A(V) to the output variable z Translate an s-graph into a C program Traverse the graph in a depth-first manner TEST: if (or switch) statement ASSIGN: assignment statement The resulting C program has the same structure
9
10/29/2002EE249 Discussion Session Performance Estimation Methods Modeling the target system The structure of C code generated by POLIS: Function()……(1) { Initialization of local variable(assignment statements); ……(2) Structure of mixed if or switch statements and assignment statements; ……(3) Return;……(4) }
10
10/29/2002EE249 Discussion Session Modeling the Target System Execution time T=T pp +k T init +T struct Code size S=S pp +k S init +S struct T pp (S pp ) :for entering and exiting the function (1)+(4) T init ( S init ):for initializing local variables(2). k is the number of local variables. T struct (S struct ):for the structure of mixed conditional statements generated from TEST nodes and assignment statements generated from ASSIGN nodes(3).
11
10/29/2002EE249 Discussion Session Modeling the Target System (cont.) T pp, S pp, T init, S init are constant which can be determined beforehand T struct = ΣP i C t (node_type_of(i), variable_type_of(i)) S struct = ΣC s (node_type_of(i), variable_type_of(i)) P i =1 if node i is on a path, otherwise P i =0 C t and C s can be obtained by using simple benchmark programs containing a mix of the C statement that appears in the generated C programs and analyzing the execution time and code size of the programs on the target compiler and the target CPU
12
10/29/2002EE249 Discussion Session Benchmark Model Four attributes to characterize a system Name of the parameter set, a name for a unit of execution time, a name for a unit of code size, and the size of an integer variable seventeen cost parameters to model the execution time, and fifteen cost parameters to model the code size A TEST node with an event-type variable/multi-valued variable with a bit mask/multi-valued variable An ASSIGN node with an event-type variable/which assigns a constant to a variable/which assigns one variable to another one Pre-processing and post-processing A branch operation Initialization of a local variable Average execution time and size for pre-defined software library functions The size of pointers The size of integer variables
13
10/29/2002EE249 Discussion Session S-graph Level Estimation Property Property 1. Each node in an S-graph has a one-to- one correspondence with only a few statements in the synthesized C code Property 2. The form of each statement is determined by the type of corresponding node Property 3. The S-graph is a DAG, hence it does not include loops in its structure Each node/edge is weighted according to pre- calculated cost parameters in the pre-process
14
10/29/2002EE249 Discussion Session S-graph Level Estimation Algorithm: SGtrace(sg i ) If (sg i ==NULL) return (C(0,∞,0)); If(sg i has been visited) return (pre-calculated C i (*,*,0) associated with sg i ); C i =initialize (max_time=0; min_time=∞; code_size=0); For each child sg j of sg i { C ij =SGtrace(sg j )+edge cost for edge e ij If(C ij.max_time> C i.max_time) C i.max_time= C ij.max_time; If(C ij.min_time< C i.min_time) C i.min_time= C ij.min_time; C i.code_size+= C ij.code_size; } C i += node cost for node sg i ; Return(C i );
15
10/29/2002EE249 Discussion Session S-graph Level Estimation The computational complexity: O(E) Average execution time: C ave =ΣP ij (C t (node_type_of(i), variable_type_of(i))+ C e (i,j)) P ij is the possibility of executing node i and going to node j C e (i,j) is the edge cost for edge e ij
16
10/29/2002EE249 Discussion Session CFSM Level Estimation Is much more difficult since a CFSM model does not closely reflect the code structure MDDs are used to represent the transition relation function of a CFSM (a node represents a multi-valued variable; ordering is important) The estimation algorithm of the MDD is based on the assumption that the maximum(minimum) cost path in an MDD is usually the maximum (minimum) cost path in the s-graph that is generated from the MDD Also based on recursive DFS traversing algorithm There is no relation between the code size of the number of the MDD nodes
17
10/29/2002EE249 Discussion Session Experimental Results(1)
18
10/29/2002EE249 Discussion Session Experimental Results(2)
19
10/29/2002EE249 Discussion Session Experimental Results(3) Compared to an assembly-level analysis: S-graph(Table 1): The differences in the maximum execution time are within (-10%, +10%) The differences in the minimum execution time are within (-20%,+20%) The differences in code size are within (-20%,+20%) CFSM(Table 2): The differences in the maximum execution time are within (-10%,+25%) The differences in the minimum execution time are within (-20%,+20%)
20
10/29/2002EE249 Discussion Session Conclusions S-graph level method provides an accurate estimation for all analysis: the maximum and minimum execution time, and code size. It is a useful technique for optimization in software synthesis because of its accuracy. CFSM level method is less accurate than the s-graph estimation, but it is still accurate enough when estimating the maximum and minimum execution time. is important for automatic partitioning of CFSMs into hardware and software parts, and also for scheduler generation.
21
10/29/2002EE249 Discussion Session Conclusions Two software performance estimation methods for use with the POLIS hardware/software codesign system are proposed in this paper. S-graph level method CFSM level method The experimental results showed that the accuracy of both proposed methods is high enough for use in the POLIS system.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.