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

feat(rp2040): add missing opcodeXXX #18

Merged
merged 7 commits into from
May 11, 2021
Merged

feat(rp2040): add missing opcodeXXX #18

merged 7 commits into from
May 11, 2021

Conversation

Turro75
Copy link
Contributor

@Turro75 Turro75 commented May 11, 2021

No description provided.

During debugging I found sometimes the LR register has LSB reset to 0 while on a real Pico at the same position it is always set as 1.
This also matches the armv6-m reference manual pag 113-114.
@urish
Copy link
Contributor

urish commented May 11, 2021

Thank you! Can you also update the tests (rp2040.spec.ts) to use these functions instead of the hard-coded opcodes?

@@ -809,7 +825,7 @@ describe('Cortex-M0+ Instruction Set', () => {

it('should execute a `lsls r5, r5, #18` instruction with carry', async () => {
await cpu.setPC(0x20000000);
await cpu.writeUint16(0x20000000, 0x04ad); // lsls r5, r5, #18
await cpu.writeUint16(0x20000000, opcodeLSLSimm(r5,r5,18)); //)0x04ad); // lsls r5, r5, #18
Copy link
Contributor Author

Choose a reason for hiding this comment

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

duplicated test?

Copy link
Contributor

Choose a reason for hiding this comment

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

This one has carry (see the last assertion in this test)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@@ -786,7 +802,7 @@ describe('Cortex-M0+ Instruction Set', () => {

it('should execute a `lsls r5, r5, #18` instruction', async () => {
await cpu.setPC(0x20000000);
await cpu.writeUint16(0x20000000, 0x04ad); // lsls r5, r5, #18
await cpu.writeUint16(0x20000000, opcodeLSLSimm(r5,r5,18));// 0x04ad); // lsls r5, r5, #18
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also remove the comment with the opcode at the end of the line?

We no longer need those since you can see the name and arguments of the opcode in the function call

@urish urish merged commit 9198f6a into wokwi:master May 11, 2021
urish added a commit that referenced this pull request May 13, 2021
format code from last two commits from Turro75:
- 9198f6a (#18)
- faccc9b (#23)
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