
Difference between s30-4  and s30-5

s30-4.zip  is the latest version described on the page project/s30
s30-5.zip  is the newer one (than s30-4) used in the lecture dsys/2017/code-s30

The difference is the instructions "intx #c" and "wfi" used in intercore messaging.

s30-4 on the project page described intx as "not" causing the interrupt.  The "wfi" just stops the core and wait for "intx".  When "intx" occurs the core resumes the execution of the next instruction.

s30-5 on the lecture dsys/2017 has different behaviour (semantic).  "intx" immitate the behavior of an interrupt (software interrupt).  The core executes "wfi" and it stops and waits for interrupt.  Other core issues "intx" which causes the receiver core to act like it has been interrupt.  So, it goes to interrupt service routine.  

Now these are two different behaviors.  I have to think about which one to be adopted.  

One concern is that this will interfere with the original interrupt (and its "sleep and wait for interrupt").  In fact, "wfi" is the same as "swi" (in the low power programming).  So, if we want intx/wfi to be similar to software interrupt (which is good for consistency), we have to find a way to make them work together with "int" and "swi". Or, should we make "wfi" and "swi" the same?

If we want intx/wfi to be different and behave like message passing then may be we should use more appropriate name (such as wait/signal) so that it is not like interrupt. But this kind of mechanism will be "alien" to the hardware design.

Another small improvement on s30-5 is that the assembler has been update to recognise "ei" and "di". The sim30 knows about these instruction as well.

The consideration will be left for future design of s30.

31 October 2017

to resolve confusion swi/wfi I decide to use two-core sync wfi/intx  in a different way than being an interrupt.  I rename wfi/intx  to  waitx/sigx.  waitx puts the core into a wait state.  sigx #c  sends intercore signal to the core #c and "wake up" core #c to resume its execution.  Now, waitx/sigx is distinc and intercore signal is NOT an interrupt.  Therefore, it is not to be confused with swi.

s30 simulator has not completely implement the interrupt.  There is no "timer" to issue interrupt regulary.  There is also no way to enable/diable individual interrupt. ei/di should be ei(n)/di(n) where n is 0..3 (int0..int3).  As it is now ei/di enable/disable the core (not discriminate 0..3).

6 Nov 2017
   