Skip to content

Set InsertNewlineAtEOF in .clang-format file #2967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
IndentPPDirectives: None
InsertNewlineAtEOF: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
Expand Down
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/physical_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,4 @@ const t_physical_tile_port* t_sub_tile::get_port_by_pin(int pin) const {
}

return nullptr;
}
}
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/read_xml_arch_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4818,4 +4818,4 @@ static T* get_type_by_name(std::string_view type_name, std::vector<T>& types) {

archfpga_throw(__FILE__, __LINE__,
"Could not find type: %s\n", type_name);
}
}
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/read_xml_arch_file_noc_tag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,4 +684,4 @@ static void process_noc_overrides(pugi::xml_node noc_overrides_tag,
bad_tag(override_tag, loc_data, noc_overrides_tag, {"router", "link"});
}
}
}
}
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/write_models_bb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ void DeclareModel_bb(FILE* Echo, const t_model* model) {

// endmodule
fprintf(Echo, "endmodule\n\n");
}
}
2 changes: 1 addition & 1 deletion libs/libarchfpga/test/main.cpp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#define CATCH_CONFIG_MAIN
#include "catch2/catch_test_macros.hpp"
#include "catch2/catch_test_macros.hpp"
2 changes: 1 addition & 1 deletion libs/libarchfpga/test/test_read_xml_arch_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,4 @@ TEST_CASE("Verifying mesh topology creation", "[NoC Arch Tests]") {
REQUIRE(vtr::isclose(golden_results_y[expected_router_id], test_noc.router_list[expected_router_id].device_y_position));
}
}
}
}
2 changes: 1 addition & 1 deletion libs/liblog/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ int main() {

log_print_info("Test complete\n");
return 0;
}
}
2 changes: 1 addition & 1 deletion odin_ii/src/ast/ast_elaborate.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ ast_node_t* find_top_module(ast_t* ast);
int simplify_ast_module(ast_node_t** ast_module, sc_hierarchy* local_ref);
void create_param_table_for_scope(ast_node_t* module_items, sc_hierarchy* local_ref);

#endif
#endif
2 changes: 1 addition & 1 deletion odin_ii/src/config/read_xml_config_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,4 @@ void read_optimizations(pugi::xml_node a_node, config_t* config, const pugiutil:
}

return;
}
}
2 changes: 1 addition & 1 deletion odin_ii/src/core/block_memories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1470,4 +1470,4 @@ static void free_block_memory(block_memory_t* to_free) {
vtr::free(to_free->memory_id);

vtr::free(to_free);
}
}
2 changes: 1 addition & 1 deletion odin_ii/src/core/odin_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ void realloc(T** ptr_ref, S _n_bytes) {
}
} // namespace odin

#endif //ODIN_MEMORY_H
#endif //ODIN_MEMORY_H
2 changes: 1 addition & 1 deletion odin_ii/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ int main(int argc, char** argv) {
netlist_t* odin_netlist = start_odin_ii(argc, argv);
terminate_odin_ii(odin_netlist);
return 0;
}
}
2 changes: 1 addition & 1 deletion odin_ii/src/netlist/netlist_statistic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,4 +547,4 @@ void compute_statistics(netlist_t* netlist, bool display) {
printf("\n");
}
}
}
}
2 changes: 1 addition & 1 deletion odin_ii/src/utils/hierarchy_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,4 @@ ast_node_t* resolve_hierarchical_name_reference_by_upward_search(sc_hierarchy* l
}

return NULL;
}
}
2 changes: 1 addition & 1 deletion odin_ii/src/utils/hierarchy_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ sc_hierarchy* copy_sc_hierarchy(sc_hierarchy* to_copy);
void free_sc_hierarchy(sc_hierarchy* to_free);
ast_node_t* resolve_hierarchical_name_reference(sc_hierarchy* local_ref, char* identifier);

