Merge remote-tracking branch 'cherry/master'
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
This commit is contained in:
commit
edfe0c8904
|
|
@ -1370,15 +1370,14 @@ LibertyReader::makeAxis(int index,
|
||||||
float scale = tableVariableUnit(axis_var, units)->scale();
|
float scale = tableVariableUnit(axis_var, units)->scale();
|
||||||
scaleFloats(axis_values, scale);
|
scaleFloats(axis_values, scale);
|
||||||
}
|
}
|
||||||
return std::make_shared<TableAxis>(axis_var, axis_values);
|
return make_shared<TableAxis>(axis_var, axis_values);
|
||||||
}
|
}
|
||||||
else if (axis_values) {
|
else if (axis_values) {
|
||||||
libWarn(62, group, "missing variable_%d attribute.", index + 1);
|
libWarn(62, group, "missing variable_%d attribute.", index + 1);
|
||||||
delete axis_values;
|
delete axis_values;
|
||||||
axis_values_[index] = nullptr;
|
axis_values_[index] = nullptr;
|
||||||
}
|
}
|
||||||
// No warning for missing index_xx attributes because they are
|
// No warning for missing index_xx attributes because they are not required.
|
||||||
// not required by ic_shell.
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1448,8 +1447,20 @@ LibertyReader::visitIndex(int index,
|
||||||
// Ignore index_xx in ecsm_waveform groups.
|
// Ignore index_xx in ecsm_waveform groups.
|
||||||
&& !stringEq(libertyGroup()->type(), "ecsm_waveform")) {
|
&& !stringEq(libertyGroup()->type(), "ecsm_waveform")) {
|
||||||
FloatSeq *axis_values = readFloatSeq(attr, 1.0F);
|
FloatSeq *axis_values = readFloatSeq(attr, 1.0F);
|
||||||
if (axis_values)
|
if (axis_values) {
|
||||||
|
if (axis_values->empty())
|
||||||
|
libWarn(172, attr, "missing table index values.");
|
||||||
|
else {
|
||||||
|
float prev = (*axis_values)[0];
|
||||||
|
for (size_t i = 1; i < axis_values->size(); i++) {
|
||||||
|
float value = (*axis_values)[i];
|
||||||
|
if (value <= prev)
|
||||||
|
libWarn(173, attr, "non-increasing table index values.");
|
||||||
|
prev = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
axis_values_[index] = axis_values;
|
axis_values_[index] = axis_values;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4366,7 +4377,7 @@ LibertyReader::makeTableAxis(int index)
|
||||||
const Units *units = library_->units();
|
const Units *units = library_->units();
|
||||||
float scale = tableVariableUnit(var, units)->scale();
|
float scale = tableVariableUnit(var, units)->scale();
|
||||||
scaleFloats(values, scale);
|
scaleFloats(values, scale);
|
||||||
axis_[index] = std::make_shared<TableAxis>(var, values);
|
axis_[index] = make_shared<TableAxis>(var, values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5395,7 +5406,7 @@ RelatedPortGroup::setIsOneToOne(bool one)
|
||||||
|
|
||||||
TimingGroup::TimingGroup(int line) :
|
TimingGroup::TimingGroup(int line) :
|
||||||
RelatedPortGroup(line),
|
RelatedPortGroup(line),
|
||||||
attrs_(std::make_shared<TimingArcAttrs>()),
|
attrs_(make_shared<TimingArcAttrs>()),
|
||||||
related_output_port_name_(nullptr),
|
related_output_port_name_(nullptr),
|
||||||
receiver_model_(nullptr)
|
receiver_model_(nullptr)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1413,7 +1413,7 @@ Table3::report(const Units *units,
|
||||||
line = unit2->asString(axis2_->axisValue(axis_index2),digits);
|
line = unit2->asString(axis2_->axisValue(axis_index2),digits);
|
||||||
line += " |";
|
line += " |";
|
||||||
for (size_t axis_index3 = 0; axis_index3 < axis3_->size(); axis_index3++) {
|
for (size_t axis_index3 = 0; axis_index3 < axis3_->size(); axis_index3++) {
|
||||||
line += table_unit->asString(value(axis_index1, axis_index2, axis_index3), digits);
|
line += table_unit->asString(value(axis_index1, axis_index2, axis_index3),digits);
|
||||||
line += " ";
|
line += " ";
|
||||||
}
|
}
|
||||||
report->reportLineString(line);
|
report->reportLineString(line);
|
||||||
|
|
@ -1448,33 +1448,21 @@ TableAxis::inBounds(float value) const
|
||||||
size_t
|
size_t
|
||||||
TableAxis::findAxisIndex(float value) const
|
TableAxis::findAxisIndex(float value) const
|
||||||
{
|
{
|
||||||
int max = static_cast<int>(values_->size()) - 1;
|
size_t size = values_->size();
|
||||||
if (max <= 0 || value <= (*values_)[0])
|
if (size <= 1 || value <= (*values_)[0])
|
||||||
// Return 0 if value is too small or the table is empty.
|
|
||||||
return 0;
|
return 0;
|
||||||
else if (value >= (*values_)[max])
|
else if (value >= (*values_)[size - 1])
|
||||||
// Return max-1 for value too large so interpolation pts are index,index+1.
|
// Return max_index-1 for value too large so interpolation pts are index,index+1.
|
||||||
return max - 1;
|
return size - 2;
|
||||||
else {
|
else {
|
||||||
int lower = -1;
|
int lower = -1;
|
||||||
int upper = max + 1;
|
int upper = size;
|
||||||
bool ascend = ((*values_)[max] >= (*values_)[0]);
|
while (upper - lower > 1) {
|
||||||
if (ascend) {
|
int mid = (upper + lower) >> 1;
|
||||||
while (upper - lower > 1) {
|
if (value >= (*values_)[mid])
|
||||||
int mid = (upper + lower) >> 1;
|
lower = mid;
|
||||||
if (value >= (*values_)[mid])
|
else
|
||||||
lower = mid;
|
upper = mid;
|
||||||
else
|
|
||||||
upper = mid;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
while (upper - lower > 1) {
|
|
||||||
int mid = (upper + lower) >> 1;
|
|
||||||
if (value < (*values_)[mid])
|
|
||||||
lower = mid;
|
|
||||||
else
|
|
||||||
upper = mid;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return lower;
|
return lower;
|
||||||
}
|
}
|
||||||
|
|
@ -1486,13 +1474,12 @@ TableAxis::findAxisIndex(float value,
|
||||||
size_t &index,
|
size_t &index,
|
||||||
bool &exists) const
|
bool &exists) const
|
||||||
{
|
{
|
||||||
int max = static_cast<int>(values_->size()) - 1;
|
size_t size = values_->size();
|
||||||
if (!values_->empty()
|
if (size != 0
|
||||||
&& value >= (*values_)[0]
|
&& value >= (*values_)[0]
|
||||||
&& value <= (*values_)[max]) {
|
&& value <= (*values_)[size - 1]) {
|
||||||
int lower = -1;
|
int lower = -1;
|
||||||
int upper = max + 1;
|
int upper = size;
|
||||||
bool ascend = ((*values_)[max] >= (*values_)[0]);
|
|
||||||
while (upper - lower > 1) {
|
while (upper - lower > 1) {
|
||||||
int mid = (upper + lower) >> 1;
|
int mid = (upper + lower) >> 1;
|
||||||
if (value == (*values_)[mid]) {
|
if (value == (*values_)[mid]) {
|
||||||
|
|
@ -1500,7 +1487,7 @@ TableAxis::findAxisIndex(float value,
|
||||||
exists = true;
|
exists = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((value > (*values_)[mid]) == ascend)
|
if (value > (*values_)[mid])
|
||||||
lower = mid;
|
lower = mid;
|
||||||
else
|
else
|
||||||
upper = mid;
|
upper = mid;
|
||||||
|
|
|
||||||
|
|
@ -729,6 +729,6 @@ int
|
||||||
SpefParse_error(const char *msg)
|
SpefParse_error(const char *msg)
|
||||||
{
|
{
|
||||||
spefFlushBuffer();
|
spefFlushBuffer();
|
||||||
sta::spef_reader->warn(179, "%s.", msg);
|
sta::spef_reader->warn(707, "%s.", msg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ Vcd::varAppendValue(string &id,
|
||||||
char value)
|
char value)
|
||||||
{
|
{
|
||||||
VcdValues &values = id_values_map_[id];
|
VcdValues &values = id_values_map_[id];
|
||||||
values.push_back(VcdValue(time, value, 0));
|
values.emplace_back(time, value, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -162,7 +162,7 @@ Vcd::varAppendBusValue(string &id,
|
||||||
int64_t bus_value)
|
int64_t bus_value)
|
||||||
{
|
{
|
||||||
VcdValues &values = id_values_map_[id];
|
VcdValues &values = id_values_map_[id];
|
||||||
values.push_back(VcdValue(time, '\0', bus_value));
|
values.emplace_back(time, '\0', bus_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
VcdValues &
|
VcdValues &
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue