streamers/absolute addressing
rjo__
Posts: 2,114
in Propeller 2
I am not myself today and have fiddled with this far too long:) The idea is to transfer the lut to an absolute location in hubram... and then transfer it back again. I am using setq for the hub to lut transfer
and a rep loop for the lut to hub transfer, because I read that $FF bytes in the lut are not copied to hub ... so as to serve a masking role. I have tried a bunch of variants... here is a good example of what doesn't work for me.
and a rep loop for the lut to hub transfer, because I read that $FF bytes in the lut are not copied to hub ... so as to serve a masking role. I have tried a bunch of variants... here is a good example of what doesn't work for me.
hub2lut SETQ2 #511 'transfer Hubram to lut rdlong lutstart,##$3000 ret lut2hub mov z,#0 mov zz,##$3000 rep @.endtrans,##512 rdlut x, z wrlong x,zz add z,#1 add zz,#1 .endtrans ret
Comments
I am now getting meaningful data slung around... but when I do lut->hub-> lut... my data is being shifted down by about -77 locations.
So for example... the original data at lut index 80 is (byte 3->0)=0,0,22,197... after sending it to the hub and back... this value showed up in lut index 3.
And if I set the number of reps to ##512... my P2V goes completely nuts:)
Thanks
Rich
I would make exactly the same argument, based on heuristics. Many people are going to see setq and setq2 and assume they are the same... I like masking as selectable for both setq and setq2... but I'm sure Chip thought about this a long time ago. I want a P2 that Chip absolutely loves. In my mind, if he has something in mind for the masking, God bless him and masking:)
Did you actually confirm that ?
Sounds a little strange, but may be ok if that is an optional feature.
According to Chip's document, you can use SETQ2 (instead of SETQ) with WRLONG to write only non-FF values to the hub. There is no variant for copying from LUT to HUB.
EDIT: That post says filter mode is optional.
EDIT: That post was long before lut-hub block transfer was implemented...
A fairly cryptic suffix - '2' means the optional Skip write if 0xFF mode.
Block lut -> hub transfers would be very useful not only for bulk hub -> hub move but for cases where lut is used as scratch pad ram.
It sounds like we need a SETQ3!
I would say SETQ2 on WRLONG should be made to do the same as on RDLONG. Another instruction can be added to set the transfer mask and target and save them in hidden registers: This should also work for cogram via SETQ.
This would allow block hub writes from either cogram or lutram and allows for custom write masks for both cogram and lutram.
I think Chip answered a similar question a month or so back when he added SETQ2, but I can't remember what was said now.
I I agree that it would be better to have SETQ2 cause WRLONG to write LUT to hub.
CZ
00 : No mask (SETQ/SETQ2)
01 : Mask out $0000_0000 (SETQMZ/SETQMZ2)
10 : Mask out $FFFF_FFFF (SETQMF/SETQMF2)
11: ?? (No mask)
Or something like that...
Can you really WRLONG and RDLONG with LUT?
If there's enough bits to make LUT source and destination addressable, way can't we just use "MOV" on it?
I think I'm confused...
Basically, logical "OR" write mode.
Right now, you have to use RDLUT/WRLUT to move longs between cog and lut memory. Additionally, you can use SETQ2 with RDLONG to load lut memory directly from hub memory. There is no mechanism to use WRLONG between lut and hub. And we can't use MOV with LUT because it's conceptually located at $200-3FF.
The current suggestion is:
* Allow SETQ2 to be used with WRLONG to transfer from lut to hub. However, as this is already used for moving masked data from cog to hub, so this leads to the next part of the suggestion:
* Use C/Z bits in SETQ and SETQ2 to provide more general-purpose masking (in either direction between cog/hub and lut/hub).
The masking only works going into hub, since it has byte-level write control. Cog and LUT are long-only.
I think I see that you can use SETQ or SETQ2 with rdlong to load LUT with one long per clock.
Need to think about how SETQ2 could be used in practice...
Here is a code snippet that attempts to copy hub longs to the lut... twice in a row.
First it uses a repeat loop... which works fine... then it uses setq2... not so good. If I comment out only the setq2 line... everything is ok. If I comment out only the rep line but leave setq2... not so good.
they should do exactly the same thing...twice.
but they don't