IREAD clock cycles not emulated correctly in SX Sim 2.06.02?
ichidan
Posts: 8
The manual says IREAD is a 4 cycle instruction, but the SX Sim emulates it as a 1 cycle instruction...
Is this a bug / old version / or am i wrong?
Is this a bug / old version / or am i wrong?
Comments
thanks for bringing this up. You did a nice job nicely animating your post - I like this!
SXSim - by no means - is free of bugs, so there is a good chance that the emulation for IREAD is wrong. I'll check this, and let you know the results soon.
BTW: Which version of SXSim are you using?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
---
James Newton, Host of SXList.com
james at sxlist,com 1-619-652-0593 fax:1-208-279-8767
SX FAQ / Code / Tutorials / Documentation:
http://www.sxlist.com Pick faster!
according to the SX20/28 and the SX48/52 datasheets, the IREAD instruction takes four cycles in turbo mode, and not just one. Interstingly, the Ubicom SX20/28 datasheet states that one cycle is taken in compatibility mode, and four in turbo mode. If you look at other instructions, like CALL, it states 2 for compatible and 3 for turbo mode, or for a MOV instruction, it states 1 for both modes. The explanation for this can be found in the dataseheet as well:
"The instruction execution time is derived by dividing the
oscillator frequency by either one (Turbo mode) or four
(Compatible mode). The divide-by factor is selected
through the FUSE Word register."
Nevertheless, this is a bit confusing, and should be corrected in a new version of the datasheet.
Back to IREAD, I assume that four cycles are correct in turbo mode as the complete instruction pipeline will be dicarded - so I'm going to fix that in SXSim.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
So I wrote a little test application, and I could verify that IREAD indeed takes four clock cycles. So I'll fix SxSim accordingly.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
---
James Newton, Host of SXList.com
james at sxlist,com 1-619-652-0593 fax:1-208-279-8767
SX FAQ / Code / Tutorials / Documentation:
http://www.sxlist.com Pick faster!