Menu

#21 Decoder fail

2.0-beta1
open
nobody
5
2006-05-05
2006-05-05
No

Hi!

I'm modeling the Freescale's ColdFire processor and it
has the following instructions:

EXTB.L:

Format:

ac_format Type_SHIFT = "%op:4 %count:3 %dir:3 %type:3
%reg53:3";

Decoder:

extbL.set_decoder(op=0x04, count=0x04, dir=0x07,
type=0x00);

LEA.L:

Format:

ac_format Type_ADD = "%op:4 %reg23:3 %opmode33:3 %ea:6";

Decoder:

leaL.set_decoder(op=0x04, opmode33=0x07);

My cross compiler generated the following:

11c: 49c0 extbl %d0

and my model does:

DBG: ----- PC=0x11c ----- 11
DBG: LEA.L <%ea>, %Ax 0 4 begin
DBG: <%ea> --> A4
DBG: Effective Address = 0
DBG: A4 = -1208643616
DBG: A4 = 0
DBG: LEA.L <%ea>, %Ax 0 4 end

The problem is that the decoder only recognizes the
LEA.L instruction because the begining (2 first bytes)
of the instructions is the same.
I already faced this problem with other two
instructions and resolved it by changing the
instruction format of one of those, but in this case, a
change like this take off all the semantics envolved on
the format...it will make my model harden to understand.

Discussion

  • Alexandro

    Alexandro - 2006-05-08

    Logged In: YES
    user_id=1489337

    Hello Andre,

    Which 'set_decoder' is specified first in your model: extbL
    ou leaL ? You should declare extbL first because the order
    in which 'set_decoder's are specified matters in the
    decoding process. If you put leaL before extbL, the decoder
    will always accuse the instruction leaL.

    Regards,
    Alexandro.

     
  • André Luiz Cardoso

    Logged In: YES
    user_id=1491895

    Hi Alexandro,

    In my original coldfire_isa.ac file, the leaL was specified
    first. I tried to put the extbl first, in fact I changed it
    to be the first instruction declared, but the problem persists.
    Do you have any suggestions to solve this?
    I think that the order of declaration shouldnt matter in
    this case...

    Thanks.
    Sorry about my english...

     

Log in to post a comment.