Skip to content
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

[WIP] VIB Upgrades for Tileable Routing Resource Graph on OpenFPGA #2637

Merged
merged 150 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
b49f82f
Update device_grid_annotation.cpp
Wang-Yuanqi-source May 26, 2024
7cdb3f7
Update tileable_chan_details_builder.cpp
Wang-Yuanqi-source May 26, 2024
c8d6be8
Update tileable_rr_graph_node_builder.cpp
Wang-Yuanqi-source May 26, 2024
f328220
Update tileable_rr_graph_gsb.h
Wang-Yuanqi-source May 26, 2024
8a83ee9
Update tileable_rr_graph_edge_builder.cpp
Wang-Yuanqi-source May 26, 2024
5e23e1b
Update tileable_rr_graph_gsb.cpp
Wang-Yuanqi-source May 26, 2024
063a13d
Update tileable_rr_graph_gsb.h
Wang-Yuanqi-source May 26, 2024
48df84d
Update tileable_rr_graph_builder.cpp
Wang-Yuanqi-source May 26, 2024
9e11eb8
Update read_xml_arch_file.cpp
Wang-Yuanqi-source May 26, 2024
9c6fc7a
Update physical_types.h
Wang-Yuanqi-source May 26, 2024
b7c24d6
Update tileable_chan_details_builder.cpp
Wang-Yuanqi-source May 26, 2024
e9e7bfe
Update chan_node_details.cpp
Wang-Yuanqi-source May 26, 2024
260572e
Update chan_node_details.h
Wang-Yuanqi-source May 26, 2024
ce1b3b4
Update tileable_rr_graph_edge_builder.h
Wang-Yuanqi-source May 26, 2024
dc6aa86
Update tileable_rr_graph_edge_builder.cpp
Wang-Yuanqi-source May 26, 2024
6a1f9f8
Update tileable_rr_graph_edge_builder.h
Wang-Yuanqi-source May 26, 2024
0d9e9fd
Update tileable_rr_graph_gsb.h
Wang-Yuanqi-source May 26, 2024
042bef4
Update rr_graph_view.h
Wang-Yuanqi-source May 26, 2024
77f802e
Update rr_graph_storage.h
Wang-Yuanqi-source May 26, 2024
ba5cd69
Update rr_graph_storage.cpp
Wang-Yuanqi-source May 26, 2024
7ffd299
Update rr_graph_builder.h
Wang-Yuanqi-source May 26, 2024
155716f
Update read_xml_arch_file.cpp
Wang-Yuanqi-source May 26, 2024
7bd0433
Update physical_types.h
Wang-Yuanqi-source Jun 9, 2024
a0ecbce
Update read_xml_arch_file.cpp
Wang-Yuanqi-source Jun 9, 2024
16ab238
Update SetupGrid.cpp
Wang-Yuanqi-source Jun 9, 2024
35cccdc
Update vpr_context.h
Wang-Yuanqi-source Jun 9, 2024
7af8feb
Update SetupGrid.h
Wang-Yuanqi-source Jun 9, 2024
56a7e68
Update vpr_api.cpp
Wang-Yuanqi-source Jun 9, 2024
98e7992
Update tileable_rr_graph_edge_builder.cpp
Wang-Yuanqi-source Jun 9, 2024
5b32f84
Update tileable_rr_graph_builder.cpp
Wang-Yuanqi-source Jun 9, 2024
87d4b59
Update tileable_rr_graph_edge_builder.h
Wang-Yuanqi-source Jun 9, 2024
c23795c
Update tileable_rr_graph_node_builder.cpp
Wang-Yuanqi-source Jun 9, 2024
873469f
Update tileable_rr_graph_node_builder.h
Wang-Yuanqi-source Jun 9, 2024
307fb0b
Update read_xml_arch_file.cpp
Wang-Yuanqi-source Jun 15, 2024
77dfbe9
Update tileable_rr_graph_builder.cpp
Wang-Yuanqi-source Jun 15, 2024
55c4835
Update check_rr_graph.cpp
Wang-Yuanqi-source Jun 15, 2024
82151d4
Update check_route.cpp
Wang-Yuanqi-source Jun 15, 2024
fffdc02
Update rr_graph_uxsdcxx_serializer.h
Wang-Yuanqi-source Jun 15, 2024
71c60e2
Update rr_graph_uxsdcxx_interface.h
Wang-Yuanqi-source Jun 15, 2024
14eedda
Update rr_graph.cpp
Wang-Yuanqi-source Jun 15, 2024
ac8c197
Update rr_graph2.cpp
Wang-Yuanqi-source Jun 15, 2024
ed15d8a
Update vpr_utils.cpp
Wang-Yuanqi-source Jun 15, 2024
e508528
Update connection_router.cpp
Wang-Yuanqi-source Jun 15, 2024
08268fe
Update overuse_report.cpp
Wang-Yuanqi-source Jun 15, 2024
6abd0b7
Update vpr_utils.h
Wang-Yuanqi-source Jun 15, 2024
f80e4c3
Update router_lookahead_map_utils.cpp
Wang-Yuanqi-source Jun 15, 2024
92fd5af
Update router_lookahead_map.cpp
Wang-Yuanqi-source Jun 15, 2024
faf2ef3
Update rr_graph_uxsdcxx.h
Wang-Yuanqi-source Jun 15, 2024
601718a
Update rr_spatial_lookup.cpp
Wang-Yuanqi-source Jun 15, 2024
0541865
Update check_rr_graph.h
Wang-Yuanqi-source Jun 15, 2024
a2777e6
Update tileable_rr_graph_edge_builder.cpp
Wang-Yuanqi-source Jun 15, 2024
58dce81
Update tileable_rr_graph_gsb.cpp
Wang-Yuanqi-source Jun 15, 2024
5bb56c7
Update tileable_rr_graph_gsb.h
Wang-Yuanqi-source Jun 15, 2024
0929cd0
Update rr_node_types.h
Wang-Yuanqi-source Jun 15, 2024
6121423
Update rr_graph_builder.h
Wang-Yuanqi-source Jun 15, 2024
1d0be82
Update rr_graph_storage.cpp
Wang-Yuanqi-source Jun 15, 2024
e904c86
Update rr_graph_storage.h
Wang-Yuanqi-source Jun 15, 2024
25b096d
Update rr_graph_cost.h
Wang-Yuanqi-source Jun 15, 2024
03556c6
Merge branch 'openfpga' into patch-1
Wang-Yuanqi-source Jul 2, 2024
75e8676
Update alloc_and_load_rr_indexed_data.cpp
Wang-Yuanqi-source Jul 13, 2024
0f81e94
Update read_route.cpp
Wang-Yuanqi-source Jul 13, 2024
9e0ae28
Update describe_rr_node.cpp
Wang-Yuanqi-source Jul 13, 2024
b65a8e2
Update check_route.cpp
Wang-Yuanqi-source Jul 13, 2024
abaec29
Update rr_graph_area.cpp
Wang-Yuanqi-source Jul 13, 2024
e6b7e7d
Update tileable_rr_graph_edge_builder.cpp
Wang-Yuanqi-source Jul 13, 2024
30dae5a
Update tileable_chan_details_builder.cpp
Wang-Yuanqi-source Jul 13, 2024
cc8816a
Update read_xml_arch_file.cpp
Wang-Yuanqi-source Jul 14, 2024
70e4f5a
Update vpr_utils.h
Wang-Yuanqi-source Jul 14, 2024
cabf2ea
Update vpr_utils.cpp
Wang-Yuanqi-source Jul 14, 2024
0ead1a8
Update router_lookahead_map_utils.cpp
Wang-Yuanqi-source Jul 14, 2024
07627be
Update tileable_rr_graph_builder.cpp
Wang-Yuanqi-source Jul 14, 2024
efb99fc
Update vpr_utils.cpp
Wang-Yuanqi-source Jul 14, 2024
510f4e2
Update SetupGrid.h
Wang-Yuanqi-source Jul 14, 2024
993aca5
Update SetupGrid.h
Wang-Yuanqi-source Jul 14, 2024
68e4d65
Merge branch 'openfpga' into patch-1
Wang-Yuanqi-source Jul 30, 2024
1afa2f5
Create vib_inf.cpp
Wang-Yuanqi-source Oct 22, 2024
f3deaa6
Create vib_inf.h
Wang-Yuanqi-source Oct 22, 2024
ccb5b56
Update rr_graph_storage.h
Wang-Yuanqi-source Oct 22, 2024
3769b62
Update physical_types.h
Wang-Yuanqi-source Oct 22, 2024
9e521a0
Update read_xml_arch_file.cpp
Wang-Yuanqi-source Oct 22, 2024
cb22a8a
Update check_rr_graph.cpp
Wang-Yuanqi-source Oct 22, 2024
487ed26
Update check_rr_graph.h
Wang-Yuanqi-source Oct 22, 2024
6382aaf
Update rr_graph_uxsdcxx_serializer.h
Wang-Yuanqi-source Oct 22, 2024
bb2d5cf
Update SetupGrid.cpp
Wang-Yuanqi-source Oct 22, 2024
b3bb7c8
Update SetupGrid.h
Wang-Yuanqi-source Oct 22, 2024
5b27ab8
Update vpr_api.cpp
Wang-Yuanqi-source Oct 22, 2024
345a27c
Update vpr_context.h
Wang-Yuanqi-source Oct 22, 2024
eeb448a
Update connection_router.cpp
Wang-Yuanqi-source Oct 22, 2024
0d7cacd
Update overuse_report.cpp
Wang-Yuanqi-source Oct 22, 2024
6f773cd
Update router_lookahead_map_utils.cpp
Wang-Yuanqi-source Oct 22, 2024
f7427aa
Update router_lookahead_map.cpp
Wang-Yuanqi-source Oct 22, 2024
d91bd9f
Update rr_graph.cpp
Wang-Yuanqi-source Oct 22, 2024
ce412a4
Update tileable_rr_graph_builder.cpp
Wang-Yuanqi-source Oct 22, 2024
d0f19a0
Update tileable_rr_graph_edge_builder.cpp
Wang-Yuanqi-source Oct 22, 2024
f117218
Update tileable_rr_graph_edge_builder.h
Wang-Yuanqi-source Oct 22, 2024
0e0c9af
Update tileable_rr_graph_gsb.cpp
Wang-Yuanqi-source Oct 22, 2024
9b8a3f2
Update tileable_rr_graph_gsb.h
Wang-Yuanqi-source Oct 22, 2024
ca9e9f1
Update tileable_rr_graph_node_builder.cpp
Wang-Yuanqi-source Oct 22, 2024
3f5633b
Update tileable_rr_graph_node_builder.h
Wang-Yuanqi-source Oct 22, 2024
317e2fe
Update vpr_utils.cpp
Wang-Yuanqi-source Oct 22, 2024
4b91e02
Update vpr_utils.h
Wang-Yuanqi-source Oct 22, 2024
0f34455
Update tileable_chan_details_builder.cpp
Wang-Yuanqi-source Oct 22, 2024
3937e3c
Merge branch 'openfpga' into patch-1
Wang-Yuanqi-source Oct 24, 2024
3a3f24e
Update tileable_rr_graph_gsb.cpp
Wang-Yuanqi-source Nov 4, 2024
a757254
Update rr_spatial_lookup.cpp
Wang-Yuanqi-source Nov 4, 2024
b447186
Update rr_gsb.cpp
Wang-Yuanqi-source Nov 4, 2024
35b4200
Update tileable_rr_graph_gsb.h
Wang-Yuanqi-source Nov 4, 2024
d5d2372
Update tileable_rr_graph_node_builder.cpp
Wang-Yuanqi-source Nov 4, 2024
8afea46
Update tileable_rr_graph_node_builder.h
Wang-Yuanqi-source Nov 4, 2024
1d45f3b
Update check_rr_graph.cpp
Wang-Yuanqi-source Nov 4, 2024
e8c88fa
Update check_rr_graph.h
Wang-Yuanqi-source Nov 4, 2024
7c6d85c
Update vib_inf.h
Wang-Yuanqi-source Nov 4, 2024
6075e31
Update physical_types.h
Wang-Yuanqi-source Nov 4, 2024
3941eef
Update vib_inf.cpp
Wang-Yuanqi-source Nov 4, 2024
6be2c9a
Update read_xml_arch_file.cpp
Wang-Yuanqi-source Nov 4, 2024
391d044
Update SetupVPR.cpp
Wang-Yuanqi-source Nov 4, 2024
6f681c2
Update SetupGrid.cpp
Wang-Yuanqi-source Nov 4, 2024
463bdd0
Update SetupGrid.h
Wang-Yuanqi-source Nov 4, 2024
6359b5c
Create SetupVibGrid.cpp
Wang-Yuanqi-source Nov 4, 2024
c0a2736
Create SetupVibGrid.h
Wang-Yuanqi-source Nov 4, 2024
52edaf9
Update vpr_api.cpp
Wang-Yuanqi-source Nov 4, 2024
60bc5a0
Update vpr_context.h
Wang-Yuanqi-source Nov 4, 2024
b9d587e
Update rr_graph.xsd
Wang-Yuanqi-source Nov 4, 2024
5ad2329
Update tileable_rr_graph_edge_builder.cpp
Wang-Yuanqi-source Nov 4, 2024
cbcdf0e
Update tileable_rr_graph_edge_builder.h
Wang-Yuanqi-source Nov 4, 2024
84faf43
Update rr_graph.cpp
Wang-Yuanqi-source Nov 4, 2024
4e046ef
Update rr_graph_uxsdcxx_serializer.h
Wang-Yuanqi-source Nov 4, 2024
60bee8f
Update overuse_report.cpp
Wang-Yuanqi-source Nov 4, 2024
0b4cfc2
Update router_lookahead_map.cpp
Wang-Yuanqi-source Nov 4, 2024
a182a76
Update router_lookahead_map_utils.cpp
Wang-Yuanqi-source Nov 4, 2024
6343061
Update rr_gsb.h
Wang-Yuanqi-source Nov 4, 2024
3bb9068
Update tileable_rr_graph_node_builder.cpp
Wang-Yuanqi-source Nov 25, 2024
be709d2
Update SetupVibGrid.cpp
Wang-Yuanqi-source Nov 25, 2024
d7d93c9
Update tileable_rr_graph_node_builder.h
Wang-Yuanqi-source Nov 25, 2024
91960e2
Update tileable_rr_graph_builder.cpp
Wang-Yuanqi-source Nov 25, 2024
729ae80
Update tileable_rr_graph_edge_builder.cpp
Wang-Yuanqi-source Nov 25, 2024
7a0dfbc
Update tileable_rr_graph_gsb.cpp
Wang-Yuanqi-source Nov 25, 2024
2e50bfb
Update rr_gsb.h
Wang-Yuanqi-source Nov 25, 2024
9dac8c4
Update tileable_rr_graph_gsb.h
Wang-Yuanqi-source Nov 25, 2024
a4479e5
Update tileable_rr_graph_edge_builder.h
Wang-Yuanqi-source Nov 25, 2024
9ae8a99
Update vib_inf.h
Wang-Yuanqi-source Nov 25, 2024
230fe0f
Update vib_inf.cpp
Wang-Yuanqi-source Nov 25, 2024
1678907
Update tileable_rr_graph_gsb.cpp
Wang-Yuanqi-source Nov 25, 2024
cfe7c2a
Update index.rst
Wang-Yuanqi-source Nov 29, 2024
35a82e7
Create VIB.rst
Wang-Yuanqi-source Nov 29, 2024
e2fff38
Add files via upload
Wang-Yuanqi-source Nov 29, 2024
8dae0c3
Create vib_test_arch.xml
Wang-Yuanqi-source Nov 29, 2024
481efce
Create music.blif
Wang-Yuanqi-source Nov 29, 2024
9240ab6
Add files via upload
Wang-Yuanqi-source Nov 29, 2024
b96878a
Merge branch 'openfpga' into patch-1
Wang-Yuanqi-source Dec 17, 2024
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
93 changes: 93 additions & 0 deletions libs/libarchfpga/src/physical_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,32 @@ struct t_grid_loc_def {
// that come from a common definition.
};

