Skip to contentSkip to conversation

New documentation for the LatticeMicro32 target

Qemu-devel In review Programmingkid 6 participants 13 messages Jul 9, 2017 – May 10, 2018

lore
Share & tools
lore
#0 lore raw

I just made a documentation page for the LatticeMicro32 target. I need to know its current status, how much of this system is implemented, what software runs on it. If anyone could supply more information that would be appreciated. Pictures of this target running would be great as well. Thanks.

Here is the page: http://wiki.qemu.org/Documentation/Platforms/LatticeMico32

#1 lore raw

Am 2017-07-09 17:39, schrieb Programmingkid:

Quoted 7 lines

I just made a documentation page for the LatticeMicro32 target. I need to know its current status, how much of this system is implemented, what software runs on it. If anyone could supply more information that would be appreciated. Pictures of this target running would be great as well. Thanks.

Here is the page: http://wiki.qemu.org/Documentation/Platforms/LatticeMico32

Hi,

thank you for your efforts. I have to admit that the current status is unknown.

I've just compiled the latest head and it looks like the BQL is missing for the interrupt helpers. I'll post a patch soon. With the patch, the basic stuff is working but there seems to be an issue with OpenGL.

You can read the quickstart instructions at:
http://milkymist.walle.cc/README.qemu

The flash image isn't working because it will boot right into the visualization mode, which is using the OpenGL stuff. The "-kernel flickernoise" method is working though. You can get the flickernoise binary at:
http://milkymist.walle.cc/updates/current/flickernoise

Besides the milkymist emulation, there is plain lm32 emulation based on the Lattice reference design which should be ok, because the tests are working (make -C tests/tcg/lm32 check)

-michael

#2 lore raw
Quoted 20 lines · Michael Walle

Am 2017-07-09 17:39, schrieb Programmingkid:

Quoted 6 lines

I just made a documentation page for the LatticeMicro32 target. I need to know its current status, how much of this system is implemented, what software runs on it. If anyone could supply more information that would be appreciated. Pictures of this target running would be great as well. Thanks.
Here is the page: http://wiki.qemu.org/Documentation/Platforms/LatticeMico32

Hi,

thank you for your efforts. I have to admit that the current status is unknown.

I've just compiled the latest head and it looks like the BQL is missing for the interrupt helpers. I'll post a patch soon. With the patch, the basic stuff is working but there seems to be an issue with OpenGL.

You can read the quickstart instructions at:
http://milkymist.walle.cc/README.qemu

Quoted 6 lines

The flash image isn't working because it will boot right into the visualization mode, which is using the OpenGL stuff. The "-kernel flickernoise" method is working though. You can get the flickernoise binary at:
http://milkymist.walle.cc/updates/current/flickernoise

Besides the milkymist emulation, there is plain lm32 emulation based on the Lattice reference design which should be ok, because the tests are working (make -C tests/tcg/lm32 check)

-michael

Thank you for all this information. It has been added to the wiki page.

#3 lore raw
Quoted 23 lines · Programmingkid
Quoted 21 lines · Michael Walle

Am 2017-07-09 17:39, schrieb Programmingkid:

Quoted 6 lines

I just made a documentation page for the LatticeMicro32 target. I need to know its current status, how much of this system is implemented, what software runs on it. If anyone could supply more information that would be appreciated. Pictures of this target running would be great as well. Thanks.
Here is the page: http://wiki.qemu.org/Documentation/Platforms/LatticeMico32

Hi,

thank you for your efforts. I have to admit that the current status is unknown.

I've just compiled the latest head and it looks like the BQL is missing for the interrupt helpers. I'll post a patch soon. With the patch, the basic stuff is working but there seems to be an issue with OpenGL.

You can read the quickstart instructions at:
http://milkymist.walle.cc/README.qemu

Quoted 9 lines
Quoted 6 lines

The flash image isn't working because it will boot right into the visualization mode, which is using the OpenGL stuff. The "-kernel flickernoise" method is working though. You can get the flickernoise binary at:
http://milkymist.walle.cc/updates/current/flickernoise

Besides the milkymist emulation, there is plain lm32 emulation based on the Lattice reference design which should be ok, because the tests are working (make -C tests/tcg/lm32 check)

-michael

Thank you for all this information. It has been added to the wiki page.

I just tried qemu-system-lm32 and it crashed.

Command-line: qemu-system-lm32 -M milkymist -kernel flickernoise

