Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libs/EXTERNAL/libblifparse/src/blif_parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ subckt: DOT_SUBCKT STRING { $$ = SubCkt(); $$.model = $2; }
latch: DOT_LATCH STRING STRING {
//Input and output only
callback.lineno(lexer.lineno());
callback.latch($2, $3, LatchType::UNSPECIFIED, "", LogicValue::UNKOWN);
callback.latch($2, $3, LatchType::UNSPECIFIED, "", LogicValue::UNKNOWN);
}
| DOT_LATCH STRING STRING latch_type latch_control {
//Input, output, type and control
callback.lineno(lexer.lineno());
callback.latch($2, $3, $4, $5, LogicValue::UNKOWN);
callback.latch($2, $3, $4, $5, LogicValue::UNKNOWN);
}
| DOT_LATCH STRING STRING latch_type latch_control latch_init {
//Input, output, type, control and init-value
Expand All @@ -215,7 +215,7 @@ latch: DOT_LATCH STRING STRING {
latch_init: LOGIC_TRUE { $$ = LogicValue::TRUE; }
| LOGIC_FALSE { $$ = LogicValue::FALSE; }
| LATCH_INIT_2 { $$ = LogicValue::DONT_CARE; }
| LATCH_INIT_3 { $$ = LogicValue::UNKOWN; }
| LATCH_INIT_3 { $$ = LogicValue::UNKNOWN; }
;

latch_control: STRING { $$ = $1;}
Expand Down
2 changes: 1 addition & 1 deletion libs/EXTERNAL/libblifparse/src/blif_pretty_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void BlifPrettyPrinter::latch(std::string input, std::string output, LatchType t
case LogicValue::FALSE: printf("%s0", indent().c_str()); break;
case LogicValue::TRUE: printf("%s1", indent().c_str()); break;
case LogicValue::DONT_CARE: printf("%s2", indent().c_str()); break;
case LogicValue::UNKOWN: printf("%s3", indent().c_str()); break;
case LogicValue::UNKNOWN: printf("%s3", indent().c_str()); break;
default: assert(false);
}
--indent_level_;
Expand Down
2 changes: 1 addition & 1 deletion libs/EXTERNAL/libblifparse/src/blifparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ enum class LogicValue {
FALSE = 0, //Logic zero
TRUE = 1, //Logic one
DONT_CARE, //Don't care
UNKOWN //Unkown (e.g. latch initial state)
UNKNOWN //Unkown (e.g. latch initial state)
};

enum class LatchType {
Expand Down
2 changes: 1 addition & 1 deletion libs/EXTERNAL/libtatum/libtatum/tatum/base/TimingType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace tatum {
enum class TimingType {
SETUP,
HOLD,
UNKOWN
UNKNOWN
};

} //namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TimingPathInfo {
DomainId capture_domain() const { return capture_domain_; }

private:
TimingType path_type_ = TimingType::UNKOWN;
TimingType path_type_ = TimingType::UNKNOWN;

Time delay_;
Time slack_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void GraphvizDotWriter::write_dot_file(std::ostream& os) {
for(NodeId node : nodes_to_dump_) {
node_slacks[node] = std::vector<TimingTag>(); //No slacks
}
TimingType timing_type = TimingType::UNKOWN;
TimingType timing_type = TimingType::UNKNOWN;

write_dot_format(os, node_tags, node_slacks, timing_type);
}
Expand Down Expand Up @@ -175,7 +175,7 @@ void GraphvizDotWriter::write_dot_edge(std::ostream& os, const EdgeId edge, cons
} else if (timing_type == TimingType::HOLD) {
os << "\\n"<< delay_calc_.hold_time(tg_, edge) << " (thld)";
} else {
TATUM_ASSERT(timing_type == TimingType::UNKOWN);
TATUM_ASSERT(timing_type == TimingType::UNKNOWN);
//Create both setup and hold edges if type is unknown
os << "\\n"<< -delay_calc_.setup_time(tg_, edge) << " (-tsu)";
os << "\\n"<< delay_calc_.hold_time(tg_, edge) << " (thld)";
Expand All @@ -190,7 +190,7 @@ void GraphvizDotWriter::write_dot_edge(std::ostream& os, const EdgeId edge, cons
} else if (timing_type == TimingType::HOLD) {
os << "\\n" << delay_calc_.min_edge_delay(tg_, edge);
} else {
TATUM_ASSERT(timing_type == TimingType::UNKOWN);
TATUM_ASSERT(timing_type == TimingType::UNKNOWN);
os << "\\n" << delay_calc_.max_edge_delay(tg_, edge) << " (tmax)";
os << "\\n" << delay_calc_.min_edge_delay(tg_, edge) << " (tmin)";
}
Expand Down
2 changes: 1 addition & 1 deletion libs/libvtrutil/src/vtr_logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ enum class LogicValue {
FALSE = 0,
TRUE = 1,
DONT_CARE = 2,
UNKOWN = 3,
UNKNOWN = 3,
NUM_LOGIC_VALUE_TYPES = 4
};

Expand Down
2 changes: 1 addition & 1 deletion vpr/src/base/atom_netlist_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void print_netlist_as_blif(FILE* f, const AtomNetlist& netlist, const LogicalMod
case vtr::LogicValue::DONT_CARE:
init_val = 2;
break;
case vtr::LogicValue::UNKOWN:
case vtr::LogicValue::UNKNOWN:
init_val = 3;
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/base/logic_vec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ std::ostream& operator<<(std::ostream& os, vtr::LogicValue val) {
os << "1";
else if (val == vtr::LogicValue::DONT_CARE)
os << "-";
else if (val == vtr::LogicValue::UNKOWN)
else if (val == vtr::LogicValue::UNKNOWN)
os << "x";
else
VTR_ASSERT(false);
Expand Down
4 changes: 2 additions & 2 deletions vpr/src/base/netlist_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ class LatchInst : public Instance {
os << "1'b0";
else if (initial_value_ == vtr::LogicValue::DONT_CARE)
os << "1'bx";
else if (initial_value_ == vtr::LogicValue::UNKOWN)
else if (initial_value_ == vtr::LogicValue::UNKNOWN)
os << "1'bx";
else
VTR_ASSERT(false);
Expand Down Expand Up @@ -2395,7 +2395,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
size_t i = 0;
//Walk through each input in the input cube for this row
while (names_row[i] != ' ') {
vtr::LogicValue input_val = vtr::LogicValue::UNKOWN;
vtr::LogicValue input_val = vtr::LogicValue::UNKNOWN;
if (names_row[i] == '1') {
input_val = vtr::LogicValue::TRUE;
} else if (names_row[i] == '0') {
Expand Down
6 changes: 3 additions & 3 deletions vpr/src/base/read_blif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ struct BlifAllocCallback : public blifparse::Callback {
};

vtr::LogicValue to_vtr_logic_value(blifparse::LogicValue val) {
vtr::LogicValue new_val = vtr::LogicValue::UNKOWN;
vtr::LogicValue new_val = vtr::LogicValue::UNKNOWN;
switch (val) {
case blifparse::LogicValue::TRUE:
new_val = vtr::LogicValue::TRUE;
Expand All @@ -645,8 +645,8 @@ vtr::LogicValue to_vtr_logic_value(blifparse::LogicValue val) {
case blifparse::LogicValue::DONT_CARE:
new_val = vtr::LogicValue::DONT_CARE;
break;
case blifparse::LogicValue::UNKOWN:
new_val = vtr::LogicValue::UNKOWN;
case blifparse::LogicValue::UNKNOWN:
new_val = vtr::LogicValue::UNKNOWN;
break;
default:
VTR_ASSERT_OPT_MSG(false, "Unknown logic value");
Expand Down
88 changes: 44 additions & 44 deletions vpr/src/power/PowerSpicedComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,45 @@
#include "vpr_error.h"
#include "PowerSpicedComponent.h"

bool sorter_PowerCallibSize(PowerCallibSize* a, PowerCallibSize* b);
bool sorter_PowerCallibInputs(PowerCallibInputs* a, PowerCallibInputs* b);
bool sorter_PowerCalibSize(PowerCalibSize* a, PowerCalibSize* b);
bool sorter_PowerCalibInputs(PowerCalibInputs* a, PowerCalibInputs* b);

PowerCallibInputs::PowerCallibInputs(PowerSpicedComponent* parent_,
PowerCalibInputs::PowerCalibInputs(PowerSpicedComponent* parent_,
float inputs)
: parent(parent_)
, num_inputs(inputs)
, sorted(false)
, done_callibration(false) {
, done_calibration(false) {
/* Add min/max bounding entries */
add_size(0);
add_size(std::numeric_limits<float>::max());
}

PowerCallibInputs::~PowerCallibInputs() {
PowerCalibInputs::~PowerCalibInputs() {
for (auto entry : entries) {
delete entry;
}
}

void PowerCallibInputs::add_size(float transistor_size, float power) {
PowerCallibSize* entry = new PowerCallibSize(transistor_size, power);
void PowerCalibInputs::add_size(float transistor_size, float power) {
PowerCalibSize* entry = new PowerCalibSize(transistor_size, power);
entries.push_back(entry);
sorted = false;
}

bool sorter_PowerCallibSize(PowerCallibSize* a, PowerCallibSize* b) {
bool sorter_PowerCalibSize(PowerCalibSize* a, PowerCalibSize* b) {
return a->transistor_size < b->transistor_size;
}

void PowerCallibInputs::sort_me() {
sort(entries.begin(), entries.end(), sorter_PowerCallibSize);
void PowerCalibInputs::sort_me() {
sort(entries.begin(), entries.end(), sorter_PowerCalibSize);
sorted = true;
}

void PowerCallibInputs::callibrate() {
void PowerCalibInputs::calibrate() {
VTR_ASSERT(entries.size() >= 2);

for (std::vector<PowerCallibSize*>::iterator it = entries.begin() + 1;
for (std::vector<PowerCalibSize*>::iterator it = entries.begin() + 1;
it != entries.end() - 1; it++) {
float est_power = parent->component_usage(num_inputs,
(*it)->transistor_size);
Expand All @@ -61,15 +61,15 @@ void PowerCallibInputs::callibrate() {
/* Set max-value placeholder */
entries[entries.size() - 1]->factor = entries[entries.size() - 2]->factor;

done_callibration = true;
done_calibration = true;
}

PowerCallibSize* PowerCallibInputs::get_entry_bound(bool lower,
PowerCalibSize* PowerCalibInputs::get_entry_bound(bool lower,
float transistor_size) {
PowerCallibSize* prev = entries[0];
PowerCalibSize* prev = entries[0];

VTR_ASSERT(sorted);
for (std::vector<PowerCallibSize*>::iterator it = entries.begin() + 1;
for (std::vector<PowerCalibSize*>::iterator it = entries.begin() + 1;
it != entries.end(); it++) {
if ((*it)->transistor_size > transistor_size) {
if (lower)
Expand All @@ -92,7 +92,7 @@ PowerSpicedComponent::PowerSpicedComponent(std::string component_name,
// add_entry(std::numeric_limits<int>::max());
add_entry(1000000000);

done_callibration = false;
done_calibration = false;
sorted = true;
}

Expand All @@ -102,14 +102,14 @@ PowerSpicedComponent::~PowerSpicedComponent() {
}
}

PowerCallibInputs* PowerSpicedComponent::add_entry(int num_inputs) {
PowerCallibInputs* entry = new PowerCallibInputs(this, num_inputs);
PowerCalibInputs* PowerSpicedComponent::add_entry(int num_inputs) {
PowerCalibInputs* entry = new PowerCalibInputs(this, num_inputs);
entries.push_back(entry);
return entry;
}

PowerCallibInputs* PowerSpicedComponent::get_entry(int num_inputs) {
std::vector<PowerCallibInputs*>::iterator it;
PowerCalibInputs* PowerSpicedComponent::get_entry(int num_inputs) {
std::vector<PowerCalibInputs*>::iterator it;

for (it = entries.begin(); it != entries.end(); it++) {
if ((*it)->num_inputs == num_inputs) {
Expand All @@ -124,12 +124,12 @@ PowerCallibInputs* PowerSpicedComponent::get_entry(int num_inputs) {
}
}

PowerCallibInputs* PowerSpicedComponent::get_entry_bound(bool lower,
PowerCalibInputs* PowerSpicedComponent::get_entry_bound(bool lower,
int num_inputs) {
PowerCallibInputs* prev = entries[0];
PowerCalibInputs* prev = entries[0];

VTR_ASSERT(sorted);
for (std::vector<PowerCallibInputs*>::iterator it = entries.begin() + 1;
for (std::vector<PowerCalibInputs*>::iterator it = entries.begin() + 1;
it != entries.end(); it++) {
if ((*it)->num_inputs > num_inputs) {
if (lower) {
Expand All @@ -150,34 +150,34 @@ PowerCallibInputs* PowerSpicedComponent::get_entry_bound(bool lower,
}

void PowerSpicedComponent::add_data_point(int num_inputs, float transistor_size, float power) {
VTR_ASSERT(!done_callibration);
PowerCallibInputs* inputs_entry = get_entry(num_inputs);
VTR_ASSERT(!done_calibration);
PowerCalibInputs* inputs_entry = get_entry(num_inputs);
inputs_entry->add_size(transistor_size, power);
sorted = false;
}

float PowerSpicedComponent::scale_factor(int num_inputs,
float transistor_size) {
PowerCallibInputs* inputs_lower;
PowerCallibInputs* inputs_upper;
PowerCalibInputs* inputs_lower;
PowerCalibInputs* inputs_upper;

PowerCallibSize* size_lower;
PowerCallibSize* size_upper;
PowerCalibSize* size_lower;
PowerCalibSize* size_upper;

float factor_lower = 0.;
float factor_upper = 0.;
float factor;

float perc_upper;

VTR_ASSERT(done_callibration);
VTR_ASSERT(done_calibration);

inputs_lower = get_entry_bound(true, num_inputs);
inputs_upper = get_entry_bound(false, num_inputs);

if (inputs_lower) {
/* Interpolation of factor between sizes for lower # inputs */
VTR_ASSERT(inputs_lower->done_callibration);
VTR_ASSERT(inputs_lower->done_calibration);
size_lower = inputs_lower->get_entry_bound(true, transistor_size);
size_upper = inputs_lower->get_entry_bound(false, transistor_size);

Expand All @@ -193,7 +193,7 @@ float PowerSpicedComponent::scale_factor(int num_inputs,

if (inputs_upper) {
/* Interpolation of factor between sizes for upper # inputs */
VTR_ASSERT(inputs_upper->done_callibration);
VTR_ASSERT(inputs_upper->done_calibration);
size_lower = inputs_upper->get_entry_bound(true, transistor_size);
size_upper = inputs_upper->get_entry_bound(false, transistor_size);

Expand Down Expand Up @@ -221,40 +221,40 @@ float PowerSpicedComponent::scale_factor(int num_inputs,
return factor;
}

bool sorter_PowerCallibInputs(PowerCallibInputs* a, PowerCallibInputs* b) {
bool sorter_PowerCalibInputs(PowerCalibInputs* a, PowerCalibInputs* b) {
return a->num_inputs < b->num_inputs;
}

void PowerSpicedComponent::sort_me() {
sort(entries.begin(), entries.end(), sorter_PowerCallibInputs);
sort(entries.begin(), entries.end(), sorter_PowerCalibInputs);

for (std::vector<PowerCallibInputs*>::iterator it = entries.begin();
for (std::vector<PowerCalibInputs*>::iterator it = entries.begin();
it != entries.end(); it++) {
(*it)->sort_me();
}
sorted = true;
}

void PowerSpicedComponent::callibrate() {
void PowerSpicedComponent::calibrate() {
sort_me();

for (std::vector<PowerCallibInputs*>::iterator it = entries.begin();
for (std::vector<PowerCalibInputs*>::iterator it = entries.begin();
it != entries.end(); it++) {
(*it)->callibrate();
(*it)->calibrate();
}
done_callibration = true;
done_calibration = true;
}

bool PowerSpicedComponent::is_done_callibration() {
return done_callibration;
bool PowerSpicedComponent::is_done_calibration() {
return done_calibration;
}

void PowerSpicedComponent::print(FILE* fp) {
fprintf(fp, "%s\n", name.c_str());
for (std::vector<PowerCallibInputs*>::iterator it = entries.begin() + 1;
for (std::vector<PowerCalibInputs*>::iterator it = entries.begin() + 1;
it != entries.end() - 1; it++) {
fprintf(fp, "Num Inputs: %d\n", (*it)->num_inputs);
for (std::vector<PowerCallibSize*>::iterator it2 = (*it)->entries.begin()
for (std::vector<PowerCalibSize*>::iterator it2 = (*it)->entries.begin()
+ 1;
it2 != (*it)->entries.end() - 1; it2++) {
fprintf(fp, " Transistor Size: %6f Factor: %3f\n",
Expand Down
Loading
Loading