-
Notifications
You must be signed in to change notification settings - Fork 414
Data structure rr_node_metadata/rr_edge_metadata owner change #1952
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,7 @@ class RRGraphBuilder { | |
/* -- Constructors -- */ | ||
public: | ||
/* See detailed comments about the data structures in the internal data storage section of this file */ | ||
RRGraphBuilder(t_rr_graph_storage* node_storage, | ||
MetadataStorage<int>* rr_node_metadata, | ||
MetadataStorage<std::tuple<int, int, short>>* rr_edge_metadata); | ||
RRGraphBuilder(t_rr_graph_storage* node_storage); | ||
|
||
/* Disable copy constructors and copy assignment operator | ||
* This is to avoid accidental copy because it could be an expensive operation considering that the | ||
|
@@ -40,6 +38,38 @@ class RRGraphBuilder { | |
t_rr_graph_storage& node_storage(); | ||
/** @brief Return a writable object for update the fast look-up of rr_node */ | ||
RRSpatialLookup& node_lookup(); | ||
/** .. warning:: The Metadata should stay as an independent data structure than rest of the internal data, | ||
* e.g., node_lookup! */ | ||
/** @brief Return a writable object for the meta data on the nodes */ | ||
MetadataStorage<int>& rr_node_metadata(); | ||
/** @brief Return a writable object for the meta data on the edge */ | ||
MetadataStorage<std::tuple<int, int, short>>& rr_edge_metadata(); | ||
|
||
/** @brief Return the size for rr_node_metadata */ | ||
inline size_t rr_node_metadata_size() const { | ||
return rr_node_metadata_.size(); | ||
} | ||
/** @brief Return the size for rr_edge_metadata */ | ||
inline size_t rr_edge_metadata_size() const { | ||
return rr_edge_metadata_.size(); | ||
} | ||
/** @brief Find the node in rr_node_metadata */ | ||
inline vtr::flat_map<int, t_metadata_dict>::const_iterator find_rr_node_metadata(const int& lookup_key) const { | ||
return rr_node_metadata_.find(lookup_key); | ||
} | ||
/** @brief Find the edge in rr_edge_metadata */ | ||
inline vtr::flat_map<std::tuple<int, int, short int>, t_metadata_dict>::const_iterator find_rr_edge_metadata(const std::tuple<int, int, short int>& lookup_key) const { | ||
return rr_edge_metadata_.find(lookup_key); | ||
} | ||
/** @brief Return the last node in rr_node_metadata */ | ||
inline vtr::flat_map<int, t_metadata_dict>::const_iterator end_rr_node_metadata() const { | ||
return rr_node_metadata_.end(); | ||
} | ||
|
||
/** @brief Return the last edge in rr_edge_metadata */ | ||
inline vtr::flat_map<std::tuple<int, int, short int>, t_metadata_dict>::const_iterator end_rr_edge_metadata() const { | ||
return rr_edge_metadata_.end(); | ||
} | ||
|
||
/** @brief Add a rr_segment to the routing resource graph. Return an valid id if successful. | ||
* - Each rr_segment contains the detailed information of a routing track, which is denoted by a node in CHANX or CHANY type. | ||
|
@@ -304,13 +334,30 @@ class RRGraphBuilder { | |
/* Detailed information about the switches, which are used in the RRGraph */ | ||
vtr::vector<RRSwitchId, t_rr_switch_inf> rr_switch_inf_; | ||
|
||
/** .. warning:: The Metadata should stay as an independent data structure than rest of the internal data, | ||
* e.g., node_lookup! */ | ||
/* Metadata is an extra data on rr-nodes and edges, respectively, that is not used by vpr | ||
* but simply passed through the flow so that it can be used by downstream tools. | ||
* The main (perhaps only) current use of this metadata is the fasm tool of symbiflow, | ||
* which needs extra metadata on which programming bits control which switch in order to produce a bitstream.*/ | ||
|
||
MetadataStorage<int>& rr_node_metadata_; | ||
MetadataStorage<std::tuple<int, int, short>>& rr_edge_metadata_; | ||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should add a warning to the comments, in order to avoid any developers to merge the metadate into other internal data:
|
||
* @brief Attributes for each rr_node. | ||
* | ||
* key: rr_node index | ||
* value: map of <attribute_name, attribute_value> | ||
*/ | ||
MetadataStorage<int> rr_node_metadata_; | ||
/** | ||
* @brief Attributes for each rr_edge | ||
* | ||
* key: <source rr_node_index, sink rr_node_index, iswitch> | ||
* iswitch: Index of the switch type used to go from this rr_node to | ||
* the next one in the routing. OPEN if there is no next node | ||
* (i.e. this node is the last one (a SINK) in a branch of the | ||
* net's routing). | ||
* value: map of <attribute_name, attribute_value> | ||
*/ | ||
MetadataStorage<std::tuple<int, int, short>> rr_edge_metadata_; | ||
}; | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,8 @@ class RRGraphView { | |
/* See detailed comments about the data structures in the internal data storage section of this file */ | ||
RRGraphView(const t_rr_graph_storage& node_storage, | ||
const RRSpatialLookup& node_lookup, | ||
const MetadataStorage<int>& rr_node_metadata, | ||
const MetadataStorage<std::tuple<int, int, short>>& rr_edge_metadata, | ||
const vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data, | ||
const vtr::vector<RRSegmentId, t_segment_inf>& rr_segments, | ||
const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switch_inf); | ||
|
@@ -419,6 +421,15 @@ class RRGraphView { | |
const RRSpatialLookup& node_lookup() const { | ||
return node_lookup_; | ||
} | ||
/** .. warning:: The Metadata should stay as an independent data structure than rest of the internal data, | ||
* e.g., node_lookup! */ | ||
MetadataStorage<int> rr_node_metadata_data() const { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add code comments |
||
return rr_node_metadata_; | ||
} | ||
|
||
MetadataStorage<std::tuple<int, int, short>> rr_edge_metadata_data() const { | ||
return rr_edge_metadata_; | ||
} | ||
|
||
/* -- Internal data storage -- */ | ||
/* Note: only read-only object or data structures are allowed!!! */ | ||
|
@@ -427,10 +438,32 @@ class RRGraphView { | |
const t_rr_graph_storage& node_storage_; | ||
/* Fast look-up for rr nodes */ | ||
const RRSpatialLookup& node_lookup_; | ||
|
||
/** .. warning:: The Metadata should stay as an independent data structure than rest of the internal data, | ||
* e.g., node_lookup! */ | ||
/* Metadata is an extra data on rr-nodes and edges, respectively, that is not used by vpr | ||
* but simply passed through the flow so that it can be used by downstream tools. | ||
* The main (perhaps only) current use of this metadata is the fasm tool of symbiflow, | ||
* which needs extra metadata on which programming bits control which switch in order to produce a bitstream.*/ | ||
/** | ||
* @brief Attributes for each rr_node. | ||
* | ||
* key: rr_node index | ||
* value: map of <attribute_name, attribute_value> | ||
*/ | ||
const MetadataStorage<int>& rr_node_metadata_; | ||
/** | ||
* @brief Attributes for each rr_edge | ||
* | ||
* key: <source rr_node_index, sink rr_node_index, iswitch> | ||
* iswitch: Index of the switch type used to go from this rr_node to | ||
* the next one in the routing. OPEN if there is no next node | ||
* (i.e. this node is the last one (a SINK) in a branch of the | ||
* net's routing). | ||
* value: map of <attribute_name, attribute_value> | ||
*/ | ||
const MetadataStorage<std::tuple<int, int, short>>& rr_edge_metadata_; | ||
/* rr_indexed_data_ and rr_segments_ are needed to lookup the segment information in node_coordinate_to_string() */ | ||
const vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data_; | ||
|
||
/* Segment info for rr nodes */ | ||
const vtr::vector<RRSegmentId, t_segment_inf>& rr_segments_; | ||
/* switch info for rr nodes */ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,8 +72,8 @@ void load_rr_file(const t_graph_type graph_type, | |
device_ctx.rr_graph.rr_segments(), | ||
device_ctx.physical_tile_types, | ||
grid, | ||
&device_ctx.rr_node_metadata, | ||
&device_ctx.rr_edge_metadata, | ||
&device_ctx.rr_graph_builder.rr_node_metadata(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the two APIs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to remove the & operator here and it starts throwing error of "no known conversion for arguments" we have to make changes to the locations where this function is used. So should I go for the changings or keep it in the way as it is? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is o.k. here. We may consider to change it later. |
||
&device_ctx.rr_graph_builder.rr_edge_metadata(), | ||
&device_ctx.arch->strings); | ||
|
||
if (vtr::check_file_name_extension(read_rr_graph_name, ".xml")) { | ||
|
Uh oh!
There was an error while loading. Please reload this page.