-
Notifications
You must be signed in to change notification settings - Fork 415
Floorplanning during place moves #1704
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
b13814b
Added floorplan constraint checks to the placement move generators
sfkhalid 1c4d515
added comments and changed cluster_floorplanning_check -> cluster_flo…
sfkhalid 88bc674
Took out commented code
sfkhalid 9009b6c
Merge branch 'master' into floorplanning_during_place_moves
sfkhalid 9e84342
Created a helper function (floorplan_legal) to check the floorplannin…
sfkhalid 2c12618
Ran make format
sfkhalid c124415
Merge 'floorplanning_during_place_moves' of https://github.com/verilo…
sfkhalid 79378a4
Added ability to write our constraints XML files after placement
sfkhalid 77d32e7
removed extra code in write_place_constraints
sfkhalid 5efca5a
Changed serializer file to write using contexts
sfkhalid fbe99b5
Locking down blocks to each place
sfkhalid ebfbc75
Added expand and subtile options
sfkhalid 0f910b8
Made minor change to serializer file to get rid of compiler warnings
sfkhalid c8fef8e
Made subtile option a bool
sfkhalid 26ba44f
Fixed issue where long atom and partition names were not being printe…
sfkhalid c8b2a6b
Fixed issue where subtile value would not be printed if it was zero
sfkhalid 7b2674d
Added comments and did minor function refactoring to routines related…
sfkhalid f3d08c4
Removed some unneeded code and changed some function parameters to co…
sfkhalid 2e7b05d
Added a lookup for which atoms are in a cluster in clustered_netlist_…
sfkhalid 4c50e8b
Add comment to describe loop that fills in constraints object for wri…
sfkhalid 76458b5
Merge branch 'master' into floorplanning_during_place_moves
vaughnbetz b352690
Merge branch 'master' into floorplanning_during_place_moves
sfkhalid efc2dec
Merge branch 'master' into floorplanning_during_place_moves
sfkhalid 1e80b92
Merge branch 'master' into floorplanning_during_place_moves
sfkhalid 7df3f45
Commented ClusterAtomsLookup class
sfkhalid cbf5a1c
Merge branch 'master' into floorplanning_during_place_moves
sfkhalid 8376186
Merge branch 'master' into floorplanning_during_place_moves
sfkhalid 6371351
Merge branch 'master' into floorplanning_during_place_moves
sfkhalid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* vpr_constraints_writer.cpp | ||
* | ||
* Author: khalid88 | ||
*/ | ||
|
||
#include "vpr_constraints_serializer.h" | ||
#include "vpr_constraints_uxsdcxx.h" | ||
|
||
#include "vtr_time.h" | ||
|
||
#include "globals.h" | ||
#include "pugixml.hpp" | ||
#include "pugixml_util.hpp" | ||
#include "echo_files.h" | ||
|
||
#include <fstream> | ||
#include "vpr_constraints_writer.h" | ||
|
||
void write_vpr_floorplan_constraints(const char* file_name, int expand, int subtile) { | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
auto& place_ctx = g_vpr_ctx.placement(); | ||
auto& atom_ctx = g_vpr_ctx.atom(); | ||
auto& cluster_ctx = g_vpr_ctx.clustering(); | ||
|
||
//Fill in all the info needed for locking atoms to their locations | ||
VprConstraints constraints; | ||
|
||
std::map<ClusterBlockId, std::vector<AtomBlockId>> cluster_atoms; | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
for (auto blk_id : cluster_ctx.clb_nlist.blocks()) { | ||
cluster_atoms.insert({blk_id, std::vector<AtomBlockId>()}); | ||
} | ||
|
||
for (auto atom_blk_id : atom_ctx.nlist.blocks()) { | ||
ClusterBlockId clb_index = atom_ctx.lookup.atom_clb(atom_blk_id); | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
cluster_atoms[clb_index].push_back(atom_blk_id); | ||
} | ||
|
||
int part_id = 0; | ||
for (auto i = cluster_atoms.begin(); i != cluster_atoms.end(); i++) { | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
std::string part_name; | ||
part_name = cluster_ctx.clb_nlist.block_name(i->first); | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
PartitionId partid(part_id); | ||
|
||
Partition part; | ||
part.set_name(part_name); | ||
|
||
PartitionRegion pr; | ||
Region reg; | ||
|
||
auto loc = place_ctx.block_locs[i->first].loc; | ||
|
||
reg.set_region_rect(loc.x - expand, loc.y - expand, loc.x + expand, loc.y + expand); | ||
reg.set_sub_tile(subtile); | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
pr.add_to_part_region(reg); | ||
part.set_part_region(pr); | ||
constraints.add_partition(part); | ||
|
||
int num_atoms = i->second.size(); | ||
|
||
for (auto j = 0; j < num_atoms; j++) { | ||
AtomBlockId atom_id = i->second[j]; | ||
constraints.add_constrained_atom(atom_id, partid); | ||
} | ||
part_id++; | ||
} | ||
|
||
VprConstraintsSerializer reader(constraints); | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if (vtr::check_file_name_extension(file_name, ".xml")) { | ||
std::fstream fp; | ||
fp.open(file_name, std::fstream::out | std::fstream::trunc); | ||
fp.precision(std::numeric_limits<float>::max_digits10); | ||
void* context; | ||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uxsd::write_vpr_constraints_xml(reader, context, fp); | ||
} else { | ||
VPR_FATAL_ERROR(VPR_ERROR_ROUTE, | ||
"Unknown extension on output %s", | ||
file_name); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* vpr_constraints_writer.h | ||
* | ||
* Author: khalid88 | ||
*/ | ||
|
||
#ifndef VPR_SRC_BASE_VPR_CONSTRAINTS_WRITER_H_ | ||
#define VPR_SRC_BASE_VPR_CONSTRAINTS_WRITER_H_ | ||
|
||
sfkhalid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
void write_vpr_floorplan_constraints(const char* file_name, int expand, int subtile); | ||
|
||
#endif /* VPR_SRC_BASE_VPR_CONSTRAINTS_WRITER_H_ */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.