-
Notifications
You must be signed in to change notification settings - Fork 414
legalizer frontend #2615
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
legalizer frontend #2615
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
321cb82
legalizer frontend
KA7E 3e01d63
Merge branch 'master' into legalizer_frontend
KA7E f876b39
fixed compiler warning
KA7E b69586d
Merge branch 'master' into legalizer_frontend
KA7E 74b7375
Merge branch 'master' into legalizer_frontend
KA7E 973fd2a
mods based on Vaughn's comments
KA7E 3deee14
forgot to delete unconditional call to print_flat_placement
KA7E cc0a460
Merge branch 'master' into legalizer_frontend
KA7E 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "globals.h" | ||
#include "load_flat_place.h" | ||
#include "clustered_netlist_utils.h" | ||
|
||
|
||
/* @brief Prints flat placement file entries for the atoms in one placed cluster. */ | ||
static void print_flat_cluster(FILE* fp, ClusterBlockId iblk, | ||
std::vector<AtomBlockId>& atoms); | ||
|
||
static void print_flat_cluster(FILE* fp, ClusterBlockId iblk, | ||
std::vector<AtomBlockId>& atoms) { | ||
|
||
auto& atom_ctx = g_vpr_ctx.atom(); | ||
t_pl_loc loc = g_vpr_ctx.placement().block_locs[iblk].loc; | ||
size_t bnum = size_t(iblk); | ||
|
||
for (auto atom : atoms) { | ||
t_pb_graph_node* atom_pbgn = atom_ctx.lookup.atom_pb(atom)->pb_graph_node; | ||
fprintf(fp, "%s %d %d %d %d #%zu %s\n", atom_ctx.nlist.block_name(atom).c_str(), | ||
loc.x, loc.y, loc.sub_tile, | ||
atom_pbgn->flat_site_index, | ||
bnum, | ||
atom_pbgn->pb_type->name); | ||
} | ||
} | ||
|
||
/* prints a flat placement file */ | ||
void print_flat_placement(const char* flat_place_file) { | ||
|
||
FILE* fp; | ||
|
||
ClusterAtomsLookup atoms_lookup; | ||
auto& cluster_ctx = g_vpr_ctx.clustering(); | ||
|
||
if (!g_vpr_ctx.placement().block_locs.empty()) { | ||
fp = fopen(flat_place_file, "w"); | ||
for (auto iblk : cluster_ctx.clb_nlist.blocks()) { | ||
auto atoms = atoms_lookup.atoms_in_cluster(iblk); | ||
print_flat_cluster(fp, iblk, atoms); | ||
} | ||
fclose(fp); | ||
} | ||
|
||
} | ||
|
||
/* ingests and legalizes a flat placement file */ | ||
bool load_flat_placement(t_vpr_setup& vpr_setup, const char* architecture_id) { | ||
VTR_LOG("load_flat_placement(); when implemented, this function:"); | ||
VTR_LOG("\n\tLoads flat placement file: %s, ", vpr_setup.FileNameOpts.FlatPlaceFile.c_str()); | ||
VTR_LOG("\n\tArch id: %s, ", architecture_id); | ||
VTR_LOG("\n\tPrints clustered netlist file: %s, ", vpr_setup.FileNameOpts.NetFile.c_str()); | ||
VTR_LOG("\n\tPrints fix clusters file: %s\n", vpr_setup.FileNameOpts.write_constraints_file.c_str()); | ||
|
||
return false; | ||
} |
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,16 @@ | ||
#ifndef LOAD_FLAT_PLACE_H | ||
#define LOAD_FLAT_PLACE_H | ||
|
||
#include "vpr_types.h" | ||
|
||
/** | ||
* @brief A function that prints a flat placement file | ||
*/ | ||
void print_flat_placement(const char* flat_place_file); | ||
|
||
/** | ||
* @brief A function that loads and legalizes a flat placement file | ||
KA7E marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
bool load_flat_placement(t_vpr_setup& vpr_setup, const char* archi_id); | ||
|
||
#endif |
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
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.