Skip to content

Commit d2fa91d

Browse files
[Infra] The Big VPR Pragma Commit
VPR is moving to a style that uses "#pragma once" instead of header gaurds. These are less error prone and may be slightly more performant. Converted all of the header gaurds in VPR into pragma once's. Also moved all pragma onces to the top of all header files to maintain a consistent style. It is a good idea to have them as the very first line in all header files. While going through all header files, cleaned up any extra header includes which were including things they did not need.
1 parent 607788b commit d2fa91d

File tree

297 files changed

+376
-955
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+376
-955
lines changed

vpr/src/analytical_place/analytical_placement_flow.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
45
* @date September 2024
56
* @brief Methods for running the Analytical Placement flow.
67
*/
78

8-
#pragma once
9-
109
// Forward declarations
1110
struct t_vpr_setup;
1211

vpr/src/analytical_place/analytical_solver.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer and Robert Luo
@@ -6,8 +7,6 @@
67
* to define the functionality of all solvers used in the AP flow.
78
*/
89

9-
#pragma once
10-
1110
#include <memory>
1211
#include "ap_flow_enums.h"
1312
#include "ap_netlist.h"

vpr/src/analytical_place/ap_flow_enums.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
45
* @date February 2025
56
* @brief Enumerations used by the Analytical Placement Flow.
67
*/
78

8-
#pragma once
9-
109
/**
1110
* @brief The type of an Analytical Solver.
1211
*

vpr/src/analytical_place/ap_netlist.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
@@ -18,8 +19,6 @@
1819
* unused by Analytical Placement are ignored.
1920
*/
2021

21-
#pragma once
22-
2322
#include <string>
2423
#include "netlist.h"
2524
#include "ap_netlist_fwd.h"

vpr/src/analytical_place/ap_netlist_fwd.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
@@ -7,8 +8,6 @@
78
* Forward declares the APNetlist class, and defines common types used by it.
89
*/
910

10-
#pragma once
11-
1211
#include "netlist_fwd.h"
1312
#include "vtr_strong_id.h"
1413

vpr/src/analytical_place/detailed_placer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
@@ -6,8 +7,6 @@
67
* and placement and optimizes them while remaining legal.
78
*/
89

9-
#pragma once
10-
1110
#include <memory>
1211
#include "ap_flow_enums.h"
1312
#include "clustered_netlist_utils.h"

vpr/src/analytical_place/flat_placement_bins.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
@@ -8,8 +9,6 @@
89
* FPGA.
910
*/
1011

11-
#pragma once
12-
1312
#include <unordered_set>
1413
#include "ap_netlist.h"
1514
#include "vtr_assert.h"

vpr/src/analytical_place/flat_placement_density_manager.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
@@ -8,8 +9,6 @@
89
* defines a bin that is "overfilled".
910
*/
1011

11-
#pragma once
12-
1312
#include <tuple>
1413
#include <unordered_set>
1514
#include <vector>

vpr/src/analytical_place/flat_placement_mass_calculator.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
45
* @date February 2024
56
* @brief Mass calculation for AP blocks and logical/physical block/tile types
67
*/
78

8-
#pragma once
9-
109
#include <vector>
1110
#include "ap_netlist_fwd.h"
1211
#include "primitive_vector.h"

vpr/src/analytical_place/full_legalizer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
@@ -7,8 +8,6 @@
78
* routed by VTR.
89
*/
910

10-
#pragma once
11-
1211
#include <memory>
1312
#include "ap_flow_enums.h"
1413

vpr/src/analytical_place/gen_ap_netlist_from_atoms.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
@@ -6,8 +7,6 @@
67
* results of the prepacker to generate an APNetlist.
78
*/
89

9-
#pragma once
10-
1110
// Forward declarations
1211
class APNetlist;
1312
class AtomNetlist;

vpr/src/analytical_place/global_placer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
@@ -12,8 +13,6 @@
1213
* architecture.
1314
*/
1415

15-
#pragma once
16-
1716
#include <memory>
1817
#include "ap_flow_enums.h"
1918
#include "flat_placement_density_manager.h"

vpr/src/analytical_place/model_grouper.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
@@ -6,8 +7,6 @@
67
* that must be legalized together in a flat placement.
78
*/
89

9-
#pragma once
10-
1110
#include <vector>
1211
#include "logic_types.h"
1312
#include "vtr_assert.h"

vpr/src/analytical_place/partial_legalizer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer and Robert Luo
@@ -11,8 +12,6 @@
1112
* constraints of the architecture).
1213
*/
1314

14-
#pragma once
15-
1615
#include <functional>
1716
#include <memory>
1817
#include <vector>

vpr/src/analytical_place/partial_placement.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
@@ -10,8 +11,6 @@
1011
* will always be on the device and will respect fixed block locations.
1112
*/
1213

13-
#pragma once
14-
1514
#include <cmath>
1615
#include "ap_netlist.h"
1716
#include "physical_types.h"

vpr/src/analytical_place/primitive_vector.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/**
23
* @file
34
* @author Alex Singer
@@ -8,8 +9,6 @@
89
* efficiently operated upon.
910
*/
1011

11-
#pragma once
12-
1312
#include <cmath>
1413
#include <cstdlib>
1514
#include <unordered_map>

vpr/src/base/CheckArch.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
#ifndef CHECKARCH_H
2-
#define CHECKARCH_H
1+
#pragma once
32

43
#include "physical_types.h"
54

65
void CheckArch(const t_arch& Arch);
7-
8-
#endif

vpr/src/base/CheckSetup.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef CHECKSETUP_H
2-
#define CHECKSETUP_H
1+
#pragma once
32