#endif
#endif
2 changes: 1 addition & 1 deletion odin_ii/src/utils/scope_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ void push_scope() {

/* update current scope */
current_scope = scope_stack.back();
}
}
2 changes: 1 addition & 1 deletion vpr/src/base/partition_region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ const PartitionRegion& get_device_partition_region() {
VTR_ASSERT_SAFE(layer_low == 0 && layer_high == n_layers - 1);

return device_pr;
}
}
2 changes: 1 addition & 1 deletion vpr/src/base/setup_noc.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ void create_noc_routers(const t_noc_inf& noc_info,
*/
void create_noc_links(const t_noc_inf& noc_info, NocStorage* noc_model);

#endif
#endif
2 changes: 1 addition & 1 deletion vpr/src/base/user_route_constraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ const std::string UserRouteConstraints::get_routing_network_name_by_net_name(std

int UserRouteConstraints::get_num_route_constraints(void) const {
return route_constraints_.size();
}
}
2 changes: 1 addition & 1 deletion vpr/src/base/user_route_constraints.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@ class UserRouteConstraints {
*/
std::unordered_map<std::string, RoutingScheme> route_constraints_;
};
#endif /* USER_ROUTE_CONSTRAINTS_H */
#endif /* USER_ROUTE_CONSTRAINTS_H */
2 changes: 1 addition & 1 deletion vpr/src/draw/draw_noc.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ void shift_noc_link(noc_link_draw_coords& link_coords, NocLinkShift link_shift_d

#endif

#endif
#endif
2 changes: 1 addition & 1 deletion vpr/src/draw/gtkcomboboxhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ gint get_item_index_by_text(gpointer combo_box, const gchar* target_item) {
return result_index;
}

#endif // NO_GRAPHICS
#endif // NO_GRAPHICS
2 changes: 1 addition & 1 deletion vpr/src/draw/search_bar.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ GdkEvent simulate_keypress(char key, GdkWindow* window);
std::string get_search_type(ezgl::application* app);
#endif /* NO_GRAPHICS */

#endif /* SEARCH_BAR_H */
#endif /* SEARCH_BAR_H */
2 changes: 1 addition & 1 deletion vpr/src/draw/ui_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ void show_widget(std::string widgetName, ezgl::application* app);

#endif /* NO_GRAPHICS */

#endif /* UISETUP_H */
#endif /* UISETUP_H */
2 changes: 1 addition & 1 deletion vpr/src/noc/bfs_routing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ void BFSRouting::generate_route(NocRouterId start_router_id,
// now get the parent of the router we moved to
curr_intermediate_router_parent_link = router_parent_link.find(curr_intermediate_router);
}
}
}
2 changes: 1 addition & 1 deletion vpr/src/noc/bfs_routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ class BFSRouting : public NocRouting {
const std::unordered_map<NocRouterId, NocLinkId>& router_parent_link);
};

#endif
#endif
2 changes: 1 addition & 1 deletion vpr/src/noc/channel_dependency_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ bool ChannelDependencyGraph::has_cycles() {

// if no vertex in the graph points to at least one of its ancestors, the graph does not have any cycles
return false;
}
}
2 changes: 1 addition & 1 deletion vpr/src/noc/noc_data_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ typedef vtr::StrongId<noc_traffic_flow_id_tag, int> NocTrafficFlowId;
struct noc_group_id_tag;
typedef vtr::StrongId<noc_group_id_tag, int> NocGroupId;

#endif
#endif
2 changes: 1 addition & 1 deletion vpr/src/noc/noc_link.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ class NocLink {
operator NocLinkId() const;
};

#endif
#endif
2 changes: 1 addition & 1 deletion vpr/src/noc/noc_router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ ClusterBlockId NocRouter::get_router_block_ref() const {
// setters
void NocRouter::set_router_block_ref(ClusterBlockId router_block_ref_id) {
router_block_ref = router_block_ref_id;
}
}
2 changes: 1 addition & 1 deletion vpr/src/noc/noc_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ class NocRouter {
void set_router_block_ref(ClusterBlockId router_block_ref_id);
};

