diff options
| author | Aaron Barnes <[email protected]> | 2021-05-09 13:11:39 -0400 |
|---|---|---|
| committer | Aaron Barnes <[email protected]> | 2021-05-09 13:11:39 -0400 |
| commit | 553346445486367799d4d67bf3537e54b7c83859 (patch) | |
| tree | 3246c6b2f4c5f06b08250fd6b1ee63f08fb93231 | |
| parent | 1ee03f0116511ac3c2d6ac7688d916191f4f0a6b (diff) | |
parition CU allocation, add prints
| -rw-r--r-- | src/abstract_hardware_model.h | 12 | ||||
| -rw-r--r-- | src/gpgpu-sim/shader.cc | 25 |
2 files changed, 34 insertions, 3 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h index c012de0..636052a 100644 --- a/src/abstract_hardware_model.h +++ b/src/abstract_hardware_model.h @@ -1315,7 +1315,17 @@ class register_set { } return false; } - + unsigned get_ready_reg_id() { + // for sub core model we need to figure which reg_id has the ready warp + // this function should only be called if has_ready() was true + assert(has_ready()); + for (unsigned i = 0; i < regs.size(); i++) { + if (not regs[i]->empty()) { + return i; + } + } + abort(); + } void move_in(warp_inst_t *&src) { warp_inst_t **free = get_free(); move_warp(*free, src); 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; |
