clkInfoCmp, tagCmp
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
ab39366f7b
commit
9f9ad0b4ab
|
|
@ -149,8 +149,8 @@ public:
|
|||
exists_[mm_index] = false;
|
||||
}
|
||||
|
||||
static bool equal(MinMaxValues *values1,
|
||||
MinMaxValues *values2)
|
||||
static bool equal(const MinMaxValues *values1,
|
||||
const MinMaxValues *values2)
|
||||
{
|
||||
return ((!values1->exists_[MinMax::minIndex()]
|
||||
&& !values2->exists_[MinMax::minIndex()])
|
||||
|
|
@ -166,6 +166,32 @@ public:
|
|||
== values2->values_[MinMax::maxIndex()]));
|
||||
}
|
||||
|
||||
static bool less(const MinMaxValues *values1,
|
||||
const MinMaxValues *values2)
|
||||
{
|
||||
if (!values1->exists_[MinMax::minIndex()]
|
||||
&& values2->exists_[MinMax::minIndex()])
|
||||
return -1;
|
||||
if (values1->exists_[MinMax::minIndex()]
|
||||
&& !values2->exists_[MinMax::minIndex()])
|
||||
return 1;
|
||||
if (!values1->exists_[MinMax::maxIndex()]
|
||||
&& values2->exists_[MinMax::maxIndex()])
|
||||
return -1;
|
||||
if (values1->exists_[MinMax::maxIndex()]
|
||||
&& !values2->exists_[MinMax::maxIndex()])
|
||||
return 1;
|
||||
if (values1->values_[MinMax::minIndex()] < values2->values_[MinMax::minIndex()])
|
||||
return -1;
|
||||
if (values1->values_[MinMax::minIndex()] > values2->values_[MinMax::minIndex()])
|
||||
return 1;
|
||||
if (values1->values_[MinMax::maxIndex()] < values2->values_[MinMax::maxIndex()])
|
||||
return -1;
|
||||
if (values1->values_[MinMax::maxIndex()] > values2->values_[MinMax::maxIndex()])
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
private:
|
||||
TYPE values_[MinMax::index_count];
|
||||
bool exists_[MinMax::index_count];
|
||||
|
|
|
|||
|
|
@ -271,18 +271,23 @@ clkInfoCmp(const ClkInfo *clk_info1,
|
|||
if (path_ap_index1 > path_ap_index2)
|
||||
return 1;
|
||||
|
||||
const Network *network = sta->network();
|
||||
const Pin *clk_src1 = clk_info1->clkSrc();
|
||||
const Pin *clk_src2 = clk_info2->clkSrc();
|
||||
if (clk_src1 < clk_src2)
|
||||
int clk_src_id1 = clk_src1 ? network->id(clk_src1) : -1;
|
||||
int clk_src_id2 = clk_src2 ? network->id(clk_src2) : -1;
|
||||
if (clk_src_id1 < clk_src_id2)
|
||||
return -1;
|
||||
if (clk_src1 > clk_src2)
|
||||
if (clk_src_id1 > clk_src_id2)
|
||||
return 1;
|
||||
|
||||
const Pin *gen_clk_src1 = clk_info1->genClkSrc();
|
||||
const Pin *gen_clk_src2 = clk_info2->genClkSrc();
|
||||
if (gen_clk_src1 < gen_clk_src2)
|
||||
int gen_clk_src_id1 = gen_clk_src1 ? network->id(gen_clk_src1) : -1;
|
||||
int gen_clk_src_id2 = gen_clk_src2 ? network->id(gen_clk_src2) : -1;
|
||||
if (gen_clk_src_id1 < gen_clk_src_id2)
|
||||
return -1;
|
||||
if (gen_clk_src1 > gen_clk_src2)
|
||||
if (gen_clk_src_id1 > gen_clk_src_id2)
|
||||
return 1;
|
||||
|
||||
bool crpr_on = sta->crprActive();
|
||||
|
|
@ -296,9 +301,15 @@ clkInfoCmp(const ClkInfo *clk_info1,
|
|||
|
||||
const ClockUncertainties *uncertainties1 = clk_info1->uncertainties();
|
||||
const ClockUncertainties *uncertainties2 = clk_info2->uncertainties();
|
||||
if (uncertainties1 < uncertainties2)
|
||||
if (uncertainties1 == nullptr && uncertainties2)
|
||||
return -1;
|
||||
if (uncertainties1 > uncertainties2)
|
||||
if (uncertainties1 && uncertainties2 == nullptr)
|
||||
return 1;
|
||||
if (uncertainties1 && uncertainties2
|
||||
&& MinMaxValues<float>::less(uncertainties1, uncertainties2))
|
||||
return -1;
|
||||
if (uncertainties1 && uncertainties2
|
||||
&& MinMaxValues<float>::less(uncertainties2, uncertainties1))
|
||||
return 1;
|
||||
|
||||
const Arrival &insert1 = clk_info1->insertion();
|
||||
|
|
|
|||
|
|
@ -338,8 +338,8 @@ tagCmp(const Tag *tag1,
|
|||
|
||||
InputDelay *input_delay1 = tag1->inputDelay();
|
||||
InputDelay *input_delay2 = tag2->inputDelay();
|
||||
int input_delay_index1 = input_delay1 ? input_delay1->index() : 0;
|
||||
int input_delay_index2 = input_delay2 ? input_delay2->index() : 0;
|
||||
int input_delay_index1 = input_delay1 ? input_delay1->index() : -1;
|
||||
int input_delay_index2 = input_delay2 ? input_delay2->index() : -1;
|
||||
if (input_delay_index1 < input_delay_index2)
|
||||
return -1;
|
||||
if (input_delay_index1 > input_delay_index2)
|
||||
|
|
|
|||
Loading…
Reference in New Issue