#endif
#endif
2 changes: 1 addition & 1 deletion vpr/src/noc/noc_routing_algorithm_creator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ std::unique_ptr<NocRouting> NocRoutingAlgorithmCreator::create_routing_algorithm
}

return noc_routing_algorithm;
}
}
2 changes: 1 addition & 1 deletion vpr/src/noc/noc_traffic_flows.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,4 @@ class NocTrafficFlows {
static constexpr double DEFAULT_MAX_TRAFFIC_FLOW_LATENCY = 1.;
};

#endif
#endif
2 changes: 1 addition & 1 deletion vpr/src/noc/read_xml_noc_traffic_flows_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,4 @@ bool check_that_all_router_blocks_have_an_associated_traffic_flow(NocContext& no
*/
std::vector<ClusterBlockId> get_cluster_blocks_compatible_with_noc_router_tiles(const ClusteringContext& cluster_ctx, t_physical_tile_type_ptr noc_router_tile_type);

#endif
#endif
2 changes: 1 addition & 1 deletion vpr/src/noc/sat_routing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,4 +670,4 @@ vtr::vector<NocTrafficFlowId, std::vector<NocLinkId>> noc_sat_route(bool minimiz
return {};
}

#endif //ENABLE_NOC_SAT_ROUTING
#endif //ENABLE_NOC_SAT_ROUTING
2 changes: 1 addition & 1 deletion vpr/src/noc/sat_routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ struct hash<std::pair<NocTrafficFlowId, NocLinkId>> {
} // namespace std

#endif
#endif
#endif
2 changes: 1 addition & 1 deletion vpr/src/noc/xy_routing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ bool XYRouting::is_turn_legal(const std::array<std::reference_wrapper<const NocR
}

return true;
}
}
2 changes: 1 addition & 1 deletion vpr/src/noc/xy_routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ class XYRouting : public TurnModelRouting {
const std::vector<TurnModelRouting::Direction> no_direction{};
};

#endif
#endif
2 changes: 1 addition & 1 deletion vpr/src/place/delay_model/PlacementDelayModelCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ PlacementDelayModelCreator::create_delay_model(const t_placer_opts& placer_opts,
free_routing_structs();

return place_delay_model;
}
}
2 changes: 1 addition & 1 deletion vpr/src/place/delay_model/compute_delta_delays_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,4 +963,4 @@ std::vector<int> get_best_classes(enum e_pin_type pintype, t_physical_tile_type_
std::stable_sort(best_classes.begin(), best_classes.end(), cmp_class);

return best_classes;
}
}
2 changes: 1 addition & 1 deletion vpr/src/place/delay_model/compute_delta_delays_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ bool find_direct_connect_sample_locations(const t_direct_inf* direct,
* with the same number of pins.
*/

std::vector<int> get_best_classes(enum e_pin_type pintype, t_physical_tile_type_ptr type);
std::vector<int> get_best_classes(enum e_pin_type pintype, t_physical_tile_type_ptr type);
2 changes: 1 addition & 1 deletion vpr/src/place/delay_model/delta_delay_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ class DeltaDelayModel : public PlaceDelayModel {

/// Indicates whether the router is a two-stage or run-flat
bool is_flat_;
};
};
2 changes: 1 addition & 1 deletion vpr/src/place/delay_model/override_delay_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ class OverrideDelayModel : public PlaceDelayModel {
static_assert(sizeof(t_override::to_class) == sizeof(short), "Expect all t_override data members to be shorts");
static_assert(sizeof(t_override::delta_x) == sizeof(short), "Expect all t_override data members to be shorts");
static_assert(sizeof(t_override::delta_y) == sizeof(short), "Expect all t_override data members to be shorts");
};
};
2 changes: 1 addition & 1 deletion vpr/src/place/delay_model/simple_delay_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ class SimpleDelayModel : public PlaceDelayModel {
*One might argue that this variability could also occur for dx and dy. However, we are operating under the assumption that the FPGA fabric architecture is regular.
*/
vtr::NdMatrix<float, 5> delays_; // [0..num_physical_type-1][0..num_layers-1][0..num_layers-1][0..max_dx][0..max_dy]
};
};
2 changes: 1 addition & 1 deletion vpr/src/place/grid_tile_lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ class GridTileLookup {
std::vector<int> max_placement_locations;
};

