WAITPNE: a missed opportunity?
Phil Pilgrim (PhiPi)
Posts: 23,514
When using the waitpne d,s instruction, it's almost always necessary to know which bits caused the mismatch. One can always read ina, of course, and with s, and xor with d, but that won't always yield the correct information. The problem comes if ina changes again between the waitpne and the read of ina. Plus, if you want to reuse the same waitpne, you've got to rewrite d with the current state.
Wouldn't it have been neat if waitpne d,s wr did all that for you? d would not only be rewritten automatically, but with the actual state of ina & s that caused the waitpne to terminate, not something that gets read later. But, alas, executing waitpne d,s wr results in d += s+1! I'm not sure if this was an accident, an oversight, or a "running out of silicon" problem. Perhaps the more useful behavior will be included in the Prop II.
-Phil
Wouldn't it have been neat if waitpne d,s wr did all that for you? d would not only be rewritten automatically, but with the actual state of ina & s that caused the waitpne to terminate, not something that gets read later. But, alas, executing waitpne d,s wr results in d += s+1! I'm not sure if this was an accident, an oversight, or a "running out of silicon" problem. Perhaps the more useful behavior will be included in the Prop II.
-Phil
Comments
In fact, once again IIRC, the wr bit is used to differentiate the read and write to hub. Very smart indeed.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
-Phil
However, I think there's more to it than simply running out of silicon. I suspect the WAITPNE / WAITPEQ logic is handled outside of the ALU path, so it doesn't have access to the result bus. (Although the hub instructions write a result.) There also may be pipeline issues if the wait states happen after the write result state.
I wouldn't be sure that WC is the INA/INB flag - I bet Chip did intend on using the Carry bit. (Although I agree that using WC would have been easier from a coding perspective.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: Forum
NTSC & PAL driver templates: ObEx Forum
OnePinTVText driver: ObEx Forum
-Phil
Once you start to do an emulation of the prop op codes and flags (I started on a Spartan 3A FPGA), you see that Chip is/was extremely smart in how he designed the prop. It's a pitty other micros were not done with the same foresight, especially the Intel 80x86 family !!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
-Phil
Addendum: This really bothers me. Nowhere else is the carry flag — a state variable that can be set gosh knows where — used implitictly to determine the operands of an instruction. It runs against the grain of the entire architecture.
Post Edited (Phil Pilgrim (PhiPi)) : 10/5/2009 3:22:36 AM GMT
Why do I know this... The spin interpreter uses the carry flag to select INA and INB. There is no change required to the ROM for a Prop IB.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
-Phil
Maybe we will find out some day.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm