Skip to content
Merged
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
1 change: 0 additions & 1 deletion src/sst/elements/llyr/llyrHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ inline HardwareNode* process_node_row(const std::vector< std::string >& row)
{
HardwareNode* hardwareNode = new HardwareNode;


// TODO: figure out lists of lists
hardwareNode->pe_id_ = std::string(row[1]);
hardwareNode->job_id_ = std::string(row[2]);
Expand Down
2 changes: 1 addition & 1 deletion src/sst/elements/llyr/mappers/pyMapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void PyMapper::mapGraph(LlyrGraph< opType > hardwareGraph, LlyrGraph< AppNode >

// std::string fileName = "deepmind/strassen2x2_clay.csv";
// std::string fileName = "deepmind/strassen_6x7_rect_gap1.csv";
std::string fileName = "hpca23/generic_solution.csv";
std::string fileName = "ipdps24/generic_solution.csv";
output_->verbose(CALL_INFO, 1, 0, "Mapping Application Using: %s\n", fileName.c_str());

std::list< HardwareNode* > node_list;
Expand Down
48 changes: 25 additions & 23 deletions src/sst/elements/llyr/pes/controlPE.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
namespace SST {
namespace Llyr {

// valid, queue id, data
typedef std::tuple< bool, int32_t, LlyrData > HelperReturn;

/**
Expand All @@ -46,6 +47,7 @@ class ControlProcessingElement : public ProcessingElement
uint64_t intResult = 0x0F;

std::vector< QueueData > argList(3);
std::vector< bool > forwarded(input_queues_->size(), 0);
LlyrData retVal;
uint32_t queue_id;
bool valid_return;
Expand Down Expand Up @@ -108,6 +110,7 @@ class ControlProcessingElement : public ProcessingElement
argList[i].valid_ = 1;
argList[i].data_ = input_queues_->at(i)->data_queue_->front();

forwarded[i] = input_queues_->at(i)->forwarded_;
input_queues_->at(i)->forwarded_ = 0;
input_queues_->at(i)->data_queue_->pop();

Expand All @@ -121,6 +124,7 @@ class ControlProcessingElement : public ProcessingElement
output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 "\n", num_inputs, num_ready);
for( uint32_t i = 0; i < argList.size(); ++i ) {
if( argList[i].valid_ == 1 ) {
input_queues_->at(i)->forwarded_ = forwarded[i];
input_queues_->at(i)->data_queue_->push(argList[i].data_);
}
}
Expand All @@ -140,6 +144,7 @@ class ControlProcessingElement : public ProcessingElement
argList[i].valid_ = 1;
argList[i].data_ = input_queues_->at(i)->data_queue_->front();

forwarded[i] = input_queues_->at(i)->forwarded_;
input_queues_->at(i)->forwarded_ = 0;
input_queues_->at(i)->data_queue_->pop();
} else {
Expand Down Expand Up @@ -186,7 +191,7 @@ class ControlProcessingElement : public ProcessingElement

// for now push the result to all output queues that need this result
if( op_binding_ == MERGE ) {
input_queues_->at(queue_id)->forwarded_ = 0;
input_queues_->at(queue_id)->forwarded_ = forwarded[queue_id];
input_queues_->at(queue_id)->data_queue_->pop();

for( uint32_t i = 0; i < output_queues_->size(); ++i ) {
Expand All @@ -205,12 +210,14 @@ class ControlProcessingElement : public ProcessingElement
// need to keep the arg-1 value if it wasn't reset, using queueId of 2 for this
if( argList[0].valid_ == 1 && argList[0].data_ == 0 && queue_id == 2 ) {
if( argList[1].valid_ == 1 ) {
input_queues_->at(1)->forwarded_ = forwarded[1];
input_queues_->at(1)->data_queue_->push(argList[1].data_);
}
}
} else if( queue_id == 2 ) {
for( uint32_t i = 0; i < argList.size(); ++i ) {
if( argList[i].valid_ == 1 ) {
input_queues_->at(i)->forwarded_ = forwarded[1];
input_queues_->at(i)->data_queue_->push(argList[i].data_);
}
}
Expand All @@ -219,6 +226,7 @@ class ControlProcessingElement : public ProcessingElement
// need to keep the arg-0 value if the data stream didn't gnom it up
if( argList[1].valid_ == 1 && argList[1].data_ == 0 ) {
if( argList[0].valid_ == 1 ) {
input_queues_->at(0)->forwarded_ = forwarded[0];
input_queues_->at(0)->data_queue_->push(argList[0].data_);
}
}
Expand Down Expand Up @@ -264,11 +272,12 @@ class ControlProcessingElement : public ProcessingElement

// SEL - Select: If control (arg2) is 0, send arg0, else send arg1
// ROS - Route on Signal: Push stored token out when input-1 is high
// ROZ - Route on 0: Forward data if control (arg1) == 0
// ROO - Route on 1: Forward data if control (arg1) == 1
// ROZ - Route on 0: Forward data if control (arg0) == 0
// ROO - Route on 1: Forward data if control (arg0) == 1
// ONEONAND - Test & Set: Emit a '1' if both inputs are 1, else drop the inputs and emit nothing TODO move to logic
// MERGE - Choose One: Forward first token to arrive
// RPT - Repeater:
// REPEATER - Repeater: If ctrl = 0, fwd buffer; if buffer empty, fill buffer and fwd; if ctrl = 1, fill buffer
// FILTER - Filter: Filter based on value (e.g. if filter 0s, forward all but 0s)
if( op == SEL ) {
if( arg2.valid_ == 1 ) {
switch( arg2.data_.to_ullong() ) {
Expand All @@ -292,12 +301,12 @@ class ControlProcessingElement : public ProcessingElement
return std::make_tuple(1, 0, arg0.data_);
} else {
do_forward_ = 0;
return std::make_tuple(0, 1, LlyrData(0x00));
return std::make_tuple(0, 0, LlyrData(0x00));
}
} else if( op == RNE ) {
if( arg1.valid_ == 1 ) {
if( arg0.data_ == arg1.data_ ) {
return std::make_tuple(0, 1, LlyrData(0x00));
return std::make_tuple(0, 0, LlyrData(0x00));
} else {
return std::make_tuple(1, 1, LlyrData(arg1.data_));
}
Expand All @@ -315,9 +324,9 @@ class ControlProcessingElement : public ProcessingElement
exit(-1);
}
} else if( op == ROO ) {
if( arg1.valid_ == 1 && arg1.data_ == 1 ) {
return std::make_tuple(1, 0, arg0.data_);
} else if( arg1.valid_ == 1 && arg1.data_ == 0 ) {
if( arg0.valid_ == 1 && arg0.data_[0] == 1 ) {
return std::make_tuple(1, 1, arg1.data_);
} else if( arg0.valid_ == 1 && arg0.data_[0] == 0 ) {
return std::make_tuple(0, 0, LlyrData(0xFF));
} else {
output_->verbose( CALL_INFO, 0, 0, "Error: invalid select signal.\n" );
Expand All @@ -326,7 +335,7 @@ class ControlProcessingElement : public ProcessingElement
} else if( op == ONEONAND ) {
if( arg0.valid_ == 1 && arg1.valid_ == 1 ) {
if( arg0.data_[0] && arg1.data_[0] ) {
return std::make_tuple(1, 1, LlyrData(0x01));
return std::make_tuple(1, 0, LlyrData(0x01));
} else {
return std::make_tuple(0, 0, LlyrData(0xFF));
}
Expand All @@ -337,13 +346,13 @@ class ControlProcessingElement : public ProcessingElement
} else if( op == GATED_ONE ) {
if( arg0.valid_ == 1 && arg1.valid_ == 1 ) {
if( arg0.data_[0] == 0 && arg1.data_[0] == 0 ) {
return std::make_tuple(1, 1, LlyrData(0x00));
return std::make_tuple(1, 0, LlyrData(0x00));
} else if( arg0.data_[0] == 0 && arg1.data_[0] == 1 ) {
return std::make_tuple(0, 0, LlyrData(0xFF));
} else if( arg0.data_[0] == 1 && arg1.data_[0] == 0 ) {
return std::make_tuple(1, 1, LlyrData(0x00));
return std::make_tuple(1, 0, LlyrData(0x00));
} else if( arg0.data_[0] == 1 && arg1.data_[0] == 1 ) {
return std::make_tuple(1, 1, LlyrData(0x01));
return std::make_tuple(1, 0, LlyrData(0x01));
} else {
return std::make_tuple(0, 0, LlyrData(0xFF));
}
Expand All @@ -365,15 +374,14 @@ class ControlProcessingElement : public ProcessingElement
return std::make_tuple(0, 0, LlyrData(0xFF));
} else if( arg0.data_ == 1 && arg1.data_ == 1 ) {
do_forward_ = 0;
return std::make_tuple(0, 1, LlyrData(0x00));
return std::make_tuple(0, 0, LlyrData(0x00));
} else {
return std::make_tuple(1, 1, LlyrData(arg1.data_));
}
} else if( op == REPEATER ) {
if( arg0.valid_ == 1 && arg0.data_ == 0 ) {
if( arg0.valid_ == 1 && arg0.data_[0] == 0 ) {
if( control_buffer_.size() > 0 ) {
output_->verbose( CALL_INFO, 0, 0, "RPTR AAAAAA\n" );

return std::make_tuple(1, 2, control_buffer_.front());
} else if( arg1.valid_ == 1 ) {
output_->verbose( CALL_INFO, 0, 0, "RPTR XXXXXXX\n" );
Expand All @@ -382,7 +390,7 @@ class ControlProcessingElement : public ProcessingElement
} else {
return std::make_tuple(0, 2, 0xFF);
}
} else if( arg0.valid_ == 1 && arg0.data_ == 1 ) {
} else if( arg0.valid_ == 1 && arg0.data_[0] == 1 ) {
if( arg1.valid_ == 1 ) {
output_->verbose( CALL_INFO, 0, 0, "RPTR NNNNNNN\n" );
control_buffer_.pop();
Expand Down Expand Up @@ -434,12 +442,6 @@ class ControlConstProcessingElement : public ControlProcessingElement
std::vector< QueueData > argList(3);
LlyrData retVal;

// FIXME lazy way to do a post-init so that the first token is free
// if( op_binding_ == ROS && first_touch_ == 1 ) {
// input_queues_->at(0)->data_queue_->push(LlyrData(0x00));
// first_touch_ = 0;
// }

if( output_->getVerboseLevel() >= 10 ) {
printInputQueue();
printOutputQueue();
Expand Down
7 changes: 3 additions & 4 deletions src/sst/elements/llyr/pes/logicPE.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ class LogicConstProcessingElement : public LogicProcessingElement
}
}

std::cout << " logic fucked a " << pending_op_ << " " << routed << std::endl;
pending_op_ = 0 | routed;

pending_op_ = 0 | routed;
//if there are values waiting on any of the inputs (queue-0 is a const), this PE could still fire
for( uint32_t i = 1; i < total_num_inputs; ++i ) {
if( input_queues_->at(i)->data_queue_->size() > 0 ) {
Expand All @@ -378,7 +378,7 @@ pending_op_ = 0 | routed;
std::cout << "++++++ Input Queue Size: " << input_queues_->at(0)->data_queue_->size();
std::cout << ", Num Inputs: " << num_inputs;
std::cout << ", Num Ready: " << num_ready << std::endl;
std::cout << " logic fucked b " << pending_op_ << std::endl;

//if all inputs are available pull from queue and add to arg list
if( num_inputs == 0 || num_ready < num_inputs ) {
output_->verbose(CALL_INFO, 4, 0, "-Inputs %" PRIu32 " Ready %" PRIu32 " Fire %" PRIu16 "\n", num_inputs, num_ready, cycles_to_fire_);
Expand Down Expand Up @@ -406,7 +406,6 @@ std::cout << " logic fucked b " << pending_op_ << std::endl;
}

// If data tokens in output queue then simulation cannot end
std::cout << " logic fucked c " << pending_op_ << std::endl;
pending_op_ = 1;

// first queue should be const, so save for later
Expand Down
7 changes: 4 additions & 3 deletions src/sst/elements/llyr/pes/processingElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ class ProcessingElement
std::cout << "(" << queueId << ") " << dstPe->getInputQueueSize(dstPe->getInputQueueId(processor_id_));
std::cout << ", max is " << queue_depth_ << std::endl;
if( dstPe->getInputQueueSize(dstPe->getInputQueueId(processor_id_)) < queue_depth_ ) {
output_->verbose(CALL_INFO, 8, 0, ">> Sending...%" PRIu32 "-%" PRIu32 " to %" PRIu32 "\n",
processor_id_, queueId, dstPe->getProcessorId());
output_->verbose(CALL_INFO, 8, 0, ">> Sending (%llu)...%" PRIu32 "-%" PRIu32 " to %" PRIu32 "\n",
output_queues_->at(queueId)->data_queue_->front().to_ullong(), processor_id_, queueId,
dstPe->getProcessorId());

sendVal = output_queues_->at(queueId)->data_queue_->front();
dstPe->pushInputQueue(dstPe->getInputQueueId(processor_id_), sendVal);
Expand Down Expand Up @@ -435,7 +436,7 @@ class ProcessingElement
for( uint32_t i = 0; i < total_num_inputs; ++i) {
bool routed = 0;
const std::string rtr_arg = *input_queues_->at(i)->routing_arg_;
std::cout << "\trtr_arg " << i << " -- " << rtr_arg << " (" << input_queues_->at(i)->forwarded_ << ")" << std::endl;
std::cout << "\trtr_arg " << i << " -- fwd " << rtr_arg << " (" << input_queues_->at(i)->forwarded_ << ")" << std::endl;
if( rtr_arg == "" || input_queues_->at(i)->forwarded_ == 1 ) {
std::cout << "continue" << std::endl;
continue;
Expand Down