CGRA-ME
|
Implementation of the Anneal Placer. More...
#include <ClusteredMapper.h>
Classes | |
struct | UnmappableException |
Public Member Functions | |
AnnealPlacer (ClusteredMapperDriver driver, const OpGraph &opgraph, const MRRG &mrrg, std::unordered_map< std::string, std::string > fix_ports, int rows, int cols, bool isElastic=false) | |
Mapping | placeOpGraph (float temp) |
void | clearPlacement () |
void | setInitialPlacement () |
float | determineTemperature (float scale) |
Private Types | |
using | OpCodeByCycle = std::pair< OpGraphOpCode, int > |
Private Member Functions | |
std::pair< bool, float > | inner_place_and_route_loop (float temp) |
The main body of one iteration. More... | |
MRRGNodeDesc | getRandomUnoccupiedFU (OpGraphOpDesc op) |
gets the functional units to map the op More... | |
MRRGNodeDesc | getRandomFU (OpGraphOpDesc op) |
std::vector< MRRGNodeDesc > | getRandomFUs (std::vector< OpGraphOpDesc > ops, bool occupied) |
MRRGNodeDesc | getFUForOpAtLoc (OpGraphOpDesc op, Location loc) |
void | ripUpOp (OpGraphOpDesc op) |
places and removes an op from an mrrgnode More... | |
bool | placeOp (OpGraphOpDesc op, MRRGNodeDesc n) |
MRRGNodeDesc | getMappedMRRGNode (OpGraphOpDesc op) |
gets the mrrgnode associated with an op or the op associated with an mrrgnode More... | |
OpGraphOpDesc | getOpMapedAt (MRRGNodeDesc n) |
bool | isClusterFixed (std::vector< OpGraphOpDesc > cluster) |
bool | accept (float delta_cost, float temperature) const |
Should a move with this delta_cost be accepted at this temperature ? More... | |
float | nextTemperature (float t, float accept_rate) const |
bool | isOpgraphCovered () const |
Checks if the opgraph mapping is valid. More... | |
bool | checkOveruse () |
void | assertOccupancyLimit (MRRGNodeDesc fu) |
BoundingBox | getBB (OpGraphValDesc) |
does the costing of the fopgraph More... | |
double | getTotalCost () |
void | swap (OpGraphOpDesc op, MRRGNodeDesc node, std::map< OpGraphOpDesc, MRRGNodeDesc > &old_placement) |
void | setMappingInto (Mapping &m) const |
void | printMapping () const |
void | printMapping (std::ostream &os) const |
std::size_t | randomUintBelow (std::size_t past_end) const |
double | randomRealBetween0And1 () const |
Private Member Functions inherited from ClusteredMapperDriver | |
ClusteredMapperDriver (std::shared_ptr< CGRA > cgra, int timelimit, const ConfigStore &args) | |
Mapping | mapOpGraph (std::shared_ptr< OpGraph > opgraph, const int II, const MRRG &mrrg, std::unordered_map< std::string, std::string > fix_port) override |
main function to map the OpGraph to the device description More... | |
Mapping | mapStatic (std::shared_ptr< OpGraph > opgraph, const int II, const MRRG &mrrg, std::unordered_map< std::string, std::string > fix_port, PrintOnDestructionChronoSequence &timing_seq) |
Mapping | mapElastic (std::shared_ptr< OpGraph > opgraph, const int II, const MRRG &mrrg, std::unordered_map< std::string, std::string > fix_port, PrintOnDestructionChronoSequence timing_seq) |
const Latency | getCyclesToSink (OpGraphOpDesc source, OpGraphOpDesc sink) |
bool | isAllOpsSupported (const OpGraph &opgraph, const MRRG &mrrg) |
void | printPlacementNeato (int i, const OpGraph &opgraph, Mapping placed, std::unordered_map< OpGraphOpDesc, int > sched) |
Private Member Functions inherited from Mapper | |
virtual | ~Mapper () |
Mapper (std::shared_ptr< CGRA > cgra, int timelimit) | |
Private Attributes | |
int | l_rows = 0 |
int | l_cols = 0 |
int | l_II |
bool | l_isElastic |
const MRRG & | l_mrrg |
const OpGraph & | l_opgraph |
std::set< MRRGNodeDesc > | l_fixed_mrrg_nodes |
std::minstd_rand | l_randomInt |
std::unordered_map< std::string, std::string > | l_fix_ports |
std::map< const MRRGNode *, NodeAttributes > | l_function_nodes |
std::map< OpGraph::NodeDescriptor, std::vector< MRRGNodeDesc > > | l_mapping = {} |
std::map< OpGraphOpCode, std::vector< std::vector< MRRGNodeDesc > > > | l_grid |
std::unordered_map< OpCodeByCycle, std::vector< MRRGNodeDesc >, pair_hash > | l_op_to_nodes |
Private Attributes inherited from ClusteredMapperDriver | |
const int | l_print |
const int | l_rand_seed |
const double | l_p_factor_factor |
const double | l_initial_pfactor |
const double | l_initial_hfactor |
const double | l_h_factor_factor |
const int | l_swap_factor |
const int | l_fanout_threshold |
const int | l_ram_ports |
const int | l_verbosity |
const bool | l_cluster |
bool | l_isElastic |
int | l_iteration_interval |
const std::string | l_arch_name |
const ConfigStore | l_mapper_args |
const int | l_cost_func |
OpScheduler * | l_op_sched |
std::vector< std::vector< OpGraphOpDesc > > | l_clusters |
std::map< OpGraphOpDesc, int > | l_op_cluster_index |
std::unordered_map< OpGraphOpDesc, std::vector< std::string > > | l_ops_to_node_names |
std::unordered_map< OpGraphOpDesc, int > | l_schedule |
Mapping | l_empty_mapping_result |
Private Attributes inherited from Mapper | |
std::shared_ptr< CGRA > | cgra |
int | timelimit |
Additional Inherited Members | |
Static Private Attributes inherited from ClusteredMapperDriver | |
static constexpr Latency | kUndefLatency = -1 |
Implementation of the Anneal Placer.
Instatiated for every mapping call. Inherits from the driver to get easy access to configuration members.
Definition at line 257 of file ClusteredMapper.h.
|
private |
Definition at line 334 of file ClusteredMapper.h.
AnnealPlacer::AnnealPlacer | ( | ClusteredMapperDriver | driver, |
const OpGraph & | opgraph, | ||
const MRRG & | mrrg, | ||
std::unordered_map< std::string, std::string > | fix_ports, | ||
int | rows, | ||
int | cols, | ||
bool | isElastic = false |
||
) |
Definition at line 28 of file AnnealPlacer.cpp.
|
private |
Should a move with this delta_cost
be accepted at this temperature
?
Definition at line 247 of file AnnealPlacer.cpp.
|
private |
Definition at line 332 of file AnnealPlacer.cpp.
|
private |
Definition at line 166 of file AnnealPlacer.cpp.
void AnnealPlacer::clearPlacement | ( | ) |
Definition at line 633 of file AnnealPlacer.cpp.
float AnnealPlacer::determineTemperature | ( | float | scale | ) |
Definition at line 454 of file AnnealPlacer.cpp.
|
private |
does the costing of the fopgraph
Definition at line 129 of file AnnealPlacer.cpp.
|
private |
Definition at line 386 of file AnnealPlacer.cpp.
|
private |
gets the mrrgnode associated with an op or the op associated with an mrrgnode
Definition at line 208 of file AnnealPlacer.cpp.
|
private |
Definition at line 189 of file AnnealPlacer.cpp.
|
private |
Definition at line 417 of file AnnealPlacer.cpp.
|
private |
Definition at line 577 of file AnnealPlacer.cpp.
|
private |
gets the functional units to map the op
Definition at line 356 of file AnnealPlacer.cpp.
|
private |
Definition at line 73 of file AnnealPlacer.cpp.
|
private |
The main body of one iteration.
Definition at line 265 of file AnnealPlacer.cpp.
|
private |
cluster | checks if the cluster has a fixed port or no |
Definition at line 256 of file AnnealPlacer.cpp.
|
private |
Checks if the opgraph mapping is valid.
Definition at line 343 of file AnnealPlacer.cpp.
|
private |
Definition at line 564 of file AnnealPlacer.cpp.
|
private |
Definition at line 233 of file AnnealPlacer.cpp.
Mapping AnnealPlacer::placeOpGraph | ( | float | temp | ) |
Definition at line 640 of file AnnealPlacer.cpp.
|
inlineprivate |
Definition at line 320 of file ClusteredMapper.h.
|
inlineprivate |
Definition at line 321 of file ClusteredMapper.h.
|
inlineprivate |
Definition at line 345 of file ClusteredMapper.h.
|
inlineprivate |
Definition at line 344 of file ClusteredMapper.h.
|
private |
places and removes an op from an mrrgnode
Definition at line 221 of file AnnealPlacer.cpp.
void AnnealPlacer::setInitialPlacement | ( | ) |
Definition at line 620 of file AnnealPlacer.cpp.
|
inlineprivate |
Definition at line 313 of file ClusteredMapper.h.
|
private |
Definition at line 514 of file AnnealPlacer.cpp.
|
private |
Definition at line 328 of file ClusteredMapper.h.
|
private |
Definition at line 338 of file ClusteredMapper.h.
|
private |
Definition at line 336 of file ClusteredMapper.h.
|
private |
Definition at line 339 of file ClusteredMapper.h.
|
private |
Definition at line 341 of file ClusteredMapper.h.
|
private |
Definition at line 329 of file ClusteredMapper.h.
|
private |
Definition at line 330 of file ClusteredMapper.h.
|
private |
Definition at line 340 of file ClusteredMapper.h.
|
private |
Definition at line 331 of file ClusteredMapper.h.
|
private |
Definition at line 342 of file ClusteredMapper.h.
|
private |
Definition at line 332 of file ClusteredMapper.h.
|
mutableprivate |
Definition at line 337 of file ClusteredMapper.h.
|
private |
Definition at line 327 of file ClusteredMapper.h.