2011-09-26 10:59:30     simulator beahving different than hardware

Document created by Aaronwu Employee on Oct 16, 2013
Version 1Show Document
  • View in full screen mode

2011-09-26 10:59:30     simulator beahving different than hardware

Kai Iskratsch (AUSTRIA)

Message: 103544   


Recently i ran into 2 situations where i found the simulator to have different behaviour than our BF527 hardware. Both appeared in hand optimized assembler code. (useing the 2010R1 bfin-elf baremetal toolchain)




first was the combination of vit_max command with a paralell store of the result register.


something like this:


R0.L=VIT_MAX(R0) || W[P0++P1] = R0.L ;


which we used as part of an optimized loop. On hardware like expected this stores the old value of R0.L and then sets R0.L to the result. in simulator this stored the new result value.




the 2nd case was in some inline asm macro where i used Status Bit Moves to apply logic operations.


I think the exact code was:






on the hardware this would set CC to 1 if the result of the last operation which modified status bits was <= 0


but in thew simulator it seems that AZ bit was set by the status bit move to cc - so if an was true a 1 was moved and az was set to 0, and if an was false a 0 was moved and az got set to 1.




2011-09-28 23:21:57     Re: simulator beahving different than hardware

Mike Frysinger (UNITED STATES)

Message: 103604   


i think your asm example is broken.  VIT_MAX needs an (ASL) or (ASR) modifier after it.  that said, there is a bug in the sim when using VIT_MAX in parallel insns.  but this is fixed now in trunk.


as for the status bits, we'll need an actual example.  we've written quite a number of tests related to the ASTAT handling, so in general, i'm fairly confident in them.