Skip to content

Commit 4ed6e5a

Browse files
committed
formatting fixes
Signed-off-by: Pawel Czarnecki <[email protected]>
1 parent e947026 commit 4ed6e5a

File tree

5 files changed

+37
-39
lines changed

5 files changed

+37
-39
lines changed

libs/libarchfpga/src/arch_util.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void free_arch(t_arch* arch) {
171171

172172
delete arch->architecture_id;
173173

174-
//Free internal model library
174+
//Free internal model library
175175
if (arch->model_library) {
176176
for (int i = 0; i < num_models_lib; ++i) {
177177
vtr::t_linked_vptr* vptr = arch->model_library[i].pb_types;
@@ -183,7 +183,7 @@ void free_arch(t_arch* arch) {
183183
}
184184

185185
//Each model has different number of inputs/outputs - delete each model separately
186-
//Free INPAD
186+
//Free INPAD
187187
delete arch->model_library[LIB_INPUT].name;
188188
delete arch->model_library[LIB_INPUT].outputs->name;
189189
delete[] arch->model_library[LIB_INPUT].outputs;
@@ -216,7 +216,7 @@ void free_arch(t_arch* arch) {
216216
delete arch->model_library[LIB_NAMES].outputs->name;
217217
delete[] arch->model_library[LIB_NAMES].outputs;
218218

219-
//Free the library array
219+
//Free the library array
220220
delete[] arch->model_library;
221221
}
222222

@@ -687,7 +687,7 @@ void alloc_and_load_default_child_for_pb_type(t_pb_type* pb_type,
687687
for (i = 0; i < copy->num_annotations; i++) {
688688
copy->annotations[i].clock = vtr::strdup(pb_type->annotations[i].clock);
689689
dot = strstr(pb_type->annotations[i].input_pins, ".");
690-
copy->annotations[i].input_pins = new char[strlen(new_name) + strlen(dot) + 1];
690+
copy->annotations[i].input_pins = new char[strlen(new_name) + strlen(dot) + 1];
691691
copy->annotations[i].input_pins[0] = '\0';
692692
strcat(copy->annotations[i].input_pins, new_name);
693693
strcat(copy->annotations[i].input_pins, dot);
@@ -852,7 +852,7 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
852852
sprintf(lut_pb_type->modes[1].interconnect[1].input_string, "%s.%s",
853853
default_name, out_port->name);
854854
lut_pb_type->modes[1].interconnect[1].output_string = new char[strlen(lut_pb_type->name) + strlen(out_port->name)
855-
+ strlen(in_port->name) + 2];
855+
+ strlen(in_port->name) + 2];
856856
sprintf(lut_pb_type->modes[1].interconnect[1].output_string, "%s.%s",
857857
lut_pb_type->name, out_port->name);
858858
lut_pb_type->modes[1].interconnect[1].infer_annotations = true;
@@ -955,7 +955,7 @@ void ProcessMemoryClass(t_pb_type* mem_pb_type) {
955955
sprintf(mem_pb_type->modes[0].interconnect[i_inter].input_string,
956956
"%s.%s", input_name, input_port_name);
957957
mem_pb_type->modes[0].interconnect[i_inter].output_string = new char[strlen(output_name) + strlen(output_port_name)
958-
+ 2 * (6 + num_pb / 10)];
958+
+ 2 * (6 + num_pb / 10)];
959959
sprintf(mem_pb_type->modes[0].interconnect[i_inter].output_string,
960960
"%s[%d:0].%s", output_name, num_pb - 1,
961961
output_port_name);
@@ -965,11 +965,11 @@ void ProcessMemoryClass(t_pb_type* mem_pb_type) {
965965
mem_pb_type->modes[0].pb_type_children[0].num_output_pins -= (mem_pb_type->ports[i].num_pins - 1);
966966

967967
mem_pb_type->modes[0].interconnect[i_inter].input_string = new char[strlen(input_name) + strlen(input_port_name)
968-
+ 2 * (6 + num_pb / 10)];
968+
+ 2 * (6 + num_pb / 10)];
969969
sprintf(mem_pb_type->modes[0].interconnect[i_inter].input_string,
970970
"%s[%d:0].%s", input_name, num_pb - 1, input_port_name);
971971
mem_pb_type->modes[0].interconnect[i_inter].output_string = new char[strlen(output_name) + strlen(output_port_name)
972-
+ 2];
972+
+ 2];
973973
sprintf(mem_pb_type->modes[0].interconnect[i_inter].output_string,
974974
"%s.%s", output_name, output_port_name);
975975
}
@@ -997,7 +997,7 @@ void ProcessMemoryClass(t_pb_type* mem_pb_type) {
997997
} else {
998998
mem_pb_type->modes[0].interconnect[i_inter].type = DIRECT_INTERC;
999999
mem_pb_type->modes[0].interconnect[i_inter].input_string = new char[strlen(input_name) + strlen(input_port_name)
1000-
+ 2 * (6 + num_pb / 10)];
1000+
+ 2 * (6 + num_pb / 10)];
10011001
sprintf(mem_pb_type->modes[0].interconnect[i_inter].input_string,
10021002
"%s[%d:%d].%s", input_name, j, j, input_port_name);
10031003
mem_pb_type->modes[0].interconnect[i_inter].output_string = new char[strlen(output_name) + strlen(output_port_name) + 2];
@@ -1111,25 +1111,25 @@ void CreateModelLibrary(t_arch* arch) {
11111111
model_library[LIB_LATCH_RE].outputs[0].clock = "clk";
11121112
model_library[LIB_LATCH_RE].outputs[0].trigg_edge = TriggeringEdge::RISING_EDGE;
11131113

1114-
/*
1115-
* Duplicate LATCH model.
1116-
* Second separate model is required for falling edge support.
1117-
* It is a copy of LIB_LATCH_RE but with different trigg_edge configuration
1118-
* for inputs/outputs t_model_ports. It is used to represent FFs triggered at
1119-
* the falling edge of the clock, while LIB_LATCH_RE represents FFs triggered
1120-
* at the rising edge.
1121-
*
1122-
* VPR uses single model of each blif primitive type (e.g. '.latch', '.names') parsed from input blif file.
1123-
* That means models are used as configuration reference for parsed blif primitives when
1124-
* Latch instances are created in circuit evaluation, meaning:
1125-
* 1 unique blif primitive configuration (parsed from blif file) maps to
1126-
* 1 unique model (defined here, in VPR internal library) which represents configuration of
1127-
* multiple primitive instances (of given type and configuration) used in the circuit
1128-
*
1129-
* Models have to be duplicated because otherwise VPR will use the configuration
1130-
* of the last parsed '.latch' for each FF in the design
1131-
*
1132-
*/
1114+
/*
1115+
* Duplicate LATCH model.
1116+
* Second separate model is required for falling edge support.
1117+
* It is a copy of LIB_LATCH_RE but with different trigg_edge configuration
1118+
* for inputs/outputs t_model_ports. It is used to represent FFs triggered at
1119+
* the falling edge of the clock, while LIB_LATCH_RE represents FFs triggered
1120+
* at the rising edge.
1121+
*
1122+
* VPR uses single model of each blif primitive type (e.g. '.latch', '.names') parsed from input blif file.
1123+
* That means models are used as configuration reference for parsed blif primitives when
1124+
* Latch instances are created in circuit evaluation, meaning:
1125+
* 1 unique blif primitive configuration (parsed from blif file) maps to
1126+
* 1 unique model (defined here, in VPR internal library) which represents configuration of
1127+
* multiple primitive instances (of given type and configuration) used in the circuit
1128+
*
1129+
* Models have to be duplicated because otherwise VPR will use the configuration
1130+
* of the last parsed '.latch' for each FF in the design
1131+
*
1132+
*/
11331133
//LATCH triggered at FALLING EDGE
11341134
model_library[LIB_LATCH_FE].name = vtr::strdup(MODEL_LATCH);
11351135
model_library[LIB_LATCH_FE].index = LIB_LATCH_FE;

libs/libarchfpga/src/arch_util.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ constexpr const int num_models_lib = 5;
2020
constexpr const int LATCH_CLOCK_INPUT_ID = 1;
2121

2222
enum InternalModel {
23-
LIB_INPUT,
24-
LIB_OUTPUT,
25-
LIB_LATCH_RE,
26-
LIB_LATCH_FE,
27-
LIB_NAMES
23+
LIB_INPUT,
24+
LIB_OUTPUT,
25+
LIB_LATCH_RE,
26+
LIB_LATCH_FE,
27+
LIB_NAMES
2828
};
2929

3030
class InstPort {

vpr/src/base/atom_netlist_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ void print_netlist_as_blif(FILE* f, const AtomNetlist& netlist) {
196196
type = "fe";
197197
} else {
198198
//Otherwise always assume rising edge (.latch could be also configured as:
199-
//'active high', 'active low', 'asynchronous')
199+
//'active high', 'active low', 'asynchronous')
200200
type = "re";
201201
}
202202
}

vpr/src/timing/read_sdc.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,9 +741,7 @@ class SdcParseCallback : public sdcparse::Callback {
741741

742742
constraint = launch_clock.period;
743743

744-
} else if ((std::fabs(launch_clock.period - capture_clock.period) < EPSILON) &&
745-
(std::fabs((launch_clock.period / 2) - std::fabs(launch_clock.rise_edge - capture_clock.rise_edge)) < EPSILON) &&
746-
(std::fabs((launch_clock.period / 2) - std::fabs(launch_clock.fall_edge - capture_clock.fall_edge)) < EPSILON)) {
744+
} else if ((std::fabs(launch_clock.period - capture_clock.period) < EPSILON) && (std::fabs((launch_clock.period / 2) - std::fabs(launch_clock.rise_edge - capture_clock.rise_edge)) < EPSILON) && (std::fabs((launch_clock.period / 2) - std::fabs(launch_clock.fall_edge - capture_clock.fall_edge)) < EPSILON)) {
747745
//The source and sink domains have the same period but are inverted, the constraint is half of the common clock period.
748746

749747
constraint = (launch_clock.period / 2);

vpr/src/util/vpr_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,8 @@ bool primitive_type_feasible(const AtomBlockId blk_id, t_pb_graph_node* curr_pb_
918918
if (cur_pb_type->model != atom_ctx.nlist.block_model(blk_id)) {
919919
//Check if the AtomBlock is related to FF (LATCH model)
920920
if ((strcmp(atom_ctx.nlist.block_model(blk_id)->name, MODEL_LATCH) == 0) && (strcmp(atom_ctx.nlist.block_model(blk_id)->name, cur_pb_type->model->name) == 0)) {
921-
//Special case for .latch: this model exists in 2 variations which are
922-
//defined one after another in linked list, check if the second variant match
921+
//Special case for .latch: this model exists in 2 variations which are
922+
//defined one after another in linked list, check if the second variant match
923923
if (cur_pb_type->model->next == atom_ctx.nlist.block_model(blk_id) && atom_ctx.nlist.block_model(blk_id)->inputs[LATCH_CLOCK_INPUT_ID].trigg_edge == TriggeringEdge::FALLING_EDGE) {
924924
// Next primitive matched AtomBlock
925925
// VPR will need data in secondary pin structs in curr_pb_graph_node

0 commit comments

Comments
 (0)