| 81 | } |
| 82 | |
| 83 | void ArrayST::optimize_array() |
| 84 | { |
| 85 | list<uca_org_t > candidate_solutions(0); |
| 86 | list<uca_org_t >::iterator candidate_iter, min_dynamic_energy_iter; |
| 87 | |
| 88 | uca_org_t * temp_res = 0; |
| 89 | local_result.valid=false; |
| 90 | |
| 91 | double throughput=l_ip.throughput, latency=l_ip.latency; |
| 92 | double area_efficiency_threshold = 20.0; |
| 93 | bool throughput_overflow=true, latency_overflow=true; |
| 94 | int optimization_end = 20; |
| 95 | compute_base_power(); |
| 96 | |
| 97 | if ((local_result.cycle_time - throughput) <= 1e-10 ) |
| 98 | throughput_overflow=false; |
| 99 | if ((local_result.access_time - latency)<= 1e-10) |
| 100 | latency_overflow=false; |
| 101 | |
| 102 | if ((opt_for_clk && opt_local) && ((l_ip.cache_sz>2048 && l_ip.assoc!=0) ||(l_ip.cache_sz>256 && l_ip.assoc==0)))//over opt small array lead to sub-optimal solutions |
| 103 | { |
| 104 | if (throughput_overflow || latency_overflow) |
| 105 | { |
| 106 | l_ip.ed=0; |
| 107 | |
| 108 | l_ip.delay_wt = 100;//Fixed number, make sure timing can be satisfied. |
| 109 | l_ip.cycle_time_wt = 1000; |
| 110 | |
| 111 | l_ip.area_wt = 10;//Fixed number, This is used to exhaustive search for individual components. |
| 112 | l_ip.dynamic_power_wt = 10;//Fixed number, This is used to exhaustive search for individual components. |
| 113 | l_ip.leakage_power_wt = 10; |
| 114 | |
| 115 | l_ip.delay_dev = 1000000;//Fixed number, make sure timing can be satisfied. |
| 116 | l_ip.cycle_time_dev = 100; |
| 117 | |
| 118 | l_ip.area_dev = 1000000;//Fixed number, This is used to exhaustive search for individual components. |
| 119 | l_ip.dynamic_power_dev = 1000000;//Fixed number, This is used to exhaustive search for individual components. |
| 120 | l_ip.leakage_power_dev = 1000000; |
| 121 | |
| 122 | throughput_overflow=true; //Reset overflow flag before start optimization iterations |
| 123 | latency_overflow=true; |
| 124 | |
| 125 | temp_res = &local_result; //Clean up the result for optimized for ED^2P |
| 126 | temp_res->cleanup(); |
| 127 | } |
| 128 | |
| 129 | |
| 130 | while ((throughput_overflow || latency_overflow)&&l_ip.cycle_time_dev > optimization_end)// l_ip.delay_dev <40 will have over-opt results |
| 131 | { |
| 132 | compute_base_power(); |
| 133 | |
| 134 | l_ip.cycle_time_dev-=10;//This is the time_dev to be used for next iteration |
| 135 | |
| 136 | // from best area to worst area -->worst timing to best timing |
| 137 | if ((((local_result.cycle_time - throughput) <= 1e-10 ) && (local_result.access_time - latency)<= 1e-10)|| |
| 138 | (local_result.data_array2->area_efficiency < area_efficiency_threshold && l_ip.assoc == 0)) |
| 139 | { //if no satisfiable solution is found,the most aggressive one is left |
| 140 | candidate_solutions.push_back(local_result); |
nothing calls this directly
no test coverage detected