43
#include "vpr_types.h"
54

@@ -12,5 +11,3 @@ void CheckSetup(const t_packer_opts& packer_opts,
1211
const std::vector<t_segment_inf>& segments,
1312
const t_timing_inf& timing,
1413
const t_chan_width_dist& chans);
15-
16-
#endif

vpr/src/base/SetupGrid.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#ifndef SETUPGRID_H
2-
#define SETUPGRID_H
3-
1+
#pragma once
42
/**
53
* @file
64
* @author Jason Luu
@@ -32,5 +30,3 @@ DeviceGrid create_device_grid(const std::string& layout_name,
3230
* (size of the bounding box of non-empty grid tiles)
3331
*/
3432
size_t count_grid_tiles(const DeviceGrid& grid);
35-
36-
#endif

vpr/src/base/SetupVPR.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef SETUPVPR_H
2-
#define SETUPVPR_H
1+
#pragma once
2+
33
#include <vector>
44
#include "read_options.h"
55
#include "physical_types.h"
@@ -28,4 +28,3 @@ void SetupVPR(const t_options* Options,
2828
std::string* GraphicsCommands,
2929
t_power_opts* PowerOpts,
3030
t_vpr_setup* vpr_setup);
31-
#endif

vpr/src/base/ShowSetup.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef SHOWSETUP_H
2-
#define SHOWSETUP_H
1+
#pragma once
32

43
#include <ostream>
54
#include <string>
@@ -35,5 +34,3 @@ struct ClusteredNetlistStats {
3534

3635
void ShowSetup(const t_vpr_setup& vpr_setup);
3736
void writeClusteredNetlistStats(const std::string& block_usage_filename);
38-
39-
#endif

vpr/src/base/atom_lookup.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef ATOM_LOOKUP_H
2-
#define ATOM_LOOKUP_H
1+
#pragma once
2+
33
#include "atom_lookup_fwd.h"
44

55
#include "vtr_vector_map.h"
@@ -149,5 +149,3 @@ class AtomLookup {
149149
vtr::linear_map<AtomPinId, tatum::NodeId> atom_pin_tnode_internal_;
150150
vtr::linear_map<tatum::NodeId, AtomPinId> tnode_atom_pin_;
151151
};
152-
153-
#endif

vpr/src/base/atom_lookup_fwd.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
#ifndef VPR_ATOM_LOOKUP_FWD_H
2-
#define VPR_ATOM_LOOKUP_FWD_H
1+
#pragma once
32

43
class AtomLookup;
54

65
enum class BlockTnode {
76
INTERNAL, ///<tnodes corresponding to internal paths withing atom blocks
87
EXTERNAL ///<tnodes corresponding to external interface of atom blocks
98
};
10-
11-
#endif

vpr/src/base/atom_netlist.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef ATOM_NETLIST_H
2-
#define ATOM_NETLIST_H
1+
#pragma once
32

43
/**
54
* @file
@@ -65,6 +64,7 @@
6564
* Refer to netlist.h for more information.
6665
*
6766
*/
67+
6868
#include <vector>
6969
#include <unordered_map>
7070

@@ -280,5 +280,3 @@ class AtomNetlist : public Netlist<AtomBlockId, AtomPortId, AtomPinId, AtomNetId
280280
};
281281

282282
#include "atom_lookup.h"
283-
284-
#endif

vpr/src/base/atom_netlist_fwd.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef ATOM_NETLIST_FWD_H
2-
#define ATOM_NETLIST_FWD_H
1+
#pragma once
2+
33
#include "vtr_strong_id.h"
44
#include "netlist_fwd.h"
55
/*
@@ -100,5 +100,3 @@ struct hash<AtomPinId> {
100100
}
101101
};
102102
} // namespace std
103-
104-
#endif

vpr/src/base/atom_netlist_utils.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef ATOM_NETLIST_UTILS_H
2-
#define ATOM_NETLIST_UTILS_H
1+
#pragma once
2+
33
#include <cstdio>
44
#include <set>
55
#include "atom_netlist.h"
@@ -122,4 +122,3 @@ std::set<AtomPinId> find_netlist_logical_clock_drivers(const AtomNetlist& netlis
122122

123123
///@brief Prints out information about netlist clocks
124124
void print_netlist_clock_info(const AtomNetlist& netlist, const LogicalModels& models);
125-
#endif

vpr/src/base/check_netlist.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#ifndef CHECK_NETLIST_H
2-
#define CHECK_NETLIST_H
1+
#pragma once
32

43
void check_netlist(int verbosity);
5-
6-
#endif

vpr/src/base/clock_modeling.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef CLOCK_MODELING_H
2-
#define CLOCK_MODELING_H
1+
#pragma once
32

43
enum e_clock_modeling {
54
IDEAL_CLOCK, ///<Treat the clock pins as ideal (i.e. not routed)
@@ -16,5 +15,3 @@ namespace ClockModeling {
1615
*/
1716
void treat_clock_pins_as_non_globals();
1817
} // namespace ClockModeling
19-
20-
#endif

vpr/src/base/clustered_netlist.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef CLUSTERED_NETLIST_H
2-
#define CLUSTERED_NETLIST_H
1+
#pragma once
32
/**
43
* @file
54
* @brief This file defines the ClusteredNetlist class in the ClusteredContext
@@ -340,5 +339,3 @@ class ClusteredNetlist : public Netlist<ClusterBlockId, ClusterPortId, ClusterPi
340339

341340
//Nets
342341
};
343-
344-
#endif

0 commit comments

Comments
 (0)