From 0dfd5ac56119e88518907a2e8171571445f8c00e Mon Sep 17 00:00:00 2001 From: Gwen Date: Mon, 12 Dec 2022 10:17:57 -0700 Subject: [PATCH] Remove llyr from release --- src/sst/elements/llyr/Makefile.am | 69 - src/sst/elements/llyr/configure.m4 | 12 - src/sst/elements/llyr/graph/edge.h | 81 - src/sst/elements/llyr/graph/graph.h | 297 --- src/sst/elements/llyr/graph/vertex.h | 153 -- src/sst/elements/llyr/llyr.cc | 574 ----- src/sst/elements/llyr/llyr.h | 166 -- src/sst/elements/llyr/llyrTypes.h | 358 --- src/sst/elements/llyr/lsQueue.h | 166 -- src/sst/elements/llyr/mappers/gemmMapper.h | 2166 ----------------- src/sst/elements/llyr/mappers/llyrMapper.h | 185 -- src/sst/elements/llyr/mappers/mapperList.h | 23 - src/sst/elements/llyr/mappers/pyMapper.h | 317 --- src/sst/elements/llyr/mappers/simpleMapper.h | 231 -- src/sst/elements/llyr/parser/instruction.h | 0 src/sst/elements/llyr/parser/parser.cc | 1913 --------------- src/sst/elements/llyr/parser/parser.h | 113 - src/sst/elements/llyr/pes/complexPE.h | 158 -- src/sst/elements/llyr/pes/controlPE.h | 181 -- src/sst/elements/llyr/pes/dummyPE.h | 51 - src/sst/elements/llyr/pes/fpPE.h | 238 -- src/sst/elements/llyr/pes/intPE.h | 262 -- src/sst/elements/llyr/pes/loadPE.h | 288 --- src/sst/elements/llyr/pes/logicPE.h | 297 --- src/sst/elements/llyr/pes/peList.h | 28 - src/sst/elements/llyr/pes/processingElement.h | 237 -- src/sst/elements/llyr/pes/storePE.h | 303 --- src/sst/elements/llyr/tests/gemm.in | 56 - src/sst/elements/llyr/tests/graph_mesh_25.hdw | 107 - src/sst/elements/llyr/tests/int-1.mem | 1 - src/sst/elements/llyr/tests/llyr_test.py | 74 - .../llyr/tests/refFiles/llyr_test.out | 175 -- .../llyr/tests/testsuite_default_llyr.py | 105 - src/sst/elements/llyr/tools/gemm_gen.py | 245 -- src/sst/elements/llyr/tools/graphGen.py | 128 - src/sst/elements/llyr/tools/graph_gen.py | 90 - src/sst/elements/llyr/tools/pyMapper.py | 7 - src/sst/elements/llyr/tools/spmm_gen.py | 301 --- src/sst/elements/llyr/tools/vf3_to_hwr.py | 57 - 39 files changed, 10213 deletions(-) delete mode 100644 src/sst/elements/llyr/Makefile.am delete mode 100644 src/sst/elements/llyr/configure.m4 delete mode 100644 src/sst/elements/llyr/graph/edge.h delete mode 100644 src/sst/elements/llyr/graph/graph.h delete mode 100644 src/sst/elements/llyr/graph/vertex.h delete mode 100644 src/sst/elements/llyr/llyr.cc delete mode 100644 src/sst/elements/llyr/llyr.h delete mode 100644 src/sst/elements/llyr/llyrTypes.h delete mode 100644 src/sst/elements/llyr/lsQueue.h delete mode 100644 src/sst/elements/llyr/mappers/gemmMapper.h delete mode 100644 src/sst/elements/llyr/mappers/llyrMapper.h delete mode 100644 src/sst/elements/llyr/mappers/mapperList.h delete mode 100644 src/sst/elements/llyr/mappers/pyMapper.h delete mode 100644 src/sst/elements/llyr/mappers/simpleMapper.h delete mode 100644 src/sst/elements/llyr/parser/instruction.h delete mode 100644 src/sst/elements/llyr/parser/parser.cc delete mode 100644 src/sst/elements/llyr/parser/parser.h delete mode 100644 src/sst/elements/llyr/pes/complexPE.h delete mode 100644 src/sst/elements/llyr/pes/controlPE.h delete mode 100644 src/sst/elements/llyr/pes/dummyPE.h delete mode 100644 src/sst/elements/llyr/pes/fpPE.h delete mode 100644 src/sst/elements/llyr/pes/intPE.h delete mode 100644 src/sst/elements/llyr/pes/loadPE.h delete mode 100644 src/sst/elements/llyr/pes/logicPE.h delete mode 100644 src/sst/elements/llyr/pes/peList.h delete mode 100644 src/sst/elements/llyr/pes/processingElement.h delete mode 100644 src/sst/elements/llyr/pes/storePE.h delete mode 100644 src/sst/elements/llyr/tests/gemm.in delete mode 100644 src/sst/elements/llyr/tests/graph_mesh_25.hdw delete mode 100644 src/sst/elements/llyr/tests/int-1.mem delete mode 100644 src/sst/elements/llyr/tests/llyr_test.py delete mode 100644 src/sst/elements/llyr/tests/refFiles/llyr_test.out delete mode 100644 src/sst/elements/llyr/tests/testsuite_default_llyr.py delete mode 100755 src/sst/elements/llyr/tools/gemm_gen.py delete mode 100755 src/sst/elements/llyr/tools/graphGen.py delete mode 100755 src/sst/elements/llyr/tools/graph_gen.py delete mode 100644 src/sst/elements/llyr/tools/pyMapper.py delete mode 100755 src/sst/elements/llyr/tools/spmm_gen.py delete mode 100755 src/sst/elements/llyr/tools/vf3_to_hwr.py diff --git a/src/sst/elements/llyr/Makefile.am b/src/sst/elements/llyr/Makefile.am deleted file mode 100644 index 1e4acc1eae..0000000000 --- a/src/sst/elements/llyr/Makefile.am +++ /dev/null @@ -1,69 +0,0 @@ -# -*- Makefile -*- -# -# - -compdir = $(pkglibdir) -comp_LTLIBRARIES = libllyr.la -libllyr_la_SOURCES = \ - llyrTypes.h \ - llyr.h \ - llyr.cc \ - graph/graph.h \ - graph/edge.h \ - graph/vertex.h \ - parser/parser.h \ - parser/parser.cc \ - mappers/llyrMapper.h \ - mappers/simpleMapper.h \ - mappers/pyMapper.h \ - mappers/gemmMapper.h \ - pes/processingElement.h \ - pes/dummyPE.h \ - pes/fpPE.h \ - pes/intPE.h \ - pes/logicPE.h \ - pes/loadPE.h \ - pes/storePE.h \ - pes/complexPE.h \ - lsQueue.h - -deprecated_libllyr_sources = - -libllyr_la_CFLAGS = \ - $(AM_CLFAGS) \ - $(LLVM_CFLAGS) - -libllyr_la_CXXFLAGS = \ - $(AM_CXXFLAGS) \ - $(LLVM_CXXFLAGS) -fexceptions - -libllyr_la_CPPFLAGS = \ - -I$(top_srcdir)/src \ - $(AM_CPPFLAGS) -fPIC -Wall \ - $(MPI_CPPFLAGS) \ - $(LLVM_CPPFLAGS) - -libllyr_la_LDFLAGS = \ - -module \ - -avoid-version \ - $(AM_LDFLAGS) \ - $(LLVM_LDFLAGS) - -if !SST_ENABLE_PREVIEW_BUILD -libllyr_la_SOURCES += $(deprecated_libsimpleElementExample_sources) -endif - -EXTRA_DIST = \ - tests/llyr_test.py - -deprecated_EXTRA_DIST = - -if !SST_ENABLE_PREVIEW_BUILD -EXTRA_DIST += $(deprecated_EXTRA_DIST) -endif - -install-exec-hook: - $(SST_REGISTER_TOOL) SST_ELEMENT_SOURCE llyr=$(abs_srcdir) - $(SST_REGISTER_TOOL) SST_ELEMENT_TESTS llyr=$(abs_srcdir)/tests - - diff --git a/src/sst/elements/llyr/configure.m4 b/src/sst/elements/llyr/configure.m4 deleted file mode 100644 index 978a2fa95d..0000000000 --- a/src/sst/elements/llyr/configure.m4 +++ /dev/null @@ -1,12 +0,0 @@ -dnl -*- Autoconf -*- - -AC_DEFUN([SST_llyr_CONFIG], [ - sst_check_llyrx="yes" - - SST_CHECK_LLVM_CONFIG([have_llvm=1], - [have_llvm=0], - [AC_MSG_ERROR([LLVM libraries required, but not found])]) - - AS_IF([test "$have_llvm" = 1], [sst_check_llyrx="yes"], [sst_check_llyrx="no"]) - AS_IF([test "$sst_check_llyrx" = "yes"], [$1], [$2]) -]) diff --git a/src/sst/elements/llyr/graph/edge.h b/src/sst/elements/llyr/graph/edge.h deleted file mode 100644 index 258178338d..0000000000 --- a/src/sst/elements/llyr/graph/edge.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef _LLYR_G_EDGE_H -#define _LLYR_G_EDGE_H - -#include -#include - -#include - -namespace SST { -namespace Llyr { - -struct EdgeProperties -{ - float weight_; -}; - -class Edge -{ -private: - EdgeProperties* properties_; - uint32_t destinationVertex_; - -protected: - -public: - explicit Edge( uint32_t vertexIn ) - { - properties_ = NULL; - destinationVertex_ = vertexIn; - } - explicit Edge( EdgeProperties* properties, uint32_t vertexIn ) - { - properties_ = properties; - destinationVertex_ = vertexIn; - } - ~Edge(); - - bool setProperties( EdgeProperties* properties ) - { - properties_ = properties; - return true; - } - - EdgeProperties* getProperties( void ) const - { - return properties_; - } - - uint32_t getDestination( void ) const - { - return destinationVertex_; - } - -}; //END Edge - - - - -} // namespace LLyr -} // namespace SST - -#endif - - - diff --git a/src/sst/elements/llyr/graph/graph.h b/src/sst/elements/llyr/graph/graph.h deleted file mode 100644 index eeb870a536..0000000000 --- a/src/sst/elements/llyr/graph/graph.h +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef _LLYR_GRAPH_H -#define _LLYR_GRAPH_H - -// enable debugging in the graph lib -// #define GRAPH_DEBUG - -#include -#include - -#include "edge.h" -#include "vertex.h" - -#include -#include -#include -#include -#include - -namespace SST { -namespace Llyr { - - -template -class LlyrGraph -{ - -private: - uint32_t vertices_; - std::map< uint32_t, Vertex< T > >* vertex_map_; - -protected: - -public: - LlyrGraph(); - ~LlyrGraph(); - - uint32_t operator []( const Vertex< T >& value ) const; - - static void copyGraph( const LlyrGraph< T > &graphIn, LlyrGraph< T > &graphOut ); - - void printGraph(); - void printDot( std::string fileName ); - - uint32_t outEdges( uint32_t vertexId ); - uint32_t numVertices() const; - - bool addEdge( uint32_t beginVertex, uint32_t endVertex ); - bool addEdge( uint32_t beginVertex, uint32_t endVertex, EdgeProperties* properties ); - - uint32_t addVertex( T type ); - uint32_t addVertex( uint32_t vertexNum, T type ); - - Vertex* getVertex( uint32_t vertexNum ) const; - void setVertex( uint32_t vertexNum, const Vertex &vertex ); - - std::map< uint32_t, Vertex >* getVertexMap( void ) const; - -}; - -template -LlyrGraph::LlyrGraph() -{ - vertex_map_ = new std::map< uint32_t, Vertex >; - vertices_ = 0; -} - -template -LlyrGraph::~LlyrGraph() -{} - -template -uint32_t LlyrGraph::operator []( const Vertex& value ) const -{ - for( auto it = vertex_map_->begin(); it != vertex_map_ ->end(); ++it ) { - if( it->second == value ) { - return it->first; - } - } - - return 0; -} - -template -void LlyrGraph::copyGraph( const LlyrGraph &graphIn, LlyrGraph &graphOut ) -{ - //container of input -> output vertex mappings - std::map< uint32_t, uint32_t > vertexMappings; - - //add all of the vertices in the input graph to the output graph - auto vertexMap = graphIn.getVertexMap(); - for( auto vertexIterator = vertexMap->begin(); vertexIterator != vertexMap ->end(); ++vertexIterator ) { - auto vertexIn = vertexIterator->second; - uint32_t newVertex = graphOut.addVertex(vertexIn.getValue()); - - auto retVal = vertexMappings.emplace( vertexIterator->first, newVertex ); - if( retVal.second == false ) { - ///TODO - } - -#ifdef GRAPH_DEBUG - std::cout << "Old: " << vertexIterator->first << " New: " << newVertex << std::endl; -#endif - } - - //go back and add all of the outEdges - for( auto vertexIterator = vertexMap->begin(); vertexIterator != vertexMap ->end(); ++vertexIterator ) { - uint32_t sourceVertex = vertexMappings[vertexIterator->first]; -// std::cout << "\n Adjacency list of vertex " << vertexIterator->first << "\n head "; - std::vector< Edge* >* adjacencyList = vertexIterator->second.getAdjacencyList(); - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); ++it ) { -// std::cout << "-> " << (*it)->getDestination(); - - EdgeProperties* tempProperties = (*it)->getProperties(); - uint32_t destinationVertex = vertexMappings[(*it)->getDestination()]; -// std::cout << "SRC: " << vertexIterator->first << " DST: " << (*it)->getDestination() << std::endl; -// std::cout << "SRC: " << sourceVertex << " DST: " << destinationVertex << std::endl; - graphOut.addEdge(sourceVertex, destinationVertex, tempProperties); - - } -// std::cout << std::endl; - } - -} - -template -void LlyrGraph::printGraph(void) -{ - typename std::map< uint32_t, Vertex >::iterator vertexIterator; - for(vertexIterator = vertex_map_->begin(); vertexIterator != vertex_map_->end(); ++vertexIterator) { - std::cout << "\n Adjacency list of vertex " << vertexIterator->first << "\n head "; - - std::vector< Edge* >* adjacencyList = vertexIterator->second.getAdjacencyList(); - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); ++it ) { - std::cout << "-> " << (*it)->getDestination(); - } - std::cout << std::endl; - } -} - -template -void LlyrGraph::printDot( std::string fileName ) -{ - std::ofstream outputFile(fileName.c_str(), std::ios::trunc); //open a file for writing (truncate the current contents) - if ( !outputFile ) //check to be sure file is open - std::cerr << "Error opening file."; - - outputFile << "digraph G {" << "\n"; - - typename std::map< uint32_t, Vertex >::iterator vertexIterator; - for(vertexIterator = vertex_map_->begin(); vertexIterator != vertex_map_->end(); ++vertexIterator) { - outputFile << vertexIterator->first << "[label=\""; - outputFile << vertexIterator->second.getValue(); - outputFile << "\"];\n"; - } - - for(vertexIterator = vertex_map_->begin(); vertexIterator != vertex_map_->end(); ++vertexIterator) { - std::vector< Edge* >* adjacencyList = vertexIterator->second.getAdjacencyList(); - - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); ++it ) { - outputFile << vertexIterator->first; - outputFile << "->"; - outputFile << (*it)->getDestination(); - outputFile << "\n"; - } - } - - outputFile << "}"; - outputFile.close(); -} - -template -uint32_t LlyrGraph::outEdges(uint32_t vertexId) -{ - return vertex_map_->at(vertexId).adjacencyList_->size(); -} - -template -uint32_t LlyrGraph::numVertices(void) const -{ - return vertices_; -} - -template -bool LlyrGraph::addEdge( uint32_t beginVertex, uint32_t endVertex ) -{ - Edge* edge = new Edge( endVertex ); - - if( vertex_map_->at(beginVertex).addEdge(edge) ) { - #ifdef GRAPH_DEBUG - std::cout << "add edge: " << beginVertex << " --> " << endVertex << "\n" << std::endl; - #endif - vertex_map_->at(beginVertex).addOutDegree(); - vertex_map_->at(endVertex).addInDegree(); - - return 1; - } - - return 0; -} - -template -bool LlyrGraph::addEdge( uint32_t beginVertex, uint32_t endVertex, EdgeProperties* properties ) -{ - Edge* edge = new Edge( properties, endVertex ); - - if( vertex_map_->at(beginVertex).addEdge(edge) ) { - #ifdef GRAPH_DEBUG - std::cout << "add edge: " << beginVertex << " --> " << endVertex << "\n" << std::endl; - #endif - vertex_map_->at(beginVertex).addOutDegree(); - vertex_map_->at(endVertex).addInDegree(); - return 1; - } - - return 0; -} - -template -uint32_t LlyrGraph::addVertex(T type) -{ - Vertex vertex; - vertex.setValue(type); - uint32_t vertexNum = vertices_; - -#ifdef GRAPH_DEBUG - std::cout << "add vertex: " << vertexNum << "\n" << std::endl; -#endif - - auto retVal = vertex_map_->emplace( vertexNum, vertex ); - if( retVal.second == false ) { - ///TODO - } - - vertices_ = vertices_ + 1; - return vertexNum; -} - -template -uint32_t LlyrGraph::addVertex(uint32_t vertexNum, T type) -{ - Vertex vertex; - vertex.setValue(type); - -#ifdef GRAPH_DEBUG - std::cout << "add vertex: " << vertexNum << "\n" << std::endl; -#endif - - auto retVal = vertex_map_->emplace( vertexNum, vertex ); - if( retVal.second == false ) { - ///TODO - } - - vertices_ = vertices_ + 1; - return vertexNum; -} - -template -Vertex* LlyrGraph::getVertex( uint32_t vertexNum ) const -{ - return &vertex_map_->at(vertexNum); -} - -template -void LlyrGraph::setVertex( uint32_t vertexNum, const Vertex &vertex ) -{ - vertex_map_->at(vertexNum) = vertex; -} - -template -std::map< uint32_t, Vertex >* LlyrGraph::getVertexMap( void ) const -{ - return vertex_map_; -} - -} // namespace LLyr -} // namespace SST - -#endif - - - diff --git a/src/sst/elements/llyr/graph/vertex.h b/src/sst/elements/llyr/graph/vertex.h deleted file mode 100644 index ed15142652..0000000000 --- a/src/sst/elements/llyr/graph/vertex.h +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef _LLYR_G_VERTEX_H -#define _LLYR_G_VERTEX_H - -#include -#include - -#include -#include - -#include "edge.h" - -namespace SST { -namespace Llyr { - -struct VertexProperties -{ - -}; - -template -class Vertex -{ -private: - T value_; - bool visited_; - uint32_t numInEdges_; - uint32_t numOutEdges_; - - std::vector< Edge* >* adjacencyList_; - -protected: - -public: - Vertex() - { - adjacencyList_ = new std::vector< Edge* >; - visited_ = 0; - numInEdges_ = 0; - numOutEdges_ = 0; - } - - Vertex( T typeIn ) : value_(typeIn) - { - adjacencyList_ = new std::vector< Edge* >; - visited_ = 0; - numInEdges_ = 0; - numOutEdges_ = 0; - } - - Vertex(const Vertex &valueIn) - { - value_ = valueIn.value_; - visited_ = valueIn.visited_; - numInEdges_ = valueIn.numInEdges_; - numOutEdges_ = valueIn.numOutEdges_; - adjacencyList_ = new std::vector< Edge* >(*(valueIn.adjacencyList_)); - } - - bool operator == (const Vertex &valueIn) const - { - return(this->value_ == valueIn.getValue()); - } - - void setValue( T typeIn ) - { - value_ = typeIn; - } - - T getValue( void ) const - { - return value_; - } - - void setVisited( bool visitIn ) - { - visited_ = visitIn; - } - - bool getVisited( void ) const - { - return visited_; - } - - std::vector< Edge* >* getAdjacencyList( void ) const - { - return adjacencyList_; - } - - bool addEdge( Edge* edgeIn ) - { - bool found = 0; - std::vector< Edge* >* adjacencyList = getAdjacencyList(); - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); ++it ) { - if( edgeIn->getDestination() == (*it)->getDestination() ) { - found = 1; - break; - } - } - - if(found == 1) { - return 0; - } else { - adjacencyList_->push_back(edgeIn); - return 1; - } - } - - void addInDegree() - { - ++numInEdges_; - } - - uint32_t getInDegree() const - { - return numInEdges_; - } - - void addOutDegree() - { - ++numOutEdges_; - } - - uint32_t getOutDegree() const - { - return numOutEdges_; - } - -}; //END Vertex - - -} // namespace LLyr -} // namespace SST - -#endif - - - diff --git a/src/sst/elements/llyr/llyr.cc b/src/sst/elements/llyr/llyr.cc deleted file mode 100644 index 29df5fff34..0000000000 --- a/src/sst/elements/llyr/llyr.cc +++ /dev/null @@ -1,574 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#include -#include - -#include -#include -#include -#include -#include - -#include "llyr.h" -#include "llyrTypes.h" -#include "parser/parser.h" -#include "mappers/mapperList.h" - -namespace SST { -namespace Llyr { - -LlyrComponent::LlyrComponent(ComponentId_t id, Params& params) : - Component(id) -{ - //initial params - clock_enabled_ = 1; - compute_complete = 0; - const uint32_t verbosity = params.find< uint32_t >("verbose", 0); - - //setup up i/o for messages - char prefix[256]; - sprintf(prefix, "[t=@t][%s]: ", getName().c_str()); - output_ = new SST::Output(prefix, verbosity, 0, Output::STDOUT); - - //tell the simulator not to end without us - registerAsPrimaryComponent(); - primaryComponentDoNotEndSim(); - - //set our Main Clock - const std::string clock_rate = params.find< std::string >("clock", "1.0GHz"); - output_->verbose(CALL_INFO, 1, 0, "Clock is configured for %s\n", clock_rate.c_str()); - clock_tick_handler_ = new Clock::Handler(this, &LlyrComponent::tick); - time_converter_ = registerClock(clock_rate, clock_tick_handler_); - - //set up memory interfaces - mem_interface_ = loadUserSubComponent("iface", ComponentInfo::SHARE_NONE, time_converter_, - new StandardMem::Handler(this, &LlyrComponent::handleEvent)); - - if( !mem_interface_ ) { - std::string interfaceName = params.find("memoryinterface", "memHierarchy.memInterface"); - output_->verbose(CALL_INFO, 1, 0, "Memory interface to be loaded is: %s\n", interfaceName.c_str()); - - Params interfaceParams = params.get_scoped_params("memoryinterfaceparams"); - interfaceParams.insert("port", "cache_link"); - mem_interface_ = loadAnonymousSubComponent(interfaceName, "iface", 0, ComponentInfo::SHARE_PORTS | - ComponentInfo::INSERT_STATS, interfaceParams, time_converter_, new StandardMem::Handler(this, &LlyrComponent::handleEvent)); - - if( !mem_interface_ ) { - output_->fatal(CALL_INFO, -1, "%s, Error loading memory interface\n", getName().c_str()); - } - } - - // set up device address space - starting_addr_ = params.find< uint64_t >("starting_addr", 0); - - // set up MMIO address for device - device_addr_ = params.find< uint64_t >("device_addr", 0); - if( device_addr_ != 0x00 ) { - clock_enabled_ = 0; - mem_interface_->setMemoryMappedAddressRegion(device_addr_, 1); - } - - //need a 'global' LS queue for reordering - ls_queue_ = new LSQueue(); - ls_entries_ = params.find< uint32_t >("ls_entries", 1); - - mem_handlers_ = new LlyrMemHandlers(this, ls_queue_, output_); - - //set up param struct - uint16_t queue_depth = params.find< uint16_t >("queue_depth", 256); - uint16_t arith_latency = params.find< uint16_t >("arith_latency", 1); - uint16_t int_latency = params.find< uint16_t >("int_latency", 1); - uint16_t fp_latency = params.find< uint16_t >("fp_latency", 1); - uint16_t fp_mul_latency = params.find< uint16_t >("fp_mul_latency", 1); - uint16_t fp_div_latency = params.find< uint16_t >("fp_div_latency", 1); - std::string mapping_tool_ = params.find< std::string >("mapping_tool", ""); - - configData_ = new LlyrConfig { ls_queue_, mem_interface_, starting_addr_, mapping_tool_, verbosity, queue_depth, - arith_latency, int_latency, fp_latency, fp_mul_latency, fp_div_latency }; - - memFileName_ = params.find("mem_init", ""); - - //construct hardware graph - std::string const& hwFileName = params.find< std::string >("hardware_graph", "hardware.cfg"); - constructHardwareGraph(hwFileName); - - //construct application graph - std::string const& swFileName = params.find< std::string >("application", "app.in"); - constructSoftwareGraph(swFileName); - - //do the mapping - Params mapperParams; //empty but needed for loadModule API - std::string mapperName = params.find("mapper", "llyr.mapper.simple"); - llyr_mapper_ = loadModule(mapperName, mapperParams); - output_->verbose(CALL_INFO, 1, 0, "Mapping application to hardware with %s\n", mapperName.c_str()); - llyr_mapper_->mapGraph(hardwareGraph_, applicationGraph_, mappedGraph_, configData_); - mappedGraph_.printDot("llyr_mapped.dot"); - //all done - output_->verbose(CALL_INFO, 1, 0, "Initialization done.\n"); -} - -LlyrComponent::LlyrComponent() : - Component(-1) -{ - // for serialization only -} - -LlyrComponent::~LlyrComponent() -{ - output_->verbose(CALL_INFO, 1, 0, "Llyr destructor fired, closing down.\n"); - -// output_->verbose(CALL_INFO, 10, 0, "Dumping hardware graph...\n"); -// if( output_->getVerboseLevel() >= 10 ) { -// hardwareGraph_.printGraph(); -// hardwareGraph_.printDot("llyr_hdwr.dot"); -// } - - output_->verbose(CALL_INFO, 10, 0, "Dumping application graph...\n"); - if( output_->getVerboseLevel() >= 10 ) { - applicationGraph_.printGraph(); -// applicationGraph_.printDot("llyr_app.dot"); - -// auto app_vertex_map_ = applicationGraph_.getVertexMap(); -// for(auto appIterator = app_vertex_map_->begin(); appIterator != app_vertex_map_->end(); ++appIterator) { -// std::cout << appIterator->first << ": "; -// std::cout << appIterator->second.getValue().optype_ << " - "; -// std::cout << appIterator->second.getValue().argument_ << " - "; -// } - } - -// output_->verbose(CALL_INFO, 10, 0, "Dumping mapping...\n"); -// if( output_->getVerboseLevel() >= 10 ) { -// mappedGraph_.printGraph(); -// mappedGraph_.printDot("llyr_mapped.dot"); -// } -} - -void LlyrComponent::init( uint32_t phase ) -{ - output_->verbose(CALL_INFO, 2, 0, "Initializing...\n"); - - mem_interface_->init( phase ); - if( 0 == phase ) { - std::vector< uint64_t >* initVector; - - //Check to see if there is any memory being initialized - if( memFileName_ != "" ) { - initVector = constructMemory(memFileName_); - } else { - initVector = new std::vector< uint64_t > {16, 64, 32, 0 , 16382, 0, 0}; - } - - std::vector memInit; - constexpr auto buff_size = sizeof(uint64_t); - uint8_t buffer[buff_size] = {}; - for( auto it = initVector->begin(); it != initVector->end(); ++it ) { - std::memcpy(buffer, std::addressof(*it), buff_size); - for( uint32_t i = 0; i < buff_size; ++i ){ - memInit.push_back(buffer[i]); - } - } - - output_->verbose(CALL_INFO, 2, 0, ">> Writing memory contents (%" PRIu64 " bytes at index 0)\n", - (uint64_t) memInit.size()); -// for( std::vector< uint8_t >::iterator it = memInit.begin() ; it != memInit.end(); ++it ) { -// std::cout << uint32_t(*it) << ' '; -// } -// -// std::cout << "\n"; - - StandardMem::Request* initMemory = new StandardMem::Write(starting_addr_, memInit.size(), memInit); - output_->verbose(CALL_INFO, 1, 0, "Sending initialization data to memory...\n"); - mem_interface_->sendUntimedData(initMemory); - output_->verbose(CALL_INFO, 1, 0, "Initialization data sent.\n"); - } -} - -void LlyrComponent::setup() -{ -} - -void LlyrComponent::finish() -{ -} - -bool LlyrComponent::tick( Cycle_t ) -{ - if( clock_enabled_ == 0 ) { - return false; - } - - compute_complete = 0; - //On each tick perform BFS on graph and compute based on operand availability - //NOTE node0 is a dummy node to simplify the algorithm - std::queue< uint32_t > nodeQueue; - - output_->verbose(CALL_INFO, 1, 0, "Device clock tick\n"); - - //Mark all nodes in the PE graph un-visited - std::map< uint32_t, Vertex< ProcessingElement* > >* vertex_map_ = mappedGraph_.getVertexMap(); - typename std::map< uint32_t, Vertex< ProcessingElement* > >::iterator vertexIterator; - for(vertexIterator = vertex_map_->begin(); vertexIterator != vertex_map_->end(); ++vertexIterator) { - vertexIterator->second.setVisited(0); - } - - //Node 0 is a dummy node and is always the entry point - nodeQueue.push(0); - - //BFS and do operations if values available in input queues - while( nodeQueue.empty() == 0 ) { - uint32_t currentNode = nodeQueue.front(); - nodeQueue.pop(); - -// std::cout << "\n Adjacency list of vertex " << currentNode << "\n head "; - std::vector< Edge* >* adjacencyList = vertex_map_->at(currentNode).getAdjacencyList(); - - //set visited for bfs - vertex_map_->at(currentNode).setVisited(1); - - //send one item from each output queue to destination - vertex_map_->at(currentNode).getValue()->doSend(); - - //send n responses from L/S unit to destination - doLoadStoreOps(ls_entries_); - - //Let the PE decide whether or not it can do the compute - vertex_map_->at(currentNode).getValue()->doCompute(); - compute_complete = compute_complete | vertex_map_->at(currentNode).getValue()->getPendingOp(); - - //add the destination vertices from this node to the node queue - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); it++ ) { - uint32_t destinationVertx = (*it)->getDestination(); - if( vertex_map_->at(destinationVertx).getVisited() == 0 ) { - vertex_map_->at(destinationVertx).setVisited(1); - nodeQueue.push(destinationVertx); - } - } - } - - // return false so we keep going - if( ls_queue_->getNumEntries() > 0 ) { - return false; - } else if( compute_complete == 1 ){ - return false; - } else { - primaryComponentOKToEndSim(); - return true; - } -} - -void LlyrComponent::handleEvent(StandardMem::Request* req) { - req->handle(mem_handlers_); -} - -// Handler for incoming Read requests -void LlyrComponent::LlyrMemHandlers::handle(StandardMem::Read* read) { - out->verbose(CALL_INFO, 8, 0, "Handle Read for Address p-0x%" PRIx64 " -- v-0x%" PRIx64 ".\n", read->pAddr, read->vAddr); - - // Make a response. Must fill in payload. - StandardMem::ReadResp* resp = static_cast(read->makeResponse()); - llyr_->mem_interface_->send(resp); -} - -// Handler for incoming Write requests -void LlyrComponent::LlyrMemHandlers::handle(StandardMem::Write* write) { - out->verbose(CALL_INFO, 8, 0, "Handle Write for Address p-0x%" PRIx64 " -- v-0x%" PRIx64 ".\n", write->pAddr, write->vAddr); - - llyr_->clock_enabled_ = 1; - - /* Send response (ack) if needed */ - if (!(write->posted)) { - llyr_->mem_interface_->send(write->makeResponse()); - } - delete write; -} - -// Handler for incoming Read responses -// - should be a response to a Read we issued -void LlyrComponent::LlyrMemHandlers::handle(StandardMem::ReadResp* resp) { - - std::stringstream dataOut; - for( auto &it : resp->data ) { - dataOut << unsigned(it) << " "; - } - out->verbose(CALL_INFO, 24, 0, "%s\n", dataOut.str().c_str()); - - // Read request needs some special handling - uint64_t addr = resp->pAddr; - uint64_t memValue = 0; - - dataOut.str(std::string()); - LlyrData testArg; - for( auto &it : resp->data ) { - testArg = it; - dataOut << testArg << " "; - } - out->verbose(CALL_INFO, 24, 0, "\n%s\n", dataOut.str().c_str()); - - std::memcpy( std::addressof(memValue), std::addressof(resp->data[0]), sizeof(memValue) ); - - testArg = memValue; -// std::cout << "*" << testArg << std::endl; - - out->verbose(CALL_INFO, 8, 0, "Response to a read, payload=%" PRIu64 ", for addr: %" PRIu64 - " to PE %" PRIu32 "\n", memValue, addr, ls_queue_->lookupEntry( resp->getID() ).second ); - - ls_queue_->setEntryData( resp->getID(), testArg ); - ls_queue_->setEntryReady( resp->getID(), 1 ); - - // Need to clean up the events coming back from the cache - delete resp; - out->verbose(CALL_INFO, 4, 0, "Complete cache response handling.\n"); -} - -// Handler for incoming Write responses -// should be a response to a Write we issued -void LlyrComponent::LlyrMemHandlers::handle(StandardMem::WriteResp* resp) { - - out->verbose(CALL_INFO, 8, 0, "Response to a write for addr: %" PRIu64 " to PE %" PRIu32 "\n", - resp->pAddr, ls_queue_->lookupEntry( resp->getID() ).second ); - ls_queue_->setEntryReady( resp->getID(), 2 ); - - // Need to clean up the events coming back from the cache - delete resp; - out->verbose(CALL_INFO, 4, 0, "Complete cache response handling.\n"); -} - -void LlyrComponent::doLoadStoreOps( uint32_t numOps ) -{ - output_->verbose(CALL_INFO, 10, 0, "Doing L/S ops\n"); - for(uint32_t i = 0; i < numOps; ++i ) { - if( ls_queue_->getNumEntries() > 0 ) { - StandardMem::Request::id_t next = ls_queue_->getNextEntry(); - - if( ls_queue_->getEntryReady(next) == 1) { - output_->verbose(CALL_INFO, 10, 0, "--(1)Mem Req ID %" PRIu32 "\n", uint32_t(next)); - LlyrData data = ls_queue_->getEntryData(next); - //pass the value to the appropriate PE - uint32_t srcPe = ls_queue_->lookupEntry( next ).first; - - mappedGraph_.getVertex(srcPe)->getValue()->doReceive(data); - - ls_queue_->removeEntry( next ); - } else if( ls_queue_->getEntryReady(next) == 2 ){ - output_->verbose(CALL_INFO, 10, 0, "--(2)Mem Req ID %" PRIu32 "\n", uint32_t(next)); - ls_queue_->removeEntry( next ); - } - } - } -} - -void LlyrComponent::constructHardwareGraph(std::string fileName) -{ - output_->verbose(CALL_INFO, 1, 0, "Constructing Hardware Graph From: %s\n", fileName.c_str()); - - std::ifstream inputStream(fileName, std::ios::in); - if( inputStream.is_open() ) { - std::string thisLine; - std::uint64_t position; - while( std::getline( inputStream, thisLine ) ) { - output_->verbose(CALL_INFO, 15, 0, "Parsing: %s\n", thisLine.c_str()); - - // skip first and last lines if this is truly dot - if( thisLine.find( "{" ) != std::string::npos || thisLine.find( "}" ) != std::string::npos) { - continue; - } - - // skip if this description includes dot layout information - if( thisLine.find( "layout" ) != std::string::npos ) { - continue; - } - - //Ignore blank lines - if( std::all_of(thisLine.begin(), thisLine.end(), isspace) == 0 ) { - //First read all nodes - //If all nodes read, must mean we're at edge list - position = thisLine.find_first_of( "[" ); - if( position != std::string::npos ) { - uint32_t vertex = std::stoul( thisLine.substr( 0, position ) ); - - std::uint64_t posA = thisLine.find_first_of( "=" ) + 1; - std::uint64_t posB = thisLine.find_last_of( "]" ); - std::string op = thisLine.substr( posA, posB-posA ); - opType operation = getOptype(op); - - output_->verbose(CALL_INFO, 10, 0, "OpString: %s\t\t%" PRIu32 "\n", op.c_str(), operation); - hardwareGraph_.addVertex( vertex, operation ); - } else { - //edge delimiter - std::regex delimiter( "\\--" ); - - std::sregex_token_iterator iterA(thisLine.begin(), thisLine.end(), delimiter, -1); - std::sregex_token_iterator iterB; - std::vector edges( iterA, iterB ); - - edges[0].erase(remove_if(edges[0].begin(), edges[0].end(), isspace), edges[0].end()); - edges[1].erase(remove_if(edges[1].begin(), edges[1].end(), isspace), edges[1].end()); - - output_->verbose(CALL_INFO, 10, 0, "Edges %s--%s\n", edges[0].c_str(), edges[1].c_str()); - - hardwareGraph_.addEdge( std::stoul(edges[0]), std::stoul(edges[1]) ); - } - } - } - - inputStream.close(); - } - else { - output_->fatal(CALL_INFO, -1, "Error: Unable to open %s\n", fileName.c_str() ); - exit(0); - } - -} - -void LlyrComponent::constructSoftwareGraph(std::string fileName) -{ - output_->verbose(CALL_INFO, 1, 0, "Constructing Application Graph From: %s\n", fileName.c_str()); - - std::ifstream inputStream(fileName, std::ios::in); - if( inputStream.is_open() ) { - std::string thisLine; - std::uint64_t position; - - std::getline( inputStream, thisLine ); - position = thisLine.find( "ModuleID" ); - - output_->verbose(CALL_INFO, 16, 0, "Parsing: %s\n", thisLine.c_str()); - if( position != std::string::npos ) { - constructSoftwareGraphIR(inputStream); - } else { - constructSoftwareGraphApp(inputStream); - } - - inputStream.close(); - } else { - output_->fatal(CALL_INFO, -1, "Error: Unable to open %s\n", fileName.c_str() ); - exit(0); - } -} - -void LlyrComponent::constructSoftwareGraphIR(std::ifstream& inputStream) -{ - std::string thisLine; - - output_->verbose(CALL_INFO, 16, 0, "Sending to LLVM parser\n"); - - inputStream.seekg (0, inputStream.beg); - std::string irString( (std::istreambuf_iterator< char >( inputStream )), - (std::istreambuf_iterator< char >() )); - Parser parser(irString, output_); - parser.generateAppGraph("offload_"); -} - -void LlyrComponent::constructSoftwareGraphApp(std::ifstream& inputStream) -{ - std::string thisLine; - std::uint64_t position; - - inputStream.seekg (0, inputStream.beg); - while( std::getline( inputStream, thisLine ) ) { - output_->verbose(CALL_INFO, 15, 0, "Parsing: %s\n", thisLine.c_str()); - - //Ignore blank lines - if( std::all_of(thisLine.begin(), thisLine.end(), isspace) == 0 ) { - //First read all nodes, if all nodes read, must mean we're at edge list - position = thisLine.find_first_of( "pe_type" ); - if( position != std::string::npos ) { - AppNode tempNode; - uint32_t vertex = std::stoul( thisLine.substr( 0, position - 2 ) ); - - std::regex delimiter( ",| " ); - std::sregex_token_iterator iterA(thisLine.begin(), thisLine.end(), delimiter, -1); - std::sregex_token_iterator iterB; - std::vector< std::string > edges( iterA, iterB ); - - //clean up the strings a bit - for( auto testIter = edges.begin(); testIter != edges.end(); ++testIter ) { - testIter->erase(remove_if(testIter->begin(), testIter->end(), isspace), testIter->end()); - testIter->erase(remove(testIter->begin(), testIter->end(), '['), testIter->end()); - testIter->erase(remove(testIter->begin(), testIter->end(), ']'), testIter->end()); - output_->verbose(CALL_INFO, 10, 0, "Hiho %s\n", testIter->c_str()); - } - - //pe_type= - 8chars - std::string op = edges[1].substr(8); - opType operation = getOptype(op); - tempNode.optype_ = operation; - output_->verbose(CALL_INFO, 10, 0, "OpString: %s\t\t%" PRIu32 "\n", op.c_str(), tempNode.optype_); - - //Check to see if this PE has any arguments - for( uint32_t i = 2; i < edges.size(); ++i ) { - tempNode.argument_[i - 2] = edges[i]; - - std::cout << i << " - " << edges[i] << " "; - std::cout << i - 2 << " : " < edges( iterA, iterB ); - - edges[0].erase(remove_if(edges[0].begin(), edges[0].end(), isspace), edges[0].end()); - edges[1].erase(remove_if(edges[1].begin(), edges[1].end(), isspace), edges[1].end()); - - output_->verbose(CALL_INFO, 10, 0, "Edges %s--%s\n", edges[0].c_str(), edges[1].c_str()); - - applicationGraph_.addEdge( std::stoul(edges[0]), std::stoul(edges[1]) ); - } - } - } -} - -std::vector< uint64_t >* LlyrComponent::constructMemory(std::string fileName) -{ - std::vector< uint64_t >* tempVector = new std::vector< uint64_t >; - - std::ifstream inputStream(fileName, std::ios::in); - if( inputStream.is_open() ) { - - std::string thisLine; - while( std::getline( inputStream, thisLine ) ) - { - std::string value; - std::stringstream stringIn(thisLine); - while( std::getline(stringIn, value, ',') ) { - tempVector->push_back(std::stoull(value)); - } - } - -// std::cout << "Init Vector(" << tempVector->size() << "): "; -// for( auto it = tempVector->begin(); it != tempVector->end(); ++it ) { -// std::cout << *it; -// std::cout << " "; -// } -// std::cout << std::endl; - - inputStream.close(); - } else { - output_->fatal(CALL_INFO, -1, "Error: Unable to open %s\n", fileName.c_str() ); - exit(0); - } - - return tempVector; -} - -} // namespace llyr -} // namespace SST - - diff --git a/src/sst/elements/llyr/llyr.h b/src/sst/elements/llyr/llyr.h deleted file mode 100644 index e10a3d93ac..0000000000 --- a/src/sst/elements/llyr/llyr.h +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#ifndef _LLYR_H -#define _LLYR_H - -#include - -#include -#include - -#include -#include -#include - -#include "graph/graph.h" -#include "lsQueue.h" -#include "llyrTypes.h" -#include "pes/peList.h" -#include "mappers/llyrMapper.h" - -using namespace SST::Interfaces; - -namespace SST { -namespace Llyr { - -class LlyrComponent : public SST::Component -{ -public: - - // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY - SST_ELI_REGISTER_COMPONENT( - LlyrComponent, - "llyr", - "LlyrDataflow", - SST_ELI_ELEMENT_VERSION(1,0,0), - "Configurable Dataflow Component", - COMPONENT_CATEGORY_UNCATEGORIZED - ) - - SST_ELI_DOCUMENT_PARAMS( - { "verbose", "Level of output verbosity, higher is more output, 0 is no output", 0 }, - { "clock", "Clock frequency", "1GHz" }, - { "device_addr", "Address of device (must be non-zero if not standalone)", "0" }, - { "starting_addr", "Address of device memory", "0" }, - { "clockcount", "Number of clock ticks to execute", "100000" }, - { "application", "Application in affine IR", "app.in" }, - { "hardware_graph", "Hardware connectivity graph", "grid.cfg" }, - { "mapping_tool", "External mapping tool", "" }, - { "mem_init", "Memory initialization file", "" }, - { "ls_entries", "Number of L/S entries to process each tick", "1" }, - { "queue_depth", "Number of buffer elements", "256" }, - { "arith_latency", "Number of clock ticks for ARITH operations", "1" }, - { "int_latency", "Number of clock ticks for INT operations", "1" }, - { "fp_latency", "Number of clock ticks for FP OTHER operations", "4" }, - { "fp_mul_latency", "Number of clock ticks for FP MUL operations", "4" }, - { "fp_div_latency", "Number of clock ticks for FP DIV operations", "4" } - ) - - ///TODO - SST_ELI_DOCUMENT_STATISTICS( - ) - - SST_ELI_DOCUMENT_PORTS( - { "cache_link", "Link to Memory Controller", { "memHierarchy.memEvent" , "" } } - ) - - SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS( - { "memory", "The memory interface to use (e.g., interface to caches)", "Interfaces::SST::StandardMem" } - ) - - LlyrComponent(SST::ComponentId_t id, SST::Params& params); - ~LlyrComponent(); - - void setup(); - void finish(); - - void init( uint32_t phase ); - -protected: - - -private: - LlyrComponent(); // for serialization only - LlyrComponent( const LlyrComponent& ); // do not implement - void operator=( const LlyrComponent& ); // do not implement - - virtual bool tick( SST::Cycle_t currentCycle ); - - void handleEvent(StandardMem::Request* req); - /* Handlers for StandardMem::Request types */ - class LlyrMemHandlers : public StandardMem::RequestHandler { - public: - friend class LlyrComponent; - friend class LSQueue; - - LlyrMemHandlers(LlyrComponent* llyr, LSQueue* ls_queue, SST::Output* out) : - StandardMem::RequestHandler(out), ls_queue_(ls_queue), llyr_(llyr) {} - virtual ~LlyrMemHandlers() {} - - virtual void handle(StandardMem::Read* read) override; - virtual void handle(StandardMem::Write* write) override; - virtual void handle(StandardMem::ReadResp* resp) override; - virtual void handle(StandardMem::WriteResp* resp) override; - - LSQueue* ls_queue_; - LlyrComponent* llyr_; - }; - - LlyrMemHandlers* mem_handlers_; - StandardMem* mem_interface_; - Addr device_addr_; - Addr starting_addr_; - - std::string mapping_tool_; - - SST::TimeConverter* time_converter_; - Clock::HandlerBase* clock_tick_handler_; - bool handler_registered_; - bool clock_enabled_; - - bool compute_complete; - - SST::Link** links_; - SST::Link* clockLink_; - SST::Output* output_; - - Statistic< uint64_t >* zeroEventCycles_; - Statistic< uint64_t >* eventCycles_; - - LlyrConfig* configData_; - LlyrGraph< opType > hardwareGraph_; - LlyrGraph< AppNode > applicationGraph_; - LlyrGraph< ProcessingElement* > mappedGraph_; - - LlyrMapper* llyr_mapper_; - - void constructHardwareGraph( std::string fileName ); - void constructSoftwareGraph( std::string fileName ); - void constructSoftwareGraphIR( std::ifstream& inputStream ); - void constructSoftwareGraphApp( std::ifstream& inputStream ); - std::vector< uint64_t >* constructMemory( std::string fileName ); - std::string memFileName_; - - uint32_t ls_entries_; - LSQueue* ls_queue_; - void doLoadStoreOps( uint32_t numOps ); - -}; - -} // namespace LLyr -} // namespace SST - -#endif /* _LLYR_H */ diff --git a/src/sst/elements/llyr/llyrTypes.h b/src/sst/elements/llyr/llyrTypes.h deleted file mode 100644 index c65d337427..0000000000 --- a/src/sst/elements/llyr/llyrTypes.h +++ /dev/null @@ -1,358 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef _LLYR_TYPES -#define _LLYR_TYPES - -#include - -#include -#include - -#define Bit_Length 64 -typedef std::bitset< Bit_Length > LlyrData; -typedef std::string Arg; -typedef uint64_t Addr; - -using namespace SST::Interfaces; - -namespace SST { -namespace Llyr { - -// forward declaration of LSQueue -class LSQueue; - -// data type to pass between Llyr, mapper, and PEs -typedef struct alignas(uint64_t) { - LSQueue* lsqueue_; - StandardMem* mem_interface_; - Addr starting_addr_; - std::string mapping_tool_; - - uint32_t verbosity_; - uint16_t queueDepth_; - uint16_t arith_latency_; - uint16_t int_latency_; - uint16_t fp_latency_; - uint16_t fp_mul_Latency_; - uint16_t fp_div_Latency_; -} LlyrConfig; - -typedef enum { - RTR = 0x00, - ANY, - ANY_MEM, - LD, - LDADDR, - STREAM_LD, - ST, - STADDR, - STREAM_ST, - ANY_LOGIC = 0x20, - AND, - OR, - XOR, - NOT, - SLL, - SLR, - ROL, - ROR, - ANY_TEST = 0x40, - EQ, - NE, - UGT, - UGE, - SGT, - SGE, - ULT, - ULE, - SLT, - SLE, - ANY_INT = 0x80, - ADD, - SUB, - MUL, - DIV, - REM, - ADDCONST, - SUBCONST, - MULCONST, - DIVCONST, - REMCONST, - ANY_FP = 0xC0, - FADD, - FSUB, - FMUL, - FDIV, - FMatMul, - ANY_CP = 0xF0, - TSIN, - TCOS, - TTAN, - DUMMY = 0xFF, - BUFFER, - SEL, - RET, - OTHER -} opType; - -inline opType getOptype(std::string &opString) -{ - opType operation; - - // transform to make opString case insensitive - std::transform(opString.begin(), opString.end(), opString.begin(), - [](unsigned char c){ return std::toupper(c); } - ); - - if( opString == "RTR" ) - operation = RTR; - else if( opString == "ANY" ) - operation = ANY; - else if( opString == "ANY_MEM" ) - operation = ANY_MEM; - else if( opString == "LD" ) - operation = LD; - else if( opString == "LDADDR" ) - operation = LDADDR; - else if( opString == "STREAM_LD" ) - operation = STREAM_LD; - else if( opString == "ST" ) - operation = ST; - else if( opString == "STADDR" ) - operation = STADDR; - else if( opString == "STREAM_ST" ) - operation = STREAM_ST; - else if( opString == "ANY_LOGIC" ) - operation = ANY_LOGIC; - else if( opString == "AND" ) - operation = AND; - else if( opString == "OR" ) - operation = OR; - else if( opString == "XOR" ) - operation = XOR; - else if( opString == "NOT" ) - operation = NOT; - else if( opString == "SLL" ) - operation = SLL; - else if( opString == "SLR" ) - operation = SLR; - else if( opString == "ROL" ) - operation = ROL; - else if( opString == "ROR" ) - operation = ROR; - else if( opString == "EQ" ) - operation = EQ; - else if( opString == "NE" ) - operation = NE; - else if( opString == "UGT" ) - operation = UGT; - else if( opString == "UGE" ) - operation = UGE; - else if( opString == "SGT" ) - operation = SGT; - else if( opString == "SGE" ) - operation = SGE; - else if( opString == "ULT" ) - operation = ULT; - else if( opString == "ULE" ) - operation = ULE; - else if( opString == "SLT" ) - operation = SLT; - else if( opString == "SLE" ) - operation = SLE; - else if( opString == "ANY_INT" ) - operation = ANY_INT; - else if( opString == "ADD" ) - operation = ADD; - else if( opString == "SUB" ) - operation = SUB; - else if( opString == "MUL" ) - operation = MUL; - else if( opString == "DIV" ) - operation = DIV; - else if( opString == "REM" ) - operation = REM; - else if( opString == "ADDCONST" ) - operation = ADDCONST; - else if( opString == "SUBCONST" ) - operation = SUBCONST; - else if( opString == "MULCONST" ) - operation = MULCONST; - else if( opString == "DIVCONST" ) - operation = DIVCONST; - else if( opString == "REMCONST" ) - operation = REMCONST; - else if( opString == "ANY_FP" ) - operation = ANY_FP; - else if( opString == "FADD" ) - operation = FADD; - else if( opString == "FSUB" ) - operation = FSUB; - else if( opString == "FMUL" ) - operation = FMUL; - else if( opString == "FDIV" ) - operation = FDIV; - else if( opString == "FMatMul" ) - operation = FMatMul; - else if( opString == "ANY_CP" ) - operation = ANY_CP; - else if( opString == "TSIN" ) - operation = TSIN; - else if( opString == "TCOS" ) - operation = TCOS; - else if( opString == "TTAN" ) - operation = TTAN; - else if( opString == "DUMMY" ) - operation = DUMMY; - else if( opString == "BUFFER" ) - operation = BUFFER; - else if( opString == "SEL" ) - operation = SEL; - else if( opString == "RET" ) - operation = RET; - else - operation = OTHER; - - return operation; -} - -inline std::string getOpString(opType &op) -{ - std::string operation; - - if( op == RTR ) - operation = "RTR"; - else if( op == ANY ) - operation = "ANY"; - else if( op == ANY_MEM ) - operation = "ANY_MEM"; - else if( op == LD ) - operation = "LD"; - else if( op == LDADDR ) - operation = "LDADDR"; - else if( op == STREAM_LD ) - operation = "STREAM_LD"; - else if( op == ST ) - operation = "ST"; - else if( op == STADDR ) - operation = "STADDR"; - else if( op == STREAM_ST ) - operation = "STREAM_ST"; - else if( op == ANY_LOGIC ) - operation = "ANY_LOGIC"; - else if( op == AND ) - operation = "AND"; - else if( op == OR ) - operation = "OR"; - else if( op == XOR ) - operation = "XOR"; - else if( op == NOT ) - operation = "NOT"; - else if( op == SLL ) - operation = "SLL"; - else if( op == SLR ) - operation = "SLR"; - else if( op == ROL ) - operation = "ROL"; - else if( op == ROR ) - operation = "ROR"; - else if( op == EQ ) - operation = "EQ"; - else if( op == NE ) - operation = "NE"; - else if( op == UGT ) - operation = "UGT"; - else if( op == UGE ) - operation = "UGE"; - else if( op == SGT ) - operation = "SGT"; - else if( op == SGE ) - operation = "SGE"; - else if( op == ULT ) - operation = "ULT"; - else if( op == ULE ) - operation = "ULE"; - else if( op == SLT ) - operation = "SLT"; - else if( op == SLE ) - operation = "SLE"; - else if( op == ANY_INT ) - operation = "ANY_INT"; - else if( op == ADD ) - operation = "ADD"; - else if( op == SUB ) - operation = "SUB"; - else if( op == MUL ) - operation = "MUL"; - else if( op == DIV ) - operation = "DIV"; - else if( op == REM ) - operation = "REM"; - else if( op == ADDCONST ) - operation = "ADDCONST"; - else if( op == SUBCONST ) - operation = "SUBCONST"; - else if( op == MULCONST ) - operation = "MULCONST"; - else if( op == DIVCONST ) - operation = "DIVCONST"; - else if( op == REMCONST ) - operation = "REMCONST"; - else if( op == ANY_FP ) - operation = "ANY_FP"; - else if( op == FADD ) - operation = "FADD"; - else if( op == FSUB ) - operation = "FSUB"; - else if( op == FMUL ) - operation = "FMUL"; - else if( op == FDIV ) - operation = "FDIV"; - else if( op == FMatMul ) - operation = "FMatMul"; - else if( op == ANY_CP ) - operation = "ANY_CP"; - else if( op == TSIN ) - operation = "TSIN"; - else if( op == TCOS ) - operation = "TCOS"; - else if( op == TTAN ) - operation = "TTAN"; - else if( op == DUMMY ) - operation = "DUMMY"; - else if( op == BUFFER ) - operation = "BUFFER"; - else if( op == SEL ) - operation = "SEL"; - else if( op == RET ) - operation = "RET"; - else - operation = "OTHER"; - - return operation; -} - -// application graph node -typedef struct alignas(uint64_t) { - opType optype_; - Arg argument_[2]; -} AppNode; - -}//Llyr -}//SST - -#endif diff --git a/src/sst/elements/llyr/lsQueue.h b/src/sst/elements/llyr/lsQueue.h deleted file mode 100644 index 4773fb2f89..0000000000 --- a/src/sst/elements/llyr/lsQueue.h +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef _LLYR_LSQ -#define _LLYR_LSQ - -#include -#include - -#include -#include -#include -#include -#include - -#include "llyrTypes.h" - -using namespace SST::Interfaces; - -namespace SST { -namespace Llyr { - - -class LSEntry -{ -public: - LSEntry(const StandardMem::Request::id_t reqId, uint32_t srcProc, uint32_t dstProc) : - req_id_(reqId), src_proc_(srcProc), dst_proc_(dstProc), ready_(0) {} - ~LSEntry() {} - - uint32_t getSourcePe() const { return src_proc_; } - uint32_t getTargetPe() const { return dst_proc_; } - StandardMem::Request::id_t getReqId() const { return req_id_; } - - void setData( LlyrData data ) { data_ = data; } - LlyrData getData() const{ return data_; } - - void setReady( uint32_t ready ) { ready_ = ready; } - uint32_t getReady() const{ return ready_; } - -protected: - StandardMem::Request::id_t req_id_; - - uint32_t src_proc_; - uint32_t dst_proc_; - - uint32_t ready_; - LlyrData data_; - -private: - -}; - -class LSQueue -{ -public: - LSQueue() - { - //setup up i/o for messages - char prefix[256]; - sprintf(prefix, "[t=@t][LSQueue]: "); - output_ = new SST::Output(prefix, 0, 0, Output::STDOUT); - } - LSQueue(const LSQueue ©) - { - output_ = copy.output_; - memory_queue_ = copy.memory_queue_; - pending_ = copy.pending_; - } - ~LSQueue() {} - - uint32_t getNumEntries() const { return memory_queue_.size(); } - StandardMem::Request::id_t getNextEntry() const { return memory_queue_.front(); } - - void addEntry( LSEntry* entry ) - { - memory_queue_.push( entry->getReqId() ); - pending_.emplace( entry->getReqId(), entry ); - } - - std::pair< uint32_t, uint32_t > lookupEntry( StandardMem::Request::id_t id ) - { - auto entry = pending_.find( id ); - if( entry == pending_.end() ) { - output_->verbose(CALL_INFO, 0, 0, "Error: response from memory could not be found.\n"); - exit(-1); - } - - return std::make_pair( entry->second->getSourcePe(), entry->second->getTargetPe() ); - } - - void removeEntry( StandardMem::Request::id_t id ) - { - memory_queue_.pop(); - auto entry = pending_.find( id ); - if( entry != pending_.end() ) { - pending_.erase(entry); - } - } - - LlyrData getEntryData( StandardMem::Request::id_t id ) const - { - auto entry = pending_.find( id ); - if( entry != pending_.end() ) { - return entry->second->getData(); - } - - return 0; - } - - void setEntryData( StandardMem::Request::id_t id, LlyrData data ) - { - auto entry = pending_.find( id ); - if( entry != pending_.end() ) { - entry->second->setData(data); - } - } - - uint32_t getEntryReady( StandardMem::Request::id_t id ) const - { - auto entry = pending_.find( id ); - if( entry != pending_.end() ) { - return entry->second->getReady(); - } - - return 0; - } - - void setEntryReady( StandardMem::Request::id_t id, uint32_t ready ) - { - auto entry = pending_.find( id ); - if( entry != pending_.end() ) { - entry->second->setReady(ready); - } - } - - -protected: - - -private: - SST::Output* output_; - - std::queue< StandardMem::Request::id_t > memory_queue_; - std::map< StandardMem::Request::id_t, LSEntry* > pending_; - -}; - - -} -} - -#endif diff --git a/src/sst/elements/llyr/mappers/gemmMapper.h b/src/sst/elements/llyr/mappers/gemmMapper.h deleted file mode 100644 index d7fe590f91..0000000000 --- a/src/sst/elements/llyr/mappers/gemmMapper.h +++ /dev/null @@ -1,2166 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#ifndef _GEMM_MAPPER_H -#define _GEMM_MAPPER_H - -#include - -#include "mappers/llyrMapper.h" - -namespace SST { -namespace Llyr { - -class GEMMMapper : public LlyrMapper -{ - -public: - explicit GEMMMapper(Params& params) : - LlyrMapper() {} - ~GEMMMapper() { } - - SST_ELI_REGISTER_MODULE_DERIVED( - GEMMMapper, - "llyr", - "mapper.gemm", - SST_ELI_ELEMENT_VERSION(1,0,0), - "GEMM optimized mapper", - SST::Llyr::LlyrMapper - ) - - void mapGraph(LlyrGraph< opType > hardwareGraph, LlyrGraph< AppNode > appGraph, - LlyrGraph< ProcessingElement* > &graphOut, - LlyrConfig* llyr_config); - -private: - - -}; - -void GEMMMapper::mapGraph(LlyrGraph< opType > hardwareGraph, LlyrGraph< AppNode > appGraph, - LlyrGraph< ProcessingElement* > &graphOut, - LlyrConfig* llyr_config) -{ - //setup up i/o for messages - char prefix[256]; - sprintf(prefix, "[t=@t][gemmMapper]: "); - SST::Output* output_ = new SST::Output(prefix, llyr_config->verbosity_, 0, Output::STDOUT); - - //Dummy node to make BFS easier -ProcessingElement* tempPE = new DummyProcessingElement(DUMMY, 0, llyr_config); -graphOut.addVertex( 0, tempPE ); - -tempPE = new LoadProcessingElement( LD, 1, llyr_config ); -graphOut.addVertex( 1, tempPE ); - -tempPE = new LoadProcessingElement( LD, 2, llyr_config ); -graphOut.addVertex( 2, tempPE ); - -tempPE = new LoadProcessingElement( LD, 3, llyr_config ); -graphOut.addVertex( 3, tempPE ); - -tempPE = new LoadProcessingElement( LD, 4, llyr_config ); -graphOut.addVertex( 4, tempPE ); - -tempPE = new LoadProcessingElement( LD, 5, llyr_config ); -graphOut.addVertex( 5, tempPE ); - -tempPE = new LoadProcessingElement( LD, 6, llyr_config ); -graphOut.addVertex( 6, tempPE ); - -tempPE = new LoadProcessingElement( LD, 7, llyr_config ); -graphOut.addVertex( 7, tempPE ); - -tempPE = new LoadProcessingElement( LD, 8, llyr_config ); -graphOut.addVertex( 8, tempPE ); - -tempPE = new LoadProcessingElement( LD, 9, llyr_config ); -graphOut.addVertex( 9, tempPE ); - -tempPE = new LoadProcessingElement( LD, 10, llyr_config ); -graphOut.addVertex( 10, tempPE ); - -tempPE = new LoadProcessingElement( LD, 11, llyr_config ); -graphOut.addVertex( 11, tempPE ); - -tempPE = new LoadProcessingElement( LD, 12, llyr_config ); -graphOut.addVertex( 12, tempPE ); - -tempPE = new LoadProcessingElement( LD, 13, llyr_config ); -graphOut.addVertex( 13, tempPE ); - -tempPE = new LoadProcessingElement( LD, 14, llyr_config ); -graphOut.addVertex( 14, tempPE ); - -tempPE = new LoadProcessingElement( LD, 15, llyr_config ); -graphOut.addVertex( 15, tempPE ); - -tempPE = new LoadProcessingElement( LD, 16, llyr_config ); -graphOut.addVertex( 16, tempPE ); - -tempPE = new LoadProcessingElement( LD, 17, llyr_config ); -graphOut.addVertex( 17, tempPE ); - -tempPE = new LoadProcessingElement( LD, 18, llyr_config ); -graphOut.addVertex( 18, tempPE ); - -tempPE = new LoadProcessingElement( LD, 19, llyr_config ); -graphOut.addVertex( 19, tempPE ); - -tempPE = new LoadProcessingElement( LD, 20, llyr_config ); -graphOut.addVertex( 20, tempPE ); - -tempPE = new LoadProcessingElement( LD, 21, llyr_config ); -graphOut.addVertex( 21, tempPE ); - -tempPE = new LoadProcessingElement( LD, 22, llyr_config ); -graphOut.addVertex( 22, tempPE ); - -tempPE = new LoadProcessingElement( LD, 23, llyr_config ); -graphOut.addVertex( 23, tempPE ); - -tempPE = new LoadProcessingElement( LD, 24, llyr_config ); -graphOut.addVertex( 24, tempPE ); - -tempPE = new LoadProcessingElement( LD, 25, llyr_config ); -graphOut.addVertex( 25, tempPE ); - -tempPE = new LoadProcessingElement( LD, 26, llyr_config ); -graphOut.addVertex( 26, tempPE ); - -tempPE = new LoadProcessingElement( LD, 27, llyr_config ); -graphOut.addVertex( 27, tempPE ); - -tempPE = new LoadProcessingElement( LD, 28, llyr_config ); -graphOut.addVertex( 28, tempPE ); - -tempPE = new LoadProcessingElement( LD, 29, llyr_config ); -graphOut.addVertex( 29, tempPE ); - -tempPE = new LoadProcessingElement( LD, 30, llyr_config ); -graphOut.addVertex( 30, tempPE ); - -tempPE = new LoadProcessingElement( LD, 31, llyr_config ); -graphOut.addVertex( 31, tempPE ); - -tempPE = new LoadProcessingElement( LD, 32, llyr_config ); -graphOut.addVertex( 32, tempPE ); - -tempPE = new LoadProcessingElement( LD, 33, llyr_config ); -graphOut.addVertex( 33, tempPE ); - -tempPE = new LoadProcessingElement( LD, 34, llyr_config ); -graphOut.addVertex( 34, tempPE ); - -tempPE = new LoadProcessingElement( LD, 35, llyr_config ); -graphOut.addVertex( 35, tempPE ); - -tempPE = new LoadProcessingElement( LD, 36, llyr_config ); -graphOut.addVertex( 36, tempPE ); - -tempPE = new LoadProcessingElement( LD, 37, llyr_config ); -graphOut.addVertex( 37, tempPE ); - -tempPE = new LoadProcessingElement( LD, 38, llyr_config ); -graphOut.addVertex( 38, tempPE ); - -tempPE = new LoadProcessingElement( LD, 39, llyr_config ); -graphOut.addVertex( 39, tempPE ); - -tempPE = new LoadProcessingElement( LD, 40, llyr_config ); -graphOut.addVertex( 40, tempPE ); - -tempPE = new LoadProcessingElement( LD, 41, llyr_config ); -graphOut.addVertex( 41, tempPE ); - -tempPE = new LoadProcessingElement( LD, 42, llyr_config ); -graphOut.addVertex( 42, tempPE ); - -tempPE = new LoadProcessingElement( LD, 43, llyr_config ); -graphOut.addVertex( 43, tempPE ); - -tempPE = new LoadProcessingElement( LD, 44, llyr_config ); -graphOut.addVertex( 44, tempPE ); - -tempPE = new LoadProcessingElement( LD, 45, llyr_config ); -graphOut.addVertex( 45, tempPE ); - -tempPE = new LoadProcessingElement( LD, 46, llyr_config ); -graphOut.addVertex( 46, tempPE ); - -tempPE = new LoadProcessingElement( LD, 47, llyr_config ); -graphOut.addVertex( 47, tempPE ); - -tempPE = new LoadProcessingElement( LD, 48, llyr_config ); -graphOut.addVertex( 48, tempPE ); - -tempPE = new IntProcessingElement( MUL, 49, llyr_config ); -graphOut.addVertex( 49, tempPE ); - -tempPE = new IntProcessingElement( MUL, 50, llyr_config ); -graphOut.addVertex( 50, tempPE ); - -tempPE = new IntProcessingElement( MUL, 51, llyr_config ); -graphOut.addVertex( 51, tempPE ); - -tempPE = new IntProcessingElement( MUL, 52, llyr_config ); -graphOut.addVertex( 52, tempPE ); - -tempPE = new IntProcessingElement( MUL, 53, llyr_config ); -graphOut.addVertex( 53, tempPE ); - -tempPE = new IntProcessingElement( MUL, 54, llyr_config ); -graphOut.addVertex( 54, tempPE ); - -tempPE = new IntProcessingElement( MUL, 55, llyr_config ); -graphOut.addVertex( 55, tempPE ); - -tempPE = new IntProcessingElement( MUL, 56, llyr_config ); -graphOut.addVertex( 56, tempPE ); - -tempPE = new IntProcessingElement( MUL, 57, llyr_config ); -graphOut.addVertex( 57, tempPE ); - -tempPE = new IntProcessingElement( MUL, 58, llyr_config ); -graphOut.addVertex( 58, tempPE ); - -tempPE = new IntProcessingElement( MUL, 59, llyr_config ); -graphOut.addVertex( 59, tempPE ); - -tempPE = new IntProcessingElement( MUL, 60, llyr_config ); -graphOut.addVertex( 60, tempPE ); - -tempPE = new IntProcessingElement( MUL, 61, llyr_config ); -graphOut.addVertex( 61, tempPE ); - -tempPE = new IntProcessingElement( MUL, 62, llyr_config ); -graphOut.addVertex( 62, tempPE ); - -tempPE = new IntProcessingElement( MUL, 63, llyr_config ); -graphOut.addVertex( 63, tempPE ); - -tempPE = new IntProcessingElement( MUL, 64, llyr_config ); -graphOut.addVertex( 64, tempPE ); - -tempPE = new IntProcessingElement( MUL, 65, llyr_config ); -graphOut.addVertex( 65, tempPE ); - -tempPE = new IntProcessingElement( MUL, 66, llyr_config ); -graphOut.addVertex( 66, tempPE ); - -tempPE = new IntProcessingElement( MUL, 67, llyr_config ); -graphOut.addVertex( 67, tempPE ); - -tempPE = new IntProcessingElement( MUL, 68, llyr_config ); -graphOut.addVertex( 68, tempPE ); - -tempPE = new IntProcessingElement( MUL, 69, llyr_config ); -graphOut.addVertex( 69, tempPE ); - -tempPE = new IntProcessingElement( MUL, 70, llyr_config ); -graphOut.addVertex( 70, tempPE ); - -tempPE = new IntProcessingElement( MUL, 71, llyr_config ); -graphOut.addVertex( 71, tempPE ); - -tempPE = new IntProcessingElement( MUL, 72, llyr_config ); -graphOut.addVertex( 72, tempPE ); - -tempPE = new IntProcessingElement( MUL, 73, llyr_config ); -graphOut.addVertex( 73, tempPE ); - -tempPE = new IntProcessingElement( MUL, 74, llyr_config ); -graphOut.addVertex( 74, tempPE ); - -tempPE = new IntProcessingElement( MUL, 75, llyr_config ); -graphOut.addVertex( 75, tempPE ); - -tempPE = new IntProcessingElement( MUL, 76, llyr_config ); -graphOut.addVertex( 76, tempPE ); - -tempPE = new IntProcessingElement( MUL, 77, llyr_config ); -graphOut.addVertex( 77, tempPE ); - -tempPE = new IntProcessingElement( MUL, 78, llyr_config ); -graphOut.addVertex( 78, tempPE ); - -tempPE = new IntProcessingElement( MUL, 79, llyr_config ); -graphOut.addVertex( 79, tempPE ); - -tempPE = new IntProcessingElement( MUL, 80, llyr_config ); -graphOut.addVertex( 80, tempPE ); - -tempPE = new IntProcessingElement( MUL, 81, llyr_config ); -graphOut.addVertex( 81, tempPE ); - -tempPE = new IntProcessingElement( MUL, 82, llyr_config ); -graphOut.addVertex( 82, tempPE ); - -tempPE = new IntProcessingElement( MUL, 83, llyr_config ); -graphOut.addVertex( 83, tempPE ); - -tempPE = new IntProcessingElement( MUL, 84, llyr_config ); -graphOut.addVertex( 84, tempPE ); - -tempPE = new IntProcessingElement( MUL, 85, llyr_config ); -graphOut.addVertex( 85, tempPE ); - -tempPE = new IntProcessingElement( MUL, 86, llyr_config ); -graphOut.addVertex( 86, tempPE ); - -tempPE = new IntProcessingElement( MUL, 87, llyr_config ); -graphOut.addVertex( 87, tempPE ); - -tempPE = new IntProcessingElement( MUL, 88, llyr_config ); -graphOut.addVertex( 88, tempPE ); - -tempPE = new IntProcessingElement( MUL, 89, llyr_config ); -graphOut.addVertex( 89, tempPE ); - -tempPE = new IntProcessingElement( MUL, 90, llyr_config ); -graphOut.addVertex( 90, tempPE ); - -tempPE = new IntProcessingElement( MUL, 91, llyr_config ); -graphOut.addVertex( 91, tempPE ); - -tempPE = new IntProcessingElement( MUL, 92, llyr_config ); -graphOut.addVertex( 92, tempPE ); - -tempPE = new IntProcessingElement( MUL, 93, llyr_config ); -graphOut.addVertex( 93, tempPE ); - -tempPE = new IntProcessingElement( MUL, 94, llyr_config ); -graphOut.addVertex( 94, tempPE ); - -tempPE = new IntProcessingElement( MUL, 95, llyr_config ); -graphOut.addVertex( 95, tempPE ); - -tempPE = new IntProcessingElement( MUL, 96, llyr_config ); -graphOut.addVertex( 96, tempPE ); - -tempPE = new IntProcessingElement( MUL, 97, llyr_config ); -graphOut.addVertex( 97, tempPE ); - -tempPE = new IntProcessingElement( MUL, 98, llyr_config ); -graphOut.addVertex( 98, tempPE ); - -tempPE = new IntProcessingElement( MUL, 99, llyr_config ); -graphOut.addVertex( 99, tempPE ); - -tempPE = new IntProcessingElement( MUL, 100, llyr_config ); -graphOut.addVertex( 100, tempPE ); - -tempPE = new IntProcessingElement( MUL, 101, llyr_config ); -graphOut.addVertex( 101, tempPE ); - -tempPE = new IntProcessingElement( MUL, 102, llyr_config ); -graphOut.addVertex( 102, tempPE ); - -tempPE = new IntProcessingElement( MUL, 103, llyr_config ); -graphOut.addVertex( 103, tempPE ); - -tempPE = new IntProcessingElement( MUL, 104, llyr_config ); -graphOut.addVertex( 104, tempPE ); - -tempPE = new IntProcessingElement( MUL, 105, llyr_config ); -graphOut.addVertex( 105, tempPE ); - -tempPE = new IntProcessingElement( MUL, 106, llyr_config ); -graphOut.addVertex( 106, tempPE ); - -tempPE = new IntProcessingElement( MUL, 107, llyr_config ); -graphOut.addVertex( 107, tempPE ); - -tempPE = new IntProcessingElement( MUL, 108, llyr_config ); -graphOut.addVertex( 108, tempPE ); - -tempPE = new IntProcessingElement( MUL, 109, llyr_config ); -graphOut.addVertex( 109, tempPE ); - -tempPE = new IntProcessingElement( MUL, 110, llyr_config ); -graphOut.addVertex( 110, tempPE ); - -tempPE = new IntProcessingElement( MUL, 111, llyr_config ); -graphOut.addVertex( 111, tempPE ); - -tempPE = new IntProcessingElement( MUL, 112, llyr_config ); -graphOut.addVertex( 112, tempPE ); - -tempPE = new IntProcessingElement( MUL, 113, llyr_config ); -graphOut.addVertex( 113, tempPE ); - -tempPE = new IntProcessingElement( MUL, 114, llyr_config ); -graphOut.addVertex( 114, tempPE ); - -tempPE = new IntProcessingElement( MUL, 115, llyr_config ); -graphOut.addVertex( 115, tempPE ); - -tempPE = new IntProcessingElement( MUL, 116, llyr_config ); -graphOut.addVertex( 116, tempPE ); - -tempPE = new IntProcessingElement( MUL, 117, llyr_config ); -graphOut.addVertex( 117, tempPE ); - -tempPE = new IntProcessingElement( MUL, 118, llyr_config ); -graphOut.addVertex( 118, tempPE ); - -tempPE = new IntProcessingElement( MUL, 119, llyr_config ); -graphOut.addVertex( 119, tempPE ); - -tempPE = new IntProcessingElement( MUL, 120, llyr_config ); -graphOut.addVertex( 120, tempPE ); - -tempPE = new IntProcessingElement( MUL, 121, llyr_config ); -graphOut.addVertex( 121, tempPE ); - -tempPE = new IntProcessingElement( MUL, 122, llyr_config ); -graphOut.addVertex( 122, tempPE ); - -tempPE = new IntProcessingElement( MUL, 123, llyr_config ); -graphOut.addVertex( 123, tempPE ); - -tempPE = new IntProcessingElement( MUL, 124, llyr_config ); -graphOut.addVertex( 124, tempPE ); - -tempPE = new IntProcessingElement( MUL, 125, llyr_config ); -graphOut.addVertex( 125, tempPE ); - -tempPE = new IntProcessingElement( MUL, 126, llyr_config ); -graphOut.addVertex( 126, tempPE ); - -tempPE = new IntProcessingElement( MUL, 127, llyr_config ); -graphOut.addVertex( 127, tempPE ); - -tempPE = new IntProcessingElement( MUL, 128, llyr_config ); -graphOut.addVertex( 128, tempPE ); - -tempPE = new IntProcessingElement( MUL, 129, llyr_config ); -graphOut.addVertex( 129, tempPE ); - -tempPE = new IntProcessingElement( MUL, 130, llyr_config ); -graphOut.addVertex( 130, tempPE ); - -tempPE = new IntProcessingElement( MUL, 131, llyr_config ); -graphOut.addVertex( 131, tempPE ); - -tempPE = new IntProcessingElement( MUL, 132, llyr_config ); -graphOut.addVertex( 132, tempPE ); - -tempPE = new IntProcessingElement( MUL, 133, llyr_config ); -graphOut.addVertex( 133, tempPE ); - -tempPE = new IntProcessingElement( MUL, 134, llyr_config ); -graphOut.addVertex( 134, tempPE ); - -tempPE = new IntProcessingElement( MUL, 135, llyr_config ); -graphOut.addVertex( 135, tempPE ); - -tempPE = new IntProcessingElement( MUL, 136, llyr_config ); -graphOut.addVertex( 136, tempPE ); - -tempPE = new IntProcessingElement( MUL, 137, llyr_config ); -graphOut.addVertex( 137, tempPE ); - -tempPE = new IntProcessingElement( MUL, 138, llyr_config ); -graphOut.addVertex( 138, tempPE ); - -tempPE = new IntProcessingElement( MUL, 139, llyr_config ); -graphOut.addVertex( 139, tempPE ); - -tempPE = new IntProcessingElement( MUL, 140, llyr_config ); -graphOut.addVertex( 140, tempPE ); - -tempPE = new IntProcessingElement( MUL, 141, llyr_config ); -graphOut.addVertex( 141, tempPE ); - -tempPE = new IntProcessingElement( MUL, 142, llyr_config ); -graphOut.addVertex( 142, tempPE ); - -tempPE = new IntProcessingElement( MUL, 143, llyr_config ); -graphOut.addVertex( 143, tempPE ); - -tempPE = new IntProcessingElement( MUL, 144, llyr_config ); -graphOut.addVertex( 144, tempPE ); - -tempPE = new IntProcessingElement( MUL, 145, llyr_config ); -graphOut.addVertex( 145, tempPE ); - -tempPE = new IntProcessingElement( MUL, 146, llyr_config ); -graphOut.addVertex( 146, tempPE ); - -tempPE = new IntProcessingElement( MUL, 147, llyr_config ); -graphOut.addVertex( 147, tempPE ); - -tempPE = new IntProcessingElement( MUL, 148, llyr_config ); -graphOut.addVertex( 148, tempPE ); - -tempPE = new IntProcessingElement( MUL, 149, llyr_config ); -graphOut.addVertex( 149, tempPE ); - -tempPE = new IntProcessingElement( MUL, 150, llyr_config ); -graphOut.addVertex( 150, tempPE ); - -tempPE = new IntProcessingElement( MUL, 151, llyr_config ); -graphOut.addVertex( 151, tempPE ); - -tempPE = new IntProcessingElement( MUL, 152, llyr_config ); -graphOut.addVertex( 152, tempPE ); - -tempPE = new IntProcessingElement( MUL, 153, llyr_config ); -graphOut.addVertex( 153, tempPE ); - -tempPE = new IntProcessingElement( MUL, 154, llyr_config ); -graphOut.addVertex( 154, tempPE ); - -tempPE = new IntProcessingElement( MUL, 155, llyr_config ); -graphOut.addVertex( 155, tempPE ); - -tempPE = new IntProcessingElement( MUL, 156, llyr_config ); -graphOut.addVertex( 156, tempPE ); - -tempPE = new IntProcessingElement( MUL, 157, llyr_config ); -graphOut.addVertex( 157, tempPE ); - -tempPE = new IntProcessingElement( MUL, 158, llyr_config ); -graphOut.addVertex( 158, tempPE ); - -tempPE = new IntProcessingElement( MUL, 159, llyr_config ); -graphOut.addVertex( 159, tempPE ); - -tempPE = new IntProcessingElement( MUL, 160, llyr_config ); -graphOut.addVertex( 160, tempPE ); - -tempPE = new IntProcessingElement( MUL, 161, llyr_config ); -graphOut.addVertex( 161, tempPE ); - -tempPE = new IntProcessingElement( MUL, 162, llyr_config ); -graphOut.addVertex( 162, tempPE ); - -tempPE = new IntProcessingElement( MUL, 163, llyr_config ); -graphOut.addVertex( 163, tempPE ); - -tempPE = new IntProcessingElement( MUL, 164, llyr_config ); -graphOut.addVertex( 164, tempPE ); - -tempPE = new IntProcessingElement( MUL, 165, llyr_config ); -graphOut.addVertex( 165, tempPE ); - -tempPE = new IntProcessingElement( MUL, 166, llyr_config ); -graphOut.addVertex( 166, tempPE ); - -tempPE = new IntProcessingElement( MUL, 167, llyr_config ); -graphOut.addVertex( 167, tempPE ); - -tempPE = new IntProcessingElement( MUL, 168, llyr_config ); -graphOut.addVertex( 168, tempPE ); - -tempPE = new IntProcessingElement( MUL, 169, llyr_config ); -graphOut.addVertex( 169, tempPE ); - -tempPE = new IntProcessingElement( MUL, 170, llyr_config ); -graphOut.addVertex( 170, tempPE ); - -tempPE = new IntProcessingElement( MUL, 171, llyr_config ); -graphOut.addVertex( 171, tempPE ); - -tempPE = new IntProcessingElement( MUL, 172, llyr_config ); -graphOut.addVertex( 172, tempPE ); - -tempPE = new IntProcessingElement( MUL, 173, llyr_config ); -graphOut.addVertex( 173, tempPE ); - -tempPE = new IntProcessingElement( MUL, 174, llyr_config ); -graphOut.addVertex( 174, tempPE ); - -tempPE = new IntProcessingElement( MUL, 175, llyr_config ); -graphOut.addVertex( 175, tempPE ); - -tempPE = new IntProcessingElement( MUL, 176, llyr_config ); -graphOut.addVertex( 176, tempPE ); - -tempPE = new IntProcessingElement( MUL, 177, llyr_config ); -graphOut.addVertex( 177, tempPE ); - -tempPE = new IntProcessingElement( MUL, 178, llyr_config ); -graphOut.addVertex( 178, tempPE ); - -tempPE = new IntProcessingElement( MUL, 179, llyr_config ); -graphOut.addVertex( 179, tempPE ); - -tempPE = new IntProcessingElement( MUL, 180, llyr_config ); -graphOut.addVertex( 180, tempPE ); - -tempPE = new IntProcessingElement( MUL, 181, llyr_config ); -graphOut.addVertex( 181, tempPE ); - -tempPE = new IntProcessingElement( MUL, 182, llyr_config ); -graphOut.addVertex( 182, tempPE ); - -tempPE = new IntProcessingElement( MUL, 183, llyr_config ); -graphOut.addVertex( 183, tempPE ); - -tempPE = new IntProcessingElement( MUL, 184, llyr_config ); -graphOut.addVertex( 184, tempPE ); - -tempPE = new IntProcessingElement( MUL, 185, llyr_config ); -graphOut.addVertex( 185, tempPE ); - -tempPE = new IntProcessingElement( MUL, 186, llyr_config ); -graphOut.addVertex( 186, tempPE ); - -tempPE = new IntProcessingElement( MUL, 187, llyr_config ); -graphOut.addVertex( 187, tempPE ); - -tempPE = new IntProcessingElement( MUL, 188, llyr_config ); -graphOut.addVertex( 188, tempPE ); - -tempPE = new IntProcessingElement( MUL, 189, llyr_config ); -graphOut.addVertex( 189, tempPE ); - -tempPE = new IntProcessingElement( MUL, 190, llyr_config ); -graphOut.addVertex( 190, tempPE ); - -tempPE = new IntProcessingElement( MUL, 191, llyr_config ); -graphOut.addVertex( 191, tempPE ); - -tempPE = new IntProcessingElement( MUL, 192, llyr_config ); -graphOut.addVertex( 192, tempPE ); - -tempPE = new IntProcessingElement( MUL, 193, llyr_config ); -graphOut.addVertex( 193, tempPE ); - -tempPE = new IntProcessingElement( MUL, 194, llyr_config ); -graphOut.addVertex( 194, tempPE ); - -tempPE = new IntProcessingElement( MUL, 195, llyr_config ); -graphOut.addVertex( 195, tempPE ); - -tempPE = new IntProcessingElement( MUL, 196, llyr_config ); -graphOut.addVertex( 196, tempPE ); - -tempPE = new IntProcessingElement( MUL, 197, llyr_config ); -graphOut.addVertex( 197, tempPE ); - -tempPE = new IntProcessingElement( MUL, 198, llyr_config ); -graphOut.addVertex( 198, tempPE ); - -tempPE = new IntProcessingElement( MUL, 199, llyr_config ); -graphOut.addVertex( 199, tempPE ); - -tempPE = new IntProcessingElement( MUL, 200, llyr_config ); -graphOut.addVertex( 200, tempPE ); - -tempPE = new IntProcessingElement( MUL, 201, llyr_config ); -graphOut.addVertex( 201, tempPE ); - -tempPE = new IntProcessingElement( MUL, 202, llyr_config ); -graphOut.addVertex( 202, tempPE ); - -tempPE = new IntProcessingElement( MUL, 203, llyr_config ); -graphOut.addVertex( 203, tempPE ); - -tempPE = new IntProcessingElement( MUL, 204, llyr_config ); -graphOut.addVertex( 204, tempPE ); - -tempPE = new IntProcessingElement( MUL, 205, llyr_config ); -graphOut.addVertex( 205, tempPE ); - -tempPE = new IntProcessingElement( MUL, 206, llyr_config ); -graphOut.addVertex( 206, tempPE ); - -tempPE = new IntProcessingElement( MUL, 207, llyr_config ); -graphOut.addVertex( 207, tempPE ); - -tempPE = new IntProcessingElement( MUL, 208, llyr_config ); -graphOut.addVertex( 208, tempPE ); - -tempPE = new IntProcessingElement( MUL, 209, llyr_config ); -graphOut.addVertex( 209, tempPE ); - -tempPE = new IntProcessingElement( MUL, 210, llyr_config ); -graphOut.addVertex( 210, tempPE ); - -tempPE = new IntProcessingElement( MUL, 211, llyr_config ); -graphOut.addVertex( 211, tempPE ); - -tempPE = new IntProcessingElement( MUL, 212, llyr_config ); -graphOut.addVertex( 212, tempPE ); - -tempPE = new IntProcessingElement( MUL, 213, llyr_config ); -graphOut.addVertex( 213, tempPE ); - -tempPE = new IntProcessingElement( MUL, 214, llyr_config ); -graphOut.addVertex( 214, tempPE ); - -tempPE = new IntProcessingElement( MUL, 215, llyr_config ); -graphOut.addVertex( 215, tempPE ); - -tempPE = new IntProcessingElement( MUL, 216, llyr_config ); -graphOut.addVertex( 216, tempPE ); - -tempPE = new IntProcessingElement( MUL, 217, llyr_config ); -graphOut.addVertex( 217, tempPE ); - -tempPE = new IntProcessingElement( MUL, 218, llyr_config ); -graphOut.addVertex( 218, tempPE ); - -tempPE = new IntProcessingElement( MUL, 219, llyr_config ); -graphOut.addVertex( 219, tempPE ); - -tempPE = new IntProcessingElement( MUL, 220, llyr_config ); -graphOut.addVertex( 220, tempPE ); - -tempPE = new IntProcessingElement( MUL, 221, llyr_config ); -graphOut.addVertex( 221, tempPE ); - -tempPE = new IntProcessingElement( MUL, 222, llyr_config ); -graphOut.addVertex( 222, tempPE ); - -tempPE = new IntProcessingElement( MUL, 223, llyr_config ); -graphOut.addVertex( 223, tempPE ); - -tempPE = new IntProcessingElement( MUL, 224, llyr_config ); -graphOut.addVertex( 224, tempPE ); - -tempPE = new IntProcessingElement( MUL, 225, llyr_config ); -graphOut.addVertex( 225, tempPE ); - -tempPE = new IntProcessingElement( MUL, 226, llyr_config ); -graphOut.addVertex( 226, tempPE ); - -tempPE = new IntProcessingElement( MUL, 227, llyr_config ); -graphOut.addVertex( 227, tempPE ); - -tempPE = new IntProcessingElement( MUL, 228, llyr_config ); -graphOut.addVertex( 228, tempPE ); - -tempPE = new IntProcessingElement( ADD, 229, llyr_config ); -graphOut.addVertex( 229, tempPE ); - -tempPE = new IntProcessingElement( ADD, 230, llyr_config ); -graphOut.addVertex( 230, tempPE ); - -tempPE = new IntProcessingElement( ADD, 231, llyr_config ); -graphOut.addVertex( 231, tempPE ); - -tempPE = new IntProcessingElement( ADD, 232, llyr_config ); -graphOut.addVertex( 232, tempPE ); - -tempPE = new IntProcessingElement( ADD, 233, llyr_config ); -graphOut.addVertex( 233, tempPE ); - -tempPE = new IntProcessingElement( ADD, 234, llyr_config ); -graphOut.addVertex( 234, tempPE ); - -tempPE = new IntProcessingElement( ADD, 235, llyr_config ); -graphOut.addVertex( 235, tempPE ); - -tempPE = new IntProcessingElement( ADD, 236, llyr_config ); -graphOut.addVertex( 236, tempPE ); - -tempPE = new IntProcessingElement( ADD, 237, llyr_config ); -graphOut.addVertex( 237, tempPE ); - -tempPE = new IntProcessingElement( ADD, 238, llyr_config ); -graphOut.addVertex( 238, tempPE ); - -tempPE = new IntProcessingElement( ADD, 239, llyr_config ); -graphOut.addVertex( 239, tempPE ); - -tempPE = new IntProcessingElement( ADD, 240, llyr_config ); -graphOut.addVertex( 240, tempPE ); - -tempPE = new IntProcessingElement( ADD, 241, llyr_config ); -graphOut.addVertex( 241, tempPE ); - -tempPE = new IntProcessingElement( ADD, 242, llyr_config ); -graphOut.addVertex( 242, tempPE ); - -tempPE = new IntProcessingElement( ADD, 243, llyr_config ); -graphOut.addVertex( 243, tempPE ); - -tempPE = new IntProcessingElement( ADD, 244, llyr_config ); -graphOut.addVertex( 244, tempPE ); - -tempPE = new IntProcessingElement( ADD, 245, llyr_config ); -graphOut.addVertex( 245, tempPE ); - -tempPE = new IntProcessingElement( ADD, 246, llyr_config ); -graphOut.addVertex( 246, tempPE ); - -tempPE = new IntProcessingElement( ADD, 247, llyr_config ); -graphOut.addVertex( 247, tempPE ); - -tempPE = new IntProcessingElement( ADD, 248, llyr_config ); -graphOut.addVertex( 248, tempPE ); - -tempPE = new IntProcessingElement( ADD, 249, llyr_config ); -graphOut.addVertex( 249, tempPE ); - -tempPE = new IntProcessingElement( ADD, 250, llyr_config ); -graphOut.addVertex( 250, tempPE ); - -tempPE = new IntProcessingElement( ADD, 251, llyr_config ); -graphOut.addVertex( 251, tempPE ); - -tempPE = new IntProcessingElement( ADD, 252, llyr_config ); -graphOut.addVertex( 252, tempPE ); - -tempPE = new IntProcessingElement( ADD, 253, llyr_config ); -graphOut.addVertex( 253, tempPE ); - -tempPE = new IntProcessingElement( ADD, 254, llyr_config ); -graphOut.addVertex( 254, tempPE ); - -tempPE = new IntProcessingElement( ADD, 255, llyr_config ); -graphOut.addVertex( 255, tempPE ); - -tempPE = new IntProcessingElement( ADD, 256, llyr_config ); -graphOut.addVertex( 256, tempPE ); - -tempPE = new IntProcessingElement( ADD, 257, llyr_config ); -graphOut.addVertex( 257, tempPE ); - -tempPE = new IntProcessingElement( ADD, 258, llyr_config ); -graphOut.addVertex( 258, tempPE ); - -tempPE = new IntProcessingElement( ADD, 259, llyr_config ); -graphOut.addVertex( 259, tempPE ); - -tempPE = new IntProcessingElement( ADD, 260, llyr_config ); -graphOut.addVertex( 260, tempPE ); - -tempPE = new IntProcessingElement( ADD, 261, llyr_config ); -graphOut.addVertex( 261, tempPE ); - -tempPE = new IntProcessingElement( ADD, 262, llyr_config ); -graphOut.addVertex( 262, tempPE ); - -tempPE = new IntProcessingElement( ADD, 263, llyr_config ); -graphOut.addVertex( 263, tempPE ); - -tempPE = new IntProcessingElement( ADD, 264, llyr_config ); -graphOut.addVertex( 264, tempPE ); - -tempPE = new IntProcessingElement( ADD, 265, llyr_config ); -graphOut.addVertex( 265, tempPE ); - -tempPE = new IntProcessingElement( ADD, 266, llyr_config ); -graphOut.addVertex( 266, tempPE ); - -tempPE = new IntProcessingElement( ADD, 267, llyr_config ); -graphOut.addVertex( 267, tempPE ); - -tempPE = new IntProcessingElement( ADD, 268, llyr_config ); -graphOut.addVertex( 268, tempPE ); - -tempPE = new IntProcessingElement( ADD, 269, llyr_config ); -graphOut.addVertex( 269, tempPE ); - -tempPE = new IntProcessingElement( ADD, 270, llyr_config ); -graphOut.addVertex( 270, tempPE ); - -tempPE = new IntProcessingElement( ADD, 271, llyr_config ); -graphOut.addVertex( 271, tempPE ); - -tempPE = new IntProcessingElement( ADD, 272, llyr_config ); -graphOut.addVertex( 272, tempPE ); - -tempPE = new IntProcessingElement( ADD, 273, llyr_config ); -graphOut.addVertex( 273, tempPE ); - -tempPE = new IntProcessingElement( ADD, 274, llyr_config ); -graphOut.addVertex( 274, tempPE ); - -tempPE = new IntProcessingElement( ADD, 275, llyr_config ); -graphOut.addVertex( 275, tempPE ); - -tempPE = new IntProcessingElement( ADD, 276, llyr_config ); -graphOut.addVertex( 276, tempPE ); - -tempPE = new IntProcessingElement( ADD, 277, llyr_config ); -graphOut.addVertex( 277, tempPE ); - -tempPE = new IntProcessingElement( ADD, 278, llyr_config ); -graphOut.addVertex( 278, tempPE ); - -tempPE = new IntProcessingElement( ADD, 279, llyr_config ); -graphOut.addVertex( 279, tempPE ); - -tempPE = new IntProcessingElement( ADD, 280, llyr_config ); -graphOut.addVertex( 280, tempPE ); - -tempPE = new IntProcessingElement( ADD, 281, llyr_config ); -graphOut.addVertex( 281, tempPE ); - -tempPE = new IntProcessingElement( ADD, 282, llyr_config ); -graphOut.addVertex( 282, tempPE ); - -tempPE = new IntProcessingElement( ADD, 283, llyr_config ); -graphOut.addVertex( 283, tempPE ); - -tempPE = new IntProcessingElement( ADD, 284, llyr_config ); -graphOut.addVertex( 284, tempPE ); - -tempPE = new IntProcessingElement( ADD, 285, llyr_config ); -graphOut.addVertex( 285, tempPE ); - -tempPE = new IntProcessingElement( ADD, 286, llyr_config ); -graphOut.addVertex( 286, tempPE ); - -tempPE = new IntProcessingElement( ADD, 287, llyr_config ); -graphOut.addVertex( 287, tempPE ); - -tempPE = new IntProcessingElement( ADD, 288, llyr_config ); -graphOut.addVertex( 288, tempPE ); - -tempPE = new IntProcessingElement( ADD, 289, llyr_config ); -graphOut.addVertex( 289, tempPE ); - -tempPE = new IntProcessingElement( ADD, 290, llyr_config ); -graphOut.addVertex( 290, tempPE ); - -tempPE = new IntProcessingElement( ADD, 291, llyr_config ); -graphOut.addVertex( 291, tempPE ); - -tempPE = new IntProcessingElement( ADD, 292, llyr_config ); -graphOut.addVertex( 292, tempPE ); - -tempPE = new IntProcessingElement( ADD, 293, llyr_config ); -graphOut.addVertex( 293, tempPE ); - -tempPE = new IntProcessingElement( ADD, 294, llyr_config ); -graphOut.addVertex( 294, tempPE ); - -tempPE = new IntProcessingElement( ADD, 295, llyr_config ); -graphOut.addVertex( 295, tempPE ); - -tempPE = new IntProcessingElement( ADD, 296, llyr_config ); -graphOut.addVertex( 296, tempPE ); - -tempPE = new IntProcessingElement( ADD, 297, llyr_config ); -graphOut.addVertex( 297, tempPE ); - -tempPE = new IntProcessingElement( ADD, 298, llyr_config ); -graphOut.addVertex( 298, tempPE ); - -tempPE = new IntProcessingElement( ADD, 299, llyr_config ); -graphOut.addVertex( 299, tempPE ); - -tempPE = new IntProcessingElement( ADD, 300, llyr_config ); -graphOut.addVertex( 300, tempPE ); - -tempPE = new IntProcessingElement( ADD, 301, llyr_config ); -graphOut.addVertex( 301, tempPE ); - -tempPE = new IntProcessingElement( ADD, 302, llyr_config ); -graphOut.addVertex( 302, tempPE ); - -tempPE = new IntProcessingElement( ADD, 303, llyr_config ); -graphOut.addVertex( 303, tempPE ); - -tempPE = new IntProcessingElement( ADD, 304, llyr_config ); -graphOut.addVertex( 304, tempPE ); - -tempPE = new IntProcessingElement( ADD, 305, llyr_config ); -graphOut.addVertex( 305, tempPE ); - -tempPE = new IntProcessingElement( ADD, 306, llyr_config ); -graphOut.addVertex( 306, tempPE ); - -tempPE = new IntProcessingElement( ADD, 307, llyr_config ); -graphOut.addVertex( 307, tempPE ); - -tempPE = new IntProcessingElement( ADD, 308, llyr_config ); -graphOut.addVertex( 308, tempPE ); - -tempPE = new IntProcessingElement( ADD, 309, llyr_config ); -graphOut.addVertex( 309, tempPE ); - -tempPE = new IntProcessingElement( ADD, 310, llyr_config ); -graphOut.addVertex( 310, tempPE ); - -tempPE = new IntProcessingElement( ADD, 311, llyr_config ); -graphOut.addVertex( 311, tempPE ); - -tempPE = new IntProcessingElement( ADD, 312, llyr_config ); -graphOut.addVertex( 312, tempPE ); - -tempPE = new IntProcessingElement( ADD, 313, llyr_config ); -graphOut.addVertex( 313, tempPE ); - -tempPE = new IntProcessingElement( ADD, 314, llyr_config ); -graphOut.addVertex( 314, tempPE ); - -tempPE = new IntProcessingElement( ADD, 315, llyr_config ); -graphOut.addVertex( 315, tempPE ); - -tempPE = new IntProcessingElement( ADD, 316, llyr_config ); -graphOut.addVertex( 316, tempPE ); - -tempPE = new IntProcessingElement( ADD, 317, llyr_config ); -graphOut.addVertex( 317, tempPE ); - -tempPE = new IntProcessingElement( ADD, 318, llyr_config ); -graphOut.addVertex( 318, tempPE ); - -tempPE = new IntProcessingElement( ADD, 319, llyr_config ); -graphOut.addVertex( 319, tempPE ); - -tempPE = new IntProcessingElement( ADD, 320, llyr_config ); -graphOut.addVertex( 320, tempPE ); - -tempPE = new IntProcessingElement( ADD, 321, llyr_config ); -graphOut.addVertex( 321, tempPE ); - -tempPE = new IntProcessingElement( ADD, 322, llyr_config ); -graphOut.addVertex( 322, tempPE ); - -tempPE = new IntProcessingElement( ADD, 323, llyr_config ); -graphOut.addVertex( 323, tempPE ); - -tempPE = new IntProcessingElement( ADD, 324, llyr_config ); -graphOut.addVertex( 324, tempPE ); - -tempPE = new IntProcessingElement( ADD, 325, llyr_config ); -graphOut.addVertex( 325, tempPE ); - -tempPE = new IntProcessingElement( ADD, 326, llyr_config ); -graphOut.addVertex( 326, tempPE ); - -tempPE = new IntProcessingElement( ADD, 327, llyr_config ); -graphOut.addVertex( 327, tempPE ); - -tempPE = new IntProcessingElement( ADD, 328, llyr_config ); -graphOut.addVertex( 328, tempPE ); - -tempPE = new IntProcessingElement( ADD, 329, llyr_config ); -graphOut.addVertex( 329, tempPE ); - -tempPE = new IntProcessingElement( ADD, 330, llyr_config ); -graphOut.addVertex( 330, tempPE ); - -tempPE = new IntProcessingElement( ADD, 331, llyr_config ); -graphOut.addVertex( 331, tempPE ); - -tempPE = new IntProcessingElement( ADD, 332, llyr_config ); -graphOut.addVertex( 332, tempPE ); - -tempPE = new IntProcessingElement( ADD, 333, llyr_config ); -graphOut.addVertex( 333, tempPE ); - -tempPE = new IntProcessingElement( ADD, 334, llyr_config ); -graphOut.addVertex( 334, tempPE ); - -tempPE = new IntProcessingElement( ADD, 335, llyr_config ); -graphOut.addVertex( 335, tempPE ); - -tempPE = new IntProcessingElement( ADD, 336, llyr_config ); -graphOut.addVertex( 336, tempPE ); - -tempPE = new IntProcessingElement( ADD, 337, llyr_config ); -graphOut.addVertex( 337, tempPE ); - -tempPE = new IntProcessingElement( ADD, 338, llyr_config ); -graphOut.addVertex( 338, tempPE ); - -tempPE = new IntProcessingElement( ADD, 339, llyr_config ); -graphOut.addVertex( 339, tempPE ); - -tempPE = new IntProcessingElement( ADD, 340, llyr_config ); -graphOut.addVertex( 340, tempPE ); - -tempPE = new IntProcessingElement( ADD, 341, llyr_config ); -graphOut.addVertex( 341, tempPE ); - -tempPE = new IntProcessingElement( ADD, 342, llyr_config ); -graphOut.addVertex( 342, tempPE ); - -tempPE = new IntProcessingElement( ADD, 343, llyr_config ); -graphOut.addVertex( 343, tempPE ); - -tempPE = new IntProcessingElement( ADD, 344, llyr_config ); -graphOut.addVertex( 344, tempPE ); - -tempPE = new IntProcessingElement( ADD, 345, llyr_config ); -graphOut.addVertex( 345, tempPE ); - -tempPE = new IntProcessingElement( ADD, 346, llyr_config ); -graphOut.addVertex( 346, tempPE ); - -tempPE = new IntProcessingElement( ADD, 347, llyr_config ); -graphOut.addVertex( 347, tempPE ); - -tempPE = new IntProcessingElement( ADD, 348, llyr_config ); -graphOut.addVertex( 348, tempPE ); - -tempPE = new StoreProcessingElement( ST, 349, llyr_config ); -graphOut.addVertex( 349, tempPE ); - -tempPE = new StoreProcessingElement( ST, 350, llyr_config ); -graphOut.addVertex( 350, tempPE ); - -tempPE = new StoreProcessingElement( ST, 351, llyr_config ); -graphOut.addVertex( 351, tempPE ); - -tempPE = new StoreProcessingElement( ST, 352, llyr_config ); -graphOut.addVertex( 352, tempPE ); - -tempPE = new StoreProcessingElement( ST, 353, llyr_config ); -graphOut.addVertex( 353, tempPE ); - -tempPE = new StoreProcessingElement( ST, 354, llyr_config ); -graphOut.addVertex( 354, tempPE ); - -tempPE = new StoreProcessingElement( ST, 355, llyr_config ); -graphOut.addVertex( 355, tempPE ); - -tempPE = new StoreProcessingElement( ST, 356, llyr_config ); -graphOut.addVertex( 356, tempPE ); - -tempPE = new StoreProcessingElement( ST, 357, llyr_config ); -graphOut.addVertex( 357, tempPE ); - -tempPE = new StoreProcessingElement( ST, 358, llyr_config ); -graphOut.addVertex( 358, tempPE ); - -tempPE = new StoreProcessingElement( ST, 359, llyr_config ); -graphOut.addVertex( 359, tempPE ); - -tempPE = new StoreProcessingElement( ST, 360, llyr_config ); -graphOut.addVertex( 360, tempPE ); - -tempPE = new StoreProcessingElement( ST, 361, llyr_config ); -graphOut.addVertex( 361, tempPE ); - -tempPE = new StoreProcessingElement( ST, 362, llyr_config ); -graphOut.addVertex( 362, tempPE ); - -tempPE = new StoreProcessingElement( ST, 363, llyr_config ); -graphOut.addVertex( 363, tempPE ); - -tempPE = new StoreProcessingElement( ST, 364, llyr_config ); -graphOut.addVertex( 364, tempPE ); - -tempPE = new StoreProcessingElement( ST, 365, llyr_config ); -graphOut.addVertex( 365, tempPE ); - -tempPE = new StoreProcessingElement( ST, 366, llyr_config ); -graphOut.addVertex( 366, tempPE ); - -tempPE = new StoreProcessingElement( ST, 367, llyr_config ); -graphOut.addVertex( 367, tempPE ); - -tempPE = new StoreProcessingElement( ST, 368, llyr_config ); -graphOut.addVertex( 368, tempPE ); - -tempPE = new StoreProcessingElement( ST, 369, llyr_config ); -graphOut.addVertex( 369, tempPE ); - -tempPE = new StoreProcessingElement( ST, 370, llyr_config ); -graphOut.addVertex( 370, tempPE ); - -tempPE = new StoreProcessingElement( ST, 371, llyr_config ); -graphOut.addVertex( 371, tempPE ); - -tempPE = new StoreProcessingElement( ST, 372, llyr_config ); -graphOut.addVertex( 372, tempPE ); - -tempPE = new StoreProcessingElement( ST, 373, llyr_config ); -graphOut.addVertex( 373, tempPE ); - -tempPE = new StoreProcessingElement( ST, 374, llyr_config ); -graphOut.addVertex( 374, tempPE ); - -tempPE = new StoreProcessingElement( ST, 375, llyr_config ); -graphOut.addVertex( 375, tempPE ); - -tempPE = new StoreProcessingElement( ST, 376, llyr_config ); -graphOut.addVertex( 376, tempPE ); - -tempPE = new StoreProcessingElement( ST, 377, llyr_config ); -graphOut.addVertex( 377, tempPE ); - -tempPE = new StoreProcessingElement( ST, 378, llyr_config ); -graphOut.addVertex( 378, tempPE ); - -tempPE = new StoreProcessingElement( ST, 379, llyr_config ); -graphOut.addVertex( 379, tempPE ); - -tempPE = new StoreProcessingElement( ST, 380, llyr_config ); -graphOut.addVertex( 380, tempPE ); - -tempPE = new StoreProcessingElement( ST, 381, llyr_config ); -graphOut.addVertex( 381, tempPE ); - -tempPE = new StoreProcessingElement( ST, 382, llyr_config ); -graphOut.addVertex( 382, tempPE ); - -tempPE = new StoreProcessingElement( ST, 383, llyr_config ); -graphOut.addVertex( 383, tempPE ); - -tempPE = new StoreProcessingElement( ST, 384, llyr_config ); -graphOut.addVertex( 384, tempPE ); - -tempPE = new StoreProcessingElement( ST, 385, llyr_config ); -graphOut.addVertex( 385, tempPE ); - -tempPE = new StoreProcessingElement( ST, 386, llyr_config ); -graphOut.addVertex( 386, tempPE ); - -tempPE = new StoreProcessingElement( ST, 387, llyr_config ); -graphOut.addVertex( 387, tempPE ); - -tempPE = new StoreProcessingElement( ST, 388, llyr_config ); -graphOut.addVertex( 388, tempPE ); - -tempPE = new StoreProcessingElement( ST, 389, llyr_config ); -graphOut.addVertex( 389, tempPE ); - -tempPE = new StoreProcessingElement( ST, 390, llyr_config ); -graphOut.addVertex( 390, tempPE ); - -tempPE = new StoreProcessingElement( ST, 391, llyr_config ); -graphOut.addVertex( 391, tempPE ); - -tempPE = new StoreProcessingElement( ST, 392, llyr_config ); -graphOut.addVertex( 392, tempPE ); - -tempPE = new StoreProcessingElement( ST, 393, llyr_config ); -graphOut.addVertex( 393, tempPE ); - -tempPE = new StoreProcessingElement( ST, 394, llyr_config ); -graphOut.addVertex( 394, tempPE ); - -tempPE = new StoreProcessingElement( ST, 395, llyr_config ); -graphOut.addVertex( 395, tempPE ); - -tempPE = new StoreProcessingElement( ST, 396, llyr_config ); -graphOut.addVertex( 396, tempPE ); - -tempPE = new StoreProcessingElement( ST, 397, llyr_config ); -graphOut.addVertex( 397, tempPE ); - -tempPE = new StoreProcessingElement( ST, 398, llyr_config ); -graphOut.addVertex( 398, tempPE ); - -tempPE = new StoreProcessingElement( ST, 399, llyr_config ); -graphOut.addVertex( 399, tempPE ); - -tempPE = new StoreProcessingElement( ST, 400, llyr_config ); -graphOut.addVertex( 400, tempPE ); - -tempPE = new StoreProcessingElement( ST, 401, llyr_config ); -graphOut.addVertex( 401, tempPE ); - -tempPE = new StoreProcessingElement( ST, 402, llyr_config ); -graphOut.addVertex( 402, tempPE ); - -tempPE = new StoreProcessingElement( ST, 403, llyr_config ); -graphOut.addVertex( 403, tempPE ); - -tempPE = new StoreProcessingElement( ST, 404, llyr_config ); -graphOut.addVertex( 404, tempPE ); - -tempPE = new StoreProcessingElement( ST, 405, llyr_config ); -graphOut.addVertex( 405, tempPE ); - -tempPE = new StoreProcessingElement( ST, 406, llyr_config ); -graphOut.addVertex( 406, tempPE ); - -tempPE = new StoreProcessingElement( ST, 407, llyr_config ); -graphOut.addVertex( 407, tempPE ); - -tempPE = new StoreProcessingElement( ST, 408, llyr_config ); -graphOut.addVertex( 408, tempPE ); - -graphOut.addEdge( 0, 1 ); -graphOut.addEdge( 0, 2 ); -graphOut.addEdge( 0, 3 ); -graphOut.addEdge( 0, 4 ); -graphOut.addEdge( 0, 5 ); -graphOut.addEdge( 0, 6 ); -graphOut.addEdge( 0, 7 ); -graphOut.addEdge( 0, 8 ); -graphOut.addEdge( 0, 9 ); -graphOut.addEdge( 0, 10 ); -graphOut.addEdge( 0, 11 ); -graphOut.addEdge( 0, 12 ); -graphOut.addEdge( 0, 13 ); -graphOut.addEdge( 0, 14 ); -graphOut.addEdge( 0, 15 ); -graphOut.addEdge( 0, 16 ); -graphOut.addEdge( 0, 17 ); -graphOut.addEdge( 0, 18 ); -graphOut.addEdge( 0, 19 ); -graphOut.addEdge( 0, 20 ); -graphOut.addEdge( 0, 21 ); -graphOut.addEdge( 0, 22 ); -graphOut.addEdge( 0, 23 ); -graphOut.addEdge( 0, 24 ); -graphOut.addEdge( 0, 25 ); -graphOut.addEdge( 0, 26 ); -graphOut.addEdge( 0, 27 ); -graphOut.addEdge( 0, 28 ); -graphOut.addEdge( 0, 29 ); -graphOut.addEdge( 0, 30 ); -graphOut.addEdge( 0, 31 ); -graphOut.addEdge( 0, 32 ); -graphOut.addEdge( 0, 33 ); -graphOut.addEdge( 0, 34 ); -graphOut.addEdge( 0, 35 ); -graphOut.addEdge( 0, 36 ); -graphOut.addEdge( 0, 37 ); -graphOut.addEdge( 0, 38 ); -graphOut.addEdge( 0, 39 ); -graphOut.addEdge( 0, 40 ); -graphOut.addEdge( 0, 41 ); -graphOut.addEdge( 0, 42 ); -graphOut.addEdge( 0, 43 ); -graphOut.addEdge( 0, 44 ); -graphOut.addEdge( 0, 45 ); -graphOut.addEdge( 0, 46 ); -graphOut.addEdge( 0, 47 ); -graphOut.addEdge( 0, 48 ); - -graphOut.addEdge( 1, 49 ); -graphOut.addEdge( 1, 52 ); -graphOut.addEdge( 1, 55 ); -graphOut.addEdge( 1, 58 ); -graphOut.addEdge( 1, 61 ); -graphOut.addEdge( 1, 64 ); -graphOut.addEdge( 1, 67 ); -graphOut.addEdge( 1, 70 ); -graphOut.addEdge( 1, 73 ); -graphOut.addEdge( 1, 76 ); - -graphOut.addEdge( 19, 49 ); -graphOut.addEdge( 19, 79 ); -graphOut.addEdge( 19, 109 ); -graphOut.addEdge( 19, 139 ); -graphOut.addEdge( 19, 169 ); -graphOut.addEdge( 19, 199 ); - -graphOut.addEdge( 2, 50 ); -graphOut.addEdge( 2, 53 ); -graphOut.addEdge( 2, 56 ); -graphOut.addEdge( 2, 59 ); -graphOut.addEdge( 2, 62 ); -graphOut.addEdge( 2, 65 ); -graphOut.addEdge( 2, 68 ); -graphOut.addEdge( 2, 71 ); -graphOut.addEdge( 2, 74 ); -graphOut.addEdge( 2, 77 ); - -graphOut.addEdge( 29, 50 ); -graphOut.addEdge( 29, 80 ); -graphOut.addEdge( 29, 110 ); -graphOut.addEdge( 29, 140 ); -graphOut.addEdge( 29, 170 ); -graphOut.addEdge( 29, 200 ); - -graphOut.addEdge( 3, 51 ); -graphOut.addEdge( 3, 54 ); -graphOut.addEdge( 3, 57 ); -graphOut.addEdge( 3, 60 ); -graphOut.addEdge( 3, 63 ); -graphOut.addEdge( 3, 66 ); -graphOut.addEdge( 3, 69 ); -graphOut.addEdge( 3, 72 ); -graphOut.addEdge( 3, 75 ); -graphOut.addEdge( 3, 78 ); - -graphOut.addEdge( 39, 51 ); -graphOut.addEdge( 39, 81 ); -graphOut.addEdge( 39, 111 ); -graphOut.addEdge( 39, 141 ); -graphOut.addEdge( 39, 171 ); -graphOut.addEdge( 39, 201 ); - -graphOut.addEdge( 20, 52 ); -graphOut.addEdge( 20, 82 ); -graphOut.addEdge( 20, 112 ); -graphOut.addEdge( 20, 142 ); -graphOut.addEdge( 20, 172 ); -graphOut.addEdge( 20, 202 ); - -graphOut.addEdge( 30, 53 ); -graphOut.addEdge( 30, 83 ); -graphOut.addEdge( 30, 113 ); -graphOut.addEdge( 30, 143 ); -graphOut.addEdge( 30, 173 ); -graphOut.addEdge( 30, 203 ); - -graphOut.addEdge( 40, 54 ); -graphOut.addEdge( 40, 84 ); -graphOut.addEdge( 40, 114 ); -graphOut.addEdge( 40, 144 ); -graphOut.addEdge( 40, 174 ); -graphOut.addEdge( 40, 204 ); - -graphOut.addEdge( 21, 55 ); -graphOut.addEdge( 21, 85 ); -graphOut.addEdge( 21, 115 ); -graphOut.addEdge( 21, 145 ); -graphOut.addEdge( 21, 175 ); -graphOut.addEdge( 21, 205 ); - -graphOut.addEdge( 31, 56 ); -graphOut.addEdge( 31, 86 ); -graphOut.addEdge( 31, 116 ); -graphOut.addEdge( 31, 146 ); -graphOut.addEdge( 31, 176 ); -graphOut.addEdge( 31, 206 ); - -graphOut.addEdge( 41, 57 ); -graphOut.addEdge( 41, 87 ); -graphOut.addEdge( 41, 117 ); -graphOut.addEdge( 41, 147 ); -graphOut.addEdge( 41, 177 ); -graphOut.addEdge( 41, 207 ); - -graphOut.addEdge( 22, 58 ); -graphOut.addEdge( 22, 88 ); -graphOut.addEdge( 22, 118 ); -graphOut.addEdge( 22, 148 ); -graphOut.addEdge( 22, 178 ); -graphOut.addEdge( 22, 208 ); - -graphOut.addEdge( 32, 59 ); -graphOut.addEdge( 32, 89 ); -graphOut.addEdge( 32, 119 ); -graphOut.addEdge( 32, 149 ); -graphOut.addEdge( 32, 179 ); -graphOut.addEdge( 32, 209 ); - -graphOut.addEdge( 42, 60 ); -graphOut.addEdge( 42, 90 ); -graphOut.addEdge( 42, 120 ); -graphOut.addEdge( 42, 150 ); -graphOut.addEdge( 42, 180 ); -graphOut.addEdge( 42, 210 ); - -graphOut.addEdge( 23, 61 ); -graphOut.addEdge( 23, 91 ); -graphOut.addEdge( 23, 121 ); -graphOut.addEdge( 23, 151 ); -graphOut.addEdge( 23, 181 ); -graphOut.addEdge( 23, 211 ); - -graphOut.addEdge( 33, 62 ); -graphOut.addEdge( 33, 92 ); -graphOut.addEdge( 33, 122 ); -graphOut.addEdge( 33, 152 ); -graphOut.addEdge( 33, 182 ); -graphOut.addEdge( 33, 212 ); - -graphOut.addEdge( 43, 63 ); -graphOut.addEdge( 43, 93 ); -graphOut.addEdge( 43, 123 ); -graphOut.addEdge( 43, 153 ); -graphOut.addEdge( 43, 183 ); -graphOut.addEdge( 43, 213 ); - -graphOut.addEdge( 24, 64 ); -graphOut.addEdge( 24, 94 ); -graphOut.addEdge( 24, 124 ); -graphOut.addEdge( 24, 154 ); -graphOut.addEdge( 24, 184 ); -graphOut.addEdge( 24, 214 ); - -graphOut.addEdge( 34, 65 ); -graphOut.addEdge( 34, 95 ); -graphOut.addEdge( 34, 125 ); -graphOut.addEdge( 34, 155 ); -graphOut.addEdge( 34, 185 ); -graphOut.addEdge( 34, 215 ); - -graphOut.addEdge( 44, 66 ); -graphOut.addEdge( 44, 96 ); -graphOut.addEdge( 44, 126 ); -graphOut.addEdge( 44, 156 ); -graphOut.addEdge( 44, 186 ); -graphOut.addEdge( 44, 216 ); - -graphOut.addEdge( 25, 67 ); -graphOut.addEdge( 25, 97 ); -graphOut.addEdge( 25, 127 ); -graphOut.addEdge( 25, 157 ); -graphOut.addEdge( 25, 187 ); -graphOut.addEdge( 25, 217 ); - -graphOut.addEdge( 35, 68 ); -graphOut.addEdge( 35, 98 ); -graphOut.addEdge( 35, 128 ); -graphOut.addEdge( 35, 158 ); -graphOut.addEdge( 35, 188 ); -graphOut.addEdge( 35, 218 ); - -graphOut.addEdge( 45, 69 ); -graphOut.addEdge( 45, 99 ); -graphOut.addEdge( 45, 129 ); -graphOut.addEdge( 45, 159 ); -graphOut.addEdge( 45, 189 ); -graphOut.addEdge( 45, 219 ); - -graphOut.addEdge( 26, 70 ); -graphOut.addEdge( 26, 100 ); -graphOut.addEdge( 26, 130 ); -graphOut.addEdge( 26, 160 ); -graphOut.addEdge( 26, 190 ); -graphOut.addEdge( 26, 220 ); - -graphOut.addEdge( 36, 71 ); -graphOut.addEdge( 36, 101 ); -graphOut.addEdge( 36, 131 ); -graphOut.addEdge( 36, 161 ); -graphOut.addEdge( 36, 191 ); -graphOut.addEdge( 36, 221 ); - -graphOut.addEdge( 46, 72 ); -graphOut.addEdge( 46, 102 ); -graphOut.addEdge( 46, 132 ); -graphOut.addEdge( 46, 162 ); -graphOut.addEdge( 46, 192 ); -graphOut.addEdge( 46, 222 ); - -graphOut.addEdge( 27, 73 ); -graphOut.addEdge( 27, 103 ); -graphOut.addEdge( 27, 133 ); -graphOut.addEdge( 27, 163 ); -graphOut.addEdge( 27, 193 ); -graphOut.addEdge( 27, 223 ); - -graphOut.addEdge( 37, 74 ); -graphOut.addEdge( 37, 104 ); -graphOut.addEdge( 37, 134 ); -graphOut.addEdge( 37, 164 ); -graphOut.addEdge( 37, 194 ); -graphOut.addEdge( 37, 224 ); - -graphOut.addEdge( 47, 75 ); -graphOut.addEdge( 47, 105 ); -graphOut.addEdge( 47, 135 ); -graphOut.addEdge( 47, 165 ); -graphOut.addEdge( 47, 195 ); -graphOut.addEdge( 47, 225 ); - -graphOut.addEdge( 28, 76 ); -graphOut.addEdge( 28, 106 ); -graphOut.addEdge( 28, 136 ); -graphOut.addEdge( 28, 166 ); -graphOut.addEdge( 28, 196 ); -graphOut.addEdge( 28, 226 ); - -graphOut.addEdge( 38, 77 ); -graphOut.addEdge( 38, 107 ); -graphOut.addEdge( 38, 137 ); -graphOut.addEdge( 38, 167 ); -graphOut.addEdge( 38, 197 ); -graphOut.addEdge( 38, 227 ); - -graphOut.addEdge( 48, 78 ); -graphOut.addEdge( 48, 108 ); -graphOut.addEdge( 48, 138 ); -graphOut.addEdge( 48, 168 ); -graphOut.addEdge( 48, 198 ); -graphOut.addEdge( 48, 228 ); - -graphOut.addEdge( 4, 79 ); -graphOut.addEdge( 4, 82 ); -graphOut.addEdge( 4, 85 ); -graphOut.addEdge( 4, 88 ); -graphOut.addEdge( 4, 91 ); -graphOut.addEdge( 4, 94 ); -graphOut.addEdge( 4, 97 ); -graphOut.addEdge( 4, 100 ); -graphOut.addEdge( 4, 103 ); -graphOut.addEdge( 4, 106 ); - -graphOut.addEdge( 5, 80 ); -graphOut.addEdge( 5, 83 ); -graphOut.addEdge( 5, 86 ); -graphOut.addEdge( 5, 89 ); -graphOut.addEdge( 5, 92 ); -graphOut.addEdge( 5, 95 ); -graphOut.addEdge( 5, 98 ); -graphOut.addEdge( 5, 101 ); -graphOut.addEdge( 5, 104 ); -graphOut.addEdge( 5, 107 ); - -graphOut.addEdge( 6, 81 ); -graphOut.addEdge( 6, 84 ); -graphOut.addEdge( 6, 87 ); -graphOut.addEdge( 6, 90 ); -graphOut.addEdge( 6, 93 ); -graphOut.addEdge( 6, 96 ); -graphOut.addEdge( 6, 99 ); -graphOut.addEdge( 6, 102 ); -graphOut.addEdge( 6, 105 ); -graphOut.addEdge( 6, 108 ); - -graphOut.addEdge( 7, 109 ); -graphOut.addEdge( 7, 112 ); -graphOut.addEdge( 7, 115 ); -graphOut.addEdge( 7, 118 ); -graphOut.addEdge( 7, 121 ); -graphOut.addEdge( 7, 124 ); -graphOut.addEdge( 7, 127 ); -graphOut.addEdge( 7, 130 ); -graphOut.addEdge( 7, 133 ); -graphOut.addEdge( 7, 136 ); - -graphOut.addEdge( 8, 110 ); -graphOut.addEdge( 8, 113 ); -graphOut.addEdge( 8, 116 ); -graphOut.addEdge( 8, 119 ); -graphOut.addEdge( 8, 122 ); -graphOut.addEdge( 8, 125 ); -graphOut.addEdge( 8, 128 ); -graphOut.addEdge( 8, 131 ); -graphOut.addEdge( 8, 134 ); -graphOut.addEdge( 8, 137 ); - -graphOut.addEdge( 9, 111 ); -graphOut.addEdge( 9, 114 ); -graphOut.addEdge( 9, 117 ); -graphOut.addEdge( 9, 120 ); -graphOut.addEdge( 9, 123 ); -graphOut.addEdge( 9, 126 ); -graphOut.addEdge( 9, 129 ); -graphOut.addEdge( 9, 132 ); -graphOut.addEdge( 9, 135 ); -graphOut.addEdge( 9, 138 ); - -graphOut.addEdge( 10, 139 ); -graphOut.addEdge( 10, 142 ); -graphOut.addEdge( 10, 145 ); -graphOut.addEdge( 10, 148 ); -graphOut.addEdge( 10, 151 ); -graphOut.addEdge( 10, 154 ); -graphOut.addEdge( 10, 157 ); -graphOut.addEdge( 10, 160 ); -graphOut.addEdge( 10, 163 ); -graphOut.addEdge( 10, 166 ); - -graphOut.addEdge( 11, 140 ); -graphOut.addEdge( 11, 143 ); -graphOut.addEdge( 11, 146 ); -graphOut.addEdge( 11, 149 ); -graphOut.addEdge( 11, 152 ); -graphOut.addEdge( 11, 155 ); -graphOut.addEdge( 11, 158 ); -graphOut.addEdge( 11, 161 ); -graphOut.addEdge( 11, 164 ); -graphOut.addEdge( 11, 167 ); - -graphOut.addEdge( 12, 141 ); -graphOut.addEdge( 12, 144 ); -graphOut.addEdge( 12, 147 ); -graphOut.addEdge( 12, 150 ); -graphOut.addEdge( 12, 153 ); -graphOut.addEdge( 12, 156 ); -graphOut.addEdge( 12, 159 ); -graphOut.addEdge( 12, 162 ); -graphOut.addEdge( 12, 165 ); -graphOut.addEdge( 12, 168 ); - -graphOut.addEdge( 13, 169 ); -graphOut.addEdge( 13, 172 ); -graphOut.addEdge( 13, 175 ); -graphOut.addEdge( 13, 178 ); -graphOut.addEdge( 13, 181 ); -graphOut.addEdge( 13, 184 ); -graphOut.addEdge( 13, 187 ); -graphOut.addEdge( 13, 190 ); -graphOut.addEdge( 13, 193 ); -graphOut.addEdge( 13, 196 ); - -graphOut.addEdge( 14, 170 ); -graphOut.addEdge( 14, 173 ); -graphOut.addEdge( 14, 176 ); -graphOut.addEdge( 14, 179 ); -graphOut.addEdge( 14, 182 ); -graphOut.addEdge( 14, 185 ); -graphOut.addEdge( 14, 188 ); -graphOut.addEdge( 14, 191 ); -graphOut.addEdge( 14, 194 ); -graphOut.addEdge( 14, 197 ); - -graphOut.addEdge( 15, 171 ); -graphOut.addEdge( 15, 174 ); -graphOut.addEdge( 15, 177 ); -graphOut.addEdge( 15, 180 ); -graphOut.addEdge( 15, 183 ); -graphOut.addEdge( 15, 186 ); -graphOut.addEdge( 15, 189 ); -graphOut.addEdge( 15, 192 ); -graphOut.addEdge( 15, 195 ); -graphOut.addEdge( 15, 198 ); - -graphOut.addEdge( 16, 199 ); -graphOut.addEdge( 16, 202 ); -graphOut.addEdge( 16, 205 ); -graphOut.addEdge( 16, 208 ); -graphOut.addEdge( 16, 211 ); -graphOut.addEdge( 16, 214 ); -graphOut.addEdge( 16, 217 ); -graphOut.addEdge( 16, 220 ); -graphOut.addEdge( 16, 223 ); -graphOut.addEdge( 16, 226 ); - -graphOut.addEdge( 17, 200 ); -graphOut.addEdge( 17, 203 ); -graphOut.addEdge( 17, 206 ); -graphOut.addEdge( 17, 209 ); -graphOut.addEdge( 17, 212 ); -graphOut.addEdge( 17, 215 ); -graphOut.addEdge( 17, 218 ); -graphOut.addEdge( 17, 221 ); -graphOut.addEdge( 17, 224 ); -graphOut.addEdge( 17, 227 ); - -graphOut.addEdge( 18, 201 ); -graphOut.addEdge( 18, 204 ); -graphOut.addEdge( 18, 207 ); -graphOut.addEdge( 18, 210 ); -graphOut.addEdge( 18, 213 ); -graphOut.addEdge( 18, 216 ); -graphOut.addEdge( 18, 219 ); -graphOut.addEdge( 18, 222 ); -graphOut.addEdge( 18, 225 ); -graphOut.addEdge( 18, 228 ); - -graphOut.addEdge( 49, 229 ); -graphOut.addEdge( 50, 229 ); -graphOut.addEdge( 229, 230 ); -graphOut.addEdge( 51, 230 ); - -graphOut.addEdge( 52, 231 ); -graphOut.addEdge( 53, 231 ); -graphOut.addEdge( 231, 232 ); -graphOut.addEdge( 54, 232 ); - -graphOut.addEdge( 55, 233 ); -graphOut.addEdge( 56, 233 ); -graphOut.addEdge( 233, 234 ); -graphOut.addEdge( 57, 234 ); - -graphOut.addEdge( 58, 235 ); -graphOut.addEdge( 59, 235 ); -graphOut.addEdge( 235, 236 ); -graphOut.addEdge( 60, 236 ); - -graphOut.addEdge( 61, 237 ); -graphOut.addEdge( 62, 237 ); -graphOut.addEdge( 237, 238 ); -graphOut.addEdge( 63, 238 ); - -graphOut.addEdge( 64, 239 ); -graphOut.addEdge( 65, 239 ); -graphOut.addEdge( 239, 240 ); -graphOut.addEdge( 66, 240 ); - -graphOut.addEdge( 67, 241 ); -graphOut.addEdge( 68, 241 ); -graphOut.addEdge( 241, 242 ); -graphOut.addEdge( 69, 242 ); - -graphOut.addEdge( 70, 243 ); -graphOut.addEdge( 71, 243 ); -graphOut.addEdge( 243, 244 ); -graphOut.addEdge( 72, 244 ); - -graphOut.addEdge( 73, 245 ); -graphOut.addEdge( 74, 245 ); -graphOut.addEdge( 245, 246 ); -graphOut.addEdge( 75, 246 ); - -graphOut.addEdge( 76, 247 ); -graphOut.addEdge( 77, 247 ); -graphOut.addEdge( 247, 248 ); -graphOut.addEdge( 78, 248 ); - -graphOut.addEdge( 79, 249 ); -graphOut.addEdge( 80, 249 ); -graphOut.addEdge( 249, 250 ); -graphOut.addEdge( 81, 250 ); - -graphOut.addEdge( 82, 251 ); -graphOut.addEdge( 83, 251 ); -graphOut.addEdge( 251, 252 ); -graphOut.addEdge( 84, 252 ); - -graphOut.addEdge( 85, 253 ); -graphOut.addEdge( 86, 253 ); -graphOut.addEdge( 253, 254 ); -graphOut.addEdge( 87, 254 ); - -graphOut.addEdge( 88, 255 ); -graphOut.addEdge( 89, 255 ); -graphOut.addEdge( 255, 256 ); -graphOut.addEdge( 90, 256 ); - -graphOut.addEdge( 91, 257 ); -graphOut.addEdge( 92, 257 ); -graphOut.addEdge( 257, 258 ); -graphOut.addEdge( 93, 258 ); - -graphOut.addEdge( 94, 259 ); -graphOut.addEdge( 95, 259 ); -graphOut.addEdge( 259, 260 ); -graphOut.addEdge( 96, 260 ); - -graphOut.addEdge( 97, 261 ); -graphOut.addEdge( 98, 261 ); -graphOut.addEdge( 261, 262 ); -graphOut.addEdge( 99, 262 ); - -graphOut.addEdge( 100, 263 ); -graphOut.addEdge( 101, 263 ); -graphOut.addEdge( 263, 264 ); -graphOut.addEdge( 102, 264 ); - -graphOut.addEdge( 103, 265 ); -graphOut.addEdge( 104, 265 ); -graphOut.addEdge( 265, 266 ); -graphOut.addEdge( 105, 266 ); - -graphOut.addEdge( 106, 267 ); -graphOut.addEdge( 107, 267 ); -graphOut.addEdge( 267, 268 ); -graphOut.addEdge( 108, 268 ); - -graphOut.addEdge( 109, 269 ); -graphOut.addEdge( 110, 269 ); -graphOut.addEdge( 269, 270 ); -graphOut.addEdge( 111, 270 ); - -graphOut.addEdge( 112, 271 ); -graphOut.addEdge( 113, 271 ); -graphOut.addEdge( 271, 272 ); -graphOut.addEdge( 114, 272 ); - -graphOut.addEdge( 115, 273 ); -graphOut.addEdge( 116, 273 ); -graphOut.addEdge( 273, 274 ); -graphOut.addEdge( 117, 274 ); - -graphOut.addEdge( 118, 275 ); -graphOut.addEdge( 119, 275 ); -graphOut.addEdge( 275, 276 ); -graphOut.addEdge( 120, 276 ); - -graphOut.addEdge( 121, 277 ); -graphOut.addEdge( 122, 277 ); -graphOut.addEdge( 277, 278 ); -graphOut.addEdge( 123, 278 ); - -graphOut.addEdge( 124, 279 ); -graphOut.addEdge( 125, 279 ); -graphOut.addEdge( 279, 280 ); -graphOut.addEdge( 126, 280 ); - -graphOut.addEdge( 127, 281 ); -graphOut.addEdge( 128, 281 ); -graphOut.addEdge( 281, 282 ); -graphOut.addEdge( 129, 282 ); - -graphOut.addEdge( 130, 283 ); -graphOut.addEdge( 131, 283 ); -graphOut.addEdge( 283, 284 ); -graphOut.addEdge( 132, 284 ); - -graphOut.addEdge( 133, 285 ); -graphOut.addEdge( 134, 285 ); -graphOut.addEdge( 285, 286 ); -graphOut.addEdge( 135, 286 ); - -graphOut.addEdge( 136, 287 ); -graphOut.addEdge( 137, 287 ); -graphOut.addEdge( 287, 288 ); -graphOut.addEdge( 138, 288 ); - -graphOut.addEdge( 139, 289 ); -graphOut.addEdge( 140, 289 ); -graphOut.addEdge( 289, 290 ); -graphOut.addEdge( 141, 290 ); - -graphOut.addEdge( 142, 291 ); -graphOut.addEdge( 143, 291 ); -graphOut.addEdge( 291, 292 ); -graphOut.addEdge( 144, 292 ); - -graphOut.addEdge( 145, 293 ); -graphOut.addEdge( 146, 293 ); -graphOut.addEdge( 293, 294 ); -graphOut.addEdge( 147, 294 ); - -graphOut.addEdge( 148, 295 ); -graphOut.addEdge( 149, 295 ); -graphOut.addEdge( 295, 296 ); -graphOut.addEdge( 150, 296 ); - -graphOut.addEdge( 151, 297 ); -graphOut.addEdge( 152, 297 ); -graphOut.addEdge( 297, 298 ); -graphOut.addEdge( 153, 298 ); - -graphOut.addEdge( 154, 299 ); -graphOut.addEdge( 155, 299 ); -graphOut.addEdge( 299, 300 ); -graphOut.addEdge( 156, 300 ); - -graphOut.addEdge( 157, 301 ); -graphOut.addEdge( 158, 301 ); -graphOut.addEdge( 301, 302 ); -graphOut.addEdge( 159, 302 ); - -graphOut.addEdge( 160, 303 ); -graphOut.addEdge( 161, 303 ); -graphOut.addEdge( 303, 304 ); -graphOut.addEdge( 162, 304 ); - -graphOut.addEdge( 163, 305 ); -graphOut.addEdge( 164, 305 ); -graphOut.addEdge( 305, 306 ); -graphOut.addEdge( 165, 306 ); - -graphOut.addEdge( 166, 307 ); -graphOut.addEdge( 167, 307 ); -graphOut.addEdge( 307, 308 ); -graphOut.addEdge( 168, 308 ); - -graphOut.addEdge( 169, 309 ); -graphOut.addEdge( 170, 309 ); -graphOut.addEdge( 309, 310 ); -graphOut.addEdge( 171, 310 ); - -graphOut.addEdge( 172, 311 ); -graphOut.addEdge( 173, 311 ); -graphOut.addEdge( 311, 312 ); -graphOut.addEdge( 174, 312 ); - -graphOut.addEdge( 175, 313 ); -graphOut.addEdge( 176, 313 ); -graphOut.addEdge( 313, 314 ); -graphOut.addEdge( 177, 314 ); - -graphOut.addEdge( 178, 315 ); -graphOut.addEdge( 179, 315 ); -graphOut.addEdge( 315, 316 ); -graphOut.addEdge( 180, 316 ); - -graphOut.addEdge( 181, 317 ); -graphOut.addEdge( 182, 317 ); -graphOut.addEdge( 317, 318 ); -graphOut.addEdge( 183, 318 ); - -graphOut.addEdge( 184, 319 ); -graphOut.addEdge( 185, 319 ); -graphOut.addEdge( 319, 320 ); -graphOut.addEdge( 186, 320 ); - -graphOut.addEdge( 187, 321 ); -graphOut.addEdge( 188, 321 ); -graphOut.addEdge( 321, 322 ); -graphOut.addEdge( 189, 322 ); - -graphOut.addEdge( 190, 323 ); -graphOut.addEdge( 191, 323 ); -graphOut.addEdge( 323, 324 ); -graphOut.addEdge( 192, 324 ); - -graphOut.addEdge( 193, 325 ); -graphOut.addEdge( 194, 325 ); -graphOut.addEdge( 325, 326 ); -graphOut.addEdge( 195, 326 ); - -graphOut.addEdge( 196, 327 ); -graphOut.addEdge( 197, 327 ); -graphOut.addEdge( 327, 328 ); -graphOut.addEdge( 198, 328 ); - -graphOut.addEdge( 199, 329 ); -graphOut.addEdge( 200, 329 ); -graphOut.addEdge( 329, 330 ); -graphOut.addEdge( 201, 330 ); - -graphOut.addEdge( 202, 331 ); -graphOut.addEdge( 203, 331 ); -graphOut.addEdge( 331, 332 ); -graphOut.addEdge( 204, 332 ); - -graphOut.addEdge( 205, 333 ); -graphOut.addEdge( 206, 333 ); -graphOut.addEdge( 333, 334 ); -graphOut.addEdge( 207, 334 ); - -graphOut.addEdge( 208, 335 ); -graphOut.addEdge( 209, 335 ); -graphOut.addEdge( 335, 336 ); -graphOut.addEdge( 210, 336 ); - -graphOut.addEdge( 211, 337 ); -graphOut.addEdge( 212, 337 ); -graphOut.addEdge( 337, 338 ); -graphOut.addEdge( 213, 338 ); - -graphOut.addEdge( 214, 339 ); -graphOut.addEdge( 215, 339 ); -graphOut.addEdge( 339, 340 ); -graphOut.addEdge( 216, 340 ); - -graphOut.addEdge( 217, 341 ); -graphOut.addEdge( 218, 341 ); -graphOut.addEdge( 341, 342 ); -graphOut.addEdge( 219, 342 ); - -graphOut.addEdge( 220, 343 ); -graphOut.addEdge( 221, 343 ); -graphOut.addEdge( 343, 344 ); -graphOut.addEdge( 222, 344 ); - -graphOut.addEdge( 223, 345 ); -graphOut.addEdge( 224, 345 ); -graphOut.addEdge( 345, 346 ); -graphOut.addEdge( 225, 346 ); - -graphOut.addEdge( 226, 347 ); -graphOut.addEdge( 227, 347 ); -graphOut.addEdge( 347, 348 ); -graphOut.addEdge( 228, 348 ); - -graphOut.addEdge( 230, 349 ); -graphOut.addEdge( 232, 350 ); -graphOut.addEdge( 234, 351 ); -graphOut.addEdge( 236, 352 ); -graphOut.addEdge( 238, 353 ); -graphOut.addEdge( 240, 354 ); -graphOut.addEdge( 242, 355 ); -graphOut.addEdge( 244, 356 ); -graphOut.addEdge( 246, 357 ); -graphOut.addEdge( 248, 358 ); -graphOut.addEdge( 250, 359 ); -graphOut.addEdge( 252, 360 ); -graphOut.addEdge( 254, 361 ); -graphOut.addEdge( 256, 362 ); -graphOut.addEdge( 258, 363 ); -graphOut.addEdge( 260, 364 ); -graphOut.addEdge( 262, 365 ); -graphOut.addEdge( 264, 366 ); -graphOut.addEdge( 266, 367 ); -graphOut.addEdge( 268, 368 ); -graphOut.addEdge( 270, 369 ); -graphOut.addEdge( 272, 370 ); -graphOut.addEdge( 274, 371 ); -graphOut.addEdge( 276, 372 ); -graphOut.addEdge( 278, 373 ); -graphOut.addEdge( 280, 374 ); -graphOut.addEdge( 282, 375 ); -graphOut.addEdge( 284, 376 ); -graphOut.addEdge( 286, 377 ); -graphOut.addEdge( 288, 378 ); -graphOut.addEdge( 290, 379 ); -graphOut.addEdge( 292, 380 ); -graphOut.addEdge( 294, 381 ); -graphOut.addEdge( 296, 382 ); -graphOut.addEdge( 298, 383 ); -graphOut.addEdge( 300, 384 ); -graphOut.addEdge( 302, 385 ); -graphOut.addEdge( 304, 386 ); -graphOut.addEdge( 306, 387 ); -graphOut.addEdge( 308, 388 ); -graphOut.addEdge( 310, 389 ); -graphOut.addEdge( 312, 390 ); -graphOut.addEdge( 314, 391 ); -graphOut.addEdge( 316, 392 ); -graphOut.addEdge( 318, 393 ); -graphOut.addEdge( 320, 394 ); -graphOut.addEdge( 322, 395 ); -graphOut.addEdge( 324, 396 ); -graphOut.addEdge( 326, 397 ); -graphOut.addEdge( 328, 398 ); -graphOut.addEdge( 330, 399 ); -graphOut.addEdge( 332, 400 ); -graphOut.addEdge( 334, 401 ); -graphOut.addEdge( 336, 402 ); -graphOut.addEdge( 338, 403 ); -graphOut.addEdge( 340, 404 ); -graphOut.addEdge( 342, 405 ); -graphOut.addEdge( 344, 406 ); -graphOut.addEdge( 346, 407 ); -graphOut.addEdge( 348, 408 ); - - - - std::queue< uint32_t > nodeQueue; - - //debugging - if( output_->getVerboseLevel() >= 10 ) { - graphOut.printGraph(); - } - - //Mark all nodes in the PE graph un-visited - std::map< uint32_t, Vertex< ProcessingElement* > >* vertex_map_ = graphOut.getVertexMap(); - typename std::map< uint32_t, Vertex< ProcessingElement* > >::iterator vertexIterator; - for(vertexIterator = vertex_map_->begin(); vertexIterator != vertex_map_->end(); ++vertexIterator) { - vertexIterator->second.setVisited(0); - } - - //Node 0 is a dummy node and is always the entry point - nodeQueue.push(0); - - //BFS and add input/output edges - while( nodeQueue.empty() == 0 ) { - uint32_t currentNode = nodeQueue.front(); - nodeQueue.pop(); - - vertex_map_->at(currentNode).setVisited(1); - - output_->verbose(CALL_INFO, 10, 0, "Adjacency list of vertex: %" PRIu32 "\n head ", currentNode); - - std::vector< Edge* >* adjacencyList = vertex_map_->at(currentNode).getAdjacencyList(); - ProcessingElement* srcNode; - ProcessingElement* dstNode; - - //add the destination vertices from this node to the node queue - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); it++ ) { - uint32_t destinationVertx = (*it)->getDestination(); - - srcNode = vertex_map_->at(currentNode).getValue(); - dstNode = vertex_map_->at(destinationVertx).getValue(); - - srcNode->bindOutputQueue(dstNode); - dstNode->bindInputQueue(srcNode); - - if( vertex_map_->at(destinationVertx).getVisited() == 0 ) { - output_->verbose(CALL_INFO, 10, 0, " -> %" PRIu32, destinationVertx); - - vertex_map_->at(destinationVertx).setVisited(1); - nodeQueue.push(destinationVertx); - } - } - - vertex_map_->at(currentNode).getValue()->queueInit(); - } - -}// mapGraph - -}// namespace Llyr -}// namespace SST - -#endif // _GEMM_MAPPER_H - diff --git a/src/sst/elements/llyr/mappers/llyrMapper.h b/src/sst/elements/llyr/mappers/llyrMapper.h deleted file mode 100644 index 3a83e3036e..0000000000 --- a/src/sst/elements/llyr/mappers/llyrMapper.h +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#ifndef _LLYR_MAPPER_H -#define _LLYR_MAPPER_H - -#include -#include - -#include "../graph/graph.h" -#include "../lsQueue.h" -#include "../llyrTypes.h" -#include "pes/peList.h" - -namespace SST { -namespace Llyr { - -class LlyrMapper : public SST::Module -{ - -public: - SST_ELI_REGISTER_MODULE_API(SST::Llyr::LlyrMapper); - - LlyrMapper() : Module() {} - virtual ~LlyrMapper() {} - - virtual void mapGraph(LlyrGraph< opType > hardwareGraph, LlyrGraph< AppNode > appGraph, - LlyrGraph< ProcessingElement* > &graphOut, - LlyrConfig* llyr_config) = 0; - - void addNode(opType op_binding, uint32_t nodeNum, LlyrGraph< ProcessingElement* > &graphOut, - LlyrConfig* llyr_config); - void addNode(opType op_binding, std::string *arguments, uint32_t nodeNum, LlyrGraph< ProcessingElement* > &graphOut, - LlyrConfig* llyr_config); -}; - -void LlyrMapper::addNode(opType op_binding, uint32_t nodeNum, LlyrGraph< ProcessingElement* > &graphOut, - LlyrConfig* llyr_config) -{ - ProcessingElement* tempPE; - - //setup up i/o for messages - char prefix[256]; - sprintf(prefix, "[t=@t][llyrMapper]: "); - SST::Output* output_ = new SST::Output(prefix, llyr_config->verbosity_, 0, Output::STDOUT); - - if( op_binding == LD ) { - tempPE = new LoadProcessingElement( LD, nodeNum, llyr_config ); - } else if( op_binding == ST ) { - tempPE = new StoreProcessingElement( ST, nodeNum, llyr_config ); - } else if( op_binding == AND ) { - tempPE = new LogicProcessingElement( AND, nodeNum, llyr_config ); - } else if( op_binding == OR ) { - tempPE = new LogicProcessingElement( OR, nodeNum, llyr_config ); - } else if( op_binding == XOR ) { - tempPE = new LogicProcessingElement( XOR, nodeNum, llyr_config ); - } else if( op_binding == NOT ) { - tempPE = new LogicProcessingElement( NOT, nodeNum, llyr_config ); - } else if( op_binding == SLL ) { - tempPE = new LogicProcessingElement( SLL, nodeNum, llyr_config ); - } else if( op_binding == SLR ) { - tempPE = new LogicProcessingElement( SLR, nodeNum, llyr_config ); - } else if( op_binding == ROL ) { - tempPE = new LogicProcessingElement( ROL, nodeNum, llyr_config ); - } else if( op_binding == ROR ) { - tempPE = new LogicProcessingElement( ROR, nodeNum, llyr_config ); - } else if( op_binding == EQ ) { - tempPE = new LogicProcessingElement( EQ, nodeNum, llyr_config ); - } else if( op_binding == NE ) { - tempPE = new LogicProcessingElement( NE, nodeNum, llyr_config ); - } else if( op_binding == UGT ) { - tempPE = new LogicProcessingElement( UGT, nodeNum, llyr_config ); - } else if( op_binding == UGE ) { - tempPE = new LogicProcessingElement( UGE, nodeNum, llyr_config ); - } else if( op_binding == SGT ) { - tempPE = new LogicProcessingElement( SGT, nodeNum, llyr_config ); - } else if( op_binding == SGE ) { - tempPE = new LogicProcessingElement( SGE, nodeNum, llyr_config ); - } else if( op_binding == ULT ) { - tempPE = new LogicProcessingElement( ULT, nodeNum, llyr_config ); - } else if( op_binding == ULE ) { - tempPE = new LogicProcessingElement( ULE, nodeNum, llyr_config ); - } else if( op_binding == SLT ) { - tempPE = new LogicProcessingElement( SLT, nodeNum, llyr_config ); - } else if( op_binding == SLE ) { - tempPE = new LogicProcessingElement( SLE, nodeNum, llyr_config ); - } else if( op_binding == ADD ) { - tempPE = new IntProcessingElement( ADD, nodeNum, llyr_config ); - } else if( op_binding == SUB ) { - tempPE = new IntProcessingElement( SUB, nodeNum, llyr_config ); - } else if( op_binding == MUL ) { - tempPE = new IntProcessingElement( MUL, nodeNum, llyr_config ); - } else if( op_binding == DIV ) { - tempPE = new IntProcessingElement( DIV, nodeNum, llyr_config ); - } else if( op_binding == REM ) { - tempPE = new IntProcessingElement( REM, nodeNum, llyr_config ); - } else if( op_binding == FADD ) { - tempPE = new FPProcessingElement( FADD, nodeNum, llyr_config ); - } else if( op_binding == FSUB ) { - tempPE = new FPProcessingElement( FSUB, nodeNum, llyr_config ); - } else if( op_binding == FMUL ) { - tempPE = new FPProcessingElement( FMUL, nodeNum, llyr_config ); - } else if( op_binding == FDIV ) { - tempPE = new FPProcessingElement( FDIV, nodeNum, llyr_config ); - } else if( op_binding == FMatMul ) { - tempPE = new FPProcessingElement( FMatMul, nodeNum, llyr_config ); - } else if( op_binding == TSIN ) { - tempPE = new ComplexProcessingElement( TSIN, nodeNum, llyr_config ); - } else if( op_binding == TCOS ) { - tempPE = new ComplexProcessingElement( TCOS, nodeNum, llyr_config ); - } else if( op_binding == TTAN ) { - tempPE = new ComplexProcessingElement( TTAN, nodeNum, llyr_config ); - } else if( op_binding == DUMMY ) { - tempPE = new DummyProcessingElement( DUMMY, nodeNum, llyr_config ); - } else if( op_binding == BUFFER ) { - tempPE = new ControlProcessingElement( BUFFER, nodeNum, llyr_config ); - } else if( op_binding == SEL ) { - tempPE = new ControlProcessingElement( SEL, nodeNum, llyr_config ); - } else if( op_binding == RTR ) { - tempPE = new ControlProcessingElement( RTR, nodeNum, llyr_config ); - } else if( op_binding == RET ) { - tempPE = new ControlProcessingElement( RET, nodeNum, llyr_config ); - } else { - output_->fatal(CALL_INFO, -1, "Error: Unable to find specified operation\n"); - exit(0); - } - - graphOut.addVertex( nodeNum, tempPE ); - -}// addNode - -void LlyrMapper::addNode(opType op_binding, std::string *arguments, uint32_t nodeNum, LlyrGraph< ProcessingElement* > &graphOut, - LlyrConfig* llyr_config) -{ - ProcessingElement* tempPE; - - //setup up i/o for messages - char prefix[256]; - sprintf(prefix, "[t=@t][llyrMapper]: "); - SST::Output* output_ = new SST::Output(prefix, llyr_config->verbosity_, 0, Output::STDOUT); - - if( op_binding == LDADDR ) { - tempPE = new AdvLoadProcessingElement( LDADDR, nodeNum, llyr_config, arguments ); - } else if( op_binding == STREAM_LD ) { - tempPE = new AdvLoadProcessingElement( STREAM_LD, nodeNum, llyr_config, arguments ); - } else if( op_binding == STADDR ) { - tempPE = new AdvStoreProcessingElement( STADDR, nodeNum, llyr_config, arguments ); - } else if( op_binding == STREAM_ST ) { - tempPE = new AdvStoreProcessingElement( STREAM_ST, nodeNum, llyr_config, arguments ); - } else if( op_binding == ADDCONST ) { - tempPE = new IntConstProcessingElement( ADDCONST, nodeNum, llyr_config, arguments ); - } else if( op_binding == SUBCONST ) { - tempPE = new IntConstProcessingElement( SUBCONST, nodeNum, llyr_config, arguments ); - } else if( op_binding == MULCONST ) { - tempPE = new IntConstProcessingElement( MULCONST, nodeNum, llyr_config, arguments ); - } else if( op_binding == DIVCONST ) { - tempPE = new IntConstProcessingElement( DIVCONST, nodeNum, llyr_config, arguments ); - } else if( op_binding == REMCONST ) { - tempPE = new IntConstProcessingElement( REMCONST, nodeNum, llyr_config, arguments ); - } else { - output_->fatal(CALL_INFO, -1, "Error: Unable to find specified operation\n"); - exit(0); - } - - graphOut.addVertex( nodeNum, tempPE ); - -}// addNode - - -}// namespace Llyr -}// namespace SST - -#endif // _LLYR_MAPPER_H diff --git a/src/sst/elements/llyr/mappers/mapperList.h b/src/sst/elements/llyr/mappers/mapperList.h deleted file mode 100644 index 9accfe55cf..0000000000 --- a/src/sst/elements/llyr/mappers/mapperList.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#ifndef _MAPPER_LIST_H -#define _MAPPER_LIST_H - -#include "simpleMapper.h" -#include "pyMapper.h" -#include "gemmMapper.h" - -#endif //MAPPER_LIST_H diff --git a/src/sst/elements/llyr/mappers/pyMapper.h b/src/sst/elements/llyr/mappers/pyMapper.h deleted file mode 100644 index e28dbccba3..0000000000 --- a/src/sst/elements/llyr/mappers/pyMapper.h +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#ifndef _PY_MAPPER_H -#define _PY_MAPPER_H - -#include -#include -#include -#include -#include -#include - -#include "mappers/llyrMapper.h" - -namespace SST { -namespace Llyr { - -typedef struct alignas(uint64_t) { - std::vector< uint32_t >* adjacency_list_; - std::vector< std::string >* state_list_; - std::vector< std::pair< uint32_t, uint32_t >* >* forward_list_; -} NodeAttributes; - -class PyMapper : public LlyrMapper -{ - -public: - explicit PyMapper(Params& params) : - LlyrMapper() {} - ~PyMapper() { } - - SST_ELI_REGISTER_MODULE_DERIVED( - PyMapper, - "llyr", - "mapper.py", - SST_ELI_ELEMENT_VERSION(1,0,0), - "App to HW", - SST::Llyr::LlyrMapper - ) - - void mapGraph(LlyrGraph< opType > hardwareGraph, LlyrGraph< AppNode > appGraph, - LlyrGraph< ProcessingElement* > &graphOut, - LlyrConfig* llyr_config); - -private: - - void runMappingTool( std::string ); - void getAdjacencyList( std::string, std::vector< uint32_t >* ); - void getStateList( std::string, std::vector< std::string >* ); - void printDot( std::string, LlyrGraph< ProcessingElement* >* ) const; - -}; - -void PyMapper::runMappingTool(std::string mapping_tool) -{ - FILE* fp; - - Py_Initialize(); - - fp = fopen(mapping_tool.c_str(), "r"); - PyRun_SimpleFile(fp, mapping_tool.c_str()); - - Py_Finalize(); -} - -void PyMapper::mapGraph(LlyrGraph< opType > hardwareGraph, LlyrGraph< AppNode > appGraph, - LlyrGraph< ProcessingElement* > &graphOut, - LlyrConfig* llyr_config) -{ - //setup up i/o for messages - char prefix[256]; - sprintf(prefix, "[t=@t][pyMapper]: "); - SST::Output* output_ = new SST::Output(prefix, llyr_config->verbosity_, 0, Output::STDOUT); - - if( llyr_config->mapping_tool_ == "" ) { - output_->fatal( CALL_INFO, -1, "This mapper requires a pre-processor, defined as mapper_tool in the configuration.\n" ); - exit(0); - } - - char tmp[256]; - getcwd(tmp, 256); - std::cout << "Current working directory: " << tmp << std::endl; - runMappingTool(llyr_config->mapping_tool_); - - std::string fileName = "00_sst.in"; - output_->verbose(CALL_INFO, 1, 0, "Mapping Application Using: %s\n", fileName.c_str()); - - std::ifstream inputStream(fileName, std::ios::in); - if( inputStream.is_open() ) { - std::string thisLine; - std::vector< uint32_t > routingList; - -// std::map< uint32_t, std::vector< uint32_t >* > adjList; -// std::map< uint32_t, std::vector< std::string >* > inputStateList; - std::map< uint32_t, NodeAttributes* > nodeAttributes; - - while( std::getline( inputStream, thisLine ) ) { - output_->verbose(CALL_INFO, 16, 0, "Parsing: %s\n", thisLine.c_str()); - - // first read mapped graph - // with delimiter ':' - // 0 -- node mapping - // 1 -- input label - // 2 -- input list - // 3 -- output list - // 4 -- operation - - std::regex delimiter( ":" ); - std::sregex_token_iterator iterA(thisLine.begin(), thisLine.end(), delimiter, -1); - std::sregex_token_iterator iterB; - std::vector tokenizedSring( iterA, iterB ); - - // clean up strings - for( auto it = tokenizedSring.begin(); it != tokenizedSring.end(); it++ ) { - std::cout << "+++ " << *it << std::endl; - it->erase(remove(it->begin(),it->end(), '\''), it->end()); - it->erase(remove(it->begin(),it->end(), '{'), it->end()); - it->erase(remove(it->begin(),it->end(), '}'), it->end()); - it->erase(remove_if(it->begin(), it->end(), isspace), it->end()); - std::cout << "--- " << *it << std::endl; - } - - // target node in fabric - std::uint64_t posA = tokenizedSring[0].find_first_of( "(" ); - std::uint64_t posB = tokenizedSring[0].find_first_of( "," ); - std::uint64_t posC = tokenizedSring[0].find_first_of( ")" ); - uint32_t hardwareVertex = std::stoul( tokenizedSring[0].substr( posA + 1, posB ) ); - output_->verbose(CALL_INFO, 15, 0, "Target Graph Node: %u\n", hardwareVertex); - - // source node from application - uint32_t applicationVertex = std::stoul( tokenizedSring[0].substr( posB + 1, posC ) ); - output_->verbose(CALL_INFO, 15, 0, "App Graph Node: %u\n", applicationVertex); - - // operation - opType op = getOptype(tokenizedSring[4]); - output_->verbose(CALL_INFO, 15, 0, "Operation: %u -- %s\n", op, getOpString(op).c_str()); - - // encode node in hardware graph - std::map< uint32_t, Vertex< AppNode > >* app_vertex_map_ = appGraph.getVertexMap(); - if( op == ADDCONST || op == SUBCONST || op == MULCONST || op == DIVCONST || op == REMCONST) { - addNode( op, app_vertex_map_->at(applicationVertex).getValue().argument_, hardwareVertex, graphOut, llyr_config ); - } else if( op == LDADDR || op == STREAM_LD || op == STADDR || op == STREAM_ST ) { - addNode( op, app_vertex_map_->at(applicationVertex).getValue().argument_, hardwareVertex, graphOut, llyr_config ); - } else { - addNode( op, hardwareVertex, graphOut, llyr_config ); - } - - std::vector< uint32_t >* adjVector = new std::vector< uint32_t >; - std::vector< std::string >* stateVector = new std::vector< std::string >; - - getAdjacencyList( tokenizedSring[3], adjVector ); - getStateList( tokenizedSring[2], stateVector ); - - std::cout << "Hardware Vertex " << hardwareVertex << std::endl; - auto attributes = new NodeAttributes; - attributes->adjacency_list_ = adjVector; - attributes->state_list_ = stateVector; - - auto newValue = nodeAttributes.emplace(hardwareVertex, attributes); - - // if the node has already been added then it must also be a routing node - // still need to add the neighbors but add to current adj list - if( newValue.second == false ) { - std::cout << "FAILED on " << hardwareVertex << std::endl; - for( auto it = adjVector->begin(); it != adjVector->end(); it++ ) { - nodeAttributes[hardwareVertex]->adjacency_list_->push_back(*it); - } - } - - std::cout << "vecIn(" << adjVector->size() << "): "; - for( auto it = adjVector->begin(); it != adjVector->end(); it++ ) { - std::cout << *it << ", "; - } - std::cout << std::endl; - } - - // add the edges and bind data queues - std::map< uint32_t, Vertex< ProcessingElement* > >* vertex_map_ = graphOut.getVertexMap(); - for( auto it = nodeAttributes.begin(); it != nodeAttributes.end(); it++ ) { - ProcessingElement* srcNode = vertex_map_->at(it->first).getValue(); - - std::cout << "nodeNum: " << it->first; - std::cout << " -- numNeighbors: " << it->second->adjacency_list_->size(); - std::cout << std::endl; - for( auto innerIt = it->second->adjacency_list_->begin(); innerIt != it->second->adjacency_list_->end(); innerIt++ ) { - ProcessingElement* dstNode = vertex_map_->at(*innerIt).getValue(); - - graphOut.addEdge( it->first, *innerIt ); - - srcNode->bindOutputQueue(dstNode); - dstNode->bindInputQueue(srcNode); - } - } - - inputStream.close(); - } else { - output_->fatal(CALL_INFO, -1, "Error: Unable to open %s\n", fileName.c_str() ); - exit(0); - } - - output_->verbose( CALL_INFO, 1, 0, "Mapping complete.\n" ); - hardwareGraph.printDot("llyr_hdwr.dot"); - graphOut.printDot("llyr_mapped.dot"); - printDot("llyr_mapped-py.dot", &graphOut); - -}// mapGraph - -void PyMapper::getAdjacencyList( std::string opList, std::vector< uint32_t >* vecIn ) -{ - std::cout << "--- Getting Adjacency List --- " << std::endl; - - // clean the input string - opList.erase(remove(opList.begin(), opList.end(), '('), opList.end()); - opList.erase(remove(opList.begin(), opList.end(), ')'), opList.end()); - opList.erase(remove(opList.begin(), opList.end(), '['), opList.end()); - opList.erase(remove(opList.begin(), opList.end(), ']'), opList.end()); - opList.erase(opList.find("operation"), std::string("operation").length()); - - // split into tokens - std::regex delimiter( "," ); - std::sregex_token_iterator iterA(opList.begin(), opList.end(), delimiter, -1); - std::sregex_token_iterator iterB; - std::vector tokenizedSring( iterA, iterB ); - - std::cout << "***Len of vector " << tokenizedSring.size() << std::endl; - // - if( tokenizedSring.size() > 1 ) { - for( uint32_t i = 0; i < tokenizedSring.size(); i++ ) { - std::cout << "+++ " << tokenizedSring[i] << std::endl; - if( i % 2 == 1 ) { - std::cout << "-- " << tokenizedSring[i] << std::endl; - vecIn->push_back(std::stoul(tokenizedSring[i])); - } - } - } -} - -void PyMapper::getStateList( std::string states, std::vector< std::string >* vecIn ) -{ - std::cout << "--- Getting State List --- " << std::endl; -std::cout << states << std::endl; - - // clean the input string - states.erase(remove(states.begin(), states.end(), '['), states.end()); - states.erase(remove(states.begin(), states.end(), ']'), states.end()); - states.erase(states.find("output"), std::string("output").length()); -std::cout << states << std::endl; - - // split into tokens - std::regex delimiter( "," ); - std::sregex_token_iterator iterA(states.begin(), states.end(), delimiter, -1); - std::sregex_token_iterator iterB; - std::vector tokenizedSring( iterA, iterB ); - - std::cout << "***Len of vector " << tokenizedSring.size() << std::endl; - - if( tokenizedSring.size() > 1 ) { - for( uint32_t i = 0; i < tokenizedSring.size(); i++ ) { - std::cout << "+++ " << tokenizedSring[i] << std::endl; - if( i % 2 == 1 ) { - std::cout << "-- " << tokenizedSring[i] << std::endl; - vecIn->push_back(tokenizedSring[i]); - } - } - } -} - -void PyMapper::printDot( std::string fileName, LlyrGraph< ProcessingElement* >* graphIn ) const -{ - std::ofstream outputFile(fileName.c_str(), std::ios::trunc); //open a file for writing (truncate the current contents) - if ( !outputFile ) //check to be sure file is open - std::cerr << "Error opening file."; - - outputFile << "digraph G {" << "\n"; - - std::map< uint32_t, Vertex< ProcessingElement* > >* vertex_map = graphIn->getVertexMap(); - std::map< uint32_t, Vertex >::iterator vertexIterator; - for(vertexIterator = vertex_map->begin(); vertexIterator != vertex_map->end(); ++vertexIterator) { - outputFile << vertexIterator->first << "[label=\""; - opType moop = vertexIterator->second.getValue()->getOpBinding(); - outputFile << vertexIterator->first << " - " << getOpString(moop); - outputFile << "\"];\n"; - } - - for(vertexIterator = vertex_map->begin(); vertexIterator != vertex_map->end(); ++vertexIterator) { - std::vector< Edge* >* adjacencyList = vertexIterator->second.getAdjacencyList(); - - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); ++it ) { - outputFile << vertexIterator->first; - outputFile << "->"; - outputFile << (*it)->getDestination(); - outputFile << "\n"; - } - } - - outputFile << "}"; - outputFile.close(); -} - -}// namespace Llyr -}// namespace SST - -#endif // _PY_MAPPER_H - diff --git a/src/sst/elements/llyr/mappers/simpleMapper.h b/src/sst/elements/llyr/mappers/simpleMapper.h deleted file mode 100644 index 347f86fd32..0000000000 --- a/src/sst/elements/llyr/mappers/simpleMapper.h +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#ifndef _SIMPLE_MAPPER_H -#define _SIMPLE_MAPPER_H - -#include -#include -#include - -#include "mappers/llyrMapper.h" - -namespace SST { -namespace Llyr { - -class SimpleMapper : public LlyrMapper -{ - -public: - explicit SimpleMapper(Params& params) : - LlyrMapper() {} - ~SimpleMapper() { } - - SST_ELI_REGISTER_MODULE_DERIVED( - SimpleMapper, - "llyr", - "mapper.simple", - SST_ELI_ELEMENT_VERSION(1,0,0), - "App to HW", - SST::Llyr::LlyrMapper - ) - - void mapGraph(LlyrGraph< opType > hardwareGraph, LlyrGraph< AppNode > appGraph, - LlyrGraph< ProcessingElement* > &graphOut, - LlyrConfig* llyr_config); - -private: - - -}; - -void SimpleMapper::mapGraph(LlyrGraph< opType > hardwareGraph, LlyrGraph< AppNode > appGraph, - LlyrGraph< ProcessingElement* > &graphOut, - LlyrConfig* llyr_config) -{ - //setup up i/o for messages - char prefix[256]; - sprintf(prefix, "[t=@t][simpleMapper]: "); - SST::Output* output_ = new SST::Output(prefix, llyr_config->verbosity_, 0, Output::STDOUT); - - std::queue< uint32_t > nodeQueue; - - output_->verbose(CALL_INFO, 32, 0, "Starting mapping\n"); - //Mark all nodes in the PE graph un-visited - std::map< uint32_t, Vertex< AppNode > >* app_vertex_map_ = appGraph.getVertexMap(); - typename std::map< uint32_t, Vertex< AppNode > >::iterator appIterator; - for(appIterator = app_vertex_map_->begin(); appIterator != app_vertex_map_->end(); ++appIterator) { - appIterator->second.setVisited(0); - - output_->verbose(CALL_INFO, 32, 0, "--Vertex %u -- In Degree %u\n", appIterator->first, appIterator->second.getInDegree()); - - if( appIterator->second.getInDegree() == 0 ) { - nodeQueue.push(appIterator->first); - } - } - - //assign new ID to mapped nodes in the graph and track mapping between app and graph - uint32_t newNodeNum = 1; - std::map< uint32_t, uint32_t > mapping; - while( nodeQueue.empty() == 0 ) { - std::stringstream dataOut; - uint32_t currentAppNode = nodeQueue.front(); - nodeQueue.pop(); - - app_vertex_map_->at(currentAppNode).setVisited(1); - opType tempOp = app_vertex_map_->at(currentAppNode).getValue().optype_; - if( tempOp == ADDCONST || tempOp == SUBCONST || tempOp == MULCONST || tempOp == DIVCONST || tempOp == REMCONST) { - addNode( tempOp, app_vertex_map_->at(currentAppNode).getValue().argument_, newNodeNum, graphOut, llyr_config ); - } else if( tempOp == LDADDR || tempOp == STREAM_LD || tempOp == STADDR || tempOp == STREAM_ST ) { - addNode( tempOp, app_vertex_map_->at(currentAppNode).getValue().argument_, newNodeNum, graphOut, llyr_config ); - } else { - addNode( tempOp, newNodeNum, graphOut, llyr_config ); - } - - // create a record of the mapping (new, old) - [[maybe_unused]] auto retVal = mapping.emplace( currentAppNode, newNodeNum ); - output_->verbose(CALL_INFO, 32, 0, "-- Current %" PRIu32 " New %" PRIu32 "\n", currentAppNode, newNodeNum); - output_->verbose(CALL_INFO, 32, 0, "Adjacency list of vertex: %" PRIu32 "\n", currentAppNode); - - // add the destination vertices from this node to the node queue - dataOut << " head"; - std::vector< Edge* >* adjacencyList = app_vertex_map_->at(currentAppNode).getAdjacencyList(); - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); it++ ) { - uint32_t destinationVertex = (*it)->getDestination(); - - if( app_vertex_map_->at(destinationVertex).getVisited() == 0 ) { - dataOut << " -> " << destinationVertex; - app_vertex_map_->at(destinationVertex).setVisited(1); - nodeQueue.push(destinationVertex); - } - else { - dataOut << " +> " << destinationVertex; - } - } - - newNodeNum = newNodeNum + 1; - output_->verbose(CALL_INFO, 32, 0, "%s\n", dataOut.str().c_str()); - } - - // insert dummy as node 0 to make BFS easier - addNode( DUMMY, 0, graphOut, llyr_config ); - - // now add the edges - std::map< uint32_t, Vertex< ProcessingElement* > >* vertex_map_ = graphOut.getVertexMap(); - typename std::map< uint32_t, Vertex< ProcessingElement* > >::iterator vertexIterator; - for(vertexIterator = vertex_map_->begin(); vertexIterator != vertex_map_->end(); ++vertexIterator) { - - // lookup the matched app PE - bool found = 0; - uint32_t appPE; - for( auto it = mapping.begin(); it != mapping.end(); ++it) { - - if( it->second == vertexIterator->first ) { - found = 1; - appPE = it->first; - break; - } - } - - if( found == 0 ) { - continue; - } - - // iterate through the adjeceny list of the app graph node and find corresponding mapped-graph node - std::vector< Edge* >* adjacencyList = app_vertex_map_->at(appPE).getAdjacencyList(); - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); it++ ) { - uint32_t destinationVertex = mapping.at((*it)->getDestination()); - graphOut.addEdge( vertexIterator->first, destinationVertex ); - } - - // add edges from the dummy root - output_->verbose(CALL_INFO, 32, 0, "Vertex %" PRIu32 " -- In Degree %" PRIu32 "\n", - vertexIterator->first, vertexIterator->second.getInDegree()); - - if( vertexIterator->second.getInDegree() == 0 ) { - graphOut.addEdge( 0, vertexIterator->first ); - } - } - - //-------------- BFS --------------------------------- - //Mark all nodes in the PE graph un-visited - for(vertexIterator = vertex_map_->begin(); vertexIterator != vertex_map_->end(); ++vertexIterator) { - vertexIterator->second.setVisited(0); - } - - //Node 0 is a dummy node and is always the entry point - nodeQueue.push(0); - - //BFS and add input/output edges - while( nodeQueue.empty() == 0 ) { - uint32_t currentNode = nodeQueue.front(); - nodeQueue.pop(); - std::stringstream dataOut; - - vertex_map_->at(currentNode).setVisited(1); - - output_->verbose(CALL_INFO, 32, 0, "Adjacency list of vertex: %" PRIu32 "\n", currentNode); - std::vector< Edge* >* adjacencyList = vertex_map_->at(currentNode).getAdjacencyList(); - ProcessingElement* srcNode; - ProcessingElement* dstNode; - - //add the destination vertices from this node to the node queue - dataOut << " head"; - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); it++ ) { - uint32_t destinationVertex = (*it)->getDestination(); - - srcNode = vertex_map_->at(currentNode).getValue(); - dstNode = vertex_map_->at(destinationVertex).getValue(); - - dataOut << "\n"; - dataOut << "\tsrcNode " << srcNode->getProcessorId() << "(" << srcNode->getOpBinding() << ")\n"; - dataOut << "\tdstNode " << dstNode->getProcessorId() << "(" << dstNode->getOpBinding() << ")\n"; - output_->verbose(CALL_INFO, 32, 0, "%s\n", dataOut.str().c_str()); - - srcNode->bindOutputQueue(dstNode); - dstNode->bindInputQueue(srcNode); - - if( vertex_map_->at(destinationVertex).getVisited() == 0 ) { - vertex_map_->at(destinationVertex).setVisited(1); - nodeQueue.push(destinationVertex); - } - } - - //FIXME Need to use a fake init on ST for now - opType tempOp = vertex_map_->at(currentNode).getValue()->getOpBinding(); - if( tempOp == ST ) { - vertex_map_->at(currentNode).getValue()->queueInit(); - } else if( tempOp == LDADDR || tempOp == STADDR ) { - vertex_map_->at(currentNode).getValue()->queueInit(); - } else if( tempOp == STREAM_LD || tempOp == STREAM_ST ) { - vertex_map_->at(currentNode).getValue()->queueInit(); - } - } - - //FIXME Fake init for now, need to read values from stack - //Initialize any L/S PEs at the top of the graph - std::vector< Edge* >* rootAdjacencyList = vertex_map_->at(0).getAdjacencyList(); - for( auto it = rootAdjacencyList->begin(); it != rootAdjacencyList->end(); it++ ) { - uint32_t destinationVertex = (*it)->getDestination(); - vertex_map_->at(destinationVertex).getValue()->queueInit(); - } - -}// mapGraph - -}// namespace Llyr -}// namespace SST - -#endif // _SIMPLE_MAPPER_H - diff --git a/src/sst/elements/llyr/parser/instruction.h b/src/sst/elements/llyr/parser/instruction.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/sst/elements/llyr/parser/parser.cc b/src/sst/elements/llyr/parser/parser.cc deleted file mode 100644 index 9536c857d0..0000000000 --- a/src/sst/elements/llyr/parser/parser.cc +++ /dev/null @@ -1,1913 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "parser.h" - -namespace SST { -namespace Llyr { - -void Parser::generateAppGraph(std::string functionName) -{ - llvm::SMDiagnostic Err; - llvm::LLVMContext Context; - - std::unique_ptr< llvm::MemoryBuffer > irBuff = llvm::MemoryBuffer::getMemBuffer(offloadString_); - std::unique_ptr< llvm::Module > mod(llvm::parseIR(irBuff->getMemBufferRef(), Err, Context)); - mod_ = mod.get(); - - //get names for anonymous instructions - auto pm = std::make_unique(mod_); -// llvm::legacy::PassManager pm; - pm->add(llvm::createPromoteMemoryToRegisterPass()); - pm->add(llvm::createInstructionNamerPass()); - pm->add(llvm::createIndVarSimplifyPass()); -// pm->add(llvm::createLoopUnrollAndJamPass()); - pm->doInitialization(); -// pm->run(*mod_); - - for( auto functionIter = mod_->getFunctionList().begin(), functionEnd = mod_->getFunctionList().end(); functionIter != functionEnd; ++functionIter ) { - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "Function Name: "; - llvm::errs().write_escaped(functionIter->getName()) << " "; - llvm::errs().write_escaped(llvm::demangle(functionIter->getName().str() )) << '\n'; - } - - //check each located function to see if it's the offload target - if( functionIter->getName().find(functionName) != std::string::npos ) { - pm->run(*functionIter); - - generatebBasicBlockGraph(&*functionIter); - expandBBGraph(&*functionIter); - assembleGraph(); - mergeGraphs(); -// collapseInductionVars(); - - break; - } else { - output_->fatal(CALL_INFO, -1, "Error: No offload target\n"); - exit(0); - } - }// function loop - - output_->verbose(CALL_INFO, 1, 0, "Finished parsing...\n"); - - printCDFG( "00_func-ins.dot" ); - printPyMapper( "00_amapper.dot" ); - -}// generateAppGraph - -void Parser::generatebBasicBlockGraph(llvm::Function* func) -{ - output_->verbose(CALL_INFO, 1, 0, "Generating BB Graph...\n"); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs().write_escaped(llvm::demangle(func->getName().str() )) << '\n'; - } - - for( auto blockIter = func->getBasicBlockList().begin(), blockEnd = func->getBasicBlockList().end(); blockIter != blockEnd; ++blockIter ) { - llvm::Instruction *Inst = llvm::dyn_cast(blockIter->getTerminator()); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\t+++Basic Block Name(" << &*blockIter << "): "; - llvm::errs().write_escaped(blockIter->getName()) << " ---> " << &*Inst << '\n'; - } - - bbGraph_->addVertex(&*blockIter); - } - - std::map< uint32_t, Vertex< llvm::BasicBlock* > >* vertex_map_ = bbGraph_->getVertexMap(); - typename std::map< uint32_t, Vertex< llvm::BasicBlock* > >::iterator vertexIterator; - for(vertexIterator = vertex_map_->begin(); vertexIterator != vertex_map_->end(); ++vertexIterator) { - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\nBasic Block " << vertexIterator->second.getValue() << "\n"; - } - - uint32_t totalSuccessors = vertexIterator->second.getValue()->getTerminator()->getNumSuccessors(); - for( uint32_t successor = 0; successor < totalSuccessors; successor++ ) { - llvm::BasicBlock* tempBB = vertexIterator->second.getValue()->getTerminator()->getSuccessor(successor); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\tSuccessors " << successor << " of " << totalSuccessors << "\n"; - llvm::errs() << "\nBasic Block " << tempBB << "\n"; - } - - typename std::map< uint32_t, Vertex< llvm::BasicBlock* > >::iterator vertexIteratorInner; - for(vertexIteratorInner = vertex_map_->begin(); vertexIteratorInner != vertex_map_->end(); ++vertexIteratorInner) { - if( vertexIteratorInner->second.getValue() == tempBB ) { - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\t\tFound: " << vertexIteratorInner->second.getValue() << "\n"; - } - - bbGraph_->addEdge(vertexIterator->first, vertexIteratorInner->first); - - break; - } - } - }// successor loop - }// basic block loop - - // bb_Graph should be complete here - output_->verbose(CALL_INFO, 1, 0, "...Basic Block Graph Done.\n"); - bbGraph_->printDot("00_bb.dot"); -}// generatebBasicBlockGraph - - -void Parser::expandBBGraph(llvm::Function* func) -{ - output_->verbose(CALL_INFO, 1, 0, "\n\nGenerating Flow Graph...\n"); - - CDFGVertex* entryVertex; - CDFGVertex* outputVertex; - CDFGVertex* inputVertex; - int32_t inputVertexID = -1; - std::map< llvm::Instruction*, CDFGVertex* >* instructionMap_ = new std::map< llvm::Instruction*, CDFGVertex* >; - - uint32_t tempOpcode; - for( auto blockIter = func->getBasicBlockList().begin(), blockEnd = func->getBasicBlockList().end(); blockIter != blockEnd; ++blockIter ) { - (*flowGraph_)[&*blockIter] = new CDFG; - CDFG &g = *((*flowGraph_)[&*blockIter]); - - (*useNode_)[&*blockIter] = new std::map< CDFGVertex*, std::vector< llvm::Instruction* >* >; - (*defNode_)[&*blockIter] = new std::map< CDFGVertex*, std::vector< llvm::Instruction* >* >; - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\t+++Basic Block Name(" << &*blockIter << "): "; - llvm::errs().write_escaped(blockIter->getName()) << '\n'; - } - - for( auto instructionIter = blockIter->begin(), instructionEnd = blockIter->end(); instructionIter != instructionEnd; ++instructionIter ) { - tempOpcode = instructionIter->getOpcode(); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\t\t**(" << &*instructionIter << ") " << *instructionIter << " -- "; - llvm::errs() << "Opcode Name: "; - llvm::errs().write_escaped(instructionIter->getName()) << " "; - llvm::errs().write_escaped(std::to_string(instructionIter->getOpcode())) << "\n"; - } - - outputVertex = new CDFGVertex; - std::string tutu; - llvm::raw_string_ostream rso(tutu); - instructionIter->print(rso); - outputVertex->instructionName_ = rso.str(); - outputVertex->instruction_ = &*instructionIter; - outputVertex->haveConst_ = 0; - outputVertex->intConst_ = 0x00; - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - - uint32_t outputVertexID = g.addVertex(outputVertex); - (*vertexList_)[&*blockIter].push_back(outputVertex); - - if( g.numVertices() == 1 ) { - entryVertex = outputVertex; - } - - instructionMap_->insert( std::pair< llvm::Instruction*, CDFGVertex* >(&*instructionIter, outputVertex) ); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "-------------------------------------------- Users List --------------------------------------------\n"; - - for( llvm::User *U : instructionIter->users() ) { - if( llvm::Instruction *Inst = llvm::dyn_cast(U) ) { - llvm::errs() << *instructionIter << " is used in instruction:\t"; - llvm::errs() << "(" << &*Inst << ") " << *Inst << "\n"; - } - - } - - llvm::errs() << "----------------------------------------------------------------------------------------------------\n"; - } - - //determine operation - if( tempOpcode == llvm::Instruction::Alloca ) { // BEGIN Allocate - - std::vector< llvm::Instruction* > *tempUseVector = new std::vector< llvm::Instruction* >; - std::vector< llvm::Instruction* > *tempDefVector = new std::vector< llvm::Instruction* >; - - // create the node/use entries (this should be empty) - (*useNode_)[&*blockIter]->insert( std::pair< CDFGVertex*, std::vector< llvm::Instruction* >* >(outputVertex, tempUseVector) ); - - //create the node/def entries - tempDefVector->push_back(&*instructionIter); - (*defNode_)[&*blockIter]->insert( std::pair< CDFGVertex*, std::vector< llvm::Instruction* >* >(outputVertex, tempDefVector) ); - - for( auto nodeUseEntry = (*useNode_)[&*blockIter]->at(outputVertex)->begin(); nodeUseEntry != (*useNode_)[&*blockIter]->at(outputVertex)->end(); nodeUseEntry++ ) { - CDFGVertex* tempVal = g.getVertex(outputVertexID)->getValue(); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "Node-Use Entry (" << tempVal->instruction_ << "): " << *nodeUseEntry << "\n"; - } - } - - for( auto nodeDefEntry = (*defNode_)[&*blockIter]->at(outputVertex)->begin(); nodeDefEntry != (*defNode_)[&*blockIter]->at(outputVertex)->end(); nodeDefEntry++ ) { - CDFGVertex* tempVal = g.getVertex(outputVertexID)->getValue(); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "Node-Def Entry (" << tempVal->instruction_ << "): " << *nodeDefEntry << "\n"; - } - } - - // END Allocate - } else if( tempOpcode == llvm::Instruction::Ret ) { // BEGIN Return - std::vector< llvm::Instruction* > *tempUseVector = new std::vector< llvm::Instruction* >; - - llvm::Value* tempOperand = llvm::cast(instructionIter)->getReturnValue(); - - // Test for ret val - // If a function returns void, the value returned is a null pointer - if( tempOperand == 0x00) { - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, new std::vector< llvm::Instruction* >) ); - } else if( llvm::isa(tempOperand) || llvm::isa(tempOperand) || llvm::isa(tempOperand) ) { - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, new std::vector< llvm::Instruction* >) ); - } else if( llvm::isa(tempOperand) ) { - std::map< llvm::Instruction*,CDFGVertex* >::iterator it = instructionMap_->find(llvm::cast(tempOperand)); - if( it != instructionMap_->end() ) { - inputVertex = instructionMap_->at(llvm::cast(tempOperand)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "+Found " << inputVertex->instruction_ << " in instructionMap_\n"; - } - } else { - inputVertex = new CDFGVertex; - inputVertex->instruction_ = 0x00; - inputVertex->haveConst_ = 0; - inputVertex->intConst_ = 0x00; - inputVertex->floatConst_ = 0x00; - inputVertex->doubleConst_ = 0x00; - - inputVertexID = g.addVertex(inputVertex); - (*vertexList_)[&*blockIter].push_back(inputVertex); - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - //add variable to node use list - tempUseVector->push_back(llvm::cast(tempOperand)); - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempUseVector) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, new std::vector< llvm::Instruction* >) ); - } - - if( output_->getVerboseLevel() > 64 ) { - for( auto nodeUseEntry = (*useNode_)[&*blockIter]->at(outputVertex)->begin(); nodeUseEntry != (*useNode_)[&*blockIter]->at(outputVertex)->end(); nodeUseEntry++ ) { - llvm::errs() << "Node-Use Entry (" << outputVertex->instruction_ << "): " << *nodeUseEntry << "\n"; - } - - for( auto nodeDefEntry = (*defNode_)[&*blockIter]->at(outputVertex)->begin(); nodeDefEntry != (*defNode_)[&*blockIter]->at(outputVertex)->end(); nodeDefEntry++ ) { - llvm::errs() << "Node-Def Entry (" << outputVertex->instruction_ << "): " << *nodeDefEntry << "\n"; - } - } - - // END Return - } else if( tempOpcode == llvm::Instruction::Call ) { // BEGIN Call - - std::vector< llvm::Instruction* > *tempUseVector = new std::vector< llvm::Instruction* >; - std::vector< llvm::Instruction* > *tempDefVector = new std::vector< llvm::Instruction* >; - - for( auto operandIter = instructionIter->op_begin(), operandEnd = instructionIter->op_end(); operandIter != operandEnd; ++operandIter ) { - llvm::Value* tempOperand = operandIter->get(); - - if( llvm::isa(tempOperand) ) { - // Don't care about these args at the moment - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - } else if( llvm::isa(tempOperand) ) { - std::map< llvm::Instruction*,CDFGVertex* >::iterator it = instructionMap_->find(llvm::cast(tempOperand)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "**** " << static_cast(operandIter->get()) << " -- " << llvm::cast(tempOperand) << " -- "; - } - - - if( it != instructionMap_->end() ) { - inputVertex = instructionMap_->at(llvm::cast(tempOperand)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "+Found " << inputVertex->instruction_ << " in instructionMap_\n"; - } - - } else { - inputVertex = new CDFGVertex; - inputVertex->instruction_ = 0x00; - inputVertex->haveConst_ = 0; - inputVertex->intConst_ = 0x00; - inputVertex->floatConst_ = 0x00; - inputVertex->doubleConst_ = 0x00; - - inputVertexID = g.addVertex(inputVertex); - (*vertexList_)[&*blockIter].push_back(inputVertex); - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - //add variable to node use list - tempUseVector->push_back(llvm::cast(tempOperand)); - } - } - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempUseVector) ); - - //create the node/def entries - tempDefVector->push_back(&*instructionIter); - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempDefVector) ); - - if( output_->getVerboseLevel() > 64 ) { - for( auto nodeUseEntry = (*useNode_)[&*blockIter]->at(outputVertex)->begin(); nodeUseEntry != (*useNode_)[&*blockIter]->at(outputVertex)->end(); nodeUseEntry++ ) { - llvm::errs() << "Node-Use Entry (" << outputVertex->instruction_ << "): " << *nodeUseEntry << "\n"; - } - - for( auto nodeDefEntry = (*defNode_)[&*blockIter]->at(outputVertex)->begin(); nodeDefEntry != (*defNode_)[&*blockIter]->at(outputVertex)->end(); nodeDefEntry++ ) { - llvm::errs() << "Node-Def Entry (" << outputVertex->instruction_ << "): " << *nodeDefEntry << "\n"; - } - } - - //END Call - } else if( tempOpcode == llvm::Instruction::Br ) { // BEGIN Branch - std::vector< llvm::Instruction* > *tempUseVector = new std::vector< llvm::Instruction* >; - std::vector< llvm::Instruction* > *tempDefVector = new std::vector< llvm::Instruction* >; - - if(llvm::cast(instructionIter)->isConditional() ) { - llvm::Value* tempCond =llvm::cast(instructionIter)->getCondition(); - - std::map< llvm::Instruction*,CDFGVertex* >::iterator it = instructionMap_->find(llvm::cast(tempCond)); - if( it != instructionMap_->end() ) { - inputVertex = instructionMap_->at(llvm::cast(tempCond)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "+src Found " << inputVertex->instruction_ << " in instructionMap_\n"; - } - } else { - inputVertex = new CDFGVertex; - inputVertex->instruction_ = 0x00; - inputVertex->haveConst_ = 0; - inputVertex->intConst_ = 0x00; - inputVertex->floatConst_ = 0x00; - inputVertex->doubleConst_ = 0x00; - - inputVertexID = g.addVertex(inputVertex); - (*vertexList_)[&*blockIter].push_back(inputVertex); - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - //add variable to node use list - tempUseVector->push_back(llvm::cast(tempCond)); - } - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempUseVector) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempDefVector) ); - - if( output_->getVerboseLevel() > 64 ) { - for( auto nodeUseEntry = (*useNode_)[&*blockIter]->at(outputVertex)->begin(); nodeUseEntry != (*useNode_)[&*blockIter]->at(outputVertex)->end(); nodeUseEntry++ ) { - llvm::errs() << "Node-Use Entry (" << outputVertex->instruction_ << "): " << *nodeUseEntry << "\n"; - } - - for( auto nodeDefEntry = (*defNode_)[&*blockIter]->at(outputVertex)->begin(); nodeDefEntry != (*defNode_)[&*blockIter]->at(outputVertex)->end(); nodeDefEntry++ ) { - llvm::errs() << "Node-Def Entry (" << outputVertex->instruction_ << "): " << *nodeDefEntry << "\n"; - } - } - - // END Branch - } else if( tempOpcode == llvm::Instruction::Load ) { // BEGIN Load - std::vector< llvm::Instruction* > *tempUseVector = new std::vector< llvm::Instruction* >; - std::vector< llvm::Instruction* > *tempDefVector = new std::vector< llvm::Instruction* >; - - llvm::Value* tempSrc = llvm::cast(instructionIter)->getPointerOperand(); - uint32_t alignment = llvm::cast(instructionIter)->getAlignment(); - - //Get src information - if( llvm::isa(tempSrc) ) { - std::map< llvm::Instruction*,CDFGVertex* >::iterator it = instructionMap_->find(llvm::cast(tempSrc)); - if( it != instructionMap_->end() ) { - inputVertex = instructionMap_->at(llvm::cast(tempSrc)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "+src Found " << inputVertex->instruction_ << " in instructionMap_\n"; - } - } else { - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = alignment; - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = alignment; -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - //add variable to node use list - tempUseVector->push_back(llvm::cast(tempSrc)); - } else { - //TODO fix arguments as source - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = alignment; - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - outputVertex->valueName_ = tempSrc->getName().str(); - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = alignment; -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; -// inputVertex->valueName_ = tempSrc->getName().str(); - -// inputVertexID = g.addVertex(inputVertex); -// g.addEdge(inputVertexID, outputVertexID); -// // if(inserted) -// // { -// // g[edgeDesc].value_t = tempSrc; -// // } -// -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - }//end src - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempUseVector) ); - - //create the node/def entries - tempDefVector->push_back(&*instructionIter); - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempDefVector) ); - - if( output_->getVerboseLevel() > 64 ) { - for( auto nodeUseEntry = (*useNode_)[&*blockIter]->at(outputVertex)->begin(); nodeUseEntry != (*useNode_)[&*blockIter]->at(outputVertex)->end(); nodeUseEntry++ ) { - llvm::errs() << "Node-Use Entry (" << outputVertex->instruction_ << "): " << *nodeUseEntry << "\n"; - } - - for( auto nodeDefEntry = (*defNode_)[&*blockIter]->at(outputVertex)->begin(); nodeDefEntry != (*defNode_)[&*blockIter]->at(outputVertex)->end(); nodeDefEntry++ ) { - llvm::errs() << "Node-Def Entry (" << outputVertex->instruction_ << "): " << *nodeDefEntry << "\n"; - } - } - - //END Load - } else if( tempOpcode == llvm::Instruction::Store ) { // BEGIN Store - std::vector< llvm::Instruction* > *tempUseVector = new std::vector< llvm::Instruction* >; - std::vector< llvm::Instruction* > *tempDefVector = new std::vector< llvm::Instruction* >; - - llvm::Value* tempDst = llvm::cast(instructionIter)->getPointerOperand(); - llvm::Value* tempSrc = llvm::cast(instructionIter)->getValueOperand(); - - //Get destination dependency - if( llvm::isa(tempDst) ) { - std::map< llvm::Instruction*,CDFGVertex* >::iterator it = instructionMap_->find(llvm::cast(tempDst)); - if( it != instructionMap_->end() ) { - inputVertex = instructionMap_->at(llvm::cast(tempDst)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "+dst Found " << inputVertex->instruction_ << " in instructionMap_\n"; - } - } else { - inputVertex = new CDFGVertex; - inputVertex->instruction_ = 0x00; - inputVertex->haveConst_ = 0; - inputVertex->intConst_ = 0x00; - inputVertex->floatConst_ = 0x00; - inputVertex->doubleConst_ = 0x00; - - inputVertexID = g.addVertex(inputVertex); - (*vertexList_)[&*blockIter].push_back(inputVertex); - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - //add variable to node use list - tempUseVector->push_back(llvm::cast(tempDst)); - - } else if( llvm::isa(tempDst) ) { - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = 0xFF; - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - outputVertex->valueName_ = tempSrc->getName().str(); - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = 0xFF; -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; -// inputVertex->valueName_ = tempSrc->getName().str(); -// -// inputVertexID = g.addVertex(inputVertex); -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = llvm::cast(instructionIter)->getValueOperand(); -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - } else { - if( llvm::isa(tempDst) ) { // signed/unsigned ints - llvm::ConstantInt* tempConst = llvm::cast(tempDst); - - outputVertex->instruction_ = 0x00; - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = tempConst->getSExtValue(); - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = tempConst->getSExtValue(); -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; -// -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - } else if( llvm::isa(tempDst) ) { // floats and doubles - llvm::ConstantFP* tempConst = llvm::cast(tempDst); - - outputVertex = new CDFGVertex; - outputVertex->instruction_ = 0x00; - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = 0x00; - if(tempDst->getType()->isFloatTy()) { - outputVertex->doubleConst_ = (double) tempConst->getValueAPF().convertToFloat(); - } else { - outputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); - } - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = 0x00; -// if(tempDst->getType()->isFloatTy()) { -// inputVertex->doubleConst_ = (double) tempConst->getValueAPF().convertToFloat(); -// } else { -// inputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); -// } -// -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - } else { - inputVertex = new CDFGVertex; - inputVertex->instruction_ = 0x00; - inputVertex->haveConst_ = 0; - inputVertex->intConst_ = 0x00; - inputVertex->floatConst_ = 0x00; - inputVertex->doubleConst_ = 0x00; - - inputVertexID = g.addVertex(inputVertex); - (*vertexList_)[&*blockIter].push_back(inputVertex); - - // Insert edge for const here since we can't discover it when we walk the graph - ParserEdgeProperties* edgeProp = new ParserEdgeProperties; - edgeProp->value_ = 0x00; - g.addEdge(inputVertexID, outputVertexID, edgeProp); - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - }// END dst dep check - - //Get source dependency - if( llvm::isa(tempSrc) ) { - std::map< llvm::Instruction*,CDFGVertex* >::iterator it = instructionMap_->find(llvm::cast(tempSrc)); - if( it != instructionMap_->end() ) { - inputVertex = instructionMap_->at(llvm::cast(tempSrc)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "+src Found " << inputVertex->instruction_ << " in instructionMap_\n"; - } - } else { -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 0; -// inputVertex->intConst_ = 0x00; -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; -// -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - //add variable to node use list - tempUseVector->push_back(llvm::cast(tempSrc)); - } else if( llvm::isa(tempSrc) ) { - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = 0xFF; - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - outputVertex->valueName_ = tempSrc->getName().str(); - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = 0xFF; -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; -// inputVertex->valueName_ = tempSrc->getName().str(); - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = llvm::cast(instructionIter)->getValueOperand(); -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - } else { - if( llvm::isa(tempSrc) ) { // signed/unsigned ints - llvm::ConstantInt* tempConst = llvm::cast(tempSrc); - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = tempConst->getSExtValue(); - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = tempConst->getSExtValue(); -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - } else if( llvm::isa(tempSrc) ) { // floats and doubles - llvm::ConstantFP* tempConst = llvm::cast(tempSrc); - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = 0x00; - if(tempSrc->getType()->isFloatTy()) { - outputVertex->doubleConst_ = (double) tempConst->getValueAPF().convertToFloat(); - } else { - outputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); - } - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = 0x00; -// // if(tempSrc->getType()->isFloatTy()) -// // inputVertex->floatConst = tempConst->getValueAPF().convertToFloat(); -// // else -// inputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } else { - inputVertex = new CDFGVertex; - inputVertex->instruction_ = 0x00; - inputVertex->haveConst_ = 0; - inputVertex->intConst_ = 0x00; - inputVertex->floatConst_ = 0x00; - inputVertex->doubleConst_ = 0x00; - - inputVertexID = g.addVertex(inputVertex); - (*vertexList_)[&*blockIter].push_back(inputVertex); - - // Insert edge for const here since we can't discover it when we walk the graph - ParserEdgeProperties* edgeProp = new ParserEdgeProperties; - edgeProp->value_ = 0x00; - g.addEdge(inputVertexID, outputVertexID, edgeProp); - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - }// END src dep check - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempUseVector) ); - - //create the node/def entries - tempDefVector->push_back(&*instructionIter); - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempDefVector) ); - - if( output_->getVerboseLevel() > 64 ) { - for( auto nodeUseEntry = (*useNode_)[&*blockIter]->at(outputVertex)->begin(); nodeUseEntry != (*useNode_)[&*blockIter]->at(outputVertex)->end(); nodeUseEntry++ ) { - llvm::errs() << "Node-Use Entry (" << outputVertex->instruction_ << "): " << *nodeUseEntry << "\n"; - } - - for( auto nodeDefEntry = (*defNode_)[&*blockIter]->at(outputVertex)->begin(); nodeDefEntry != (*defNode_)[&*blockIter]->at(outputVertex)->end(); nodeDefEntry++ ) { - llvm::errs() << "Node-Def Entry (" << outputVertex->instruction_ << "): " << *nodeDefEntry << "\n"; - } - } - - llvm::errs() << "???????????? STORE END\n"; - - //END Store - } else if( tempOpcode == llvm::Instruction::GetElementPtr ){ // BEGIN GEP - std::vector< llvm::Instruction* > *tempUseVector = new std::vector< llvm::Instruction* >; - std::vector< llvm::Instruction* > *tempDefVector = new std::vector< llvm::Instruction* >; - - for( auto operandIter = instructionIter->op_begin(), operandEnd = instructionIter->op_end(); operandIter != operandEnd; ++operandIter ) { - llvm::Value* tempOperand = operandIter->get(); - - if( llvm::isa(tempOperand) ) { - if( llvm::isa(tempOperand) ) { // signed/unsigned ints - llvm::ConstantInt* tempConst = llvm::cast(tempOperand); - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = tempConst->getSExtValue(); - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = tempConst->getSExtValue(); -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - } else if( llvm::isa(tempOperand) ) { // floats and doubles - llvm::ConstantFP* tempConst = llvm::cast(tempOperand); - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = 0x00; - if(tempOperand->getType()->isFloatTy()) { - outputVertex->doubleConst_ = (double) tempConst->getValueAPF().convertToFloat(); - } else { - outputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); - } - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = 0x00; -// // if(tempOperand->getType()->isFloatTy()) -// // inputVertex->floatConst = tempConst->getValueAPF().convertToFloat(); -// // else -// inputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - } else if( llvm::isa(tempOperand) ) { - std::map< llvm::Instruction*,CDFGVertex* >::iterator it = instructionMap_->find(llvm::cast(tempOperand)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "**** " << static_cast(operandIter->get()) << " -- " << - llvm::cast(tempOperand) << " -- "; - } - - if( it != instructionMap_->end() ) { - inputVertex = instructionMap_->at(llvm::cast(tempOperand)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "+Found " << inputVertex->instruction_ << " in instructionMap_\n"; - } - } else { - inputVertex = new CDFGVertex; - inputVertex->instruction_ = 0x00; - inputVertex->haveConst_ = 0; - inputVertex->intConst_ = 0x00; - inputVertex->floatConst_ = 0x00; - inputVertex->doubleConst_ = 0x00; - - inputVertexID = g.addVertex(inputVertex); - (*vertexList_)[&*blockIter].push_back(inputVertex); - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - //add variable to node use list - tempUseVector->push_back(llvm::cast(tempOperand)); - } - } - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempUseVector) ); - - //create the node/def entries - tempDefVector->push_back(&*instructionIter); - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempDefVector) ); - - if( output_->getVerboseLevel() > 64 ) { - for( auto nodeUseEntry = (*useNode_)[&*blockIter]->at(outputVertex)->begin(); nodeUseEntry != (*useNode_)[&*blockIter]->at(outputVertex)->end(); nodeUseEntry++ ) { - llvm::errs() << "Node-Use Entry (" << outputVertex->instruction_ << "): " << *nodeUseEntry << "\n"; - } - - for( auto nodeDefEntry = (*defNode_)[&*blockIter]->at(outputVertex)->begin(); nodeDefEntry != (*defNode_)[&*blockIter]->at(outputVertex)->end(); nodeDefEntry++ ) { - llvm::errs() << "Node-Def Entry (" << outputVertex->instruction_ << "): " << *nodeDefEntry << "\n"; - } - } - - //END GEP - } else if( tempOpcode == llvm::Instruction::ICmp || tempOpcode == llvm::Instruction::FCmp ) { // BEGIN Int/Float Compare - std::vector< llvm::Instruction* > *tempUseVector = new std::vector< llvm::Instruction* >; - std::vector< llvm::Instruction* > *tempDefVector = new std::vector< llvm::Instruction* >; - - for( auto operandIter = instructionIter->op_begin(), operandEnd = instructionIter->op_end(); operandIter != operandEnd; ++operandIter ) { - llvm::Value* tempOperand = operandIter->get(); - - if( llvm::isa(tempOperand) ) { - if( llvm::isa(tempOperand) ) { // signed/unsigned ints - llvm::ConstantInt* tempConst = llvm::cast(tempOperand); - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = tempConst->getSExtValue(); - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = tempConst->getSExtValue(); -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - } else if( llvm::isa(tempOperand) ) { // floats and doubles - llvm::ConstantFP* tempConst = llvm::cast(tempOperand); - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = 0x00; - if(tempOperand->getType()->isFloatTy()) { - outputVertex->doubleConst_ = (double) tempConst->getValueAPF().convertToFloat(); - } else { - outputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); - } - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = 0x00; -// // if(tempOperand->getType()->isFloatTy()) -// // inputVertex->floatConst = tempConst->getValueAPF().convertToFloat(); -// // else -// inputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - } else if( llvm::isa(tempOperand) ) { - std::map< llvm::Instruction*,CDFGVertex* >::iterator it = instructionMap_->find(llvm::cast(tempOperand)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "**** " << static_cast(operandIter->get()) << " -- " << llvm::cast(tempOperand) << " -- "; - } - - if( it != instructionMap_->end() ) { - inputVertex = instructionMap_->at(llvm::cast(tempOperand)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "+Found " << inputVertex->instruction_ << " in instructionMap_\n"; - } - } else { - inputVertex = new CDFGVertex; - inputVertex->instruction_ = 0x00; - inputVertex->haveConst_ = 0; - inputVertex->intConst_ = 0x00; - inputVertex->floatConst_ = 0x00; - inputVertex->doubleConst_ = 0x00; - - inputVertexID = g.addVertex(inputVertex); - (*vertexList_)[&*blockIter].push_back(inputVertex); - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - //add variable to node use list - tempUseVector->push_back(llvm::cast(tempOperand)); - } else if( llvm::isa(tempOperand) || llvm::isa(tempOperand) ) { - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = 0xFF; - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = 0xFF; -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - } - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempUseVector) ); - - //create the node/def entries - tempDefVector->push_back(&*instructionIter); - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempDefVector) ); - - if( output_->getVerboseLevel() > 64 ) { - for( auto nodeUseEntry = (*useNode_)[&*blockIter]->at(outputVertex)->begin(); nodeUseEntry != (*useNode_)[&*blockIter]->at(outputVertex)->end(); nodeUseEntry++ ) { - llvm::errs() << "Node-Use Entry (" << outputVertex->instruction_ << "): " << *nodeUseEntry << "\n"; - } - - for( auto nodeDefEntry = (*defNode_)[&*blockIter]->at(outputVertex)->begin(); nodeDefEntry != (*defNode_)[&*blockIter]->at(outputVertex)->end(); nodeDefEntry++ ) { - llvm::errs() << "Node-Def Entry (" << outputVertex->instruction_ << "): " << *nodeDefEntry << "\n"; - } - } - - // END Int/Float Compare - } else if( llvm::Instruction::isCast(tempOpcode) ) { // BEGIN llvm::cast (Instruction.def) - std::vector< llvm::Instruction* > *tempUseVector = new std::vector< llvm::Instruction* >; - std::vector< llvm::Instruction* > *tempDefVector = new std::vector< llvm::Instruction* >; - - for( auto operandIter = instructionIter->op_begin(), operandEnd = instructionIter->op_end(); operandIter != operandEnd; ++operandIter ) { - llvm::Value* tempOperand = operandIter->get(); - - if( llvm::isa(tempOperand) ) { - if( llvm::isa(tempOperand) ) { // signed/unsigned ints - llvm::ConstantInt* tempConst = llvm::cast(tempOperand); - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = tempConst->getSExtValue(); - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = tempConst->getSExtValue(); -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - } - else if( llvm::isa(tempOperand) ) // floats and doubles - { - llvm::ConstantFP* tempConst = llvm::cast(tempOperand); - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = 0x00; - if(tempOperand->getType()->isFloatTy()) { - outputVertex->doubleConst_ = (double) tempConst->getValueAPF().convertToFloat(); - } else { - outputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); - } - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = 0x00; -// // if(tempOperand->getType()->isFloatTy()) -// // inputVertex->floatConst = tempConst->getValueAPF().convertToFloat(); -// // else -// inputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - } else if( llvm::isa(tempOperand) ) { - std::map< llvm::Instruction*,CDFGVertex* >::iterator it = instructionMap_->find(llvm::cast(tempOperand)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "**** " << static_cast(operandIter->get()) << " -- " << llvm::cast(tempOperand) << " -- "; - } - - if( it != instructionMap_->end() ) { - inputVertex = instructionMap_->at(llvm::cast(tempOperand)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "+Found " << inputVertex->instruction_ << " in instructionMap_\n"; - } - - } else { - inputVertex = new CDFGVertex; - inputVertex->instruction_ = 0x00; - inputVertex->haveConst_ = 0; - inputVertex->intConst_ = 0x00; - inputVertex->floatConst_ = 0x00; - inputVertex->doubleConst_ = 0x00; - - inputVertexID = g.addVertex(inputVertex); - (*vertexList_)[&*blockIter].push_back(inputVertex); - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - //add variable to node use list - tempUseVector->push_back(llvm::cast(tempOperand)); - } - - } - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempUseVector) ); - - //create the node/def entries - tempDefVector->push_back(&*instructionIter); - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempDefVector) ); - - if( output_->getVerboseLevel() > 64 ) { - for( auto nodeUseEntry = (*useNode_)[&*blockIter]->at(outputVertex)->begin(); nodeUseEntry != (*useNode_)[&*blockIter]->at(outputVertex)->end(); nodeUseEntry++ ) { - llvm::errs() << "Node-Use Entry (" << outputVertex->instruction_ << "): " << *nodeUseEntry << "\n"; - } - - for( auto nodeDefEntry = (*defNode_)[&*blockIter]->at(outputVertex)->begin(); nodeDefEntry != (*defNode_)[&*blockIter]->at(outputVertex)->end(); nodeDefEntry++ ) { - llvm::errs() << "Node-Def Entry (" << outputVertex->instruction_ << "): " << *nodeDefEntry << "\n"; - } - } - - //END CAST - } else if( llvm::Instruction::isBinaryOp(tempOpcode) ) { // BEGIN binary operators & logical operators -- two operands - std::vector< llvm::Instruction* > *tempUseVector = new std::vector< llvm::Instruction* >; - std::vector< llvm::Instruction* > *tempDefVector = new std::vector< llvm::Instruction* >; - - for( auto operandIter = instructionIter->op_begin(), operandEnd = instructionIter->op_end(); operandIter != operandEnd; ++operandIter ) { - llvm::Value* tempOperand = operandIter->get(); - - if( llvm::isa(tempOperand) ) { - if( llvm::isa(tempOperand) ) { // signed/unsigned ints - llvm::ConstantInt* tempConst = llvm::cast(tempOperand); - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = tempConst->getSExtValue(); - outputVertex->floatConst_ = 0x00; - outputVertex->doubleConst_ = 0x00; - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = tempConst->getSExtValue(); -// inputVertex->floatConst_ = 0x00; -// inputVertex->doubleConst_ = 0x00; - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, new std::vector< llvm::Instruction* >) ); - - } else if( llvm::isa(tempOperand) ){ // floats and doubles - llvm::ConstantFP* tempConst = llvm::cast(tempOperand); - - outputVertex->haveConst_ = 1; - outputVertex->intConst_ = 0x00; - if(tempOperand->getType()->isFloatTy()) { - outputVertex->doubleConst_ = (double) tempConst->getValueAPF().convertToFloat(); - } else { - outputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); - } - -// inputVertex = new CDFGVertex; -// inputVertex->instruction_ = 0x00; -// inputVertex->haveConst_ = 1; -// inputVertex->intConst_ = 0x00; -// // if(tempOperand->getType()->isFloatTy()) -// // inputVertex->floatConst = tempConst->getValueAPF().convertToFloat(); -// // else -// inputVertex->doubleConst_ = tempConst->getValueAPF().convertToDouble(); - -// inputVertexID = g.addVertex(inputVertex); -// (*vertexList_)[&*blockIter].push_back(inputVertex); -// -// // Insert edge for const here since we can't discover it when we walk the graph -// ParserEdgeProperties* edgeProp = new ParserEdgeProperties; -// edgeProp->value_ = 0x00; -// g.addEdge(inputVertexID, outputVertexID, edgeProp); -// -// // create the node/use entries -// (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, new std::vector< llvm::Instruction* >) ); -// -// //create the node/def entries -// (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, new std::vector< llvm::Instruction* >) ); - } - } else if( llvm::isa(tempOperand) ) { - std::map< llvm::Instruction*,CDFGVertex* >::iterator it = instructionMap_->find(llvm::cast(tempOperand)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "**** " << static_cast(operandIter->get()) << " -- " << llvm::cast(tempOperand) << " -- "; - } - - if( it != instructionMap_->end() ) { - inputVertex = instructionMap_->at(llvm::cast(tempOperand)); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "+Found " << inputVertex->instruction_ << " in instructionMap_\n"; - } - } else { - inputVertex = new CDFGVertex; - inputVertex->instruction_ = 0x00; - inputVertex->haveConst_ = 0; - inputVertex->intConst_ = 0x00; - inputVertex->floatConst_ = 0x00; - inputVertex->doubleConst_ = 0x00; - - inputVertexID = g.addVertex(inputVertex); - (*vertexList_)[&*blockIter].push_back(inputVertex); - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(inputVertex, new std::vector< llvm::Instruction* >) ); - } - - //add variable to node use list - tempUseVector->push_back(llvm::cast(tempOperand)); - } - - } - - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempUseVector) ); - - //create the node/def entries - tempDefVector->push_back(&*instructionIter); - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, tempDefVector) ); - - if( output_->getVerboseLevel() > 64 ) { - for( auto nodeUseEntry = (*useNode_)[&*blockIter]->at(outputVertex)->begin(); nodeUseEntry != (*useNode_)[&*blockIter]->at(outputVertex)->end(); nodeUseEntry++ ) { - llvm::errs() << "Node-Use Entry (" << outputVertex->instruction_ << "): " << *nodeUseEntry << "\n"; - } - - for( auto nodeDefEntry = (*defNode_)[&*blockIter]->at(outputVertex)->begin(); nodeDefEntry != (*defNode_)[&*blockIter]->at(outputVertex)->end(); nodeDefEntry++ ) { - llvm::errs() << "Node-Def Entry (" << outputVertex->instruction_ << "): " << *nodeDefEntry << "\n"; - } - } - - //END ALU - } else { - // create the node/use entries - (*useNode_)[&*blockIter]->insert( std::pair* >(outputVertex, new std::vector< llvm::Instruction* >) ); - - //create the node/def entries - (*defNode_)[&*blockIter]->insert( std::pair* >(outputVertex, new std::vector< llvm::Instruction* >) ); - - if( output_->getVerboseLevel() > 64 ) { - for( auto nodeUseEntry = (*useNode_)[&*blockIter]->at(outputVertex)->begin(); nodeUseEntry != (*useNode_)[&*blockIter]->at(outputVertex)->end(); nodeUseEntry++ ) { - llvm::errs() << "Node-Use Entry (" << outputVertex->instruction_ << "): " << *nodeUseEntry << "\n"; - } - - for( auto nodeDefEntry = (*defNode_)[&*blockIter]->at(outputVertex)->begin(); nodeDefEntry != (*defNode_)[&*blockIter]->at(outputVertex)->end(); nodeDefEntry++ ) { - llvm::errs() << "Node-Def Entry (" << outputVertex->instruction_ << "): " << *nodeDefEntry << "\n"; - } - } - } - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "********************************************* Ins Map *********************************************\n"; - for( std::map< llvm::Instruction*,CDFGVertex* >::iterator it = instructionMap_->begin(); it != instructionMap_->end(); ++it ) { - llvm::errs() << it->first; - llvm::errs() << " "; - } - llvm::errs() << "\n****************************************************************************************************\n"; - - llvm::errs() << "\t\t\tnum operands " << instructionIter->getNumOperands() << "\n"; - for( auto operandIter = instructionIter->op_begin(), operandEnd = instructionIter->op_end(); operandIter != operandEnd; ++operandIter ) { - llvm::errs() << "\t\t\top get " << operandIter->get() << "\n"; - llvm::errs() << "\t\t\top uses " << operandIter->get()->getNumUses() << "\n"; - llvm::errs() << "\t\t\top dump "; - operandIter->get()->dump(); - - if( operandIter->get()->hasName() == 1 ) { - llvm::errs() << "\t\t\tfound "; - llvm::errs().write_escaped(operandIter->get()->getName().str()) << " "; - } else { - llvm::errs() << "\t\t\tempty \n"; - } - llvm::errs() << "\n"; - } - - llvm::errs() << "\n"; - } - } - } - - // should be complete here - output_->verbose(CALL_INFO, 1, 0, "...Flow Graph Done.\n"); - -}//END expandBBGraph - -void Parser::assembleGraph(void) -{ - // Need to assemble the actual graph -- insert edges for def-use chains - // This is done for each vertex in the BB graph and then merged - BBGraph &bbg = *bbGraph_; - - auto vertexMap = bbg.getVertexMap(); - for(auto bbGraphIter = vertexMap->begin(); bbGraphIter != vertexMap->end(); ++bbGraphIter) { -// std::cout << bbGraphIter->first << "[label=\""; -// std::cout << bbGraphIter->second.getValue(); -// std::cout << "\"];\n"; - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\nConstructing graph for basic block " << bbGraphIter->second.getValue() << "...\n"; - } - - llvm::BasicBlock* basicBlock = bbGraphIter->second.getValue(); - CDFG &g = *((*flowGraph_)[basicBlock]); - - if( output_->getVerboseLevel() > 64 ) { - // Prints list of all instructions in the basic block before processing - for( auto revIt = (*vertexList_)[basicBlock].rbegin(); revIt != (*vertexList_)[basicBlock].rend(); ++revIt) { - llvm::errs() << "\t" << (*revIt)->instruction_ << "\n"; - } - llvm::errs() << "\n\n"; - } - - for( auto revIt = (*vertexList_)[basicBlock].rbegin(); revIt != (*vertexList_)[basicBlock].rend(); ++revIt) { - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\n\tInstruction: " << (*revIt)->instruction_ << "\n"; - } - - // For each vertex, iterate through the instruction's use list - // Insert an edge between the uses and the next def - // Defs may be origin node, previous store, etc - for( auto nodeUseEntry = (*useNode_)[basicBlock]->at(*revIt)->begin(); nodeUseEntry != (*useNode_)[basicBlock]->at(*revIt)->end(); ++nodeUseEntry ) { - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\t\tNode Use Entry: " << *nodeUseEntry << "\n"; - } - - // Check for actual instructions used in this vertex - for( auto innerRevIt = revIt; innerRevIt != (*vertexList_)[basicBlock].rend(); ++innerRevIt ) { - llvm::Instruction* innerInst = (*innerRevIt)->instruction_; - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\t\t\tinner: " << innerInst << "\n"; - } - - if( innerRevIt == revIt || innerInst == 0x00 ) { - continue; - } - - // FIXME Assume Allocate -> Store -> Load chain and skip edge between allocate and load - if( (*revIt)->instruction_->getOpcode() == llvm::Instruction::Load && innerInst->getOpcode() == llvm::Instruction::Alloca ) { - continue; - } - - if( innerInst == *nodeUseEntry ) { - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\t\t\t\tfound: " << innerInst << "\n"; - } - - ParserEdgeProperties* edgeProp = new ParserEdgeProperties; - edgeProp->value_ = 0x00; - g.addEdge(g[*innerRevIt], g[*revIt], edgeProp); - } - - // Check for RAW and WAW deps - uint32_t opccode = (*revIt)->instruction_->getOpcode(); - if( opccode == llvm::Instruction::Load || opccode == llvm::Instruction::Store ) { - for( auto operandIter = innerInst->op_begin(), operandEnd = innerInst->op_end(); operandIter != operandEnd; ++operandIter ) { - if( innerInst->getOpcode() == llvm::Instruction::Store ) { - if( *operandIter == *nodeUseEntry ) { - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\t\t\t\t(" << (*innerRevIt)->instruction_ << ") operand " << *operandIter << "\n"; - } - - ParserEdgeProperties* edgeProp = new ParserEdgeProperties; - edgeProp->value_ = 0x00; - g.addEdge(g[*innerRevIt], g[*revIt], edgeProp); - } - } - } - } - } - } - }//END dep chain - - // Finally, check for orphaned nodes - // Want to connect them with any previous node that is non-zero and has zero out-edges - output_->verbose(CALL_INFO, 1, 0, "\nChecking for orphans...\n"); - - auto cdfgVertexMap = g.getVertexMap(); - for(auto cdfgGraphIter = cdfgVertexMap->begin(); cdfgGraphIter != cdfgVertexMap->end(); ++cdfgGraphIter) { - - llvm::Instruction* tempIns = cdfgGraphIter->second.getValue()->instruction_; - if( tempIns != 0x00 ) { - if( tempIns->getOpcode() != llvm::Instruction::Alloca ) { - if( cdfgGraphIter->second.getInDegree() <= 0 && cdfgGraphIter->second.getOutDegree() <= 0 ) { - for( auto revIt = (*vertexList_)[basicBlock].rbegin(); revIt != (*vertexList_)[basicBlock].rend(); ++revIt) { - if( (*revIt)->instruction_ != 0x00 && g.getVertex(g[*revIt])->getOutDegree() <= 0 && (*revIt)->instruction_ != tempIns) { - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "@@@@@@@@@@@@@@@@@@@@@@@@@ " << (*revIt)->instruction_; - llvm::errs() << " to " << tempIns << "\n"; - } - - ParserEdgeProperties* edgeProp = new ParserEdgeProperties; - edgeProp->value_ = 0x00; - g.addEdge(g[*revIt], cdfgGraphIter->first, edgeProp); - } - } - } - } - } - }//END orphan check - } -}//END assembleGraph - -void Parser::mergeGraphs() -{ - output_->verbose(CALL_INFO, 1, 0, "\nMerging graphs\n"); - - functionGraph_ = new CDFG; - BBGraph &bbg = *bbGraph_; - auto bbVertexMap = bbg.getVertexMap(); - for(auto bbGraphIter = bbVertexMap->begin(); bbGraphIter != bbVertexMap->end(); ++bbGraphIter) { - llvm::BasicBlock* basicBlock = bbGraphIter->second.getValue(); - CDFG &g = *((*flowGraph_)[basicBlock]); - CDFG::copyGraph(g, *functionGraph_); - } - - functionGraph_->printDot("00_func.dot"); - - // Connect the individual basic blocks back together - output_->verbose(CALL_INFO, 1, 0, "...adding edges...\n"); - - auto funcVertexMap = functionGraph_->getVertexMap(); - for( auto vertexIterator = funcVertexMap->begin(); vertexIterator != funcVertexMap ->end(); ++vertexIterator ) { - llvm::Instruction* tempIns = vertexIterator->second.getValue()->instruction_; - - if( tempIns != 0x00 ) { - if( tempIns->getOpcode() == llvm::Instruction::Br ) { - llvm::BasicBlock* currentBB = tempIns->getParent(); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "Ins " << &*tempIns << " located in " << &*currentBB << "\n"; - } - - // Identify all successor basic bloacks and identify all entry instructions for each one - // An entry instruction is a non-zero instruction with no in-edges - llvm::BasicBlock* nextBB; - std::vector < llvm::Instruction* > connectorList; - uint32_t totalSuccessors = currentBB->getTerminator()->getNumSuccessors(); - for( uint32_t successor = 0; successor < totalSuccessors; successor++ ) { - nextBB = currentBB->getTerminator()->getSuccessor(successor); - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "-----Next BB: " << nextBB << "\n"; - } - - CDFG &g = *((*flowGraph_)[nextBB]); - auto vertexMap = g.getVertexMap(); - for( auto vertexIteratorInner = vertexMap->begin(); vertexIteratorInner != vertexMap ->end(); ++vertexIteratorInner ) { - bool found = 0; - llvm::Instruction* targetIns = vertexIteratorInner->second.getValue()->instruction_; - std::vector< CDFGVertex* >::reverse_iterator targetIter = std::find((*vertexList_)[nextBB].rbegin(), (*vertexList_)[nextBB].rend(), vertexIteratorInner->second.getValue()); - - if( targetIns != 0x00 ) { - // If there's only a single instruction then we can link directly - // otherwise we need to check for backward deps - if( (*vertexList_)[nextBB].size() == 1 ) { - connectorList.push_back(targetIns); - } else { - for( auto operandIter = targetIns->op_begin(), operandEnd = targetIns->op_end(); operandIter != operandEnd; operandIter++ ) { - if( llvm::isa(*operandIter) ) { - for( std::vector< CDFGVertex* >::reverse_iterator revIt = targetIter + 1; revIt != (*vertexList_)[nextBB].rend(); ++revIt) { - if( (*revIt)->instruction_ == *operandIter ) { - found = 1; - break; - } - } - } - } - - // If the operands do not depend on a previous ins, then we can safely link - if( found == 0 && targetIns->getOpcode() > 10 ) { - connectorList.push_back(targetIns); - } - } - } - } - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "Dumping connector list for " << &*currentBB << ": "; - for( auto connectorIter = connectorList.begin(); connectorIter != connectorList.end(); connectorIter++ ) { - llvm::errs() << *connectorIter << ", "; - } - llvm::errs() << "\n"; - } - } - - for( auto connectorIter = connectorList.begin(); connectorIter != connectorList.end(); connectorIter++ ) { - for( auto vertexIteratorInner = funcVertexMap->begin(); vertexIteratorInner != funcVertexMap ->end(); ++vertexIteratorInner ) { - if( *connectorIter == vertexIteratorInner->second.getValue()->instruction_ ) { - - if( output_->getVerboseLevel() > 64 ) { - llvm::errs() << "\tConnecting (" << &*currentBB; - llvm::errs() << ") " << vertexIterator->second.getValue()->instruction_ << " in " << vertexIterator->second.getValue()->instruction_->getParent(); - llvm::errs() << " to (" << &*nextBB; - llvm::errs() << ") " << vertexIteratorInner->second.getValue()->instruction_ << " in " << vertexIteratorInner->second.getValue()->instruction_->getParent() << "\n"; - } - - ParserEdgeProperties* edgeProp = new ParserEdgeProperties; - edgeProp->value_ = 0x00; - functionGraph_->addEdge(vertexIterator->first, vertexIteratorInner->first, edgeProp ); - } - } - } - } - } - } - - output_->verbose(CALL_INFO, 1, 0, "...merge finished\n"); - functionGraph_->printDot("00_func-m.dot"); - -}//END mergeGraphs - -void Parser::printCDFG( const std::string fileName ) const -{ - //open a file for writing (truncate the current contents) - std::ofstream outputFile(fileName.c_str(), std::ios::trunc); - - //check to be sure file is open - if ( !outputFile ) { - output_->fatal(CALL_INFO, -1, "Error: Cannot open file %s\n", fileName.c_str()); - exit(0); - } - - outputFile << "digraph G {" << "\n"; - - auto funcVertexMap = functionGraph_->getVertexMap(); - for( auto vertexIterator = funcVertexMap->begin(); vertexIterator != funcVertexMap ->end(); ++vertexIterator ) { - - outputFile << vertexIterator->first << "[label=\""; - outputFile << vertexIterator->second.getValue()->instructionName_; - outputFile << "\"];\n"; - } - - for(auto vertexIterator = funcVertexMap->begin(); vertexIterator != funcVertexMap->end(); ++vertexIterator) { - std::vector< Edge* >* adjacencyList = vertexIterator->second.getAdjacencyList(); - - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); ++it ) { - outputFile << vertexIterator->first; - outputFile << "->"; - outputFile << (*it)->getDestination(); - outputFile << "\n"; - } - } - - outputFile << "}"; - outputFile.close(); - - -}//END printCDFG - -void Parser::printVertex ( const CDFGVertex* vertexIn ) const -{ - std::cerr << vertexIn->instruction_ << std::endl; - std::cerr << "\t" << vertexIn->instructionName_ << std::endl; - std::cerr << "\t" << vertexIn->valueName_ << std::endl; - std::cerr << "\t\t" << vertexIn->haveConst_ << std::endl; - std::cerr << "\t\t" << vertexIn->intConst_ << std::endl; - std::cerr << "\t\t" << vertexIn->floatConst_ << std::endl; - std::cerr << "\t\t" << vertexIn->doubleConst_ << std::endl; -// std::cerr << "\t" << vertexIn->leftArg_ << std::endl; -// std::cerr << "\t" << vertexIn->rightArg_ << std::endl; -} - -void Parser::printPyMapper( const std::string fileName ) const -{ - std::ofstream outputFile(fileName.c_str(), std::ios::trunc); //open a file for writing (truncate the current contents) - if ( !outputFile ) //check to be sure file is open - std::cerr << "Error opening file."; - - outputFile << "// model intput" << "\n"; - outputFile << "strict digraph {" << "\n"; - - //need this for type size but there should be a better way - llvm::DataLayout* dataLayout = new llvm::DataLayout(mod_); - - auto funcVertexMap = functionGraph_->getVertexMap(); - for( auto vertexIterator = funcVertexMap->begin(); vertexIterator != funcVertexMap ->end(); ++vertexIterator ) { - - bool swapped = 0; - llvm::Instruction* tempInstruction = vertexIterator->second.getValue()->instruction_; - if( tempInstruction != NULL ) { - std::cout << "vertex: " << vertexIterator->first << "\n"; - - //temp const vector - std::map< uint32_t, std::string > constVector; - //write node ID - outputFile << vertexIterator->first << " ["; - outputFile << std::flush; - - //write operands - bool first = 0; - outputFile << "input=" << "\""; - for( auto operandIter = tempInstruction->op_begin(), operandEnd = tempInstruction->op_end(); operandIter != operandEnd; ++operandIter ) { - if( first != 0 ) { - outputFile << ":"; - } else { - first = 1; - } - - std::cout << operandIter->get()->getNameOrAsOperand() << " -- boopA" << std::endl; - - if( llvm::isa(operandIter) ) { - std::cout << operandIter->getOperandNo() << "\":"; - std::cout << vertexIterator->second.getValue()->intConst_ << " "; - std::cout << vertexIterator->second.getValue()->floatConst_ << " "; - std::cout << vertexIterator->second.getValue()->doubleConst_ << " "; - std::cout << std::endl; - - if( llvm::isa(operandIter) ) { - llvm::ConstantInt* tempConst = llvm::cast(operandIter); - - constVector.emplace( operandIter->getOperandNo(), tempConst->getNameOrAsOperand() ); - std::cout << tempConst->getNameOrAsOperand() << " -- inboop" << std::endl; - - } else if( llvm::isa(operandIter) ) { - llvm::ConstantFP* tempConst = llvm::cast(operandIter); - - constVector.emplace( operandIter->getOperandNo(), tempConst->getNameOrAsOperand() ); - std::cout << tempConst->getNameOrAsOperand() << " -- fpboop" << std::endl; - - } else if( llvm::isa(operandIter) ) { - outputFile << operandIter->get()->getNameOrAsOperand(); - std::cout << operandIter->get()->getNameOrAsOperand() << " -- boopB" << std::endl; - - } else if( llvm::isa(operandIter) ) { - outputFile << operandIter->get()->getNameOrAsOperand(); - std::cout << operandIter->get()->getNameOrAsOperand() << " -- boopG" << std::endl; - } else { - output_->fatal(CALL_INFO, -1, "Error: No valid operand\n"); - exit(0); - } - } else { - outputFile << operandIter->get()->getNameOrAsOperand(); - std::cout << operandIter->get()->getNameOrAsOperand() << " -- boopC" << std::endl; - } - - }//end for - outputFile << "\"" << ", "; - - //write constants - outputFile << "consts=" << "\""; - for( auto it = constVector.begin(); it != constVector.end(); ) { - outputFile << it->second << ":" << it->first; - ++it; - if( it != constVector.end() ) { - outputFile << "\":"; - } - } - outputFile << "\"" << ", "; - - //write outputs - llvm::Value* returnval = llvm::cast(tempInstruction); - outputFile << "output=" << "\""; - if( returnval->hasName() == 1 ) { - outputFile << returnval->getName().str(); - } - outputFile << "\"" << ", "; - - //write op - outputFile << "op=" << "\""; - outputFile << tempInstruction->getOpcodeName(); - outputFile << "\"" << ", "; - - //write type - outputFile << "type=" << "\""; - if( tempInstruction->getType()->isSized() ) { - outputFile << dataLayout->getTypeStoreSize(tempInstruction->getType()); - } - outputFile << "\"" << "];"; - - //finish - outputFile << "\n"; - } - } - - outputFile << std::endl; - for(auto vertexIterator = funcVertexMap->begin(); vertexIterator != funcVertexMap->end(); ++vertexIterator) { - std::vector< Edge* >* adjacencyList = vertexIterator->second.getAdjacencyList(); - - for( auto it = adjacencyList->begin(); it != adjacencyList->end(); ++it ) { - outputFile << vertexIterator->first; - outputFile << "->"; - outputFile << (*it)->getDestination(); - outputFile << "\n"; - } - } - - outputFile << "}"; - outputFile.close(); - -}//END printPyMapper - -void Parser::collapseInductionVars() -{ - std::cout << "\n\n ---Collapse Testing---\n" << std::flush; - - auto funcVertexMap = functionGraph_->getVertexMap(); - for( auto vertexIterator = funcVertexMap->begin(); vertexIterator != funcVertexMap ->end(); ++vertexIterator ) { - - llvm::Instruction* tempInstruction = vertexIterator->second.getValue()->instruction_; - if( tempInstruction != NULL ) { - std::cout << "vertex: " << vertexIterator->first << "\n"; - - //write operands - for( auto operandIter = tempInstruction->op_begin(), operandEnd = tempInstruction->op_end(); operandIter != operandEnd; ++operandIter ) { - std::cout << operandIter->get()->getNameOrAsOperand() << " -- boopA" << std::endl; - - if( llvm::isa(operandIter) ) { - std::cout << operandIter->getOperandNo() << ": "; - std::cout << vertexIterator->second.getValue()->intConst_ << " "; - std::cout << vertexIterator->second.getValue()->floatConst_ << " "; - std::cout << vertexIterator->second.getValue()->doubleConst_ << " "; - std::cout << std::endl; - - if( llvm::isa(operandIter) ) { - llvm::ConstantInt* tempConst = llvm::cast(operandIter); - - std::cout << tempConst->getNameOrAsOperand() << " -- inboop" << std::endl; - - } else if( llvm::isa(operandIter) ) { - llvm::ConstantFP* tempConst = llvm::cast(operandIter); - - std::cout << tempConst->getNameOrAsOperand() << " -- fpboop" << std::endl; - - } else if( llvm::isa(operandIter) ) { - - std::cout << operandIter->get()->getNameOrAsOperand() << " -- boopB" << std::endl; - - } else if( llvm::isa(operandIter) ) { - - std::cout << operandIter->get()->getNameOrAsOperand() << " -- boopG" << std::endl; - } else { - output_->fatal(CALL_INFO, -1, "Error: No valid operand\n"); - exit(0); - } - } else { - - std::cout << operandIter->get()->getNameOrAsOperand() << " -- boopC" << std::endl; - } - - }//end for - } - } - -}//END collapseInductionVars - -} // namespace llyr -} // namespace SST - - diff --git a/src/sst/elements/llyr/parser/parser.h b/src/sst/elements/llyr/parser/parser.h deleted file mode 100644 index 90f3ad6192..0000000000 --- a/src/sst/elements/llyr/parser/parser.h +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#ifndef _PARSER_H -#define _PARSER_H - -#define DEBUG - -#include - -#include -#include -#include -#include -#include -#include - -#include "graph/graph.h" -#include "llyrTypes.h" -#include "pes/peList.h" - -namespace SST { -namespace Llyr { - -struct alignas(int64_t) ParserEdgeProperties : EdgeProperties -{ - llvm::Value* value_; - int64_t const_; -}; - -struct alignas(int64_t) CDFGVertex -{ - llvm::Instruction* instruction_; - std::string valueName_; - - bool haveConst_; - int64_t intConst_; - float floatConst_; - double doubleConst_; - - std::string instructionName_; - std::string sizeType_; -}; - -typedef LlyrGraph< CDFGVertex* > CDFG; -typedef LlyrGraph< llvm::BasicBlock* > BBGraph; - -class Parser -{ -public: - Parser(const std::string& offloadString, SST::Output* output) : - output_(output), offloadString_(offloadString) - { - vertexList_ = new std::map< llvm::BasicBlock*, std::vector< CDFGVertex* > >; - - defNode_ = new std::map< llvm::BasicBlock*, std::map< CDFGVertex*, std::vector< llvm::Instruction* >* >* >; - useNode_ = new std::map< llvm::BasicBlock*, std::map< CDFGVertex*, std::vector< llvm::Instruction* >* >* >; - - flowGraph_ = new std::map< llvm::BasicBlock*, CDFG* >; - bbGraph_ = new BBGraph; - } - - ~Parser() {}; - - void generateAppGraph( std::string functionName ); - -protected: - -private: - SST::Output* output_; - std::string offloadString_; - std::string offloadTarget_; - - BBGraph* bbGraph_; - CDFG* functionGraph_; - - llvm::Module* mod_; - - std::map< llvm::BasicBlock*, CDFG* >* flowGraph_; - std::map< llvm::BasicBlock*, std::vector< CDFGVertex* > >* vertexList_; - - std::map< llvm::BasicBlock*, std::map< CDFGVertex*, std::vector< llvm::Instruction* >* >* >* defNode_; - std::map< llvm::BasicBlock*, std::map< CDFGVertex*, std::vector< llvm::Instruction* >* >* >* useNode_; - - void generatebBasicBlockGraph(llvm::Function* func); - void expandBBGraph(llvm::Function* func); - void assembleGraph(); - void mergeGraphs(); - - void collapseInductionVars(); - - void printVertex ( const CDFGVertex* ) const; - void printCDFG( const std::string fileName ) const; - void printPyMapper( const std::string fileName ) const; - -}; - -} // namespace LLyr -} // namespace SST - -#endif /* _PARSER_H */ diff --git a/src/sst/elements/llyr/pes/complexPE.h b/src/sst/elements/llyr/pes/complexPE.h deleted file mode 100644 index 85e4ce9f5a..0000000000 --- a/src/sst/elements/llyr/pes/complexPE.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * // Copyright 2013-2022 NTESS. Under the terms - * // of Contract DE-NA0003525 with NTESS, the U.S. - * // Government retains certain rights in this software. - * // - * // Copyright (c) 2013-2022, NTESS - * // All rights reserved. - * // - * // Portions are copyright of other developers: - * // See the file CONTRIBUTORS.TXT in the top level directory - * // the distribution for more information. - * // - * // This file is part of the SST software package. For license - * // information, see the LICENSE file in the top level directory of the - * // distribution. - */ - -#ifndef _COMPLEX_PE_H -#define _COMPLEX_PE_H - -#include - -#include "pes/processingElement.h" - -namespace SST { -namespace Llyr { - -/** - * @todo write docs - */ -class ComplexProcessingElement : public ProcessingElement -{ -public: - ComplexProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config, - uint32_t cycles = 1) : - ProcessingElement(op_binding, processor_id, llyr_config) - { - cycles_ = cycles; - input_queues_= new std::vector< LlyrQueue* >; - output_queues_ = new std::vector< LlyrQueue* >; - } - - virtual bool doSend() - { - uint32_t queueId; - LlyrData sendVal; - ProcessingElement* dstPe; - - for(auto it = output_queue_map_.begin() ; it != output_queue_map_.end(); ++it ) { - queueId = it->first; - dstPe = it->second; - - if( output_queues_->at(queueId)->data_queue_->size() > 0 ) { - output_->verbose(CALL_INFO, 8, 0, ">> Sending...%" PRIu32 "-%" PRIu32 " to %" PRIu32 "\n", - processor_id_, queueId, dstPe->getProcessorId()); - - sendVal = output_queues_->at(queueId)->data_queue_->front(); - output_queues_->at(queueId)->data_queue_->pop(); - - dstPe->pushInputQueue(dstPe->getInputQueueId(this->getProcessorId()), sendVal); - } - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - virtual bool doReceive(LlyrData data) { return 0; }; - - virtual bool doCompute() - { - output_->verbose(CALL_INFO, 4, 0, ">> Compute 0x%" PRIx32 "\n", op_binding_); - - uint64_t intResult = 0x0F; - - std::vector< LlyrData > argList; - LlyrData retVal; - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - uint32_t num_ready = 0; - uint32_t num_inputs = input_queues_->size(); - - //check to see if all of the input queues have data - for( uint32_t i = 0; i < num_inputs; ++i) { - if( input_queues_->at(i)->data_queue_->size() > 0 ) { - num_ready = num_ready + 1; - } - } - - //if there are values waiting on any of the inputs, this PE could still fire - if( num_ready < num_inputs && num_ready > 0) { - pending_op_ = 1; - } else { - pending_op_ = 0; - } - - //if all inputs are available pull from queue and add to arg list - if( num_ready < num_inputs ) { - output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - return false; - } else { - output_->verbose(CALL_INFO, 4, 0, "+Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - for( uint32_t i = 0; i < num_inputs; ++i) { - argList.push_back(input_queues_->at(i)->data_queue_->front()); - input_queues_->at(i)->data_queue_->pop(); - } - } - - switch( op_binding_ ) { - case TSIN : - intResult = sin(argList[0].to_ullong()); - break; - case TCOS : - intResult = cos(argList[0].to_ullong()); - break; - case TTAN : - intResult = tan(argList[0].to_ullong()); - break; - default : - output_->verbose(CALL_INFO, 0, 0, "Error: could not find corresponding op-%" PRIu32 ".\n", op_binding_); - exit(-1); - } - - retVal = LlyrData(intResult); - - output_->verbose(CALL_INFO, 32, 0, "intResult = %" PRIu64 "\n", intResult); - output_->verbose(CALL_INFO, 32, 0, "retVal = %s\n", retVal.to_string().c_str()); - - //for now push the result to all output queues - for( uint32_t i = 0; i < output_queues_->size(); ++i) { - output_queues_->at(i)->data_queue_->push(retVal); - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - //TODO for testing only - virtual void queueInit() {}; - -}; - -}//SST -}//Llyr - -#endif // _LOGIC_PE_H diff --git a/src/sst/elements/llyr/pes/controlPE.h b/src/sst/elements/llyr/pes/controlPE.h deleted file mode 100644 index ce6d569f4a..0000000000 --- a/src/sst/elements/llyr/pes/controlPE.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * // Copyright 2013-2022 NTESS. Under the terms - * // of Contract DE-NA0003525 with NTESS, the U.S. - * // Government retains certain rights in this software. - * // - * // Copyright (c) 2013-2022, NTESS - * // All rights reserved. - * // - * // Portions are copyright of other developers: - * // See the file CONTRIBUTORS.TXT in the top level directory - * // the distribution for more information. - * // - * // This file is part of the SST software package. For license - * // information, see the LICENSE file in the top level directory of the - * // distribution. - */ - -#ifndef _CONTROL_PE_H -#define _CONTROL_PE_H - -#include "pes/processingElement.h" - -namespace SST { -namespace Llyr { - -/** - * @todo write docs - */ -class ControlProcessingElement : public ProcessingElement -{ -public: - ControlProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config, - uint32_t cycles = 1) : - ProcessingElement(op_binding, processor_id, llyr_config) - { - cycles_ = cycles; - input_queues_= new std::vector< LlyrQueue* >; - output_queues_ = new std::vector< LlyrQueue* >; - } - - virtual bool doSend() - { - uint32_t queueId; - LlyrData sendVal; - ProcessingElement* dstPe; - - for(auto it = output_queue_map_.begin() ; it != output_queue_map_.end(); ++it ) { - queueId = it->first; - dstPe = it->second; - - if( output_queues_->at(queueId)->data_queue_->size() > 0 ) { - output_->verbose(CALL_INFO, 8, 0, ">> Sending...%" PRIu32 "-%" PRIu32 " to %" PRIu32 "\n", - processor_id_, queueId, dstPe->getProcessorId()); - - sendVal = output_queues_->at(queueId)->data_queue_->front(); - output_queues_->at(queueId)->data_queue_->pop(); - - dstPe->pushInputQueue(dstPe->getInputQueueId(this->getProcessorId()), sendVal); - } - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - virtual bool doReceive(LlyrData data) { return 0; }; - - virtual bool doCompute() - { - output_->verbose(CALL_INFO, 4, 0, ">> Compute 0x%" PRIx32 "\n", op_binding_); - - uint64_t intResult = 0x0F; - - std::vector< LlyrData > argList; - LlyrData retVal; - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - uint32_t num_ready = 0; - uint32_t num_inputs = input_queues_->size(); - - //check to see if all of the input queues have data - for( uint32_t i = 0; i < num_inputs; ++i) { - if( input_queues_->at(i)->data_queue_->size() > 0 ) { - num_ready = num_ready + 1; - } - } - - //if there are values waiting on any of the inputs, this PE could still fire - if( num_ready < num_inputs && num_ready > 0) { - pending_op_ = 1; - } else { - pending_op_ = 0; - } - - //if all inputs are available pull from queue and add to arg list - if( num_ready < num_inputs ) { - output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - return false; - } else { - output_->verbose(CALL_INFO, 4, 0, "+Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - for( uint32_t i = 0; i < num_inputs; ++i) { - argList.push_back(input_queues_->at(i)->data_queue_->front()); - input_queues_->at(i)->data_queue_->pop(); - } - } - - switch( op_binding_ ) { - case SEL : - retVal = helperFunction(op_binding_, argList[0], argList[1], argList[2]); - break; - case RTR : - retVal = LlyrData(0x00); - break; - case RET : - retVal = LlyrData(0x00); - break; - default : - output_->verbose(CALL_INFO, 0, 0, "Error: could not find corresponding op-%" PRIu32 ".\n", op_binding_); - exit(-1); - } - - output_->verbose(CALL_INFO, 32, 0, "intResult = %" PRIu64 "\n", intResult); - output_->verbose(CALL_INFO, 32, 0, "retVal = %s\n", retVal.to_string().c_str()); - - //for now push the result to all output queues - for( uint32_t i = 0; i < output_queues_->size(); ++i) { - output_queues_->at(i)->data_queue_->push(retVal); - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - //TODO for testing only - virtual void queueInit() {}; - -private: - LlyrData helperFunction( opType op, LlyrData arg0, LlyrData arg1, LlyrData arg2 ) - { - -// std::cout << "ARG[0]:" << arg0 << "::" << arg0.to_ullong() << std::endl; -// std::cout << "ARG[1]:" << arg1 << "::" << arg1.to_ullong() << std::endl; -// std::cout << "ARG[2]:" << arg2 << "::" << arg2.to_ullong() << std::endl; - - uint32_t select_signal = arg2.to_ullong(); - if( op == SEL ) { - switch( select_signal ) { - case 0 : - return arg0; - break; - case 1 : - return arg1; - break; - default : - output_->verbose(CALL_INFO, 0, 0, "Error: invalid select signal.\n"); - exit(-1); - } - } else { - output_->verbose(CALL_INFO, 0, 0, "Error: could not find corresponding op-%" PRIu32 ".\n", op_binding_); - exit(-1); - } - } - -}; - -}//SST -}//Llyr - -#endif // _LOGIC_PE_H diff --git a/src/sst/elements/llyr/pes/dummyPE.h b/src/sst/elements/llyr/pes/dummyPE.h deleted file mode 100644 index c8d109676a..0000000000 --- a/src/sst/elements/llyr/pes/dummyPE.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * // Copyright 2013-2022 NTESS. Under the terms - * // of Contract DE-NA0003525 with NTESS, the U.S. - * // Government retains certain rights in this software. - * // - * // Copyright (c) 2013-2022, NTESS - * // All rights reserved. - * // - * // Portions are copyright of other developers: - * // See the file CONTRIBUTORS.TXT in the top level directory - * // the distribution for more information. - * // - * // This file is part of the SST software package. For license - * // information, see the LICENSE file in the top level directory of the - * // distribution. - */ - -#ifndef _DUMMY_PE_H -#define _DUMMY_PE_H - -#include "pes/processingElement.h" - -namespace SST { -namespace Llyr { - -/** - * @todo write docs - */ -class DummyProcessingElement : public ProcessingElement -{ -public: - DummyProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config) : - ProcessingElement(op_binding, processor_id, llyr_config) - { - input_queues_= new std::vector< LlyrQueue* >; - output_queues_ = new std::vector< LlyrQueue* >; - } - - virtual bool doSend() { return 0; }; - virtual bool doReceive(LlyrData data) { return 0; }; - virtual bool doCompute() { return 0; }; - - //TODO for testing only - virtual void queueInit() {}; - -}; - -}//SST -}//Llyr - -#endif // _DUMMY_PE_H diff --git a/src/sst/elements/llyr/pes/fpPE.h b/src/sst/elements/llyr/pes/fpPE.h deleted file mode 100644 index 37308f381a..0000000000 --- a/src/sst/elements/llyr/pes/fpPE.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * // Copyright 2013-2022 NTESS. Under the terms - * // of Contract DE-NA0003525 with NTESS, the U.S. - * // Government retains certain rights in this software. - * // - * // Copyright (c) 2013-2022, NTESS - * // All rights reserved. - * // - * // Portions are copyright of other developers: - * // See the file CONTRIBUTORS.TXT in the top level directory - * // the distribution for more information. - * // - * // This file is part of the SST software package. For license - * // information, see the LICENSE file in the top level directory of the - * // distribution. - */ - -#ifndef _FP_PE_H -#define _FP_PE_H - -#include -#include - -#include "pes/processingElement.h" - -namespace SST { -namespace Llyr { - -/** - * @todo write docs - */ -class FPProcessingElement : public ProcessingElement -{ -public: - FPProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config, - uint32_t cycles = 1) : - ProcessingElement(op_binding, processor_id, llyr_config) - { - cycles_ = cycles; - input_queues_= new std::vector< LlyrQueue* >; - output_queues_ = new std::vector< LlyrQueue* >; - } - - virtual bool doSend() - { - uint32_t queueId; - LlyrData sendVal; - ProcessingElement* dstPe; - - for(auto it = output_queue_map_.begin() ; it != output_queue_map_.end(); ++it ) { - queueId = it->first; - dstPe = it->second; - - if( output_queues_->at(queueId)->data_queue_->size() > 0 ) { - output_->verbose(CALL_INFO, 8, 0, ">> Sending...%" PRIu32 "-%" PRIu32 " to %" PRIu32 "\n", - processor_id_, queueId, dstPe->getProcessorId()); - - sendVal = output_queues_->at(queueId)->data_queue_->front(); - output_queues_->at(queueId)->data_queue_->pop(); - - dstPe->pushInputQueue(dstPe->getInputQueueId(this->getProcessorId()), sendVal); - } - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - virtual bool doReceive(LlyrData data) { return 0; }; - - virtual bool doCompute() - { - output_->verbose(CALL_INFO, 4, 0, ">> Compute 0x%" PRIx32 "\n", op_binding_); - - uint64_t intResult = 0x0F; - - std::vector< LlyrData > argList; - std::vector< double > convList; - LlyrData retVal; - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - uint32_t num_ready = 0; - uint32_t num_inputs = input_queues_->size(); - - //check to see if all of the input queues have data - for( uint32_t i = 0; i < num_inputs; ++i) { - if( input_queues_->at(i)->data_queue_->size() > 0 ) { - num_ready = num_ready + 1; - } - } - - //if there are values waiting on any of the inputs, this PE could still fire - if( num_ready < num_inputs && num_ready > 0) { - pending_op_ = 1; - } else { - pending_op_ = 0; - } - - //if all inputs are available pull from queue and add to arg list - if( num_ready < num_inputs ) { - output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - return false; - } else { - output_->verbose(CALL_INFO, 4, 0, "+Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - for( uint32_t i = 0; i < num_inputs; ++i) { - argList.push_back(input_queues_->at(i)->data_queue_->front()); - input_queues_->at(i)->data_queue_->pop(); - } - } - - //need to convert from the raw bits to floating point - for(auto it = argList.begin() ; it != argList.end(); ++it ) { - double fpResult = bits_to_double(*it); - convList.push_back(fpResult); - } - - double fpResult; - std::stringstream dataOut; - switch( op_binding_ ) { - case FADD : - fpResult = convList[0] + convList[1]; - dataOut << std::setprecision(std::numeric_limits::max_digits10) << fpResult << " = "; - dataOut << std::setprecision(std::numeric_limits::max_digits10) << convList[0] << " + " << convList[1]; - dataOut << std::endl; - break; - case FSUB : - fpResult = convList[0] - convList[1]; - dataOut << std::setprecision(std::numeric_limits::max_digits10) << fpResult << " = "; - dataOut << std::setprecision(std::numeric_limits::max_digits10) << convList[0] << " - " << convList[1]; - dataOut << std::endl; - break; - case FMUL : - fpResult = convList[0] * convList[1]; - dataOut << std::setprecision(std::numeric_limits::max_digits10) << fpResult << " = "; - dataOut << std::setprecision(std::numeric_limits::max_digits10) << convList[0] << " * " << convList[1]; - dataOut << std::endl; - break; - case FDIV : - fpResult = convList[0] / convList[1]; - dataOut << std::setprecision(std::numeric_limits::max_digits10) << fpResult << " = "; - dataOut << std::setprecision(std::numeric_limits::max_digits10) << convList[0] << " / " << convList[1]; - dataOut << std::endl; - break; - default : - output_->verbose(CALL_INFO, 0, 0, "Error: could not find corresponding op-%" PRIu32 ".\n", op_binding_); - exit(-1); - } - output_->verbose(CALL_INFO, 32, 0, "%s\n", dataOut.str().c_str()); - - //convert the fp value back to raw bits for storage - retVal = LlyrData(fp_to_bits(&fpResult)); - - output_->verbose(CALL_INFO, 32, 0, "intResult = %f\n", fpResult); - output_->verbose(CALL_INFO, 32, 0, "intResult = %" PRIu64 "\n", intResult); - output_->verbose(CALL_INFO, 32, 0, "retVal = %s\n", retVal.to_string().c_str()); - - //for now push the result to all output queues - for( uint32_t i = 0; i < output_queues_->size(); ++i) { - output_queues_->at(i)->data_queue_->push(retVal); - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - //TODO for testing only - virtual void queueInit() {}; - -private: - //helper to convert from bitset to float - float bits_to_float( std::bitset valIn ) - { - const auto newValue = valIn.to_ullong(); - constexpr auto size = sizeof(float); - uint8_t fpBuffer[size] = {}; - std::memcpy(fpBuffer, std::addressof(newValue), size); - - float fpResult; - std::memcpy(std::addressof(fpResult), fpBuffer, size); - - return fpResult; - } - - //helper to convert from bitset to double - double bits_to_double( std::bitset valIn ) - { - const auto newValue = valIn.to_ullong(); - constexpr auto size = sizeof(double); - uint8_t fpBuffer[size] = {}; - std::memcpy(fpBuffer, std::addressof(newValue), size); - - double fpResult; - std::memcpy(std::addressof(fpResult), fpBuffer, size); - - return fpResult; - } - - //helper to convert from fp to bitset - template - std::bitset fp_to_bits( T* fpIn ) - { - uint64_t intResult = 0; - constexpr auto size = sizeof(T); - uint8_t bufferA[size] = {}; - - std::memcpy(bufferA, std::addressof(*fpIn), size); - std::memcpy(std::addressof(intResult), bufferA, size); - std::bitset myBits = std::bitset(intResult); - - return myBits; - } - - //helper for debugging -- convert bitset to string - std::string bits_to_string( std::bitset valIn ) - { - return valIn.to_string(); - } - - - -}; - -}//SST -}//Llyr - -#endif // _FP_PE_H diff --git a/src/sst/elements/llyr/pes/intPE.h b/src/sst/elements/llyr/pes/intPE.h deleted file mode 100644 index 9d91a098e6..0000000000 --- a/src/sst/elements/llyr/pes/intPE.h +++ /dev/null @@ -1,262 +0,0 @@ -/* - * // Copyright 2013-2022 NTESS. Under the terms - * // of Contract DE-NA0003525 with NTESS, the U.S. - * // Government retains certain rights in this software. - * // - * // Copyright (c) 2013-2022, NTESS - * // All rights reserved. - * // - * // Portions are copyright of other developers: - * // See the file CONTRIBUTORS.TXT in the top level directory - * // the distribution for more information. - * // - * // This file is part of the SST software package. For license - * // information, see the LICENSE file in the top level directory of the - * // distribution. - */ - -#ifndef _INT_PE_H -#define _INT_PE_H - -#include "pes/processingElement.h" - -namespace SST { -namespace Llyr { - -/** - * @todo write docs - */ -class IntProcessingElement : public ProcessingElement -{ -public: - IntProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config) : - ProcessingElement(op_binding, processor_id, llyr_config) - { - input_queues_= new std::vector< LlyrQueue* >; - output_queues_ = new std::vector< LlyrQueue* >; - } - - virtual bool doSend() - { - uint32_t queueId; - LlyrData sendVal; - ProcessingElement* dstPe; - - for(auto it = output_queue_map_.begin() ; it != output_queue_map_.end(); ++it ) { - queueId = it->first; - dstPe = it->second; - - if( output_queues_->at(queueId)->data_queue_->size() > 0 ) { - output_->verbose(CALL_INFO, 8, 0, ">> Sending...%" PRIu32 "-%" PRIu32 " to %" PRIu32 "\n", - processor_id_, queueId, dstPe->getProcessorId()); - - sendVal = output_queues_->at(queueId)->data_queue_->front(); - output_queues_->at(queueId)->data_queue_->pop(); - - dstPe->pushInputQueue(dstPe->getInputQueueId(this->getProcessorId()), sendVal); - } - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - virtual bool doReceive(LlyrData data) { return 0; }; - - virtual bool doCompute() - { - output_->verbose(CALL_INFO, 4, 0, ">> Compute 0x%" PRIx32 "\n", op_binding_); - - uint64_t intResult = 0x0F; - - std::vector< LlyrData > argList; - LlyrData retVal; - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - uint32_t num_ready = 0; - uint32_t num_inputs = input_queues_->size(); - - //check to see if all of the input queues have data - for( uint32_t i = 0; i < num_inputs; ++i) { - if( input_queues_->at(i)->data_queue_->size() > 0 ) { - num_ready = num_ready + 1; - } - } - - //if there are values waiting on any of the inputs, this PE could still fire - if( num_ready < num_inputs && num_ready > 0) { - pending_op_ = 1; - } else { - pending_op_ = 0; - } - - //if all inputs are available pull from queue and add to arg list - if( num_ready < num_inputs ) { - output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - return false; - } else { - output_->verbose(CALL_INFO, 4, 0, "+Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - for( uint32_t i = 0; i < num_inputs; ++i) { - argList.push_back(input_queues_->at(i)->data_queue_->front()); - input_queues_->at(i)->data_queue_->pop(); - } - } - - switch( op_binding_ ) { - case ADD : - intResult = argList[0].to_ullong() + argList[1].to_ullong(); - break; - case SUB : - intResult = argList[0].to_ullong() - argList[1].to_ullong(); - break; - case MUL : - intResult = argList[0].to_ullong() * argList[1].to_ullong(); - break; - case DIV : - intResult = argList[0].to_ullong() / argList[1].to_ullong(); - break; - case REM : - intResult = argList[0].to_ullong() % argList[1].to_ullong(); - break; - default : - output_->verbose(CALL_INFO, 0, 0, "Error: could not find corresponding op-%" PRIu32 ".\n", op_binding_); - exit(-1); - } - - retVal = LlyrData(intResult); - - output_->verbose(CALL_INFO, 32, 0, "intResult = %" PRIu64 "\n", intResult); - output_->verbose(CALL_INFO, 32, 0, "retVal = %s\n", retVal.to_string().c_str()); - - //for now push the result to all output queues - for( uint32_t i = 0; i < output_queues_->size(); ++i) { - output_queues_->at(i)->data_queue_->push(retVal); - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - //TODO for testing only - virtual void queueInit() {}; - -};// IntProcessingElement - -class IntConstProcessingElement : public IntProcessingElement -{ -public: - IntConstProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config, - std::string *arguments) : - IntProcessingElement(op_binding, processor_id, llyr_config) - { - int_const_ = std::stoll(arguments[0]); - input_queues_= new std::vector< LlyrQueue* >; - output_queues_ = new std::vector< LlyrQueue* >; - } - - virtual bool doCompute() - { - output_->verbose(CALL_INFO, 4, 0, ">> Compute 0x%" PRIx32 "\n", op_binding_); - - uint64_t intResult = 0x0F; - - std::vector< LlyrData > argList; - LlyrData retVal; - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - uint32_t num_ready = 0; - uint32_t num_inputs = input_queues_->size(); - - //check to see if all of the input queues have data - for( uint32_t i = 0; i < num_inputs; ++i) { - if( input_queues_->at(i)->data_queue_->size() > 0 ) { - num_ready = num_ready + 1; - } - } - - //if there are values waiting on any of the inputs, this PE could still fire - if( num_ready < num_inputs && num_ready > 0) { - pending_op_ = 1; - } else { - pending_op_ = 0; - } - - //if all inputs are available pull from queue and add to arg list - if( num_ready < num_inputs ) { - output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - return false; - } else { - output_->verbose(CALL_INFO, 4, 0, "+Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - for( uint32_t i = 0; i < num_inputs; ++i) { - argList.push_back(input_queues_->at(i)->data_queue_->front()); - input_queues_->at(i)->data_queue_->pop(); - } - } - - switch( op_binding_ ) { - case ADDCONST : - intResult = argList[0].to_ullong() + int_const_; - break; - case SUBCONST : - intResult = argList[0].to_ullong() - int_const_; - break; - case MULCONST : - intResult = argList[0].to_ullong() * int_const_; - break; - case DIVCONST : - intResult = argList[0].to_ullong() / int_const_; - break; - case REMCONST : - intResult = argList[0].to_ullong() % int_const_; - break; - default : - output_->verbose(CALL_INFO, 0, 0, "Error: could not find corresponding op-%" PRIu32 ".\n", op_binding_); - exit(-1); - } - - retVal = LlyrData(intResult); - - output_->verbose(CALL_INFO, 32, 0, "intResult = %" PRIu64 "\n", intResult); - output_->verbose(CALL_INFO, 32, 0, "retVal = %s\n", retVal.to_string().c_str()); - - //for now push the result to all output queues - for( uint32_t i = 0; i < output_queues_->size(); ++i) { - output_queues_->at(i)->data_queue_->push(retVal); - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - //TODO for testing only - virtual void queueInit() {}; - -private: - int64_t int_const_; - -};// IntConstProcessingElement - -}//SST -}//Llyr - -#endif // _INT_PE_H_H diff --git a/src/sst/elements/llyr/pes/loadPE.h b/src/sst/elements/llyr/pes/loadPE.h deleted file mode 100644 index d3756f3b88..0000000000 --- a/src/sst/elements/llyr/pes/loadPE.h +++ /dev/null @@ -1,288 +0,0 @@ -/* - * // Copyright 2013-2022 NTESS. Under the terms - * // of Contract DE-NA0003525 with NTESS, the U.S. - * // Government retains certain rights in this software. - * // - * // Copyright (c) 2013-2022, NTESS - * // All rights reserved. - * // - * // Portions are copyright of other developers: - * // See the file CONTRIBUTORS.TXT in the top level directory - * // the distribution for more information. - * // - * // This file is part of the SST software package. For license - * // information, see the LICENSE file in the top level directory of the - * // distribution. - */ - -#ifndef _LOAD_PE_H -#define _LOAD_PE_H - -#include "pes/processingElement.h" - -namespace SST { -namespace Llyr { - -/** - * @todo write docs - */ -class LoadProcessingElement : public ProcessingElement -{ -public: - LoadProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config, - uint32_t cycles = 1) : - ProcessingElement(op_binding, processor_id, llyr_config) - { - cycles_ = cycles; - input_queues_= new std::vector< LlyrQueue* >; - output_queues_ = new std::vector< LlyrQueue* >; - } - - virtual bool doSend() - { - uint32_t queueId; - LlyrData sendVal; - ProcessingElement* dstPe; - - for(auto it = output_queue_map_.begin() ; it != output_queue_map_.end(); ++it ) { - queueId = it->first; - dstPe = it->second; - - if( output_queues_->at(queueId)->data_queue_->size() > 0 ) { - output_->verbose(CALL_INFO, 8, 0, ">> Sending...%" PRIu32 "-%" PRIu32 " to %" PRIu32 "\n", - processor_id_, queueId, dstPe->getProcessorId()); - - sendVal = output_queues_->at(queueId)->data_queue_->front(); - output_queues_->at(queueId)->data_queue_->pop(); - - dstPe->pushInputQueue(dstPe->getInputQueueId(this->getProcessorId()), sendVal); - } - } - - return true; - } - - virtual bool doReceive(LlyrData data) - { - output_->verbose(CALL_INFO, 8, 0, ">> Receive 0x%" PRIx64 "\n", uint64_t(data.to_ullong())); - - //for now push the result to all output queues - for( uint32_t i = 0; i < output_queues_->size(); ++i) { - output_queues_->at(i)->data_queue_->push(data); - } - - return true; - } - - virtual bool doCompute() - { - output_->verbose(CALL_INFO, 4, 0, ">> Compute 0x%" PRIx32 "\n", op_binding_); - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - std::vector< LlyrData > argList; - uint32_t num_ready = 0; - uint32_t num_inputs = input_queues_->size(); - - //check to see if all of the input queues have data - for( uint32_t i = 0; i < num_inputs; ++i) { - if( input_queues_->at(i)->data_queue_->size() > 0 ) { - num_ready = num_ready + 1; - } - } - - //if there are values waiting on any of the inputs, this PE could still fire - if( num_ready < num_inputs && num_ready > 0) { - pending_op_ = 1; - } else { - pending_op_ = 0; - } - - //if all inputs are available pull from queue and add to arg list - if( num_ready < num_inputs ) { - output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - return false; - } else { - output_->verbose(CALL_INFO, 4, 0, "+Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - for( uint32_t i = 0; i < num_inputs; ++i) { - argList.push_back(input_queues_->at(i)->data_queue_->front()); - input_queues_->at(i)->data_queue_->pop(); - } - } - - //create the memory request - switch( op_binding_ ) { - case LD : - doLoad(argList[0].to_ullong()); - break; - default : - output_->fatal(CALL_INFO, -1, "Error: could not find corresponding op-%" PRIu32 ".\n", op_binding_); - exit(-1); - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - virtual void queueInit() - { - output_->verbose(CALL_INFO, 4, 0, ">> Fake Init(%" PRIu32 "), Op %" PRIu32 " \n", - processor_id_, op_binding_ ); - - //TODO Need a more elegant way to initialize these queues - if( input_queues_init_.size() > 0 ) { - std::queue< LlyrData >* tempQueue(&input_queues_init_); - input_queues_->at(0)->data_queue_ = tempQueue; - - } else { - //for now assume that the address queue is on in-0 - uint64_t addr = llyr_config_->starting_addr_ + ( (processor_id_ - 1) * (Bit_Length / 8) ); - if( input_queues_->size() > 0 ) { - LlyrData temp = LlyrData(addr); - output_->verbose(CALL_INFO, 8, 0, "Init(%" PRIu32 ")::%" PRIx64 "::%" PRIu64 "\n", 0, addr, temp.to_ulong()); - input_queues_->at(0)->data_queue_->push(temp); - - addr = addr + (Bit_Length / 8); - } - } - } - -protected: - std::queue< LlyrData > input_queues_init_; - - bool doLoad(uint64_t addr) - { - uint32_t targetPe; - StandardMem::Request* req = new StandardMem::Read(addr, 8); - - output_->verbose(CALL_INFO, 4, 0, "Creating a load request (%" PRIu32 ") from address: %" PRIu64 "\n", uint32_t(req->getID()), addr); - - //find out where the load actually needs to go - auto it = output_queue_map_.begin(); - for( ; it != output_queue_map_.end(); ++it ) { - if( it->first == 0 ) { - targetPe = it->second->getProcessorId(); - break; - } - } - - //exit the simulation if there is not a corresponding destination - if( it == output_queue_map_.end() ) { - output_->fatal(CALL_INFO, -1, "Error: could not find corresponding PE.\n"); - exit(-1); - } - - LSEntry* tempEntry = new LSEntry( req->getID(), processor_id_, targetPe ); - lsqueue_->addEntry( tempEntry ); - - mem_interface_->send( req ); - - return 1; - - } - -private: - -};//END LoadProcessingElement - -class AdvLoadProcessingElement : public LoadProcessingElement -{ -public: - AdvLoadProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config, - std::string *arguments, uint32_t cycles = 1) : - LoadProcessingElement(op_binding, processor_id, llyr_config) - { - cycles_ = cycles; - - if( arguments[0] != "" ) { - int64_t init_value = std::stoll(arguments[0]); - input_queues_init_.push(LlyrData(init_value)); - } - - if( arguments[1] != "" ) { - termination_ = std::stoll(arguments[1]); - } else { - termination_ = 0; - } - - input_queues_= new std::vector< LlyrQueue* >; - output_queues_ = new std::vector< LlyrQueue* >; - } - - virtual bool doCompute() - { - output_->verbose(CALL_INFO, 4, 0, ">> Compute 0x%" PRIx32 "\n", op_binding_); - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - std::vector< LlyrData > argList; - uint32_t num_ready = 0; - uint32_t num_inputs = input_queues_->size(); - - //check to see if all of the input queues have data - for( uint32_t i = 0; i < num_inputs; ++i) { - if( input_queues_->at(i)->data_queue_->size() > 0 ) { - num_ready = num_ready + 1; - } - } - - //if there are values waiting on any of the inputs, this PE could still fire - if( num_ready < num_inputs && num_ready > 0) { - pending_op_ = 1; - } else { - pending_op_ = 0; - } - - //if all inputs are available pull from queue and add to arg list - if( num_ready < num_inputs ) { - output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - return false; - } else { - output_->verbose(CALL_INFO, 4, 0, "+Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - for( uint32_t i = 0; i < num_inputs; ++i) { - argList.push_back(input_queues_->at(i)->data_queue_->front()); - input_queues_->at(i)->data_queue_->pop(); - } - } - - //create the memory request - if( op_binding_ == LDADDR ) { - doLoad(argList[0].to_ullong()); - } else if( op_binding_ == STREAM_LD ) { - doLoad(argList[0].to_ullong()); - if( termination_ > 0 ) { - termination_ = termination_ - 1; - input_queues_->at(0)->data_queue_->push(LlyrData(argList[0].to_ullong() + (Bit_Length / 8))); - } - } else { - output_->fatal(CALL_INFO, -1, "Error: could not find corresponding op-%" PRIu32 ".\n", op_binding_); - exit(-1); - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - -private: - uint64_t termination_; - -};// AdvLoadProcessingElement - -}//SST -}//Llyr - -#endif // _LOAD_PE_H diff --git a/src/sst/elements/llyr/pes/logicPE.h b/src/sst/elements/llyr/pes/logicPE.h deleted file mode 100644 index d4f3cf3ef2..0000000000 --- a/src/sst/elements/llyr/pes/logicPE.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * // Copyright 2013-2022 NTESS. Under the terms - * // of Contract DE-NA0003525 with NTESS, the U.S. - * // Government retains certain rights in this software. - * // - * // Copyright (c) 2013-2022, NTESS - * // All rights reserved. - * // - * // Portions are copyright of other developers: - * // See the file CONTRIBUTORS.TXT in the top level directory - * // the distribution for more information. - * // - * // This file is part of the SST software package. For license - * // information, see the LICENSE file in the top level directory of the - * // distribution. - */ - -#ifndef _LOGIC_PE_H -#define _LOGIC_PE_H - -#include "pes/processingElement.h" - -namespace SST { -namespace Llyr { - -/** - * @todo write docs - */ -class LogicProcessingElement : public ProcessingElement -{ -public: - LogicProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config, - uint32_t cycles = 1) : - ProcessingElement(op_binding, processor_id, llyr_config) - { - cycles_ = cycles; - input_queues_= new std::vector< LlyrQueue* >; - output_queues_ = new std::vector< LlyrQueue* >; - } - - virtual bool doSend() - { - uint32_t queueId; - LlyrData sendVal; - ProcessingElement* dstPe; - - for(auto it = output_queue_map_.begin() ; it != output_queue_map_.end(); ++it ) { - queueId = it->first; - dstPe = it->second; - - if( output_queues_->at(queueId)->data_queue_->size() > 0 ) { - output_->verbose(CALL_INFO, 8, 0, ">> Sending...%" PRIu32 "-%" PRIu32 " to %" PRIu32 "\n", - processor_id_, queueId, dstPe->getProcessorId()); - - sendVal = output_queues_->at(queueId)->data_queue_->front(); - output_queues_->at(queueId)->data_queue_->pop(); - - dstPe->pushInputQueue(dstPe->getInputQueueId(this->getProcessorId()), sendVal); - } - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - virtual bool doReceive(LlyrData data) { return 0; }; - - virtual bool doCompute() - { - output_->verbose(CALL_INFO, 4, 0, ">> Compute 0x%" PRIx32 "\n", op_binding_); - - uint64_t intResult = 0x0F; - - std::vector< LlyrData > argList; - LlyrData retVal; - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - uint32_t num_ready = 0; - uint32_t num_inputs = input_queues_->size(); - - //check to see if all of the input queues have data - for( uint32_t i = 0; i < num_inputs; ++i) { - if( input_queues_->at(i)->data_queue_->size() > 0 ) { - num_ready = num_ready + 1; - } - } - - //if there are values waiting on any of the inputs, this PE could still fire - if( num_ready < num_inputs && num_ready > 0) { - pending_op_ = 1; - } else { - pending_op_ = 0; - } - - //if all inputs are available pull from queue and add to arg list - if( num_ready < num_inputs ) { - output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - return false; - } else { - output_->verbose(CALL_INFO, 4, 0, "+Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - for( uint32_t i = 0; i < num_inputs; ++i) { - argList.push_back(input_queues_->at(i)->data_queue_->front()); - input_queues_->at(i)->data_queue_->pop(); - } - } - -// std::cout << "ARG[0]:" << argList[0] << std::endl; -// std::cout << "ARG[1]:" << argList[1] << std::endl; - - switch( op_binding_ ) { - case AND : - retVal = argList[0]; - retVal &= argList[1]; - break; - case OR : - retVal = argList[0]; - retVal |= argList[1]; - break; - case XOR : - retVal = argList[0]; - retVal ^= argList[1]; - break; - case NOT : - retVal = ~argList[0]; - break; - case SLL : - retVal = argList[0] << argList[1].to_ullong(); - break; - case SLR : - retVal = argList[0] >> argList[1].to_ullong(); - break; - case ROL : - retVal = (argList[0] << argList[1].to_ullong()) | (argList[0] >> (Bit_Length - argList[1].to_ullong())); - break; - case ROR : - retVal = (argList[0] >> argList[1].to_ullong()) | (argList[0] << (Bit_Length - argList[1].to_ullong())); - break; - case EQ : - case NE : - case UGT : - case UGE : - case SGT : - case SGE : - case ULT : - case ULE : - case SLT : - case SLE : - retVal = helperFunction(op_binding_, argList[0], argList[1]); - break; - default : - output_->verbose(CALL_INFO, 0, 0, "Error: could not find corresponding op-%" PRIu32 ".\n", op_binding_); - exit(-1); - } - - output_->verbose(CALL_INFO, 32, 0, "intResult = %" PRIu64 "\n", intResult); - output_->verbose(CALL_INFO, 32, 0, "retVal = %s\n", retVal.to_string().c_str()); - - //for now push the result to all output queues - for( uint32_t i = 0; i < output_queues_->size(); ++i) { - output_queues_->at(i)->data_queue_->push(retVal); - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - //TODO for testing only - virtual void queueInit() {}; - -private: - LlyrData helperFunction( opType op, LlyrData arg0, LlyrData arg1 ) - { - //TODO might need this for data length conversion? -// std::bitset<8> x("10000010"); -// std::bitset<64> y; -// -// //if msb == 1, then it's negative and must sign extend -// y = y | std::bitset<64>(x.to_ullong()); -// if( x.test(x.size() - 1) == 1 ) { -// y |= 0xFFFFFFFFFFFFFF00; -// } -// -// std::cout << "x:" << x << "::" << x.size() << "\n"; -// std::cout << "y:" << y << "::" << y.size() << "\n"; -// -// int64_t boo = (int64_t)(y.to_ulong()); -// std::bitset<64> bitTestL = boo; - -// std::cout << "ARG[0]:" << arg0 << "::" << arg0.to_ullong() << std::endl; -// std::cout << "ARG[1]:" << arg1 << "::" << arg1.to_ullong() << std::endl; - - if( op == EQ ) { - if( arg0.to_ullong() == arg1.to_ullong() ) { - return 1; - } else { - return 0; - } - } - else if( op == NE ) { - if( arg0.to_ullong() != arg1.to_ullong() ) { - return 1; - } else { - return 0; - } - } - else if( op == UGT ) { - if( arg0.to_ullong() > arg1.to_ullong() ) { - return 1; - } else { - return 0; - } - } - else if( op == UGE ) { - if( arg0.to_ullong() >= arg1.to_ullong() ) { - return 1; - } else { - return 0; - } - } - else if( op == ULT ) { - if( arg0.to_ullong() < arg1.to_ullong() ) { - return 1; - } else { - return 0; - } - } - else if( op == ULE ) { - if( arg0.to_ullong() <= arg1.to_ullong() ) { - return 1; - } else { - return 0; - } - } - else if( op == SGT ) { - int64_t arg0s = (int64_t)(arg0.to_ullong()); - int64_t arg1s = (int64_t)(arg1.to_ullong()); - - if( arg0s > arg1s ) { - return 1; - } else { - return 0; - } - } - else if( op == SGE ) { - int64_t arg0s = (int64_t)(arg0.to_ullong()); - int64_t arg1s = (int64_t)(arg1.to_ullong()); - - if( arg0s >= arg1s ) { - return 1; - } else { - return 0; - } - } - else if( op == SLT ) { - int64_t arg0s = (int64_t)(arg0.to_ullong()); - int64_t arg1s = (int64_t)(arg1.to_ullong()); - - if( arg0s < arg1s ) { - return 1; - } else { - return 0; - } - } - else if( op == SLE ) { - int64_t arg0s = (int64_t)(arg0.to_ullong()); - int64_t arg1s = (int64_t)(arg1.to_ullong()); - - if( arg0s <= arg1s ) { - return 1; - } else { - return 0; - } - } - else { - output_->verbose(CALL_INFO, 0, 0, "Error: could not find corresponding op-%" PRIu32 ".\n", op_binding_); - exit(-1); - } - } - -}; - -}//SST -}//Llyr - -#endif // _LOGIC_PE_H diff --git a/src/sst/elements/llyr/pes/peList.h b/src/sst/elements/llyr/pes/peList.h deleted file mode 100644 index 8053b77490..0000000000 --- a/src/sst/elements/llyr/pes/peList.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#ifndef _PE_LIST_H -#define _PE_LIST_H - -#include "complexPE.h" -#include "controlPE.h" -#include "dummyPE.h" -#include "fpPE.h" -#include "intPE.h" -#include "loadPE.h" -#include "logicPE.h" -#include "storePE.h" - -#endif //_PE_LIST_H diff --git a/src/sst/elements/llyr/pes/processingElement.h b/src/sst/elements/llyr/pes/processingElement.h deleted file mode 100644 index d5fdba9af7..0000000000 --- a/src/sst/elements/llyr/pes/processingElement.h +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2013-2022 NTESS. Under the terms -// of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2013-2022, NTESS -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef _LLYR_PE_H -#define _LLYR_PE_H - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - - -#include "../graph/graph.h" -#include "../lsQueue.h" -#include "../llyrTypes.h" - -namespace SST { -namespace Llyr { - -typedef struct alignas(uint64_t) { - bool forward_; - uint32_t target_queue_; - std::queue< LlyrData >* data_queue_; -} LlyrQueue; - -class ProcessingElement -{ -public: - ProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config) : - op_binding_(op_binding), processor_id_(processor_id), - pending_op_(0), llyr_config_(llyr_config) - { - //setup up i/o for messages - char prefix[256]; - sprintf(prefix, "[t=@t][ProcessingElement-%u]: ", processor_id_); - output_ = new SST::Output(prefix, llyr_config_->verbosity_, 0, Output::STDOUT); - - pending_op_ = 0; - lsqueue_ = llyr_config->lsqueue_; - mem_interface_ = llyr_config->mem_interface_; - } - - virtual ~ProcessingElement() {}; - - uint32_t bindInputQueue(ProcessingElement* src) - { - uint32_t queueId = input_queues_->size(); - - output_->verbose(CALL_INFO, 4, 0, ">> Binding Input Queue-%" PRIu32 " on PE-%" PRIu32 " to PE-%" PRIu32 "\n", - queueId, processor_id_, src->getProcessorId() ); - - auto retVal = input_queue_map_.emplace( queueId, src ); - if( retVal.second == false ) { - return 0; - } - - //if insert succeeded need to create the queue -// std::queue< LlyrData >* tempQueue = new std::queue< LlyrData >; -// input_queues_->push_back(tempQueue); - - LlyrQueue* tempQueue = new LlyrQueue; - tempQueue->data_queue_ = new std::queue< LlyrData >; - input_queues_->push_back(tempQueue); - - return queueId; - } - - uint32_t bindOutputQueue(ProcessingElement* dst) - { - uint32_t queueId = output_queues_->size(); - - output_->verbose(CALL_INFO, 4, 0, ">> Binding Output Queue-%" PRIu32 " on PE-%" PRIu32 " to PE-%" PRIu32 "\n", - queueId, processor_id_, dst->getProcessorId() ); - - auto retVal = output_queue_map_.emplace( queueId, dst ); - if( retVal.second == false ) { - return 0; - } - - //if insert succeeded need to create the queue -// std::queue< LlyrData >* tempQueue = new std::queue< LlyrData >; -// output_queues_->push_back(tempQueue); - - LlyrQueue* tempQueue = new LlyrQueue; - tempQueue->data_queue_ = new std::queue< LlyrData >; - output_queues_->push_back(tempQueue); - - return queueId; - } - - void pushInputQueue(uint32_t id, uint64_t &inVal ) - { - LlyrData newValue = LlyrData(inVal); - input_queues_->at(id)->data_queue_->push(newValue); - } - - void pushInputQueue(uint32_t id, LlyrData &inVal ) - { - input_queues_->at(id)->data_queue_->push(inVal); - } - - int32_t getInputQueueId(uint32_t id) const - { - auto it = input_queue_map_.begin(); - for( ; it != input_queue_map_.end(); ++it ) { - if( it->second->getProcessorId() == id ) { - return it->first; - } - } - - return -1; - } - - int32_t getOutputQueueId(uint32_t id) const - { - auto it = output_queue_map_.begin(); - for( ; it != output_queue_map_.end(); ++it ) { - if( it->second->getProcessorId() == id ) { - return it->first; - } - } - - return -1; - } - - ProcessingElement* getProcInputQueueBinding(uint32_t id) const - { - auto it = input_queue_map_.begin(); - for( ; it != input_queue_map_.end(); ++it ) { - if( it->first == id ) { - return it->second; - } - } - - return NULL; - } - - uint32_t getNumInputQueues() const { return input_queues_->size(); } - uint32_t getNumOutputQueues() const { return output_queues_->size(); } - - void setOpBinding(opType binding) { op_binding_ = binding; } - opType getOpBinding() const { return op_binding_; } - - void setProcessorId(uint32_t id) { processor_id_ = id; } - uint32_t getProcessorId() const { return processor_id_; } - - bool getPendingOp() const { return pending_op_; } - - void printInputQueue() - { - for( uint32_t i = 0; i < input_queues_->size(); ++i ) { - std::cout << "i:" << i << ": " << input_queues_->at(i)->data_queue_->size(); - if( input_queues_->at(i)->data_queue_->size() > 0 ) { - std::cout << ":" << input_queues_->at(i)->data_queue_->front().to_ullong() << ":" << input_queues_->at(i)->data_queue_->front() << "\n"; - } else { - std::cout << ":x" << ":x" << "\n"; - } - } - } - - void printOutputQueue() - { - for( uint32_t i = 0; i < output_queues_->size(); ++i ) { - std::cout << "o:" << i << ": " << output_queues_->at(i)->data_queue_->size(); - if( output_queues_->at(i)->data_queue_->size() > 0 ) { - std::cout << ":" << output_queues_->at(i)->data_queue_->back().to_ullong() << ":" << output_queues_->at(i)->data_queue_->front() << "\n"; - } else { - std::cout << ":x" << ":x" << "\n"; - } - } - } - - virtual bool doSend() = 0; - virtual bool doReceive(LlyrData data) = 0; - virtual bool doCompute() = 0; - - //TODO for testing only - virtual void queueInit() = 0; - -protected: - opType op_binding_; - - uint32_t cycles_; - uint32_t processor_id_; - - // input and output queues per PE - uint32_t queue_depth_; - std::vector< LlyrQueue* >* input_queues_; - std::vector< LlyrQueue* >* output_queues_; - -/* std::vector< std::queue< LlyrData >* >* input_queues_; - std::vector< std::queue< LlyrData >* >* output_queues_;*/ - - // need to connect PEs to queues -- queue_id, src/dst - std::map< uint32_t, ProcessingElement* > input_queue_map_; - std::map< uint32_t, ProcessingElement* > output_queue_map_; - - // track outstanding L/S requests (passed from top-level) - LSQueue* lsqueue_; - - Interfaces::StandardMem* mem_interface_; - SST::Output* output_; - - // used to stall execution - waiting on mem/queues full - bool pending_op_; - - // bundle of configuration parameters - LlyrConfig* llyr_config_; - -private: - -}; - - -}//SST -}//Llyr - -#endif //_LLYR_PE_H diff --git a/src/sst/elements/llyr/pes/storePE.h b/src/sst/elements/llyr/pes/storePE.h deleted file mode 100644 index 65b4d20d19..0000000000 --- a/src/sst/elements/llyr/pes/storePE.h +++ /dev/null @@ -1,303 +0,0 @@ -/* - * // Copyright 2013-2022 NTESS. Under the terms - * // of Contract DE-NA0003525 with NTESS, the U.S. - * // Government retains certain rights in this software. - * // - * // Copyright (c) 2013-2022, NTESS - * // All rights reserved. - * // - * // Portions are copyright of other developers: - * // See the file CONTRIBUTORS.TXT in the top level directory - * // the distribution for more information. - * // - * // This file is part of the SST software package. For license - * // information, see the LICENSE file in the top level directory of the - * // distribution. - */ - -#ifndef _STORE_PE_H -#define _STORE_PE_H - -#include - -#include "pes/processingElement.h" - -namespace SST { -namespace Llyr { - -/** - * @todo write docs - */ -class StoreProcessingElement : public ProcessingElement -{ -public: - StoreProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config, - uint32_t cycles = 1) : - ProcessingElement(op_binding, processor_id, llyr_config) - { - cycles_ = cycles; - output_queues_ = new std::vector< LlyrQueue* >; - - //stores need two input queues -- address and data - input_queues_= new std::vector< LlyrQueue* >; - LlyrQueue* tempQueue = new LlyrQueue; - tempQueue->data_queue_ = new std::queue< LlyrData >; - input_queues_->push_back(tempQueue); - } - - virtual bool doSend() - { - uint32_t queueId; - LlyrData sendVal; - ProcessingElement* dstPe; - - for(auto it = output_queue_map_.begin() ; it != output_queue_map_.end(); ++it ) { - queueId = it->first; - dstPe = it->second; - - if( output_queues_->at(queueId)->data_queue_->size() > 0 ) { - output_->verbose(CALL_INFO, 8, 0, ">> Sending...%" PRIu32 "-%" PRIu32 " to %" PRIu32 "\n", - processor_id_, queueId, dstPe->getProcessorId()); - - sendVal = output_queues_->at(queueId)->data_queue_->front(); - output_queues_->at(queueId)->data_queue_->pop(); - - dstPe->pushInputQueue(dstPe->getInputQueueId(this->getProcessorId()), sendVal); - } - } - - return true; - } - - virtual bool doReceive(LlyrData data) - { - output_->verbose(CALL_INFO, 8, 0, ">> Receive 0x%" PRIx64 "\n", uint64_t(data.to_ullong())); - - //for now push the result to all output queues - for( uint32_t i = 0; i < output_queues_->size(); ++i) { - output_queues_->at(i)->data_queue_->push(data); - } - - return true; - } - - virtual bool doCompute() - { - output_->verbose(CALL_INFO, 4, 0, ">> Compute 0x%" PRIx32 "\n", op_binding_); - - if( output_->getVerboseLevel() >= 64 ) { - printInputQueue(); - printOutputQueue(); - } - - std::vector< LlyrData > argList; - uint32_t num_ready = 0; - uint32_t num_inputs = input_queues_->size(); - - //check to see if all of the input queues have data - for( uint32_t i = 0; i < num_inputs; ++i) { - if( input_queues_->at(i)->data_queue_->size() > 0 ) { - num_ready = num_ready + 1; - } - } - - //if there are values waiting on any of the inputs, this PE could still fire - if( num_ready < num_inputs && num_ready > 0) { - pending_op_ = 1; - } else { - pending_op_ = 0; - } - - //if all inputs are available pull from queue and add to arg list - if( num_ready < num_inputs ) { - output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - return false; - } else { - output_->verbose(CALL_INFO, 4, 0, "+Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - for( uint32_t i = 0; i < num_inputs; ++i) { - argList.push_back(input_queues_->at(i)->data_queue_->front()); - input_queues_->at(i)->data_queue_->pop(); - } - } - - doStore(argList[0].to_ullong(), argList[1].to_ullong()); - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - - virtual void queueInit() - { - output_->verbose(CALL_INFO, 4, 0, ">> Fake Init(%" PRIu32 "), Op %" PRIu32 " \n", - processor_id_, op_binding_ ); - - //TODO Need a more elegant way to initialize these queues - if( input_queues_init_.size() > 0 ) { - std::queue< LlyrData >* tempQueue(&input_queues_init_); - input_queues_->at(0)->data_queue_ = tempQueue; - } else { - //for now assume that the address queue is on in-0 - uint64_t addr = llyr_config_->starting_addr_ + ( (processor_id_ - 1) * (Bit_Length / 8) ); - if( input_queues_->size() > 0 ) { - LlyrData temp = LlyrData(addr); - output_->verbose(CALL_INFO, 8, 0, "Init(%" PRIu32 ")::%" PRIx64 "::%" PRIu64 "\n", 0, addr, temp.to_ulong()); - input_queues_->at(0)->data_queue_->push(temp); - - addr = addr + (Bit_Length / 8); - } - } - } - -protected: - std::queue< LlyrData > input_queues_init_; - - bool doStore(uint64_t addr, LlyrData data) - { - uint32_t targetPe = processor_id_; - - const auto newValue = data.to_ullong(); - - constexpr auto size = sizeof(uint64_t); - uint8_t buffer[size] = {}; - std::memcpy(buffer, std::addressof(newValue), size); - - output_->verbose(CALL_INFO, 64, 0, "llyr = %s\n", data.to_string().c_str()); - output_->verbose(CALL_INFO, 64, 0, "conv = %llu\n", newValue); - - if( output_->getVerboseLevel() >= 64 ) { - std::stringstream dataOut; - for(uint32_t i = 0; i < size; ++i) { - dataOut << static_cast< uint16_t >(buffer[i]) << ", "; - } - output_->verbose(CALL_INFO, 64, 0, "%s\n", dataOut.str().c_str()); - } - - std::vector< uint8_t > payload(8); - memcpy( std::addressof(payload[0]), std::addressof(newValue), size ); - - if( output_->getVerboseLevel() >= 64 ) { - std::stringstream dataOut; - for( auto it = payload.begin(); it != payload.end(); ++it ) { - dataOut << static_cast< uint16_t >(*it) << ", "; - } - output_->verbose(CALL_INFO, 64, 0, "%s\n", dataOut.str().c_str()); - } - - StandardMem::Request* req = new StandardMem::Write(addr, 8, payload); - output_->verbose(CALL_INFO, 4, 0, "Creating a store request (%" PRIu32 ") to address: %" PRIu64 "\n", uint32_t(req->getID()), addr); - - LSEntry* tempEntry = new LSEntry( req->getID(), processor_id_, targetPe ); - lsqueue_->addEntry( tempEntry ); - - mem_interface_->send( req ); - - return 1; - } - -private: - -};// END StoreProcessingElement - -class AdvStoreProcessingElement : public StoreProcessingElement -{ -public: - AdvStoreProcessingElement(opType op_binding, uint32_t processor_id, LlyrConfig* llyr_config, - std::string *arguments, uint32_t cycles = 1) : - StoreProcessingElement(op_binding, processor_id, llyr_config) - { - cycles_ = cycles; - - if( arguments[0] != "" ) { - int64_t init_value = std::stoll(arguments[0]); - input_queues_init_.push(LlyrData(init_value)); - } - - if( arguments[1] != "" ) { - termination_ = std::stoll(arguments[1]); - } else { - termination_ = 0; - } - - output_queues_ = new std::vector< LlyrQueue* >; - - //stores need two input queues -- address and data - input_queues_= new std::vector< LlyrQueue* >; - LlyrQueue* tempQueue = new LlyrQueue; - tempQueue->data_queue_ = new std::queue< LlyrData >; - input_queues_->push_back(tempQueue); - } - - virtual bool doCompute() - { - output_->verbose(CALL_INFO, 4, 0, ">> Compute 0x%" PRIx32 "\n", op_binding_); - - if( output_->getVerboseLevel() >= 64 ) { - printInputQueue(); - printOutputQueue(); - } - - std::vector< LlyrData > argList; - uint32_t num_ready = 0; - uint32_t num_inputs = input_queues_->size(); - - //check to see if all of the input queues have data - for( uint32_t i = 0; i < num_inputs; ++i) { - if( input_queues_->at(i)->data_queue_->size() > 0 ) { - num_ready = num_ready + 1; - } - } - - //if there are values waiting on any of the inputs, this PE could still fire - if( num_ready < num_inputs && num_ready > 0) { - pending_op_ = 1; - } else { - pending_op_ = 0; - } - - //if all inputs are available pull from queue and add to arg list - if( num_ready < num_inputs ) { - output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - return false; - } else { - output_->verbose(CALL_INFO, 4, 0, "+Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready); - for( uint32_t i = 0; i < num_inputs; ++i) { - argList.push_back(input_queues_->at(i)->data_queue_->front()); - input_queues_->at(i)->data_queue_->pop(); - } - } - - //create the memory request - if( op_binding_ == STADDR ) { - doStore(argList[0].to_ullong(), argList[1].to_ullong()); - } else if( op_binding_ == STREAM_ST ) { - doStore(argList[0].to_ullong(), argList[1].to_ullong()); - if( termination_ > 0 ) { - termination_ = termination_ - 1; - input_queues_->at(0)->data_queue_->push(LlyrData(argList[0].to_ullong() + (Bit_Length / 8))); - } - } else { - output_->fatal(CALL_INFO, -1, "Error: could not find corresponding op-%" PRIu32 ".\n", op_binding_); - exit(-1); - } - - if( output_->getVerboseLevel() >= 10 ) { - printInputQueue(); - printOutputQueue(); - } - - return true; - } - -private: - uint64_t termination_; - -};// AdvStoreProcessingElement - -}//SST -}//Llyr - -#endif // _STORE_PE_H diff --git a/src/sst/elements/llyr/tests/gemm.in b/src/sst/elements/llyr/tests/gemm.in deleted file mode 100644 index 1126fc4d7e..0000000000 --- a/src/sst/elements/llyr/tests/gemm.in +++ /dev/null @@ -1,56 +0,0 @@ -1 [pe_type=LD] -2 [pe_type=LD] -3 [pe_type=LD] -4 [pe_type=LD] -5 [pe_type=LD] -6 [pe_type=LD] -7 [pe_type=LD] -8 [pe_type=LD] -9 [pe_type=LD] -10 [pe_type=MUL] -11 [pe_type=MUL] -12 [pe_type=MUL] -13 [pe_type=MUL] -14 [pe_type=MUL] -15 [pe_type=MUL] -16 [pe_type=ADD] -17 [pe_type=ADD] -18 [pe_type=ADD] -19 [pe_type=ADD] -20 [pe_type=ST] -21 [pe_type=ST] - -1 -- 10 -1 -- 13 - -4 -- 10 - -2 -- 11 -2 -- 14 - -6 -- 11 - -3 -- 12 -3 -- 15 - -8 -- 12 - -5 -- 13 - -7 -- 14 - -9 -- 15 - -10 -- 16 -11 -- 16 -16 -- 17 -12 -- 17 - -13 -- 18 -14 -- 18 -18 -- 19 -15 -- 19 - -17 -- 20 -19 -- 21 - diff --git a/src/sst/elements/llyr/tests/graph_mesh_25.hdw b/src/sst/elements/llyr/tests/graph_mesh_25.hdw deleted file mode 100644 index bea105e245..0000000000 --- a/src/sst/elements/llyr/tests/graph_mesh_25.hdw +++ /dev/null @@ -1,107 +0,0 @@ -digraph "Hardware Description" { -0 [label=any] -1 [label=any] -2 [label=any] -3 [label=any] -4 [label=any] -5 [label=any] -6 [label=any] -7 [label=any] -8 [label=any] -9 [label=any] -10 [label=any] -11 [label=any] -12 [label=any] -13 [label=any] -14 [label=any] -15 [label=any] -16 [label=any] -17 [label=any] -18 [label=any] -19 [label=any] -20 [label=any] -21 [label=any] -22 [label=any] -23 [label=any] -24 [label=any] -0--1 -0--5 -1--0 -1--2 -1--6 -2--1 -2--3 -2--7 -3--2 -3--4 -3--8 -4--3 -4--9 -5--0 -5--6 -5--10 -6--1 -6--5 -6--7 -6--11 -7--2 -7--6 -7--8 -7--12 -8--3 -8--7 -8--9 -8--13 -9--4 -9--8 -9--14 -10--5 -10--11 -10--15 -11--6 -11--10 -11--12 -11--16 -12--7 -12--11 -12--13 -12--17 -13--8 -13--12 -13--14 -13--18 -14--9 -14--13 -14--19 -15--10 -15--16 -15--20 -16--11 -16--15 -16--17 -16--21 -17--12 -17--16 -17--18 -17--22 -18--13 -18--17 -18--19 -18--23 -19--14 -19--18 -19--24 -20--15 -20--21 -21--16 -21--20 -21--22 -22--17 -22--21 -22--23 -23--18 -23--22 -23--24 -24--19 -24--23 -} diff --git a/src/sst/elements/llyr/tests/int-1.mem b/src/sst/elements/llyr/tests/int-1.mem deleted file mode 100644 index c07122cd0b..0000000000 --- a/src/sst/elements/llyr/tests/int-1.mem +++ /dev/null @@ -1 +0,0 @@ -0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024 diff --git a/src/sst/elements/llyr/tests/llyr_test.py b/src/sst/elements/llyr/tests/llyr_test.py deleted file mode 100644 index d964153950..0000000000 --- a/src/sst/elements/llyr/tests/llyr_test.py +++ /dev/null @@ -1,74 +0,0 @@ -# Automatically generated SST Python input -import sst - -# Define SST core options -sst.setProgramOption("timebase", "1 ps") -sst.setProgramOption("stopAtCycle", "10000s") - -# Constants shared across components -tile_clk_mhz = 1 -backing_size = 16384 -l1_size = 512 -verboseLevel = 0 -statLevel = 16 -mainDebug = 0 -otherDebug = 0 -debugLevel = 0 - -# Define the simulation components -df_0 = sst.Component("df_0", "llyr.LlyrDataflow") -df_0.addParams({ - "verbose" : str(verboseLevel), - "clock" : str(tile_clk_mhz) + "GHz", - "mem_init" : "int-1.mem", - "application" : "gemm.in", - "hardware_graph": "graph_mesh_25.hdw", - "mapper" : "llyr.mapper.simple" -}) -iface = df_0.setSubComponent("iface", "memHierarchy.standardInterface") - -df_l1cache = sst.Component("df_l1", "memHierarchy.Cache") -df_l1cache.addParams({ - "access_latency_cycles" : "2", - "cache_frequency" : str(tile_clk_mhz) + "GHz", - "replacement_policy" : "lru", - "coherence_protocol" : "MESI", - "cache_size" : str(l1_size) + "B", - "associativity" : "1", - "cache_line_size" : "16", - "verbose" : str(verboseLevel), - "debug" : str(otherDebug), - "debug_level" : str(debugLevel), - "L1" : "1" -}) - -df_memory = sst.Component("memory", "memHierarchy.MemController") -df_memory.addParams({ - "backing" : "mmap", - "verbose" : str(verboseLevel), - "debug" : str(otherDebug), - "debug_level" : str(debugLevel), - "addr_range_start" : "0", - "clock" : str(tile_clk_mhz) + "GHz", -}) - -backend = df_memory.setSubComponent("backend", "memHierarchy.simpleMem") -backend.addParams({ - "access_time" : "100 ns", - "mem_size" : str(backing_size) + "B", -}) - -# Enable SST Statistics Outputs for this simulation -sst.setStatisticLoadLevel(statLevel) -sst.enableAllStatisticsForAllComponents({"type":"sst.AccumulatorStatistic"}) -#sst.setStatisticOutput("sst.statOutputTXT", { "filepath" : "output.csv" }) - -# Define the simulation links -link_df_cache_link = sst.Link("link_cpu_cache_link") -link_df_cache_link.connect( (iface, "port", "1ps"), (df_l1cache, "high_network_0", "1ps") ) -link_df_cache_link.setNoCut() - -link_mem_bus_link = sst.Link("link_mem_bus_link") -link_mem_bus_link.connect( (df_l1cache, "low_network_0", "5ps"), (df_memory, "direct_link", "5ps") ) - - diff --git a/src/sst/elements/llyr/tests/refFiles/llyr_test.out b/src/sst/elements/llyr/tests/refFiles/llyr_test.out deleted file mode 100644 index 2fc046fdea..0000000000 --- a/src/sst/elements/llyr/tests/refFiles/llyr_test.out +++ /dev/null @@ -1,175 +0,0 @@ -memory, Notice: memory controller's region is larger than the backend's mem_size, controller is limiting accessible memory to mem_size -Region: start=0, end=18446744073709551615, interleaveStep=0, interleaveSize=0. MemSize: 16384B - df_l1.default_stat : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_GetS_I : Accumulator : Sum.u64 = 5; SumSQ.u64 = 5; Count.u64 = 5; Min.u64 = 1; Max.u64 = 1; - df_l1.stateEvent_GetS_S : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_GetS_M : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_GetX_I : Accumulator : Sum.u64 = 2; SumSQ.u64 = 2; Count.u64 = 2; Min.u64 = 1; Max.u64 = 1; - df_l1.stateEvent_GetX_S : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_GetX_M : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_GetSX_I : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_GetSX_S : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_GetSX_M : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_GetSResp_IS : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_GetXResp_IS : Accumulator : Sum.u64 = 5; SumSQ.u64 = 5; Count.u64 = 5; Min.u64 = 1; Max.u64 = 1; - df_l1.stateEvent_GetXResp_IM : Accumulator : Sum.u64 = 2; SumSQ.u64 = 2; Count.u64 = 2; Min.u64 = 1; Max.u64 = 1; - df_l1.stateEvent_GetXResp_SM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Inv_I : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Inv_S : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Inv_IS : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Inv_IM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Inv_SM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Inv_SB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Inv_IB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInvX_I : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInvX_M : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInvX_IS : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInvX_IM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInvX_SB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInvX_IB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Fetch_I : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Fetch_S : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Fetch_IS : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Fetch_IM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Fetch_SM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Fetch_IB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_Fetch_SB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInv_I : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInv_S : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInv_M : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInv_IS : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInv_IM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInv_SM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInv_SB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInv_IB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_ForceInv_I : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_ForceInv_S : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_ForceInv_M : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_ForceInv_IS : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_ForceInv_IM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_ForceInv_SM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_ForceInv_SB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_ForceInv_IB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FlushLine_I : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FlushLine_S : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FlushLine_M : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FlushLineInv_I : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FlushLineInv_S : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FlushLineInv_M : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FlushLineResp_I : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FlushLineResp_IB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FlushLineResp_SB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_GetS : Accumulator : Sum.u64 = 5; SumSQ.u64 = 5; Count.u64 = 5; Min.u64 = 1; Max.u64 = 1; - df_l1.eventSent_GetX : Accumulator : Sum.u64 = 2; SumSQ.u64 = 2; Count.u64 = 2; Min.u64 = 1; Max.u64 = 1; - df_l1.eventSent_GetSX : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_Write : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_PutM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_NACK : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_FlushLine : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_FlushLineInv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_FetchResp : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_FetchXResp : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_AckInv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_GetSResp : Accumulator : Sum.u64 = 9; SumSQ.u64 = 9; Count.u64 = 9; Min.u64 = 1; Max.u64 = 1; - df_l1.eventSent_GetXResp : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_WriteResp : Accumulator : Sum.u64 = 2; SumSQ.u64 = 2; Count.u64 = 2; Min.u64 = 1; Max.u64 = 1; - df_l1.eventSent_FlushLineResp : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_Put : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_Get : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_AckMove : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_CustomReq : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_CustomResp : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_CustomAck : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.EventStalledForLockedCacheline : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.evict_I : Accumulator : Sum.u64 = 6; SumSQ.u64 = 6; Count.u64 = 6; Min.u64 = 1; Max.u64 = 1; - df_l1.evict_S : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.evict_M : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.evict_IS : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.evict_IM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.evict_SM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.evict_SB : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.latency_GetS_hit : Accumulator : Sum.u64 = 438; SumSQ.u64 = 47966; Count.u64 = 4; Min.u64 = 108; Max.u64 = 111; - df_l1.latency_GetS_miss : Accumulator : Sum.u64 = 545; SumSQ.u64 = 59415; Count.u64 = 5; Min.u64 = 107; Max.u64 = 111; - df_l1.latency_GetX_hit : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.latency_GetX_miss : Accumulator : Sum.u64 = 215; SumSQ.u64 = 23113; Count.u64 = 2; Min.u64 = 107; Max.u64 = 108; - df_l1.latency_GetX_upgrade : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.latency_GetSX_hit : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.latency_GetSX_miss : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.latency_GetSX_upgrade : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.latency_FlushLine : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.latency_FlushLine_fail : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.latency_FlushLineInv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.latency_FlushLineInv_fail : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetSHit_Arrival : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetXHit_Arrival : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetSXHit_Arrival : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetSHit_Blocked : Accumulator : Sum.u64 = 4; SumSQ.u64 = 4; Count.u64 = 4; Min.u64 = 1; Max.u64 = 1; - df_l1.GetXHit_Blocked : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetSXHit_Blocked : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetSMiss_Arrival : Accumulator : Sum.u64 = 5; SumSQ.u64 = 5; Count.u64 = 5; Min.u64 = 1; Max.u64 = 1; - df_l1.GetXMiss_Arrival : Accumulator : Sum.u64 = 2; SumSQ.u64 = 2; Count.u64 = 2; Min.u64 = 1; Max.u64 = 1; - df_l1.GetSXMiss_Arrival : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetSMiss_Blocked : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetXMiss_Blocked : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetSXMiss_Blocked : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.CacheHits : Accumulator : Sum.u64 = 4; SumSQ.u64 = 4; Count.u64 = 4; Min.u64 = 1; Max.u64 = 1; - df_l1.CacheMisses : Accumulator : Sum.u64 = 7; SumSQ.u64 = 7; Count.u64 = 7; Min.u64 = 1; Max.u64 = 1; - df_l1.stateEvent_AckPut_I : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_PutS : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.eventSent_PutE : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_GetS_E : Accumulator : Sum.u64 = 4; SumSQ.u64 = 4; Count.u64 = 4; Min.u64 = 1; Max.u64 = 1; - df_l1.stateEvent_GetX_E : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_GetSX_E : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FlushLine_E : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FlushLineInv_E : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInv_E : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_ForceInv_E : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.stateEvent_FetchInvX_E : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.evict_E : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.TotalEventsReceived : Accumulator : Sum.u64 = 18; SumSQ.u64 = 18; Count.u64 = 18; Min.u64 = 1; Max.u64 = 1; - df_l1.TotalEventsReplayed : Accumulator : Sum.u64 = 4; SumSQ.u64 = 4; Count.u64 = 4; Min.u64 = 1; Max.u64 = 1; - df_l1.Put_uncache_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.Get_uncache_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.AckMove_uncache_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetS_uncache_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.Write_uncache_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetSX_uncache_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetSResp_uncache_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.WriteResp_uncache_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.CustomReq_uncache_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.CustomResp_uncache_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.CustomAck_uncache_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.NULLCMD_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetS_recv : Accumulator : Sum.u64 = 9; SumSQ.u64 = 9; Count.u64 = 9; Min.u64 = 1; Max.u64 = 1; - df_l1.GetX_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetSX_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.Write_recv : Accumulator : Sum.u64 = 2; SumSQ.u64 = 2; Count.u64 = 2; Min.u64 = 1; Max.u64 = 1; - df_l1.FlushLine_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.FlushLineInv_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetSResp_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.GetXResp_recv : Accumulator : Sum.u64 = 7; SumSQ.u64 = 7; Count.u64 = 7; Min.u64 = 1; Max.u64 = 1; - df_l1.FlushLineResp_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.Inv_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.ForceInv_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.Fetch_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.FetchInv_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.FetchInvX_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.NACK_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.AckPut_recv : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - df_l1.MSHR_occupancy : Accumulator : Sum.u64 = 1161; SumSQ.u64 = 8905; Count.u64 = 224; Min.u64 = 0; Max.u64 = 9; - df_l1.Bank_conflicts : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - memory.requests_received_GetS : Accumulator : Sum.u64 = 5; SumSQ.u64 = 5; Count.u64 = 5; Min.u64 = 1; Max.u64 = 1; - memory.requests_received_GetSX : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - memory.requests_received_GetX : Accumulator : Sum.u64 = 2; SumSQ.u64 = 2; Count.u64 = 2; Min.u64 = 1; Max.u64 = 1; - memory.requests_received_Write : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - memory.requests_received_PutM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - memory.outstanding_requests : Accumulator : Sum.u64 = 718; SumSQ.u64 = 2960; Count.u64 = 224; Min.u64 = 0; Max.u64 = 5; - memory.latency_GetS : Accumulator : Sum.u64 = 515; SumSQ.u64 = 53055; Count.u64 = 5; Min.u64 = 101; Max.u64 = 105; - memory.latency_GetSX : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - memory.latency_GetX : Accumulator : Sum.u64 = 203; SumSQ.u64 = 20605; Count.u64 = 2; Min.u64 = 101; Max.u64 = 102; - memory.latency_Write : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - memory.latency_PutM : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - memory.cycles_with_issue : Accumulator : Sum.u64 = 7; SumSQ.u64 = 7; Count.u64 = 7; Min.u64 = 1; Max.u64 = 1; - memory.cycles_attempted_issue_but_rejected : Accumulator : Sum.u64 = 0; SumSQ.u64 = 0; Count.u64 = 0; Min.u64 = 0; Max.u64 = 0; - memory.total_cycles : Accumulator : Sum.u64 = 224; SumSQ.u64 = 50176; Count.u64 = 1; Min.u64 = 224; Max.u64 = 224; -Simulation is complete, simulated time: 224 ns diff --git a/src/sst/elements/llyr/tests/testsuite_default_llyr.py b/src/sst/elements/llyr/tests/testsuite_default_llyr.py deleted file mode 100644 index a7523d1f1e..0000000000 --- a/src/sst/elements/llyr/tests/testsuite_default_llyr.py +++ /dev/null @@ -1,105 +0,0 @@ -# -*- coding: utf-8 -*- - -from sst_unittest import * -from sst_unittest_support import * - -################################################################################ -# Code to support a single instance module initialize, must be called setUp method - -module_init = 0 -module_sema = threading.Semaphore() - -def initializeTestModule_SingleInstance(class_inst): - global module_init - global module_sema - - module_sema.acquire() - if module_init != 1: - try: - # Put your single instance Init Code Here - pass - except: - pass - module_init = 1 - module_sema.release() - -################################################################################ - -class testcase_llyr_Component(SSTTestCase): - - def initializeClass(self, testName): - super(type(self), self).initializeClass(testName) - # Put test based setup code here. it is called before testing starts - # NOTE: This method is called once for every test - - def setUp(self): - super(type(self), self).setUp() - initializeTestModule_SingleInstance(self) - # Put test based setup code here. it is called once before every test - - def tearDown(self): - # Put test based teardown code here. it is called once after every test - super(type(self), self).tearDown() - -##### - - @unittest.skipIf(testing_check_get_num_ranks() > 1, "llyr: test_llyr_singlestream skipped if ranks > 1") - @unittest.skipIf(testing_check_get_num_threads() > 1, "llyr: test_llyr_singlestream skipped if threads > 1") - def test_llyr_singlestream(self): - self.llyr_test_template("llyr_test") - -##### - - def llyr_test_template(self, testcase, testtimeout=240): - # Get the path to the test files - test_path = self.get_testsuite_dir() - outdir = self.get_test_output_run_dir() - tmpdir = self.get_test_output_tmp_dir() - - # Set the various file paths - testDataFileName="test_llyr_{0}".format(testcase) - - sdlfile = "{0}/{1}.py".format(test_path, testcase) - reffile = "{0}/refFiles/{1}.out".format(test_path, testDataFileName) - outfile = "{0}/{1}.out".format(outdir, testDataFileName) - errfile = "{0}/{1}.err".format(outdir, testDataFileName) - mpioutfiles = "{0}/{1}.testfile".format(outdir, testDataFileName) - - self.run_sst(sdlfile, outfile, errfile, mpi_out_files=mpioutfiles, timeout_sec=testtimeout) - - testing_remove_component_warning_from_file(outfile) - - # NOTE: THE PASS / FAIL EVALUATIONS ARE PORTED FROM THE SQE BAMBOO - # BASED testSuite_XXX.sh THESE SHOULD BE RE-EVALUATED BY THE - # DEVELOPER AGAINST THE LATEST VERSION OF SST TO SEE IF THE - # TESTS & RESULT FILES ARE STILL VALID - - ### Check for success ### - - # Lines to ignore during diff - ## This is generated by SST when the number of ranks/threads > # of components - ignore_lines = ["WARNING: No components are assigned to"] - ## These are warnings/info generated by SST/memH in debug mode - ignore_lines.append("Notice: memory controller's region is larger than the backend's mem_size") - ignore_lines.append("Region: start=") - - filesAreTheSame, statDiffs, othDiffs = testing_stat_output_diff(outfile, reffile, ignore_lines, {}, True) - - # Perform the tests - if filesAreTheSame: - log_debug(" -- Output file {0} passed check against the Reference File {1}".format(outfile, reffile)) - elif use_pin_traces: ## PIN traces are generated dynamically and may diff, but the line count should match - # Use processed diffs so that ignore lines are still ignored - stat_lc = sum(1 for x in statDiffs if x[0] == "<") - oth_lc = sum(1 for x in othDiffs if x[0] == "<") - if stat_lc*2 == len(statDiffs) and oth_lc*2 == len(othDiffs): - log_debug(" -- Output file {0} pass line count check against the Reference File {1}".format(outfile, reffile)) - else: - diffdata = self._prettyPrintDiffs(statDiffs, othDiffs) - log_failure(diffdata) - self.assertTrue(filesAreTheSame, "Output file {0} does not pass line count check against the Reference File {1} ".format(outfile, reffile)) - - else: - diffdata = self._prettyPrintDiffs(statDiffs, othDiffs) - log_failure(diffdata) - self.assertTrue(filesAreTheSame, "Output file {0} does not pass check against the Reference File {1} ".format(outfile, reffile)) diff --git a/src/sst/elements/llyr/tools/gemm_gen.py b/src/sst/elements/llyr/tools/gemm_gen.py deleted file mode 100755 index 176342d1be..0000000000 --- a/src/sst/elements/llyr/tools/gemm_gen.py +++ /dev/null @@ -1,245 +0,0 @@ -#!/usr/bin/python3 - -import itertools -from collections import defaultdict - -debug = 0 -data_type = 0 #0 int, 1 fp64 - -m = 1 -k = 3 -n = 2 - -#m = 2 -#k = 1 -#n = 1 - -#m = 2 -#k = 2 -#n = 2 - -#m = 4 -#k = 2 -#n = 4 - -#m = 8 -#k = 4 -#n = 8 - -#m = 4 -#k = 4 -#n = 4 - -#m = 6 -#k = 3 -#n = 10 - -#m = 12 -#k = 12 -#n = 12 - -#m = 24 -#k = 24 -#n = 24 - -#m = 128 -#k = 128 -#n = 128 - -#m = 60 -#k = 30 -#n = 100 - -num_load = (m * k) + (k * n) -num_mul = k * m * n -num_add = (k - 1) * (m * n) -num_store = m * n - -pe_string_pre = "pe_type=" -edge_string_pre = "graphOut.addEdge" - -## -def extract_groups( grouping ): - temp_list = list(itertools.zip_longest(*(iter(grouping),) * 2, fillvalue=-1)) - return temp_list - -if( debug == 1 ): - print("Num load: " + str(num_load) + " 1-" + str(num_load)) - print("Num mult: " + str(num_mul) + " " + str(1 + num_load) + "-" + str(num_load+num_mul)) - print("Num add: " + str(num_add) + " " + str(1 + num_mul + num_load) + "-" + str(num_load+num_mul+num_add)) - print("Num store: " + str(num_store) + " " + str(1 + num_add + num_mul + num_load) + "-" + str(num_add+num_load+num_mul+num_store)) - print("\n") - - -# open the file -file = open("gemm.in", "w") - -pe_num = 1 -def write_pe( pe_string, pe, num_pes ): - file.write("%s [%s%s]\n" % (pe_num, pe_string_pre, pe)) - -# write loads -for counter in range( 0, num_load ): - write_pe( "LoadProcessingElement", "LD", pe_num ) - pe_num = pe_num + 1 - -# write mul -mul_start = pe_num -for counter in range( 0, num_mul ): - if( data_type == 1 ): - write_pe( "IntProcessingElement", "FMUL", pe_num ) - else: - write_pe( "IntProcessingElement", "MUL", pe_num ) - pe_num = pe_num + 1 - -# write add -add_start = pe_num -for counter in range( 0, num_add ): - if( data_type == 1 ): - write_pe( "IntProcessingElement", "FADD", pe_num ) - else: - write_pe( "IntProcessingElement", "ADD", pe_num ) - pe_num = pe_num + 1 - -# write store -store_start = pe_num -for counter in range( 0, num_store ): - write_pe( "StoreProcessingElement", "ST", pe_num ) - pe_num = pe_num + 1 - -file.write("\n") - -if( debug == 1 ): - print(" %s %s %s" % (mul_start, add_start, store_start)) - -# write edges -# connect loads to muls (first load is PE-1) -a_start = 1 -a_end = (k * m) -a_next = a_start -b_start = a_end + 1 -b_end = b_start + ((k * n) - 1) -b_next = b_start -if( debug == 1 ): - print("LD-MUL A:%s-%s B:%s-%s\n" % (a_start, a_end, b_start, b_end)) - file.write("LD-MUL A:%s-%s B:%s-%s\n" % (a_start, a_end, b_start, b_end)) - -mul_pe_dict = defaultdict(list) -add_pe_list = [] -final_add_pe_list = [] -new_mul = mul_start -for x in range( 0, m ): - b_offset = 0 - a_offset = a_start + (x * k) - mul_pe = new_mul - for y in range( 0, n ): - temp_list = [] - b_next = b_start + b_offset - #file.write("PE Start " + str(mul_pe) + " B-" + str(b_next) + "\n") - for z in range( 0, k ): - a_next = a_offset + z - mul_pe_dict[a_next].append(mul_pe) - mul_pe_dict[b_next].append(mul_pe) - temp_list.append(mul_pe) - #file.write("%s -- %s\n" % (a_next, b_next)) - b_next = b_next + n - mul_pe = mul_pe + 1 - #for key in mul_pe_dict.keys(): - #val = mul_pe_dict[key] - #print("Key", key, 'points to', val) - #print("\n") - #file.write("\n") - add_pe_list.append(temp_list) - b_offset = b_offset + 1 - new_mul = mul_pe - -if( debug == 1 ): - for val in add_pe_list: - print(val) - print("\n") - -for key in mul_pe_dict.keys(): - value = mul_pe_dict[key] - for val in value: - file.write("%s -- %s\n" % (key, val)) - file.write("\n") - -# connect adds to muls -test = [] -if( debug == 1 ): - file.write("MUL-ADD A:%s-%s B:%s-%s\n" % (a_start, a_end, b_start, b_end)) - -def add_tree( boop, next_add ): - global add_start - add_pe_groups = [] - if( len(boop) > 1 ): - if( debug == 1 ): - print("Here") - print(boop) - for x in boop: - if( x.count(-1) == 0 ): - file.write("%s -- %s\n" % (x[0], next_add)) - file.write("%s -- %s\n" % (x[1], next_add)) - add_pe_groups.append(next_add) - next_add = next_add + 1 - if( debug == 1 ): - print(x) - else: - add_pe_groups.append(x[0]) - if( debug == 1 ): - print(x) - - add_start = next_add - if( debug == 1 ): - print(add_pe_groups) - test = extract_groups(add_pe_groups) - if( debug == 1 ): - print(test) - add_tree(test, add_start) - else: - if( debug == 1 ): - print("Here 2") - print(boop) - for x in boop: - if( x.count(-1) == 0 ): - file.write("%s -- %s\n" % (x[0], next_add)) - file.write("%s -- %s\n" % (x[1], next_add)) - add_pe_groups.append(next_add) - final_add_pe_list.append(next_add) - next_add = next_add + 1 - if( debug == 1 ): - print(x) - else: - final_add_pe_list.append(x[0]) - if( debug == 1 ): - print(x) - - add_start = next_add - if( debug == 1 ): - print(add_pe_groups) - print(final_add_pe_list) - -for value in add_pe_list: - test = list(itertools.zip_longest(*(iter(value),) * 2, fillvalue=-1)) - if( debug == 1 ): - print("ADD") - print(test) - add_tree(test, add_start) - file.write("\n") - if( debug == 1 ): - print("\n") - -## Connect stores -next_store = store_start -for value in final_add_pe_list: - if( debug == 1 ): - print("ST") - print(value) - file.write("%s -- %s\n" % (value, next_store)) - next_store = next_store + 1 - -file.write("\n") - - -# cleanup -file.close() diff --git a/src/sst/elements/llyr/tools/graphGen.py b/src/sst/elements/llyr/tools/graphGen.py deleted file mode 100755 index 0795606aad..0000000000 --- a/src/sst/elements/llyr/tools/graphGen.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -import numpy as np -import networkx as nx -import matplotlib.pyplot as plt -from collections import defaultdict - -# mesh, torus, all -output_type = "all" - -# node operation -row_ops = 0 -col_ops = 0 -edge_ops = 0 - -G = nx.DiGraph() - -#for rows in (2, 4, 8, 16, 32, 64): -for rows in (2, 4, 8, 16, 32): - cols = rows - num_nodes = rows * cols - graph_topology = np.arange(num_nodes).reshape(rows, cols) - - fileName = "graph_" + output_type + "_" + str(num_nodes) + ".dot" - - for i in range(0, num_nodes): - G.add_node(i) - - if( output_type == "mesh" ): - node_num = 0 - for i in range(0, rows): - for j in range(0, cols): - num_neighbors = 0 - for i_x in range(max(0,i-1), min(cols,i+2)): - for j_y in range(max(0,j-1), min(rows,j+2)): - if( i == i_x and j == j_y ): - continue - elif( i < i_x or i > i_x ): - if( j < j_y or j > j_y ): - continue - num_neighbors = num_neighbors + 1 - - for i_x in range(max(0,i-1), min(cols,i+2)): - for j_y in range(max(0,j-1), min(rows,j+2)): - if( i == i_x and j == j_y ): - continue - elif( i < i_x or i > i_x ): - if( j < j_y or j > j_y ): - continue - G.add_edge(node_num, graph_topology[i_x][j_y]) - - node_num = node_num + 1 - - elif( output_type == "all" ): - node_list = {new_list: [] for new_list in range(num_nodes)} - for node in node_list: - node_num = 0 - for i in range(0, rows): - for j in range(0, cols): - if( str(node_num) != str(node) ): - node_list[node].append(node_num) - node_num = node_num + 1 - - for node in node_list: - for neighbor in node_list[node]: - G.add_edge(node, neighbor) - - else: - node_num = 0 - for i in range(0, rows): - for j in range(0, cols): - num_neighbors = 0 - for i_x in range(max(0,i-1), min(cols,i+2)): - for j_y in range(max(0,j-1), min(rows,j+2)): - if( i == i_x and j == j_y ): - continue - num_neighbors = num_neighbors + 1 - - for i_x in range(max(0,i-1), min(cols,i+2)): - for j_y in range(max(0,j-1), min(rows,j+2)): - if( i == i_x and j == j_y ): - continue - G.add_edge(node_num, graph_topology[i_x][j_y]) - node_num = node_num + 1 - - ## All nodes can do this op - if( row_ops == 0 and col_ops == 0 and edge_ops == 0 ): - for node in G.nodes(): - G.nodes[node]["op"] = "any" - else: - for node in G.nodes(): - G.nodes[node]["op"] = "arithmetic" - - ## First and last row have different op - if( row_ops == 1 ): - node = 0 - for i in range(0, rows): - for j in range(0, cols): - if( i == 0 or i == rows - 1 ): - G.nodes[node]["op"] = "memory" - node = node + 1 - - ## First and last column have different op - if( col_ops == 1 ): - node = 0 - for i in range(0, rows): - for j in range(0, cols): - if( j == 0 or j == cols - 1 ): - G.nodes[node]["op"] = "memory" - node = node + 1 - - ## Edges have different op - if( edge_ops == 1 ): - node = 0 - for i in range(0, rows): - for j in range(0, cols): - if( j == 0 or j == cols - 1 or i == 0 or i == rows - 1 ): - G.nodes[node]["op"] = "memory" - node = node + 1 - - nx.nx_pydot.write_dot(G, fileName) - - nx.nx_pydot.graphviz_layout(G, prog="neato") # prog options: neato, dot, fdp, sfdp, twopi, circo - nx.draw(G, pos = nx.nx_pydot.graphviz_layout(G), - node_size=1200, node_color='lightblue', linewidths=0.25, - font_size=10, font_weight='bold', with_labels=True) - #plt.show() - - diff --git a/src/sst/elements/llyr/tools/graph_gen.py b/src/sst/elements/llyr/tools/graph_gen.py deleted file mode 100755 index 645337df37..0000000000 --- a/src/sst/elements/llyr/tools/graph_gen.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/python - -#import graphviz - -total_pes = 8 -pe_num = 0 - -#g = graphviz.Graph("Hardware Description", filename='hardware.cfg') - -### create nodes -#for counter in range( 0, total_pes ): - #g.node( str(counter), 'any') - -### create edges for fully conntected graph -#for x in range( 0, total_pes ): - #for y in range( x + 1, total_pes ): - #g.edge( str(x), str(y)) - -##g.view() - -import os -import networkx as nx -from networkx.algorithms import isomorphism -from networkx.drawing.nx_pydot import write_dot -from networkx.algorithms import isomorphism as iso - -hw_graph = nx.DiGraph() -sw_graph = nx.DiGraph() - -### create nodes -for counter in range( 0, total_pes ): - hw_graph.add_node( counter, label="any") - -## create edges for fully conntected graph -for x in range( 0, total_pes ): - for y in range( x + 1, total_pes ): - hw_graph.add_edge( x, y ) - -## app graphFile -sw_graph.add_node( 1, label="any") -sw_graph.add_node( 2, label="any") -sw_graph.add_node( 3, label="any") -sw_graph.add_node( 4, label="any") -sw_graph.add_node( 5, label="any") -sw_graph.add_node( 6, label="any") -sw_graph.add_node( 7, label="any") -sw_graph.add_node( 8, label="any") - -sw_graph.add_edge( 1, 4 ) -sw_graph.add_edge( 2, 4 ) -#sw_graph.add_edge( 2, 5 ) -#sw_graph.add_edge( 3, 5 ) -#sw_graph.add_edge( 4, 6 ) -#sw_graph.add_edge( 5, 7 ) - - -# Nodes 'a', 'b', 'c' and 'd' form a column. -# Nodes 'g', 'h', 'i' and 'j' form a column. -g1edges = [['a', 'g'], ['a', 'h'], ['a', 'i'], - ['b', 'g'], ['b', 'h'], ['b', 'j'], - ['c', 'g'], ['c', 'i'], ['c', 'j'], - ['d', 'h'], ['d', 'i'], ['d', 'j']] - -# Nodes 1,2,3,4 form the clockwise corners of a large square. -# Nodes 5,6,7,8 form the clockwise corners of a small square -g2edges = [[1, 2], [2, 3], [3, 4], [4, 1], - [5, 6], [6, 7], [7, 8], [8, 5], - [1, 5], [2, 6], [3, 7], [4, 8]] - -g1 = nx.Graph() -g2 = nx.Graph() -g1.add_edges_from(g1edges) -g2.add_edges_from(g2edges) -#g3 = g2.subgraph([1, 2, 3, 4]) -#gm = iso.GraphMatcher(g1, g2) - -gm = iso.DiGraphMatcher(hw_graph, sw_graph) -for subgraph in gm.subgraph_isomorphisms_iter(): - print( subgraph ) - -gm = iso.DiGraphMatcher(sw_graph, hw_graph) -for subgraph in gm.subgraph_isomorphisms_iter(): - print( subgraph ) - -nx.drawing.nx_pydot.write_dot(sw_graph, '/tmp/sw.dot') -nx.drawing.nx_pydot.write_dot(hw_graph, '/tmp/hw.dot') - -os.system("dot -Tpdf /tmp/sw.dot -o /tmp/sw_test.pdf") -os.system("dot -Tpdf /tmp/hw.dot -o /tmp/hw_test.pdf") - diff --git a/src/sst/elements/llyr/tools/pyMapper.py b/src/sst/elements/llyr/tools/pyMapper.py deleted file mode 100644 index f957fd2bb1..0000000000 --- a/src/sst/elements/llyr/tools/pyMapper.py +++ /dev/null @@ -1,7 +0,0 @@ -import os -dir_path = os.path.dirname(os.path.realpath(__file__)) - -print('External Python program running...') -print('Hello World from Python program') -print(dir_path) - diff --git a/src/sst/elements/llyr/tools/spmm_gen.py b/src/sst/elements/llyr/tools/spmm_gen.py deleted file mode 100755 index 968bfd3a90..0000000000 --- a/src/sst/elements/llyr/tools/spmm_gen.py +++ /dev/null @@ -1,301 +0,0 @@ -#!/usr/bin/python3 - -import itertools -from collections import defaultdict - -debug = 0 -data_type = 0 #0 int, 1 fp64 - -## mxn * nxk -#m = 1 -#n = 3 -#k = 2 - -m = 3 -n = 3 -k = 2 - -#m = 3 -#n = 3 -#k = 3 - -#m = 12 -#n = 12 -#k = 12 - -#m = 16 -#n = 16 -#k = 16 - -## init non-zeroes -#non_zeroes = [1] -non_zeroes = [1,2,3,4,5] - -## init row_ptr -#row_ptr = [0,1] -row_ptr = [0,1,3,5] -#row_ptr = [0,1,4,5] - -## init col_ptr -#col_ptr = [0,1] -col_ptr = [0,0,1,1,2] -#col_ptr = [0,0,1,2,2] - -## init dense mat -dense_mat = [] -for i in range( n ): - x = [] - for j in range( k ): - x.append(0) - dense_mat.append(x) - -dense_mat[0][0] = 6 -dense_mat[0][1] = 7 -dense_mat[1][0] = 8 -dense_mat[1][1] = 9 -dense_mat[2][0] = 10 -dense_mat[2][1] = 11 - -#dense_mat[0][2] = 12 -#dense_mat[1][2] = 13 -#dense_mat[2][2] = 14 - - -## write memory file -mem_file = open("spmm-mem.in", "w") - -# write k -mem_file.write(str(k) + ",") - -#write v -converted_list = [str(element) for element in non_zeroes] -mem_file.write(",".join(converted_list)) -mem_file.write(",") - -#write row_ptr -converted_list = [str(element) for element in row_ptr] -mem_file.write(",".join(converted_list)) -mem_file.write(",") - -#write col_ptr -converted_list = [str(element) for element in col_ptr] -mem_file.write(",".join(converted_list)) -mem_file.write(",") - -for i in dense_mat: - converted_list = [str(element) for element in i] - mem_file.write(",".join(converted_list)) - mem_file.write(",") - -#fill memory -for i in range(255): - mem_file.write(str(255)) - if( i != 255 ): - mem_file.write(",") - -mem_file.close() - -##################################### -pe_string_pre = " [pe_type=" -adj_list = defaultdict(list) - -result = [] -for i in range( m ): - x = [] - for j in range( k ): - x.append(0) - result.append(x) - -# open the file -file = open("spmm.in", "w") - -#for x in result: - #converted_list = [str(element) for element in x] - #print(",".join(converted_list)) - -v_start_addr = 8 -r_start_addr = v_start_addr + (8 * len(non_zeroes)) -c_start_addr = r_start_addr + (8 * len(row_ptr)) -d_start_addr = c_start_addr + (8 * len(col_ptr)) -store_start_addr = 256 - -print("size of non_zeroes = " + str(len(non_zeroes)) + " " + str(v_start_addr)) -print("size of row_ptr = " + str(len(row_ptr)) + " " + str(r_start_addr)) -print("size of col_ptr = " + str(len(col_ptr)) + " " + str(c_start_addr)) -print("size of dense = " + str(len(dense_mat)) + " " + str(d_start_addr)) - -# write ld for k -adj_list[1].append(2) -file.write( str(1) + pe_string_pre + "LDADDR,0" + "]" + "\n" ) -file.write( str(2) + pe_string_pre + "MULCONST,8" + "]" + "\n" ) -file.write( "\n" ) - -pe_id = 3 -#for x in range( 0, m ): -for x in range( 0, len(row_ptr) - 1 ): - sp_ld_dict = defaultdict(int) - col_ld_dict = defaultdict(int) - partial_product = defaultdict(list) - - print(x) - for y in range( row_ptr[x], row_ptr[x+1] ): - ## LD sparse[j] - temp_addr = v_start_addr + (8 * y) - file.write( str(pe_id) + pe_string_pre + "LDADDR," + str(temp_addr) + "]" + "\n" ) - sp_ld_dict[y] = pe_id - pe_id = pe_id + 1 - - ## LD column[j] - temp_addr = c_start_addr + (8 * y) - file.write( str(pe_id) + pe_string_pre + "LDADDR," + str(temp_addr) + "]" + "\n" ) - col_ld_dict[y]= pe_id - pe_id = pe_id + 1 - - for z in range( 0, k ): - #print( str(x) + " " + str(y) + " " + str(z) ) - #print( str(result[x][z]) + " + " + str (non_zeroes[y]) + " * " + str(dense_mat[col_ptr[y]][z]) ) - result[x][z] = result[x][z] + non_zeroes[y] * dense_mat[col_ptr[y]][z] - - # calculate col in d[][] - mul_1 = pe_id - temp_pe = col_ld_dict[y] - adj_list[temp_pe].append(pe_id) - adj_list[2].append(pe_id) - file.write(str(pe_id) + pe_string_pre + "MUL" + "]" + "\n") - pe_id = pe_id + 1 - - # calculate row in d[][] - offset_pe = pe_id - adj_list[mul_1].append(pe_id) - offset = d_start_addr + (z * 8) - file.write(str(pe_id) + pe_string_pre + "ADDCONST," + str(offset) + "]" + "\n") - pe_id = pe_id + 1 - - # sparse[j] * dense[] - mul_2 = pe_id - temp_pe = sp_ld_dict[y] - adj_list[temp_pe].append(pe_id) - partial_product[z].append(mul_2) - file.write(str(pe_id) + pe_string_pre + "MUL" + "]" + "\n") - pe_id = pe_id + 1 - - # LD dense[col[j]][k] - ld_dense = pe_id - adj_list[offset_pe].append(pe_id) - adj_list[pe_id].append(mul_2) - file.write(str(pe_id) + pe_string_pre + "LD" + "]" + "\n") - pe_id = pe_id + 1 - - ## ST final value - #final_st[z].append(pe_id) - #file.write(str(pe_id) + pe_string_pre + "STADDR," + str(store_start_addr) + "]" + "\n") - #store_start_addr = store_start_addr + 8 - #pe_id = pe_id + 1 - - file.write( "\n" ) - - #for key in sp_ld_dict.keys(): - #val = sp_ld_dict[key] - #print("SP Key", key, 'points to', val) - - #for key in col_ld_dict.keys(): - #val = col_ld_dict[key] - #print("COL Key", key, 'points to', val) - - for key in partial_product.keys(): - val = partial_product[key] - #print("PP Key", key, 'points to', val) - - # match the accumulators - if( len(val) > 1 ): - acc_list = [] - #print("Moo! Cows! " + str(len(val))) - while( len(val) > 1 ): - #print("A " + str(len(val))) - adj_list[val.pop()].append(pe_id) - adj_list[val.pop()].append(pe_id) - acc_list.append(pe_id) - file.write(str(pe_id) + pe_string_pre + "ADD" + "]" + "\n") - pe_id = pe_id + 1 - if( len(val) > 0 ): - #print("B " + str(len(val))) - adj_list[val.pop()].append(pe_id) - acc_list.append(pe_id) - file.write(str(pe_id) + pe_string_pre + "ADD" + "]" + "\n") - pe_id = pe_id + 1 - # adder tree - if( len(acc_list) > 1 ): - #print("Boo! Who? " + str(len(acc_list))) - while( len(acc_list) > 1 ): - #print("C " + str(len(acc_list))) - # check if the adder has a single input - num_found = 0 - for key in adj_list.keys(): - top = adj_list[key] - if( acc_list[-1] in top ): - num_found = num_found + 1 - #print("Found " + str(top)) - - # if the tail has a single input, it's the bottom of the tree because muls are grouped above - if( num_found == 1 ): - adj_list[acc_list[-2]].append(acc_list[-1]) - - # otherwise we need another adder - else: - adj_list[acc_list[-1]].append(pe_id) - adj_list[acc_list[-2]].append(pe_id) - file.write(str(pe_id) + pe_string_pre + "ADD" + "]" + "\n") - pe_id = pe_id + 1 - - #print(str(acc_list.pop())) - #print(str(acc_list.pop())) - acc_list.pop() - acc_list.pop() - - if( len(acc_list) > 0 ): - #print("D " + str(len(acc_list))) - adj_list[pe_id - 1].append(pe_id) - file.write(str(pe_id) + pe_string_pre + "ADD" + "]" + "\n") - pe_id = pe_id + 1 - print(str(acc_list.pop())) - - # ST final value - adj_list[pe_id - 1].append(pe_id) - file.write(str(pe_id) + pe_string_pre + "STADDR," + str(store_start_addr) + "]" + "\n") - store_start_addr = store_start_addr + 8 - pe_id = pe_id + 1 - - else: - #print("Boo! " + str(acc_list[0])) - - # ST final value - file.write(str(pe_id) + pe_string_pre + "STADDR," + str(store_start_addr) + "]" + "\n") - store_start_addr = store_start_addr + 8 - pe_id = pe_id + 1 - - else: - #print("Narf! " + str(partial_product[key][0])) - # ST final value - adj_list[partial_product[key][0]].append(pe_id) - file.write(str(pe_id) + pe_string_pre + "STADDR," + str(store_start_addr) + "]" + "\n") - store_start_addr = store_start_addr + 8 - pe_id = pe_id + 1 - - #print( "\n" ) - -for key in adj_list.keys(): - val = adj_list[key] - #print("ADJ Key", key, 'points to', val) - for i in val: - file.write(str(key) + " -- " + str(i) + "\n") - file.write("\n") - -for x in result: - converted_list = [str(element) for element in x] - print(",".join(converted_list)) - - - -# cleanup -file.close() - diff --git a/src/sst/elements/llyr/tools/vf3_to_hwr.py b/src/sst/elements/llyr/tools/vf3_to_hwr.py deleted file mode 100755 index 1785810531..0000000000 --- a/src/sst/elements/llyr/tools/vf3_to_hwr.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/python3 -import sys -import getopt -import numpy as np - -input_file = "" -output_file = "" - -opts, argv = getopt.getopt(sys.argv[1:], 'i:o:') - -for opt, arg in opts: - if opt in( "-i", "--ifile" ): - input_file = arg - elif opt in( "-o", "--ofile" ): - output_file = arg - -first_line = 0 -node_list = 0 -temp_edges = 0 -dotFile = open( output_file, "w" ) -parse = open( input_file, 'r' ) - -dotFile.write( "digraph \"Hardware Description\" {\n" ) -#dotFile.write( "layout=sfdp\n" ) -#dotFile.write( "node [shape=plaintext]\n" ) - -for line in parse: - if( first_line == 0 ): - first_line = 1 - elif( line == "\n" ): - if( node_list == 0 ): - node_list = 1 - elif( node_list == 1 ): - node_list = 2 - temp_edges = 1 - else: - temp_edges = 1 - else: - tempLine = line.strip().split() - if( node_list == 1 ): - dotFile.write( str(tempLine[0]) + " " + "[label=any]") - dotFile.write( "\n" ) - elif( temp_edges == 1 ): - temp_edges = 0 - else: - dotFile.write( str(tempLine[0]) + "--" + str(tempLine[1]) ) - dotFile.write( "\n" ) - -dotFile.write( "}\n" ) - -parse.close() -dotFile.close() - - #for file in ; do ../convert_dot.py -i $file -o "${file}.dot"; done - #for file in gemm*; do if [[ $file != *".vf3" ]]; then echo $file; fi done - #for file in gemm*; do if [[ $file == *".vf3" ]]; then ../convert_dot.py -i $file -o "${file}.dot"; fi done -