Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gensa #2229

Merged
merged 1 commit into from
Oct 4, 2023
Merged

gensa #2229

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions src/sst/elements/GNA/Makefile.am

This file was deleted.

30 changes: 30 additions & 0 deletions src/sst/elements/gensa/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- Makefile -*-
#
#

AM_CPPFLAGS += \
$(MPI_CPPFLAGS) \
-I$(top_srcdir)/src

compdir = $(pkglibdir)
comp_LTLIBRARIES = libgensa.la
libgensa_la_SOURCES = \
neuron.h \
neuron.cc \
gensa.h \
gensa.cc \
OutputHolder.h

EXTRA_DIST = \
README \
tests/testsuite_default_gensa.py \
tests/test_gensa_1.py \
tests/model \
tests/OutputParser.py

libgensa_la_LDFLAGS = -module -avoid-version

install-exec-hook:
$(SST_REGISTER_TOOL) SST_ELEMENT_SOURCE gensa=$(abs_srcdir)
$(SST_REGISTER_TOOL) SST_ELEMENT_TESTS gensa=$(abs_srcdir)/tests

File renamed without changes.
34 changes: 17 additions & 17 deletions src/sst/elements/GNA/GNA.cc → src/sst/elements/gensa/gensa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// distribution.

#include <sst_config.h>
#include "GNA.h"
#include "gensa.h"

#include <fstream>

Expand All @@ -25,11 +25,11 @@

using namespace SST;
//using namespace SST::MemHierarchy;
using namespace SST::GNAComponent;
using namespace SST::gensaComponent;
using namespace std;


GNA::GNA (ComponentId_t id, Params & params)
gensa::gensa (ComponentId_t id, Params & params)
: Component (id)
{
now = 0;
Expand All @@ -40,7 +40,7 @@ GNA::GNA (ComponentId_t id, Params & params)
numDeliveries = 0;

uint32_t outputLevel = params.find<uint32_t> ("verbose", 0);
out.init ("GNA:@p:@l: ", outputLevel, 0, Output::STDOUT);
out.init ("gensa:@p:@l: ", outputLevel, 0, Output::STDOUT);

// get parameters
modelPath = params.find<string>("modelPath", "model");
Expand All @@ -50,7 +50,7 @@ GNA::GNA (ComponentId_t id, Params & params)

//set our clock
string clockFreq = params.find<string> ("clock", "1GHz");
clockTC = registerClock (clockFreq, new Clock::Handler<GNA> (this, &GNA::clockTic));
clockTC = registerClock (clockFreq, new Clock::Handler<gensa> (this, &gensa::clockTic));

// tell the simulator not to end without us
registerAsPrimaryComponent ();
Expand All @@ -60,31 +60,31 @@ GNA::GNA (ComponentId_t id, Params & params)
memory = loadUserSubComponent<Interfaces::StandardMem> (
"memory",
ComponentInfo::SHARE_NONE, clockTC,
new Interfaces::StandardMem::Handler<GNA> (this, &GNA::handleMemory)
new Interfaces::StandardMem::Handler<gensa> (this, &gensa::handleMemory)
);
if (!memory)
{
params.insert ("port", "mem_link");
memory = loadAnonymousSubComponent<Interfaces::StandardMem> (
"memHierarchy.standardInterface", "memory", 0,
ComponentInfo::SHARE_PORTS, params, clockTC,
new Interfaces::StandardMem::Handler<GNA>(this, &GNA::handleMemory)
new Interfaces::StandardMem::Handler<gensa>(this, &gensa::handleMemory)
);
}
if (!memory) out.fatal (CALL_INFO, -1, "Unable to load memHierarchy.standardInterface subcomponent\n");

link = loadUserSubComponent<Interfaces::SimpleNetwork> ("networkIF", ComponentInfo::SHARE_NONE, 1);
if (!link) out.fatal (CALL_INFO, 1, "No networkIF subcomponent\n");
link->setNotifyOnReceive (new Interfaces::SimpleNetwork::Handler<GNA> (this, &GNA::handleNetwork));
link->setNotifyOnReceive (new Interfaces::SimpleNetwork::Handler<gensa> (this, &gensa::handleNetwork));
}

GNA::GNA ()
gensa::gensa ()
: Component(-1)
{
// for serialization only
}

GNA::~GNA ()
gensa::~gensa ()
{
for (auto n : neurons) delete n;
while (! networkRequests.empty ())
Expand All @@ -95,7 +95,7 @@ GNA::~GNA ()
}

void
GNA::init (unsigned int phase)
gensa::init (unsigned int phase)
{
memory->init (phase);
link ->init (phase);
Expand Down Expand Up @@ -274,21 +274,21 @@ GNA::init (unsigned int phase)
}

void
GNA::setup ()
gensa::setup ()
{
memory->setup ();
link->setup ();
}

void
GNA::complete (unsigned int phase)
gensa::complete (unsigned int phase)
{
memory->complete (phase);
link->complete (phase);
}

