Skip to content

Commit 724b87e

Browse files
committed
libs: arch: interchange: add comment on constant blocks
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 8658bdd commit 724b87e

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

libs/libarchfpga/src/read_fpga_interchange_arch.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,18 @@ struct ArchReader {
448448
return pad_bels_.count(name) != 0;
449449
}
450450

451+
/** @brief Utility function to fill in all the necessary information for the sub_tile
452+
*
453+
* Given a physical tile type and a corresponding sub tile with additional information on the IO pin count
454+
* this function populates all the data structures corresponding to the sub tile, and modifies also the parent
455+
* physical tile type, updating the pin numberings as well as the directs pin mapping for the equivalent sites
456+
*
457+
* Affected data structures:
458+
* - pinloc
459+
* - fc_specs
460+
* - equivalent_sites
461+
* - tile_block_pin_directs_map
462+
**/
451463
void fill_sub_tile(t_physical_tile_type& type, t_sub_tile& sub_tile, int num_pins, int input_count, int output_count) {
452464
sub_tile.num_phy_pins += num_pins;
453465
type.num_pins += num_pins;
@@ -2040,6 +2052,31 @@ struct ArchReader {
20402052
}
20412053
}
20422054

2055+
/** @brief The constant block is a synthetic tile which is used to assign a virtual
2056+
* location in the grid to the constant signals which are than driven to
2057+
* all the real constant wires.
2058+
*
2059+
* The block's diagram can be seen below. The port names are specified in
2060+
* the interchange device database, therefore GND and VCC are mainly
2061+
* examples in this case.
2062+
*
2063+
* +---------------+
2064+
* | |
2065+
* | +-------+ |
2066+
* | | | |
2067+
* | | GND +----+--> RR Graph node
2068+
* | | | |
2069+
* | +-------+ |
2070+
* | |
2071+
* | |
2072+
* | +-------+ |
2073+
* | | | |
2074+
* | | VCC +----+--> RR Graph node
2075+
* | | | |
2076+
* | +-------+ |
2077+
* | |
2078+
* +---------------+
2079+
*/
20432080
void process_constant_block() {
20442081
std::vector<std::pair<std::string, std::string>> const_cells{arch_->gnd_cell, arch_->vcc_cell};
20452082

@@ -2121,6 +2158,7 @@ struct ArchReader {
21212158
ltypes_.push_back(block);
21222159
}
21232160

2161+
/** @brief Creates the models corresponding to the constant cells that are used in a given interchange device */
21242162
void process_constant_model() {
21252163
std::vector<std::pair<std::string, std::string>> const_cells{arch_->gnd_cell, arch_->vcc_cell};
21262164

@@ -2146,6 +2184,11 @@ struct ArchReader {
21462184
}
21472185
}
21482186

2187+
/** @brief Creates a synthetic constant tile that will be located in the external layer of the device.
2188+
*
2189+
* The constant tile has two output ports, one for GND and the other for VCC. The constant tile hosts
2190+
* the constant pb type that is generated as well. See process_constant_model and process_constant_block.
2191+
*/
21492192
void process_constant_tile() {
21502193
std::vector<std::pair<std::string, std::string>> const_cells{arch_->gnd_cell, arch_->vcc_cell};
21512194
// Create constant tile

vpr/src/base/read_interchange_netlist.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct NetlistReader {
8282

8383
std::unordered_map<size_t, std::unordered_map<std::pair<size_t, size_t>, std::string, vtr::hash_pair>> port_net_maps_;
8484

85+
/** @brief Preprocesses the port net maps, populating the port_net_maps_ hash map to be later accessed for faster lookups */
8586
void prepare_port_net_maps() {
8687
auto inst_list = nr_.getInstList();
8788
auto decl_list = nr_.getCellDecls();

0 commit comments

Comments
 (0)