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

misc: fixed a perfcct error when pc greater than 0x80000000. #299

Merged
merged 3 commits into from
Feb 26, 2025

Conversation

zephyrols
Copy link
Collaborator

@zephyrols zephyrols commented Feb 21, 2025

pc is unsigned, but sqlite3 only supports signed integer [-2^63, 2^63-1], if real pc > 2^63-1, it will be stored as negative number, (negtive pc = real pc - 2^64), when read a negtive pc, real pc = negtive pc + 2^64.

pc is unsigned, but sqlite3 only supports signed integer [-2^63, 2^63-1], if real pc > 2^63-1, it will be stored as negative number, (negtive pc = real pc - 2^64), when read a negtive pc, real pc = negtive pc + 2^64.

Change-Id: Ia4a8fba82f07934963c197d8305c35b8d85ce737
@zephyrols
Copy link
Collaborator Author

zephyrols commented Feb 21, 2025

A script util/ClockAnalysis.py was added.

usage: ClockAnalysis.py [-h] [-p PERIOD] [-P {gem5,rtl}] [-s START_TICK] [-e END_TICK]
                        [-n NUM_INSTS] [--inter-gap] [--inner-gap] [--tool {perfcct,bbl}]
                        [--attention-pc ATTENTION_PC [ATTENTION_PC ...]]
                        [--start-pc START_PC] [--end-pc END_PC]
                        sqldb

positional arguments:
  sqldb                 Path to the SQLite database

options:
  -h, --help            show this help message and exit
  -p PERIOD, --period PERIOD
                        Number of ticks per clock cycle
  -P {gem5,rtl}, --platform {gem5,rtl}
                        Platform to analyze
  -s START_TICK, --start-tick START_TICK
                        Start tick to analyze
  -e END_TICK, --end-tick END_TICK
                        End tick to analyze
  -n NUM_INSTS, --num-insts NUM_INSTS
                        MAX Number of instructions to analyze
  --inter-gap           Analyze inter-gap
  --inner-gap           Analyze inner-gap
  --tool {perfcct,bbl}  Mode to analyze
  --attention-pc ATTENTION_PC [ATTENTION_PC ...]
                        Attention PC
  --start-pc START_PC   Start PC to analyze, a hex value start with 0x
  --end-pc END_PC       End PC to analyze, a hex value start with 0x

@zephyrols zephyrols reopened this Feb 21, 2025
@zephyrols zephyrols changed the title misc: fix perfcct too large pc store/read error. misc: fixed a perfcct error when pc greater than 0x80000000. Feb 21, 2025
@zephyrols zephyrols marked this pull request as ready for review February 21, 2025 18:47
Change-Id: Id7b2c7bb28203c1e7042677ff6030f0a117b89ee
Change-Id: I9940a9ce87382488548a37d9412c66093d82f6d6
@zephyrols zephyrols added calibration module calibration bug Something isn't working and removed calibration module calibration bug Something isn't working labels Feb 26, 2025
@zephyrols zephyrols merged commit a3ae66c into OpenXiangShan:xs-dev Feb 26, 2025
10 checks passed
@zephyrols zephyrols deleted the fix-perfcct branch February 26, 2025 08:59
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.

2 participants