Skip to content

Commit 7865234

Browse files
Merge pull request #3081 from AlexandreSinger/feature-include-cleanup
[Infra] Cleaned Up Includes in Non-External Libs
2 parents 2dc22c5 + 7ae0027 commit 7865234

File tree

116 files changed

+182
-471
lines changed

Some content is hidden

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

116 files changed

+182
-471
lines changed

libs/libarchfpga/src/arch_check.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include <set>
2+
#include <sstream>
23

4+
#include "arch_util.h"
35
#include "logic_types.h"
46
#include "vtr_log.h"
57
#include "arch_error.h"

libs/libarchfpga/src/arch_check.h

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

43
/**
54
* This file includes all the definitions of functions which purpose is to
@@ -8,12 +7,9 @@
87
* All new functions corresponding to the architecture checking should end up here.
98
*/
109

11-
#include "arch_types.h"
12-
#include "arch_util.h"
13-
14-
#include "physical_types_util.h"
15-
16-
#include "vtr_util.h"
10+
#include <stdint.h>
11+
#include "logic_types.h"
12+
#include "physical_types.h"
1713

1814
#ifdef __cplusplus
1915
extern "C" {
@@ -76,5 +72,3 @@ void check_models(t_arch* arch);
7672
#ifdef __cplusplus
7773
}
7874
#endif
79-
80-
#endif

libs/libarchfpga/src/arch_error.h

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

43
#include "vtr_error.h"
54
#include <cstdarg>
@@ -14,5 +13,3 @@ class ArchFpgaError : public vtr::VtrError {
1413
ArchFpgaError(std::string msg = "", std::string new_filename = "", size_t new_linenumber = -1)
1514
: vtr::VtrError(msg, new_filename, new_linenumber) {}
1615
};
17-
18-
#endif

libs/libarchfpga/src/arch_types.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1+
#pragma once
12
/*
23
* Data types describing the FPGA architecture.
34
*
45
* Date: February 19, 2009
56
* Authors: Jason Luu and Kenneth Kent
67
*/
78

8-
#ifndef ARCH_TYPES_H
9-
#define ARCH_TYPES_H
10-
11-
#include "logic_types.h"
12-
#include "physical_types.h"
13-
#include "cad_types.h"
14-
159
/* Input file parsing. */
1610
#define TOKENS " \t\n"
1711

@@ -25,5 +19,3 @@ enum class e_arch_format {
2519
VTR, ///<VTR-specific device XML format
2620
FPGAInterchange ///<FPGA Interchange device format
2721
};
28-
29-
#endif

libs/libarchfpga/src/arch_util.h

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

4-
#include <regex>
53
#include <unordered_set>
64
#include "physical_types.h"
75

@@ -114,4 +112,3 @@ void link_physical_logical_types(std::vector<t_physical_tile_type>& PhysicalTile
114112
std::vector<t_logical_block_type>& LogicalBlockTypes);
115113

116114
void setup_pin_classes(t_physical_tile_type* type);
117-
#endif

libs/libarchfpga/src/cad_types.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1+
#pragma once
12
/*
23
* Data types used to give architectural hints for the CAD algorithm
34
*/
4-
#ifndef CAD_TYPES_H
5-
#define CAD_TYPES_H
65

7-
#include "logic_types.h"
86
#include "physical_types.h"
97

108
struct t_pack_pattern_connections;
@@ -128,5 +126,3 @@ struct t_cluster_placement_primitive {
128126
float base_cost; /* cost independent of current status of packing */
129127
float incremental_cost; /* cost dependent on current status of packing */
130128
};
131-
132-
#endif

libs/libarchfpga/src/clock_types.h

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

43
#include <string>
5-
#include <vector>
64