struct t_vib_grid_loc_def {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Suggest to move the VIB-related data structures to a separated header file. It can avoid merging conflicts in future.
  • Like the t_grid_loc_def, code comments are required.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove VIB-related data structure to a new class.

t_vib_grid_loc_def(std::string block_type_val, int priority_val)
: block_type(block_type_val)
, priority(priority_val)
, x("0", "W-1", "max(w+1,W)", "w") //Fill in x direction, no repeat, incr by block width
, y("0", "H-1", "max(h+1,H)", "h") //Fill in y direction, no repeat, incr by block height
{}

std::string block_type; //The block type name

int priority = 0; //Priority of the specification.
// In case of conflicting specifications
// the largest priority wins.

t_grid_loc_spec x; //Horizontal location specification
t_grid_loc_spec y; //Veritcal location specification

// When 1 metadata tag is split among multiple t_grid_loc_def, one
// t_grid_loc_def is arbitrarily chosen to own the metadata, and the other
// t_grid_loc_def point to the owned version.
std::unique_ptr<t_metadata_dict> owned_meta;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the metadata is not used for now, we do not need to include them in the VIB data structure.
Since our objective is to separate the codes to the most (avoid merging conflicts as much as possible), I suggest to decouple with the existing data structure t_grid_loc_spec and enum GridDefType. As a result, all the VIB-related data structure can be moved to the vib_inf.[h|cpp]

Copy link

@Wang-Yuanqi-source Wang-Yuanqi-source Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will decouple t_grid_loc_spec and enum GridDefType and move all VIB-related data structures to the vib_inf.[h|cpp]

t_metadata_dict* meta = nullptr; // Metadata for this location definition. This
// metadata may be shared with multiple grid_locs
// that come from a common definition.
};

