Andes Workshop

It is currently Tue Sep 26, 2017 7:58 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: lbi $r0, [$r0+0] (全部為0的指令)(ALZ用途)
PostPosted: Wed Feb 22, 2012 12:15 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
0x00000000在Andes Core裡也是一個指令,
lbi $r0, [$r0+0]

如果user希望在00000000發生時通知,(因為可能有異常)
可以打開ALZ這個bit。

以下是ISA manual裡的說明:
“LBI R0, [R0+0]” baseline version 2 special behavior –
This instruction will become a Reserved instruction when the INT_MASK.ALZ (INT_MASK[29]) is set to one. INT_MASK is also named as ir14. This special behavior can be used to debug a system. When this special behavior is used, compiler and assembler should avoid generating this instruction.

下面是SPA Manual裡的說明。
Attachment:
alz1.gif
alz1.gif [ 46.82 KiB | Viewed 4346 times ]


Attachment:
alz2.gif
alz2.gif [ 21.53 KiB | Viewed 4346 times ]


ALZ 是提供一個特殊目的 debug 工具, 設計的用途是如果程式不明原因亂跑時, 如果執行到 All Zero Opcode reserved instruction (0x00000000), 可以盡快產生 exception. 否則如果程式亂跑又 fetch 到的 code 是 All Zero Opcode (一般 padding data 會塞 0x00 or 0xff ), 程式會視為正常狀況而繼續執行. 所以user可能無法知道程式的錯誤點.

但是, All Zero Opcode 也是一個合法指令 (LBI R0, [R0+0]), 因此在正常的 program 下, ALZ bit 是要 disable. 否則會造成一遇到lbi $r0, [$r0+0]就發exception。如果沒有特殊情形,建議把 ALZ disable.


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group