summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpgpu-sim')
-rw-r--r--src/gpgpu-sim/shader.cc25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index c6e7b8f..40120ec 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -3974,7 +3974,18 @@ void opndcoll_rfu_t::allocate_cu(unsigned port_num) {
for (unsigned j = 0; j < inp.m_cu_sets.size(); j++) {
std::vector<collector_unit_t> &cu_set = m_cus[inp.m_cu_sets[j]];
bool allocated = false;
- for (unsigned k = 0; k < cu_set.size(); k++) {
+ unsigned cuLowerBound = 0;
+ unsigned cuUpperBound = cu_set.size();
+ if(sub_core_model) {
+ // Sub core model only allocates on the subset of CUs assigned to the scheduler that issued
+ unsigned reg_id = (*inp.m_in[i]).get_ready_reg_id();
+ assert(cu_set.size() % m_num_warp_scheds == 0);
+ unsigned cusPerSched = cu_set.size() / m_num_warp_scheds;
+ cuLowerBound = reg_id * cusPerSched;
+ cuUpperBound = cuLowerBound + cusPerSched;
+ assert(0 <= cuLowerBound && cuUpperBound <= cu_set.size());
+ }
+ for (unsigned k = cuLowerBound; k < cuUpperBound; k++) {
if (cu_set[k].is_free()) {
collector_unit_t *cu = &cu_set[k];
allocated = cu->allocate(inp.m_in[i], inp.m_out[i]);
@@ -3984,7 +3995,7 @@ void opndcoll_rfu_t::allocate_cu(unsigned port_num) {
}
if (allocated) break; // cu has been allocated, no need to search more.
}
- break; // can only service a single input, if it failed it will fail for
+ //break; // can only service a single input, if it failed it will fail for
// others.
}
}
@@ -4098,6 +4109,16 @@ bool opndcoll_rfu_t::collector_unit_t::allocate(register_set *pipeline_reg_set,
void opndcoll_rfu_t::collector_unit_t::dispatch() {
assert(m_not_ready.none());
// move_warp(*m_output_register,m_warp);
+ // Print out which OC dispatched which warp sched id to which exec pipeline
+ std::cout << "Dispatched from OC: "
+ << this->get_id()
+ << "\t Warp_id: "
+ << m_warp->get_uid()
+ << "\t Sched_id: "
+ << m_warp->get_schd_id()
+ << "\tto execution register: "
+ << m_output_register->get_name()
+ << std::endl;
m_output_register->move_in(m_warp);
m_free = true;
m_output_register = NULL;