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

util: add --debug-cycle to help debug print #256

Open
wants to merge 1 commit into
base: xs-dev
Choose a base branch
from

Conversation

jensen-yan
Copy link
Collaborator

it will enable print cycle in DPRINTF,
print tick is difficult to debug, print cycle helps, DPRINTF print like:
31635: system.cpu.branchPred: [c: 95] DecoupledBPUWithFTB::tick()
c: 95 means cycle, 95 = 31635 / 333, 333 is ticks for 1 cycle in 3GHz, use cpu->clockPeriod() is greater, but not all class have cpu member.

Change-Id: I0ff1f3e3290842e6ba110393705c003616103924

it will enable print cycle in DPRINTF,
print tick is difficult to debug, print cycle helps,
DPRINTF print like:
  31635: system.cpu.branchPred: [c: 95] DecoupledBPUWithFTB::tick()
c: 95 means cycle, 95 = 31635 / 333, 333 is ticks for 1 cycle in 3GHz,
use cpu->clockPeriod() is greater, but not all class have cpu member.

Change-Id: I0ff1f3e3290842e6ba110393705c003616103924
@tastynoob tastynoob requested a review from shinezyy January 9, 2025 06:33
Copy link
Contributor

@shinezyy shinezyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason that original dprintf printing ticks instead of cycles is that not all clockedobjects are in the same clock domain.

But it is much more convenient for CPU guys to use a CPU core clock (this is the reason of this patch).

To avoid magic 333, I suggest to add a new member function "cpuCycle()" to "clockedObject".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants