@@ -199,12 +199,11 @@ void shire_other_esrs_t::cold_reset(unsigned shireid)
199199{
200200 (void ) shireid;
201201 minion_feature = 0x01 ;
202- thread0_disable = 0xFE ; // Can be overriden by OTP(?)
202+ thread0_disable = 0xFE ; // Only start minion 0 hart 0.
203203 thread1_disable = 0xFF ;
204204 mtime_local_target = 0 ;
205205 clk_gate_ctrl = 0 ;
206- // TODO: no implemented yet
207- // debug_clk_gate_ctrl = 0;
206+ debug_clk_gate_ctrl = 0 ;
208207 // time_config = 0x28;
209208 // sm_config = 0;
210209}
@@ -386,22 +385,22 @@ uint64_t System::esr_read(const Agent& agent, uint64_t addr)
386385 case ESR_CLK_GATE_CTRL:
387386 return shire_other_esrs[shire].clk_gate_ctrl ;
388387 case ESR_DEBUG_CLK_GATE_CTRL:
389- // TODO: new, no spec
390- return 0 ;
388+ return shire_other_esrs[shire].debug_clk_gate_ctrl ;
391389 case ESR_DMCTRL:
392390 return agent.chip ->read_dmctrl ();
393391 case ESR_SM_CONFIG:
394- // TODO: implement Status Monitor in debug module
392+ // Status Monitor not implemented.
395393 return 0 ;
396394 case ESR_SM_TRIGGER:
395+ // Status Monitor not implemented.
397396 return 0 ; // WARL
398397 case ESR_SM_MATCH:
399398 case ESR_SM_FILTER0:
400399 case ESR_SM_FILTER1:
401400 case ESR_SM_FILTER2:
402401 case ESR_SM_DATA0:
403402 case ESR_SM_DATA1:
404- // TODO: implement Status Monitor in debug module
403+ // Status Monitor not implemented.
405404 return 0 ;
406405 }
407406 WARN_AGENT (esrs, agent, " Read unknown shire_other ESR S%u:0x%" PRIx64, shireid (shire), esr);
@@ -683,27 +682,18 @@ void System::esr_write(const Agent& agent, uint64_t addr, uint64_t value)
683682 shireid (shire), shire_other_esrs[shire].clk_gate_ctrl );
684683 return ;
685684 case ESR_DEBUG_CLK_GATE_CTRL:
686- // TODO: implement
687- // shire_other_esrs[shire].debug_clk_gate_ctrl = uint8_t(value & 0x2);
688- // LOG_AGENT(DEBUG, agent, "S%u:debug_clk_gate_ctrl = 0x%" PRIx8,
689- // shireid(shire), shire_other_esrs[shire].debug_clk_gate_ctrl);
685+ shire_other_esrs[shire].debug_clk_gate_ctrl = uint8_t (value & 0x1 );
686+ LOG_AGENT (DEBUG, agent, " S%u:debug_clk_gate_ctrl = 0x%" PRIx8,
687+ shireid (shire), shire_other_esrs[shire].debug_clk_gate_ctrl );
690688 return ;
691689 case ESR_DMCTRL:
692690 agent.chip ->write_dmctrl (uint32_t (value & 0xF400'000F ));
693691 LOG_AGENT (DEBUG, agent, " S%u:dmctrl = 0x%" PRIx32,
694692 shireid (shire), uint32_t (value & 0xF400'000F ));
695693 return ;
696694 case ESR_SM_CONFIG:
697- // TODO: implement Status Monitor in debug module
698- // shire_other_esrs[shire].sm_config = uint16_t(value & 0xFFF);
699- // LOG_AGENT(DEBUG, agent, "S%u:sm_config = 0x%" PRIx16,
700- // shireid(shire), shire_other_esrs[shire].sm_config);
701- return ;
702695 case ESR_SM_TRIGGER:
703- // TODO: implement Status Monitor in debug module
704- // shire_other_esrs[shire].sm_trigger = uint8_t(value & 0x1);
705- // LOG_AGENT(DEBUG, agent, "S%u:sm_trigger = 0x%" PRIx8,
706- // shireid(shire), shire_other_esrs[shire].sm_trigger);
696+ // No-op - emulator has no low level state information.
707697 return ;
708698 }
709699 WARN_AGENT (esrs, agent, " Write unknown shire_other ESR S%u:0x%" PRIx64, shireid (shire), esr);
@@ -754,7 +744,7 @@ void System::write_icache_prefetch(Privilege /*privilege*/, unsigned shire, uint
754744 (void )(value);
755745#else
756746 if (!shire_other_esrs[shire].icache_prefetch_active ) {
757- bool active = ((value >> 48 ) & 0xF ) && shire_other_esrs[shire].shire_coop_mode ;
747+ bool active = shire_other_esrs[shire].shire_coop_mode ;
758748 shire_other_esrs[shire].icache_prefetch_active = active;
759749 }
760750#endif
0 commit comments