Problems with latest FPGA release
ozpropdev
Posts: 2,792
Sorry Chip,
I'm still having issues with LOCBASE in the new release (24 March 2014)
Expected return result should be $E20 and returns $20.
Brian
I'm still having issues with LOCBASE in the new release (24 March 2014)
Expected return result should be $E20 and returns $20.
TYPE: 57 VALUE: 04000E20 NAME: TEST_DATA bug1 locbase test_index,@@test_data
LOCBASE converts a 16-bit hub instruction address into a normal 18-bit hub address for use with RDxxxx/WRxxxx instructions: LOCBASE D,@relative9 'get 18-bit hub address from 9-bit relative address into D LOCBASE D,@@relative16 'get 18-bit hub address from 16-bit relative address into D LOCBASE D,S 'get 18-bit hub address from S[15:0] into DCheers
Brian
Comments
Brian, I'll look at this right away when I get into the shop this morning. Maybe I didn't solve the whole problem. I actually didn't even test it, myself, because it seemed so obvious to me what the problem had been. That was a mistake! I'm sorry. We'll have this working in the next several hours.
I also want to see if I can get COGNEW to fail like potatohead experienced.
I re-ran the LOCLONG tests from yesterday and they DO PASS now, so that hardware fix was good.
What we are left with is an assembler issue handling @@ properly. I'm working on this now...
The assembler seems to be fine, after all.
If, in your example, 'test_data' was declared under an ORG (instead of an ORGH), it would be a cog address, and not a hub address. That would explain what's going on. You'd need to declare it under an ORGH to make it work right.
BUT how about if I write in ORG declare but will address HUB @@SD_Table
The only thing that has to be under an ORGH is the data that will be accessed via RDxxxx/WRxxxx instructions, since you can't use RDxxxx/WRxxxx to access cog RAM - only hub RAM.
That was it. I assumed that all addresses would be "treated" as HUB addresses.
So the lesson here is for data in "COG" mode use the conventional way of reference
and for "HUB" mode use the new Got it.
Cheers
Brian
Post Edit: Cheers
[/code]
There should be a way - a prefix of some sort - of obtaining the hub address corresponding to where the long was loaded from in the hub.
Given that '##' is already used for large constants/addresses for other instructions, how about having PNut understand that
LOCBASE myreg,##mydata means use the hub address corresponding to mydata's cog location, and perhaps even
LOCBASE myreg,@@mydata for the relative equivalent?
I can see wanting to use longs "underlying" a cog in the hub.
COG and HUB mode that is OK.
BUT how I address that in MIXED mode?
I agree. I need to make a flag for the constant resolver in the assembler, so that when one of these LOCxxxx instructions is looking for data, it always uses the hub address, and never the cog address.
Is it possible in future FPGA releases to have a release date or version id readable by Pnut to verify current loaded version.
Jumping back and forth from different releases to cross check tests can sometime get confusing.
This also applies to Pnut as well to match the loaded FPGA release. This would help greatly.
Cheers
Brian
I'll start using the ROM Monitor intro message for that, and match it with the associated PNut.
I did that a few times so I re-named all of my pnut.exe files to include the version numbers.
Tested with ozpropdev's toobox. found him using a PUSHB opcode not in the last list of opcodes.
Is PUSHB still valid?
Enjoy!
Mike
All those pushes and pops are still there.
PUSHB is possibly WRLONG D/#,PTRB-- because B works in reverse
PUSHX is possibly WRAUX D/#,PTRX++
PUSHY is possibly WRAUX D/#,PTRY--
POPA is possibly RDLONG D,PTRA--
etc
You might like to start a new thread and give us the details of the online editor. I have only partly followed your progress on the P1 thread.
Looks like I lost it while extracting the opcodes from the post.
will update the editor soon.
Enjoy!
Mike
Yes. It is on the P1 thread since it uses OpenSpin converted to JavaScript by @Heater. And OpenSpin does not yet compile P2 code. But hopefully it will at some point.
Funny times ahead.
Enjoy!
Mike
Only PTRY was made to have any reverse behavior (via CALLY/RETY), so the PTRA/PTRB pushes and pops are all normal:
PUSHA D/# is WRLONG D/#,PTRA++
PUSHB D/# is WRLONG D/#,PTRB++
PUSHX D/# is WRAUX D/#,PTRX++
PUSHY D/# is WRAUX D/#,--PTRY
POPA D is RDLONG D,--PTRA
POPB D is RDLONG D,--PTRB
POPX D is RDAUX D,--PTRX
POPY D is RDAUX D,PTRY++
Thanks Chip.
When the cog starts, all PTR A/B/X/Y are reset to 0, so we can use PTRX/Y immediately without the need to reset the values???
ie So a PUSHX will put into AUX at $00 and a PUSHY will put into $FF ???
That's all correct about PTRX/PTRY, but you probably just forgot about PTRA being the parameter and PTRB pointing to where the program was loaded or execution began.
A different question... when starting a new cog with COGNEW/COGNEWX it returns the cog# in the D operand if the start was successful. If the COGNEWx was preceeded with a TARG instruction would this work... I presume the TARGOFF will be required if the cog was not started (no cogs available) because in that case, D would not have been written ???
As long as COGNEW D/# uses D and not #, a value will be written, regardless of success or not. So, TARG could be used to redirect the result.