void
GNA::finish ()
gensa::finish ()
{
memory->finish ();
link ->finish ();
Expand All @@ -305,7 +305,7 @@ GNA::finish ()
// Retrieving synapse records and transmitting spike packets can run in parallel with executing the LIF model,
// but the LIF model needs to stall until all spikes are sent.
bool
GNA::clockTic (Cycle_t t)
gensa::clockTic (Cycle_t t)
{
using namespace Interfaces;
if (! networkRequests.empty ())
Expand Down Expand Up @@ -366,7 +366,7 @@ GNA::clockTic (Cycle_t t)
}

void
GNA::handleMemory (Interfaces::StandardMem::Request * req)
gensa::handleMemory (Interfaces::StandardMem::Request * req)
{
SST::Interfaces::StandardMem::ReadResp * resp = dynamic_cast<SST::Interfaces::StandardMem::ReadResp *> (req);
assert (resp);
Expand All @@ -386,7 +386,7 @@ GNA::handleMemory (Interfaces::StandardMem::Request * req)
}

bool
GNA::handleNetwork (int vn)
gensa::handleNetwork (int vn)
{
// Ignore vn. It should always be 0 because that's all we registered for.

Expand Down
22 changes: 11 additions & 11 deletions src/sst/elements/GNA/GNA.h → src/sst/elements/gensa/gensa.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// information, see the LICENSE file in the top level directory of the
// distribution.

#ifndef _GNA_H
#define _GNA_H
#ifndef _gensa_h
#define _gensa_h

#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
Expand All @@ -37,13 +37,13 @@


namespace SST {
namespace GNAComponent {
namespace gensaComponent {

class GNA : public SST::Component {
class gensa : public SST::Component {
public:
// Element Library Info

SST_ELI_REGISTER_COMPONENT(GNA, "GNA", "core", SST_ELI_ELEMENT_VERSION(1,0,0),
SST_ELI_REGISTER_COMPONENT(gensa, "gensa", "core", SST_ELI_ELEMENT_VERSION(1,0,0),
"Spiking Processor", COMPONENT_CATEGORY_PROCESSOR)

SST_ELI_DOCUMENT_PARAMS(
Expand Down Expand Up @@ -82,12 +82,12 @@ class GNA : public SST::Component {
std::set<uint64_t> memoryRequests;
std::queue<SST::Interfaces::SimpleNetwork::Request*> networkRequests;

GNA (SST::ComponentId_t id, SST::Params& params); // regular constructor
GNA (); // for serialization only
GNA (const GNA&) = delete;
~GNA();
gensa (SST::ComponentId_t id, SST::Params& params); // regular constructor
gensa (); // for serialization only
gensa (const gensa&) = delete;
~gensa();

void operator= (const GNA&) = delete;
void operator= (const gensa&) = delete;

void init (unsigned int phase);
void setup ();
Expand All @@ -112,4 +112,4 @@ class SyncEvent : public SST::Event

}
}
#endif /* _GNA_H */
#endif /* _gensa_h */
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <sst_config.h>
#include "neuron.h"

using namespace SST::GNAComponent;
using namespace SST::gensaComponent;
using namespace std;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


namespace SST {
namespace GNAComponent {
namespace gensaComponent {

struct Synapse {
float weight;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
(options, args) = op.parse_args()

# Define the simulation components
comp_gna = sst.Component("GNA", "GNA.GNA")
comp_gna = sst.Component("gensa", "gensa.core")
comp_gna.addParams({
"verbose" : 1,
"neurons" : options.neurons,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Define the simulation components

core = sst.Component("GNA", "GNA.core")
core = sst.Component("gensa", "gensa.core")
core.addParams({
"verbose" : 1,
"modelPath" : options.neurons,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initializeTestModule_SingleInstance(class_inst):

################################################################################

class testcase_GNA_Component(SSTTestCase):
class testcase_gensa_Component(SSTTestCase):

def initializeClass(self, testName):
super(type(self), self).initializeClass(testName)
Expand All @@ -43,20 +43,20 @@ def tearDown(self):

#####

def test_GNA_1(self):
self.GNA_test_template("1")
def test_gensa_1(self):
self.gensa_test_template("1")

#####

def GNA_test_template(self, testcase):
def gensa_test_template(self, testcase):
# Note: testcase param is ignored for now
# 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_GNA_{0}".format(testcase)
testDataFileName="test_gensa_{0}".format(testcase)

sdlfile = "{0}/{1}.py".format(test_path, testDataFileName)
reffile = "{0}/refFiles/{1}.out".format(test_path, testDataFileName)
Expand All @@ -72,7 +72,7 @@ def GNA_test_template(self, testcase):

# Check if any output to stderr
if os_test_file(errfile, "-s"):
log_testing_note("GNA test {0} has a Non-Empty Error File {1}".format(testDataFileName, errfile))
log_testing_note("gensa test {0} has a Non-Empty Error File {1}".format(testDataFileName, errfile))

# Check if spiking pattern exactly matches expected values
cmp_result = True
Expand Down