Block move SETQ/Cordic related issue
ozpropdev
Posts: 2,792
in Propeller 2
Hi Chip
I've found an issue with the Cordic giving incorrect results when preceeded by a block move instruction pair.
I have to insert a spacer instruction between to get correct results.
The spacer instution can be any instruction.
It almost like a SETQ value of $FFFFFFFF is being passed into the cordic.
I went back to V18 FPGA image and the issue was there too.
Here's some example code for the P123 board to demonstrate the issue.
I've found an issue with the Cordic giving incorrect results when preceeded by a block move instruction pair.
I have to insert a spacer instruction between to get correct results.
The spacer instution can be any instruction.
It almost like a SETQ value of $FFFFFFFF is being passed into the cordic.
I went back to V18 FPGA image and the issue was there too.
Here's some example code for the P123 board to demonstrate the issue.
dat org loc pa,#\parms loc ptrb,#@mycode setq pa coginit #16,ptrb cogstop #0 dat orgh $400 parms long 60_000_000 'parameter block long 115200 long 63 long 62 org mycode bmask dirb,#15 'enable leds setq #3 rdlong parm1,ptra 'block move 4 longs nop '???? Needed for correct Cordic result ???? qdiv parm1,parm2 getqx outb 'show result on leds jmp #$ parm1 long 0 parm2 long 0 parm3 long 0 parm4 long 0
Comments
At the end of a cog-register block read or block write (SETQ+RDxxxx/WRxxxx), an extra clock cycle is spent to re-read the next instruction's S and D registers, since the block move had corrupted the RAM's data latches. This reading was being done for D, but not for S, due to some absent-mindedness on my part. I asserted the extra read signal on the other RAM port and a 9-bit address mux for the S register, and now the problem is fixed.
Here is a new 2-cog FPGA image for the Prop123-A9 board...
https://drive.google.com/a/parallax.com/file/d/0B9NbgkdrupkHUWNUSDc2XzkyTFE/view?usp=sharing
I'll take it for a spin when i'm back at my FPGA board tonight.
http://forums.parallax.com/discussion/167026/drvh-instruction-causes-dirx-issues
and
http://forums.parallax.com/discussion/167052/streamer-nco-rollover-event-misfire
Thanks for pointing this out. I knew there was at least one other thing that I have to chase next. But, now I remember there were, indeed, two things. I'll get to these in the morning. You just saved me a bunch of time by pointing these out. Thanks, again.
Google drive permissions need to be changed for allow access to this file.
Sorry about that. I clicked the wrong permission button. It should work now:
https://drive.google.com/file/d/0B9NbgkdrupkHUWNUSDc2XzkyTFE/view?usp=sharing
Thanks Chip
Thanks for your help in finding and testing bugs!