Error message: audio: Failed to create voice `mm_ac97.in'
**
ERROR: /accel/tcg/tcg-all.c:42:tcg_handle_interrupt: assertion failed: (qemu_mutex_iothread_locked()) Abort trap: 6

Host: Mac OS 10.12.5

#4 lore raw

Am 2017-07-17 17:18, schrieb Programmingkid:

Quoted 36 lines
Quoted 22 lines · Programmingkid
Quoted 21 lines · Michael Walle

Am 2017-07-09 17:39, schrieb Programmingkid:

Quoted 6 lines

I just made a documentation page for the LatticeMicro32 target. I need to know its current status, how much of this system is implemented, what software runs on it. If anyone could supply more information that would be appreciated. Pictures of this target running would be great as well. Thanks.
Here is the page: http://wiki.qemu.org/Documentation/Platforms/LatticeMico32

Hi,

thank you for your efforts. I have to admit that the current status is unknown.

I've just compiled the latest head and it looks like the BQL is missing for the interrupt helpers. I'll post a patch soon. With the patch, the basic stuff is working but there seems to be an issue with OpenGL.

You can read the quickstart instructions at:
http://milkymist.walle.cc/README.qemu

Quoted 9 lines
Quoted 6 lines

The flash image isn't working because it will boot right into the visualization mode, which is using the OpenGL stuff. The "-kernel flickernoise" method is working though. You can get the flickernoise binary at:
http://milkymist.walle.cc/updates/current/flickernoise

Besides the milkymist emulation, there is plain lm32 emulation based on the Lattice reference design which should be ok, because the tests are working (make -C tests/tcg/lm32 check)

-michael

Thank you for all this information. It has been added to the wiki page.

I just tried qemu-system-lm32 and it crashed.

Command-line: qemu-system-lm32 -M milkymist -kernel flickernoise

Quoted 7 lines

Error message: audio: Failed to create voice `mm_ac97.in' **
ERROR: /accel/tcg/tcg-all.c:42:tcg_handle_interrupt: assertion failed:
(qemu_mutex_iothread_locked())
Abort trap: 6

Host: Mac OS 10.12.5

As I said before, I guess the BQL is missing here. Try the following patch:

target/lm32/op_helper.c +4 -0
index 2177c8ad12..93b8d09794 100644
@@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc)
 
 void HELPER(wcsr_im)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_im(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 
 void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_ip(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 
 void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)

-michael

#5 lore raw
Quoted 50 lines · Michael Walle

Am 2017-07-17 17:18, schrieb Programmingkid:

Quoted 19 lines
Quoted 18 lines · Programmingkid
Quoted 8 lines · Michael Walle

Am 2017-07-09 17:39, schrieb Programmingkid:

Quoted 6 lines

I just made a documentation page for the LatticeMicro32 target. I need to know its current status, how much of this system is implemented, what software runs on it. If anyone could supply more information that would be appreciated. Pictures of this target running would be great as well. Thanks.
Here is the page: http://wiki.qemu.org/Documentation/Platforms/LatticeMico32

Quoted 9 lines

Hi,
thank you for your efforts. I have to admit that the current status is unknown.
I've just compiled the latest head and it looks like the BQL is missing for the interrupt helpers. I'll post a patch soon. With the patch, the basic stuff is working but there seems to be an issue with OpenGL. You can read the quickstart instructions at:
http://milkymist.walle.cc/README.qemu
The flash image isn't working because it will boot right into the visualization mode, which is using the OpenGL stuff. The "-kernel flickernoise" method is working though. You can get the flickernoise binary at:
http://milkymist.walle.cc/updates/current/flickernoise
Besides the milkymist emulation, there is plain lm32 emulation based on the Lattice reference design which should be ok, because the tests are working (make -C tests/tcg/lm32 check) -michael

Quoted 1 line

Thank you for all this information. It has been added to the wiki page.

Quoted 8 lines

I just tried qemu-system-lm32 and it crashed.
Command-line: qemu-system-lm32 -M milkymist -kernel flickernoise Error message: audio: Failed to create voice `mm_ac97.in' **
ERROR: /accel/tcg/tcg-all.c:42:tcg_handle_interrupt: assertion failed:
(qemu_mutex_iothread_locked())
Abort trap: 6
Host: Mac OS 10.12.5

As I said before, I guess the BQL is missing here. Try the following patch:

target/lm32/op_helper.c +2 -0
index 2177c8ad12..93b8d09794 100644
@@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc)
 
 void HELPER(wcsr_im)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
    lm32_pic_set_im(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 
 void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im)
 {

target/lm32/op_helper.c void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc)

Quoted 10 lines
target/lm32/op_helper.c +2 -1
+    qemu_mutex_lock_iothread();
    lm32_pic_set_ip(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 
 void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)
 
 
 
-michael

Thank you very much for the patch. It fixed the problem. Now I can take a picture of the screen and add it to the wiki page.

#6 lore raw
In reply to Michael Walle
Quoted 27 lines · Michael Walle

Am 2017-07-17 17:18, schrieb Programmingkid:

Quoted 11 lines

I just tried qemu-system-lm32 and it crashed.

Command-line: qemu-system-lm32 -M milkymist -kernel flickernoise

Error message: audio: Failed to create voice `mm_ac97.in' **
ERROR: /accel/tcg/tcg-all.c:42:tcg_handle_interrupt: assertion failed:
(qemu_mutex_iothread_locked())
Abort trap: 6

Host: Mac OS 10.12.5

As I said before, I guess the BQL is missing here. Try the following patch:

target/lm32/op_helper.c +2 -0
index 2177c8ad12..93b8d09794 100644
@@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc)
 
 void HELPER(wcsr_im)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_im(env->pic_state, im);
+    qemu_mutex_unlock_iothread();