enum GridDefType {
AUTO,
FIXED
Expand All @@ -382,6 +408,10 @@ struct t_layer_def {
std::vector<t_grid_loc_def> loc_defs; //The list of block location definitions for this layer specification
};

struct t_vib_layer_def {
std::vector<t_vib_grid_loc_def> loc_defs; //The list of block location definitions for this layer specification
};

struct t_grid_def {
GridDefType grid_type = GridDefType::AUTO; //The type of this grid specification

Expand All @@ -395,6 +425,19 @@ struct t_grid_def {
std::vector<t_layer_def> layers;
};

struct t_vib_grid_def {
GridDefType grid_type = GridDefType::AUTO; //The type of this grid specification

std::string name = ""; //The name of this device

int width = -1; //Fixed device width (only valid for grid_type == FIXED)
int height = -1; //Fixed device height (only valid for grid_type == FIXED)

float aspect_ratio = 1.; //Aspect ratio for auto-sized devices (only valid for
//grid_type == AUTO)
std::vector<t_vib_layer_def> layers;
};

/************************* POWER ***********************************/

/* Global clock architecture */
Expand Down Expand Up @@ -1613,6 +1656,9 @@ struct t_segment_inf {
enum e_parallel_axis parallel_axis;
std::vector<bool> cb;
std::vector<bool> sb;
bool isbend;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest to add code comments to explain each new element, especially for the bend and part_len which are not clear by themselves.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add code comments to explain this part.

std::vector<int> bend;
std::vector<int> part_len;
int seg_index;
enum SegResType res_type = SegResType::GENERAL;
//float Cmetal_per_m; /* Wire capacitance (per meter) */
Expand Down Expand Up @@ -1998,6 +2044,47 @@ struct t_noc_inf {
std::string noc_router_tile_name;
};

/* for vib tag */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see very tight correlations among the data structures, t_seg_group, e_multistage_mux_from_or_to_type, t_from_or_to_inf, t_first_stage_mux_inf, t_second_stage_mux_inf and t_vib_inf.
Separated data structures in C-style bring confusion in code readabilities.
Is it possible to create a class such as VibInf? Just like RRGSB

struct t_seg_group {
std::string name;
int seg_index;
int track_num;
};

enum e_multistage_mux_from_or_to_type {
PB = 0,
SEGMENT,
MUX
};

struct t_from_or_to_inf {
std::string type_name;
e_multistage_mux_from_or_to_type from_type; //from_or_to_type
int type_index = -1;
int phy_pin_index = -1;
char seg_dir = ' ';
int seg_index = -1;
};

struct t_first_stage_mux_inf {
std::string mux_name;
std::vector<t_from_or_to_inf> froms;
};

struct t_second_stage_mux_inf : t_first_stage_mux_inf {
std::vector<t_from_or_to_inf> to; // for io type, port[pin] may map to several sinks
};

struct t_vib_inf {
std::string name; /* vib name */
std::string pbtype_name; /* pbtype name of vib */
int seg_group_num; /* seg group number of vib */
int switch_idx; /* vib switch index */
std::vector<t_seg_group> seg_groups;
std::vector<t_first_stage_mux_inf> first_stages;
std::vector<t_second_stage_mux_inf> second_stages;
};

/* Detailed routing architecture */
struct t_arch {
/** Stores unique strings used as key and values in <metadata> tags,
Expand Down Expand Up @@ -2075,10 +2162,16 @@ struct t_arch {

std::vector<t_grid_def> grid_layouts; //Set of potential device layouts

std::vector<t_vib_grid_def> vib_grid_layouts;

t_clock_arch_spec clock_arch; // Clock related data types

// if we have an embedded NoC in the architecture, then we store it here
t_noc_inf* noc = nullptr;

// added for vib
bool is_vib_arch = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The boolean variable may not be necessary. Can we use the vib_infs.empty() to show if VIB is used or not? Or we can create a method is_vib_arch()

std::vector<t_vib_inf> vib_infs;
};

#endif
Loading
Loading