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

Enable HwbpManual #541

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lz-bro
Copy link
Contributor

@lz-bro lz-bro commented Mar 1, 2024

Change-Id: I2ee8718f03d6e381369b7d3bb0222563789ed525

@@ -710,6 +715,7 @@ def test(self):
self.gdb.p("$pc")
assertRegex(output, r"[bB]reakpoint")
assertIn("rot13 ", output)
self.gdb.stepi()
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need this stepi ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rot13(fox);
checksum ^= crc32a(fox, strlen(fox));
rot13(fox);
checksum ^= crc32a(fox, strlen(fox));

According to the program, I think that the breakpoint should be hit 2 times at rot13, and then hit at crc32a and _exit sequentially. So stepi avoids hitting the rot13 breakpoint at the same position as main

Copy link
Collaborator

@aap-sc aap-sc May 9, 2024

Choose a reason for hiding this comment

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

So stepi avoids hitting the rot13 breakpoint at the same position as main

I don't get it. What do you mean "at the same position as main" ? main and rot13 should have different addresses. When gdb issues a continue request it issues a single-step and then issues a real continue. The breakpoint at main should not be hit.

if value == tdata1:
value = self.gdb.p("$tdata1")
if value == tdata1 or \
(value >> (xlen-4) == 0x6 and \
Copy link
Collaborator

Choose a reason for hiding this comment

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

value >> (xlen-4) == 0x6 What is the purpose of this condition? If I read this right we explicitly ask for TYPE=2 trigger. How come we end up with TYPE=6?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The purpose is to be compatible with spec 1.0 and 0.13. On our hardware that supports spec 0.13, setting the TYPE to 2 trigger actually we end up with TYPE=6.

Copy link
Collaborator

Choose a reason for hiding this comment

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

can we instead just re-request type==6 if the resulting value of tdata1 is different? I believe this would enable us to support wide range of platforms in a more cleaner way.

@lz-bro lz-bro force-pushed the enable_HwbpManual branch 2 times, most recently from 4f5c95e to 785eee0 Compare May 7, 2024 11:19
@lz-bro
Copy link
Contributor Author

lz-bro commented Nov 1, 2024

@aap-sc hello,I have made some modifications to support wide range of platforms. Could you please review it.

@aap-sc
Copy link
Collaborator

aap-sc commented Nov 2, 2024

@lz-bro I think it would be better to leave set_manual_trigger and just perform 2 separate calls (for type2 and type6) passing the desired mask along the way (if type2/type6 triggers require a different mask). @en-sc would you kindly take a look too?

@lz-bro
Copy link
Contributor Author

lz-bro commented Nov 5, 2024

@lz-bro I think it would be better to leave set_manual_trigger and just perform 2 separate calls (for type2 and type6) passing the desired mask along the way (if type2/type6 triggers require a different mask). @en-sc would you kindly take a look too?

Thanks, I agree that perform 2 separate calls (for type2 and type6)

type_none = set_field(0, TDATA1_TYPE(self.hart.xlen),
TDATA1_TYPE_NONE)
if type_rb == type_match:
maskmax_rb = tdata1_rb & MCONTROL_MASKMAX(self.hart.xlen)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd sugest passing the mask to use before the comparison of tdata1 and tdata1_rb as an argument of set_manual_trigger()

@lz-bro
Copy link
Contributor Author

lz-bro commented Nov 6, 2024

@en-sc Passing both type_none and type_match as an argument of set_manual_trigger() ?Which parameter are you referring to as a function argument .
Or is the maskmax, If so, maskmax is preset, I cannot get it befor read tdata1

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