target/lm32/op_helper.c void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc) · line 117

Quoted 10 lines
target/lm32/op_helper.c +2 -0
 }
 
 void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_ip(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 
 void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)

I just fell over this, it looks like this fix never made it into master.

Michael, could you submit this as a full patch with a commit message and signed-off-by, please? cc: [email protected] as well, since it fixes a "breaks the board completely" bug.

thanks
-- PMM

#7 lore raw

PATCH 1/1 lm32: take BQL before writing IP/IM register

Writing to these registers may raise an interrupt request. Actually, this prevents the milkymist board from starting.

---
 target/lm32/op_helper.c | 4 ++++
 1 file changed, 4 insertions(+)
target/lm32/op_helper.c +4 -0
index 30f670eee8..a766a1ece4 100644
@@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc)
 
 void HELPER(wcsr_im)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_im(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 
 void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_ip(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 
 void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)
Signature · 1 line
2.11.0
#8 lore raw

Re: [Qemu-devel] [PATCH] lm32: take BQL before writing IP/IM register

Hi Peter,

do you apply this patch? Or do I have to send a pull request?

-michael

Am 2018-01-09 18:01, schrieb Michael Walle:

Quoted 31 lines

Writing to these registers may raise an interrupt request. Actually, this prevents the milkymist board from starting.

---
 target/lm32/op_helper.c | 4 ++++
 1 file changed, 4 insertions(+)
target/lm32/op_helper.c +4 -0
index 30f670eee8..a766a1ece4 100644
@@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t 
 dc)
 
 void HELPER(wcsr_im)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_im(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 
 void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_ip(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 

void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)

#9 lore raw

Re: [Qemu-devel] [PATCH] lm32: take BQL before writing IP/IM register

Quoted 4 lines · Michael Walle

Hi Peter,

do you apply this patch? Or do I have to send a pull request?

Cc'ing Paolo.

Quoted 9 lines

-michael

Am 2018-01-09 18:01, schrieb Michael Walle:

Quoted 5 lines

Writing to these registers may raise an interrupt request. Actually, this prevents the milkymist board from starting.

Quoted 27 lines
Quoted 26 lines

---
 target/lm32/op_helper.c | 4 ++++

 1 file changed, 4 insertions(+)
target/lm32/op_helper.c +4 -0
index 30f670eee8..a766a1ece4 100644
@@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t
 dc)
 
  void HELPER(wcsr_im)(CPULM32State *env, uint32_t im)
  {
+    qemu_mutex_lock_iothread();
      lm32_pic_set_im(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
  }
 
  void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im)
  {
+    qemu_mutex_lock_iothread();
      lm32_pic_set_ip(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
  }
 

 void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)

#10 lore raw

Re: [Qemu-devel] [PATCH] lm32: take BQL before writing IP/IM register

Quoted 7 lines · Philippe Mathieu-Daudé
Quoted 4 lines · Michael Walle

Hi Peter,

do you apply this patch? Or do I have to send a pull request?

Cc'ing Paolo.

Please send a pull request.

Paolo

Quoted 39 lines
Quoted 9 lines

-michael

Am 2018-01-09 18:01, schrieb Michael Walle:

Quoted 5 lines

Writing to these registers may raise an interrupt request. Actually, this prevents the milkymist board from starting.

Quoted 27 lines
Quoted 26 lines

---
 target/lm32/op_helper.c | 4 ++++

 1 file changed, 4 insertions(+)
target/lm32/op_helper.c +4 -0
index 30f670eee8..a766a1ece4 100644
@@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t
 dc)
 
  void HELPER(wcsr_im)(CPULM32State *env, uint32_t im)
  {
+    qemu_mutex_lock_iothread();
      lm32_pic_set_im(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
  }
 
  void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im)
  {
+    qemu_mutex_lock_iothread();
      lm32_pic_set_ip(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
  }
 

 void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)

Reviewed-by on v1 1/1
#11 lore raw

Re: [Qemu-devel] [PATCH] lm32: take BQL before writing IP/IM register

In reply to Michael Walle
Quoted 5 lines · Michael Walle

Writing to these registers may raise an interrupt request. Actually, this prevents the milkymist board from starting.

Quoted 15 lines
---
 target/lm32/op_helper.c | 4 ++++
 1 file changed, 4 insertions(+)
target/lm32/op_helper.c +2 -0
index 30f670eee8..a766a1ece4 100644
@@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc)
 
 void HELPER(wcsr_im)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_im(env->pic_state, im);
+    qemu_mutex_unlock_iothread();

target/lm32/op_helper.c void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc) · line 117

Quoted 10 lines
target/lm32/op_helper.c +2 -0
 }
 
 void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_ip(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 
 void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)

--
Alex Bennée

#12 lore raw
In reply to Peter Maydell

Am 2018-01-09 12:58, schrieb Peter Maydell:

Quoted 5 lines

I just fell over this, it looks like this fix never made it into master.

Michael, could you submit this as a full patch with a commit message and signed-off-by, please? cc: [email protected] as well, since it fixes a "breaks the board completely" bug.

oops, sorry about that :(

-michael