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

back to back multiply, mtspr and multiply. #113

Open
JaewonHur opened this issue Jan 2, 2020 · 0 comments
Open

back to back multiply, mtspr and multiply. #113

JaewonHur opened this issue Jan 2, 2020 · 0 comments

Comments

@JaewonHur
Copy link
Contributor

JaewonHur commented Jan 2, 2020

When I input multiply, mtspr, multiply instructions sequentially, like this,

  b08e1111	l.muli	r4, r14, 0x1111
  c011f416	l.mtspr	r17, r30, 0xf416
  b2160001	l.muli	r16, r22, 0x0001

value in r30 is written to r22 due to the mtspr.
and next l.muli instruction uses r22's value in multiplication.

However, next l.muli instruction mistakenly brings old value of r22 because the write back of first l.muli instruction occupies register write port when mtspr should write.
Register read-write bypass can fix this situation but I saw ENABLE_BYPASS parameters in mor1kx_rf_cappuccino.v is set to 0.
Are there any reason for it?

The full input instructions are as follow.

  18000000	l.movhi	r0, 0x0000
  a8200001	l.ori	r1, r0, 0x0001
  c0000811	l.mtspr	r0, r1, 0x0811
  abc00000      l.ori   r30, r0, 0x0000
  aac00000      l.ori   r22, r0, 0x0000
  a8800000      l.ori   r4, r0, 0x0000
  a9c00000      l.ori   r14, r0, 0x0000
  aa200000      l.ori   r17, r0, 0x0000
  aa000000      l.ori   r16, r0, 0x0000
  afde0001      l.ori   r30, r30, 0x0001
  aed60002	l.xori	r22, r22, 0x0002
  b08e1111	l.muli	r4, r14, 0x1111
  c011f416	l.mtspr	r17, r30, 0xf416
  b2160001	l.muli	r16, r22, 0x0001
  15000000	l.nop	0x0
  15000000	l.nop	0x0
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

No branches or pull requests

1 participant