#include <boost/config.hpp>
#include <iostream>
#include <fstream>
#include <boost/graph/graph_traits.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/graphviz.hpp>
#include <boost/graph/copy.hpp>
#include <queue>
#include <map>
#include <list>
#include <bitset>
#include <algorithm>
Go to the source code of this file.
|
std::string | removeCurlyBrackets (const std::string &input) |
|
std::string | gNames_deliemter_changes (std::string gNames) |
|
std::string | string_remover (std::string original_string, std::string toRemove) |
|
void | jsonUppercase (json &j) |
|
std::string | readCommentSection (std::ifstream &inputFile) |
|
bool | skipPlacement (std::string hOpcode, json &jsonParsed) |
|
bool | needLocking (int HID, json &jsonParsed, std::string &jsonLockNode) |
|
void | readDeviceModelPragma (std::ifstream &deviceModelFile, json &UgrammPragmaConfig) |
|
void | readApplicationGraphPragma (std::ifstream &applicationGraphFile, json &UgrammPragmaConfig) |
|
bool | widthCheck (int hWidth, int gWidth) |
| Checks if the application graph's node width is less than or equal to the device model's node width.
|
|
bool | compatibilityCheck (int gID, int hID, std::map< int, NodeConfig > *hConfig, std::map< int, NodeConfig > *gConfig) |
|
void | printRoutingResults (int y, std::ofstream &positionedOutputFile, std::ofstream &unpositionedOutputFile, std::map< int, NodeConfig > *hConfig, std::map< int, NodeConfig > *gConfig) |
|
void | mandatoryFunCellConnections (int gNumber, std::string FunCellName, DirectedGraph *G, std::ofstream &positionedOutputFile, std::ofstream &unpositionedOutputFile) |
|
void | printPlacementResults (int gNumber, std::string gName, DirectedGraph *G, std::ofstream &positionedOutputFile, std::ofstream &unpositionedOutputFile, std::map< int, NodeConfig > *gConfig, json &ugrammConfig) |
|
void | printMappedResults (DirectedGraph *H, DirectedGraph *G, std::map< int, NodeConfig > *hConfig, std::map< int, NodeConfig > *gConfig, json &UgrammPragmaConfig) |
|
void | printName (int n) |
|
void | printVertexModels (DirectedGraph *H, DirectedGraph *G, std::map< int, NodeConfig > *hConfig, std::map< int, int > &invUsers) |
|
void | printRouting (int signal) |
|
void | readDeviceModel (DirectedGraph *G, std::map< int, NodeConfig > *gConfig) |
|
void | readApplicationGraph (DirectedGraph *H, std::map< int, NodeConfig > *hConfig, std::map< int, NodeConfig > *gConfig) |
|
◆ FunCell_Visual_Enable
#define FunCell_Visual_Enable 1 |
◆ PinCell_Visual_Enable
#define PinCell_Visual_Enable 1 |
◆ RouteCell_Visual_Enable
#define RouteCell_Visual_Enable 0 |
◆ VISUAL_SCALE
◆ compatibilityCheck()
bool compatibilityCheck |
( |
int | gID, |
|
|
int | hID, |
|
|
std::map< int, NodeConfig > * | hConfig, |
|
|
std::map< int, NodeConfig > * | gConfig ) |
Checks whether the current opcode required by the application node is supported by the device model node.
This function determines if the opcode needed by the application node (represented by hOpcode
) is compatible with or supported by the device model node type (represented by gType
).
- Parameters
-
gType | The type of the device model node. [ALU, MemPort etc..] |
hOpcode | The opcode required by the application node. [FMUL, FADD, INPUT, OUTPUT] |
hConfig | A map containing node configuration details of device-model graph. |
gConfig | A map containing node configuration details of device-model graph. |
- Returns
- bool Returns true if the opcode is supported by the device model node, false otherwise.
◆ gNames_deliemter_changes()
std::string gNames_deliemter_changes |
( |
std::string | gNames | ) |
|
Changes the delimiters in the given string from "." to "_" (neato dot format does not support "." delimiter in the node name)
- Parameters
-
gNames | The input string to modify. |
- Returns
- A new string with updated delimiters.
Changes the delimiters in the given string from "." to "_" (neato dot format does not support "." delimiter in the node name)
◆ jsonUppercase()
void jsonUppercase |
( |
json & | j | ) |
|
Converts all keys and values of the parsed JSON object to uppercase for normalization.
- Parameters
-
j | Reference to the JSON object to be normalized. |
Converts all keys and values of the parsed JSON object to uppercase for normalization.
◆ mandatoryFunCellConnections()
void mandatoryFunCellConnections |
( |
int | gNumber, |
|
|
std::string | FunCellName, |
|
|
DirectedGraph * | G, |
|
|
std::ofstream & | positionedOutputFile, |
|
|
std::ofstream & | unpositionedOutputFile ) |
Connects associated pins to the specified FunCell in the device model graph.
- Parameters
-
gNumber | A boost node id from the device-model graph. |
FunCellName | The name of the FunCell to connect. |
G | Pointer to the directed graph representing the device model. |
positionedOutputFile | Output file stream for positioned connections. |
unpositionedOutputFile | Output file stream for unpositioned connections. |
Connects associated pins to the specified FunCell in the device model graph.
◆ needLocking()
bool needLocking |
( |
int | HID, |
|
|
json & | jsonParsed, |
|
|
std::string & | jsonLockNode ) |
Checks whether locking is required for the given hNamed based on the information given in the JSON. In JSON, we define the locking code as "hName::gName"
- Parameters
-
HID | Current HID of the application graph |
jsonParsed | Reference to the parsed JSON object containing node type information. |
jsonLockNode | Retrieved full string of the lock node from the JSON file only is a lock exist for a specific node in application graph |
- Returns
- bool Returns true if locking is required, false otherwise.
Checks whether locking is required for the given hNamed based on the information given in the JSON. In JSON, we define the locking code as "hName::gName"
◆ printMappedResults()
Prints mapping results in neato format: First displays the layout and then shows connections between the nodes.
- Parameters
-
H | A pointer to the application graph. |
G | A pointer to the device-model graph. |
hConfig | A map containing node configuration details of application graph. |
gConfig | A map containing node configuration details of device-model graph. |
ugrammConfig | A map containing parsed pragma and config related information. |
Prints mapping results in neato format: First displays the layout and then shows connections between the nodes.
◆ printName()
Prints the device model cell name corresponding to a given boost id number from device model graph.
- Parameters
-
Prints the device model cell name corresponding to a given boost id number from device model graph.
◆ printPlacementResults()
void printPlacementResults |
( |
int | gNumber, |
|
|
std::string | gName, |
|
|
DirectedGraph * | G, |
|
|
std::ofstream & | positionedOutputFile, |
|
|
std::ofstream & | unpositionedOutputFile, |
|
|
std::map< int, NodeConfig > * | gConfig, |
|
|
json & | UgrammPragmaConfig ) |
Prints placement information to a mapping-output file.
- Parameters
-
gNumber | A boost node id from the device-model graph. |
gName | An integer used in the output. |
G | A pointer to the device-model graph. |
positionedOutputFile | The positioned-output dot file stream (this dot-file contains actual co-ordinates of the node cells). |
unpositionedOutputFile | The unpositioned-output dot file stream (this dot-file does not contain any co-ordinates of the node cells). |
gConfig | A map containing node configuration details of device-model graph. |
ugrammConfig | A map containing parsed pragma and config related information. |
Prints placement information to a mapping-output file.
◆ printRouting()
void printRouting |
( |
int | signal | ) |
|
Prints the routing details for the given signal.
- Parameters
-
signal | The signal for which to print routing details. |
Prints the routing details for the given signal.
◆ printRoutingResults()
void printRoutingResults |
( |
int | y, |
|
|
std::ofstream & | positionedOutputFile, |
|
|
std::ofstream & | unpositionedOutputFile, |
|
|
std::map< int, NodeConfig > * | hConfig, |
|
|
std::map< int, NodeConfig > * | gConfig ) |
Prints routing information to a mapping-output file.
- Parameters
-
gNumber | A boost node id from the device-model graph. |
y | A boost node id from the application graph. |
positionedOutputFile | The positioned-output dot file stream (this dot-file contains actual co-ordinates of the node cells). |
unpositionedOutputFile | The unpositioned-output dot file stream (this dot-file does not contain any co-ordinates of the node cells). |
hConfig | A map containing node configuration details of device-model graph. |
gConfig | A map containing node configuration details of device-model graph. |
Prints routing information to a mapping-output file.
◆ printVertexModels()
Prints vertex models of the application graph's nodes.
- Parameters
-
H | A pointer to the application graph. |
G | A pointer to the device-model graph. |
hConfig | A map containing node configuration details of device-model graph. |
invUsers | A map of hIDs to mapped gIDs. |
Prints vertex models of the application graph's nodes.
◆ readApplicationGraph()
Reads a DOT file and stores attributes into the application graph.
- Parameters
-
H | Pointer to the directed graph representing the application graph. |
hConfig | Pointer to the map where node attributes will be stored. |
gConfig | Pointer to the map where node attributes will be stored. |
Reads a DOT file and stores attributes into the application graph.
◆ readApplicationGraphPragma()
void readApplicationGraphPragma |
( |
std::ifstream & | applicationGraphFile, |
|
|
json & | UgrammPragmaConfig ) |
Reads, checks, and stores PRAGMA directives from the application graph file.
- Parameters
-
applicationGraphFile | Reference to the input file stream for the application graph. |
UgrammPragmaConfig | Reference to the map where PRAGMA directives will be stored. |
Reads, checks, and stores PRAGMA directives from the application graph file.
◆ readCommentSection()
std::string readCommentSection |
( |
std::ifstream & | inputFile | ) |
|
Reads a multi-line comment containing PRAGMA from the given file.
- Parameters
-
inputFile | Reference to the input file stream from which to read the comment section. |
- Returns
- std::string Returns the content of the multi-line comment as a string.
Reads a multi-line comment containing PRAGMA from the given file.
◆ readDeviceModel()
Reads a DOT file and stores attributes into the device model graph.
- Parameters
-
G | Pointer to the directed graph representing the device model. |
gConfig | Pointer to the map where node attributes will be stored. |
Reads a DOT file and stores attributes into the device model graph.
◆ readDeviceModelPragma()
void readDeviceModelPragma |
( |
std::ifstream & | deviceModelFile, |
|
|
json & | UgrammPragmaConfig ) |
Reads, checks, and stores PRAGMA directives from the device model file.
- Parameters
-
deviceModelFile | Reference to the input file stream for the device model. |
UgrammPragmaConfig | Reference to the map where PRAGMA directives will be stored. |
Reads, checks, and stores PRAGMA directives from the device model file.
◆ removeCurlyBrackets()
std::string removeCurlyBrackets |
( |
const std::string & | input | ) |
|
Removes the curly brackets '{' and '}' from the given string. The kernels present in CGRA-ME have {} included in the node names, which hinders dot visualization.
- Parameters
-
input | The input string from which curly brackets should be removed. |
- Returns
- A new string with the curly brackets removed. If no curly brackets are found, the original string is returned unchanged.
Removes the curly brackets '{' and '}' from the given string. The kernels present in CGRA-ME have {} included in the node names, which hinders dot visualization.
◆ skipPlacement()
bool skipPlacement |
( |
std::string | hOpcode, |
|
|
json & | jsonParsed ) |
Checks whether placement is required for the given opcode based on the information given in the JSON. In JSON, we can either have opcode("Reg") or nodeType("ALU/Memport") to be skipped.
- Parameters
-
hOpcode | The opcode from the application graph to check. |
jsonParsed | Reference to the parsed JSON object containing node type information. |
- Returns
- bool Returns true if placement is required, false otherwise.
Checks whether placement is required for the given opcode based on the information given in the JSON. In JSON, we can either have opcode("Reg") or nodeType("ALU/Memport") to be skipped.
◆ string_remover()
std::string string_remover |
( |
std::string | original_string, |
|
|
std::string | toRemove ) |
Removes a specified substring from the original string.
- Parameters
-
original_string | The original string. |
toRemove | The substring to remove. |
- Returns
- A new string with the substring removed.
Removes a specified substring from the original string.
◆ widthCheck()
bool widthCheck |
( |
int | hWidth, |
|
|
int | gWidth ) |
Checks if the application graph's node width is less than or equal to the device model's node width.
- Parameters
-
hWidth | Width of node in the application graph. |
gWidth | Width of node in the device model. |
- Returns
true
if hWidth
is less than or equal to gWidth
, otherwise false
.
Checks if the application graph's node width is less than or equal to the device model's node width.
◆ colors
std::vector<std::string> colors |
|
extern |
◆ funCellMapping
std::map<std::string, std::string> funCellMapping |
|
extern |
◆ input_pin_color
std::string input_pin_color |
|
extern |
◆ output_pin_color
std::string output_pin_color |
|
extern |
◆ unused_cell_color
std::string unused_cell_color |
|
extern |