75
enum class e_clock_type {
86
SPINE,
@@ -59,5 +57,3 @@ struct t_clock_connection_arch {
5957
std::string locationy;
6058
float fc;
6159
};
62-
63-
#endif

libs/libarchfpga/src/device_grid.h

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

43
#include <string>
54
#include <vector>
@@ -149,5 +148,3 @@ class DeviceGrid {
149148

150149
std::vector<t_logical_block_type_ptr> limiting_resources_;
151150
};
152-
153-
#endif

libs/libarchfpga/src/echo_arch.h

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

4-
#include "arch_types.h"
3+
#include <vector>
4+
#include "physical_types.h"
55

66
void EchoArch(const char* EchoFile,
77
const std::vector<t_physical_tile_type>& PhysicalTileTypes,
88
const std::vector<t_logical_block_type>& LogicalBlockTypes,
99
const t_arch* arch);
10-
11-
#endif

libs/libarchfpga/src/histogram.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <algorithm>
22
#include <string>
3-
#include <sstream>
43
#include <cmath>
54

65
#include "vtr_log.h"

libs/libarchfpga/src/histogram.h

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

43
#include <limits>
4+
#include <string>
55
#include <vector>
66

77
struct HistogramBucket {
@@ -22,5 +22,3 @@ void print_histogram(std::vector<HistogramBucket> histogram);
2222
float get_histogram_mode(std::vector<HistogramBucket> histogram);
2323

2424
std::vector<std::string> format_histogram(std::vector<HistogramBucket> histogram, size_t width = 80);
25-
26-
#endif

libs/libarchfpga/src/logic_types.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/*
23
* Data types describing the logic (technology-mapped) models that the architecture can implement.
34
* Logic models include LUT (.names), flipflop (.latch), inpad, outpad, memory slice, etc.
@@ -10,9 +11,6 @@
1011
* Date: April, 2025
1112
*/
1213

13-
#ifndef LOGIC_TYPES_H
14-
#define LOGIC_TYPES_H
15-
1614
#include "vtr_assert.h"
1715
#include "vtr_list.h"
1816
#include "vtr_memory.h"
@@ -275,5 +273,3 @@ class LogicalModels {
275273
/// @brief A lookup between the name of a logical model and its ID.
276274
std::unordered_map<std::string, LogicalModelId> model_name_to_logical_model_id_;
277275
};
278-
279-
#endif

libs/libarchfpga/src/parse_switchblocks.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
#ifndef PARSE_SWITCHBLOCKS_H
2-
#define PARSE_SWITCHBLOCKS_H
1+
#pragma once
32

4-
#include <vector>
3+
#include "physical_types.h"
54
#include "pugixml.hpp"
6-
#include "pugixml_util.hpp"
5+
#include "pugixml_loc.hpp"
76
#include "vtr_expr_eval.h"
87

98
/**** Function Declarations ****/
@@ -18,5 +17,3 @@ void check_switchblock(const t_switchblock_inf* sb, const t_arch* arch);
1817

1918
/* returns integer result according to the specified formula and data */
2019
int get_sb_formula_raw_result(vtr::FormulaParser& formula_parser, const char* formula, const vtr::t_formula_data& mydata);
21-
22-
#endif /* PARSE_SWITCHBLOCKS_H */

libs/libarchfpga/src/physical_types.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/*
23
* Data types describing the physical components on the FPGA architecture.
34
*
@@ -24,8 +25,6 @@
2425
* Authors: Jason Luu and Kenneth Kent
2526
*/
2627

27-
#pragma once
28-
2928
#include <functional>
3029
#include <utility>
3130
#include <vector>
@@ -34,12 +33,9 @@
3433
#include <map>
3534
#include <unordered_map>
3635
#include <limits>
37-
#include <numeric>
38-
#include <set>
3936
#include <unordered_set>
4037

4138
#include "vtr_ndmatrix.h"
42-
#include "vtr_hash.h"
4339
#include "vtr_bimap.h"
4440
#include "vtr_string_interning.h"
4541

libs/libarchfpga/src/physical_types_util.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#include <set>
1+
#include <numeric>
22
#include "vtr_assert.h"
3-
#include "vtr_memory.h"
43
#include "vtr_util.h"
54

6-
#include "arch_types.h"
7-
#include "arch_util.h"
85
#include "arch_error.h"
96

107
#include "physical_types_util.h"

libs/libarchfpga/src/physical_types_util.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
21
#pragma once
3-
4-
#include "physical_types.h"
5-
62
/********************************************************************
73
* *
84
* Physical types utility functions *
@@ -114,6 +110,8 @@
114110
* and CLK_2 (physical pin) from the BUFG (logical block) and CLOCK TILE (physical tile).
115111
*/
116112

113+
#include "physical_types.h"
114+
117115
///@brief Returns true if the absolute physical pin index is an output of the given physical tile type
118116
bool is_opin(int ipin, t_physical_tile_type_ptr type);
119117

libs/libarchfpga/src/read_fpga_interchange_arch.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11

2-
32
#include "read_fpga_interchange_arch.h"
4-
#include "logic_types.h"
53

64
#ifdef VTR_ENABLE_CAPNPROTO
75

6+
#include <numeric>
7+
#include "LogicalNetlist.capnp.h"
8+
#include "logic_types.h"
9+
#include "DeviceResources.capnp.h"
10+
#include "LogicalNetlist.capnp.h"
11+
#include "capnp/serialize.h"
12+
813
#include <algorithm>
914
#include <kj/std/iostream.h>
1015
#include <limits>
@@ -26,6 +31,15 @@
2631
#include "arch_error.h"
2732
#include "arch_util.h"
2833

34+
#else // VTR_ENABLE_CAPNPROTO
35+
36+
#include <vector>
37+
#include "physical_types.h"
38+
#include "vtr_error.h"
39+
40+
#endif // VTR_ENABLE_CAPNPROTO
41+
42+
#ifdef VTR_ENABLE_CAPNPROTO
2943
/*
3044
* FPGA Interchange Device frontend
3145
*
Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
1-
#ifndef READ_FPGAINTERCHANGE_ARCH_FILE_H
2-
#define READ_FPGAINTERCHANGE_ARCH_FILE_H
1+
#pragma once
32

4-
#include "arch_types.h"
5-
6-
#ifdef VTR_ENABLE_CAPNPROTO
7-
8-
#include "DeviceResources.capnp.h"
9-
#include "LogicalNetlist.capnp.h"
10-
#include "capnp/serialize.h"
11-
#include "capnp/serialize-packed.h"
12-
#include <fcntl.h>
13-
#include <unistd.h>
14-
15-
#endif // VTR_ENABLE_CAPNPROTO
3+
#include <vector>
4+
#include "physical_types.h"
165

176
#ifdef __cplusplus
187
extern "C" {
@@ -34,5 +23,3 @@ void FPGAInterchangeReadArch(const char* FPGAInterchangeDeviceFile,
3423
#ifdef __cplusplus
3524
}
3625
#endif
37-
38-
#endif

libs/libarchfpga/src/read_xml_arch_file.h

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

4-
#include "arch_types.h"
3+
#include <vector>
4+
#include "physical_types.h"
55

66
#ifdef __cplusplus
77
extern "C" {
@@ -21,5 +21,3 @@ void XmlReadArch(const char* ArchFile,
2121
#ifdef __cplusplus
2222
}
2323
#endif
24-
25-
#endif

libs/libarchfpga/src/read_xml_arch_file_noc_tag.h

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

53
#include "pugixml.hpp"
64
#include "pugixml_loc.hpp"
@@ -37,5 +35,3 @@ struct t_mesh_region {
3735
/// The number of NoC routers in each row or column.
3836
int mesh_size;
3937
};
40-
41-
#endif //VTR_READ_XML_ARCH_FILE_NOC_TAG_H

libs/libarchfpga/src/read_xml_util.h

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

43
#include "pugixml.hpp"
54
#include "pugixml_loc.hpp"
@@ -24,5 +23,3 @@ void bad_attribute_value(const pugi::xml_attribute attr,
2423

2524
InstPort make_inst_port(std::string str, pugi::xml_node node, const pugiutil::loc_data& loc_data);
2625
InstPort make_inst_port(pugi::xml_attribute attr, pugi::xml_node node, const pugiutil::loc_data& loc_data);
27-
28-
#endif
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#ifndef WRITE_MODELS_BB_H
2-
#define WRITE_MODELS_BB_H
1+
#pragma once
32

4-
#include "arch_types.h"
3+
#include "physical_types.h"
54

65
void WriteModels_bb(const char* ArchFile,
76
const char* VEchoFile,
87
const t_arch* arch);
9-
10-
#endif

0 commit comments

Comments
 (0)