#endif /* VPR_SRC_PLACE_GRID_TILE_LOOKUP_H_ */
#endif /* VPR_SRC_PLACE_GRID_TILE_LOOKUP_H_ */
2 changes: 1 addition & 1 deletion vpr/src/place/placer_breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ void stop_placement_and_check_breakpoints(t_pl_blocks_to_be_moved& blocks_affect
e_move_result move_outcome,
double delta_c,
double bb_delta_c,
double timing_delta_c);
double timing_delta_c);
2 changes: 1 addition & 1 deletion vpr/src/place/timing/PlacerTimingCosts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ void PlacerTimingCosts::invalidate(const double* invalidated_cost) {
}

VTR_ASSERT_SAFE_MSG(std::isnan(connection_costs_[0]), "Invalidating any connection should have invalidated the root");
}
}
2 changes: 1 addition & 1 deletion vpr/src/route/rr_graph_indexed_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ void load_rr_index_segments(const int num_segment) {
index = CHANX_COST_INDEX_START + num_segment + iseg;
device_ctx.rr_indexed_data[RRIndexedDataId(index)].seg_index = iseg;
}
}
}
2 changes: 1 addition & 1 deletion vpr/src/timing/NetPinTimingInvalidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ inline std::unique_ptr<NetPinTimingInvalidator> make_net_pin_timing_invalidator(
return std::make_unique<IncrNetPinTimingInvalidator>(net_list, clb_atom_pin_lookup, atom_nlist,
atom_lookup, timing_info, is_flat);
}
}
}
2 changes: 1 addition & 1 deletion vpr/test/test_bfs_routing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ TEST_CASE("test_route_flow", "[vpr_noc_bfs_routing]") {
}
}

} // namespace
} // namespace
2 changes: 1 addition & 1 deletion vpr/test/test_clustered_netlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ TEST_CASE("test_find_block_with_matching_name", "[vpr_clustered_netlist]") {
REQUIRE((size_t)(block_id_from_name.find("router:noc_router_four|flit_out_two[0]~reg0")->second) == (size_t)test_router_id);
}
}
} // namespace
} // namespace
2 changes: 1 addition & 1 deletion vpr/test/test_compressed_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,4 @@ TEST_CASE("test_compressed_grid", "[vpr_compressed_grid]") {
logical_block_types.clear();
}

} // namespace
} // namespace
2 changes: 1 addition & 1 deletion vpr/test/test_noc_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,4 +457,4 @@ TEST_CASE("test_generate_router_key_from_grid_location", "[vpr_noc]") {
}
}

} // namespace
} // namespace
2 changes: 1 addition & 1 deletion vpr/test/test_noc_traffic_flows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ TEST_CASE("test_adding_traffic_flows", "[vpr_noc_traffic_flows]") {
REQUIRE(traffic_flow_storage.get_traffic_flows_associated_to_router_block(invalid_block).empty());
}
}
} // namespace
} // namespace
2 changes: 1 addition & 1 deletion vpr/test/test_odd_even_routing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,4 @@ TEST_CASE("test_route_flow", "[vpr_noc_odd_even_routing]") {
}
}

} // namespace
} // namespace
2 changes: 1 addition & 1 deletion vpr/test/test_read_xml_noc_traffic_flows_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,4 +553,4 @@ TEST_CASE("test_get_cluster_blocks_compatible_with_noc_router_tiles", "[vpr_noc_
free_clustered_netlist();
}
}
} // namespace
} // namespace
Loading