Shop OBEX P1 Docs P2 Docs Learn Events
The unofficial P2 documentation project - Page 7 — Parallax Forums

The unofficial P2 documentation project

145791013

Comments

  • cgraceycgracey Posts: 14,151
    edited 2012-12-18 19:17
    Cluso99 wrote: »
    Chip:
    And these... Should SUBR, CMPSUB, INCMOD and DECMOD have R=1 ?

    Yes, as a default, R=1 for those instructions.
  • cgraceycgracey Posts: 14,151
    edited 2012-12-18 19:21
    jmg wrote: »
    can these have a granularity formula ? - and mins and inc sizes for ?
    Are all multi-task compatible ?
    I see this caveat
    PASSCNT This is intended as a non-pipeline-stalling alternative to WAITCNT, for use in multi-task programs.


    I do not quite follow the * 1 clock if task uses no more than every 4th time slot (4 clocks in single-task)

    something like : This takes X cycles + V*S*Tcy more, where Tcy is the sysClk period, S is the Slice multiplier and V is the variable time
    0..RealTime. ?

    PASSCNT takes 1 clock + as many clocks as there are instructions in the pipeline which belong to the same task as PASSCNT, which will need to be cancelled to support the branch. If no branch occurs, the instruction takes just 1 clock. I will clarify this later tonight when I make some more changes. Sorry about the ambiguity.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-12-18 20:21
    cgracey wrote: »
    Yes, as a default, R=1 for those instructions.
    Just to clarify, R must be 1 for these instructions SUBR, CMPSUB, INCMOD and DECMOD ? (iF 0 they do not decode correctly)
  • cgraceycgracey Posts: 14,151
    edited 2012-12-18 20:23
    Cluso99 wrote: »
    Just to clarify, R must be 1 for these instructions SUBR, CMPSUB, INCMOD and DECMOD ? (iF 0 they do not decode correctly)

    R may be 0, but then the result won't get stored. These are all set up as R=1 by default, but you could do an "nr" after the operands to stop D from being written.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-12-18 20:41
    Chip: I also presume that the instructions in opcode 000011 that do not have an operand (CACHEX, SYNCTRx, etc) have R=0 ?
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-12-18 20:43
    cgracey wrote: »
    R may be 0, but then the result won't get stored. These are all set up as R=1 by default, but you could do an "nr" after the operands to stop D from being written.
    Chip: Then how do you decode these instructions with R=0 as in my post above?
    eg
    [TABLE="class: cms_table, width: 1059"]
    [TR]
    [TD]111000[/TD]
    
    [TD]0[/TD]
    
    [TD]0[/TD]
    
    [TD]0[/TD]
    
    [TD]0[/TD]
    
    [TD]1111[/TD]
    
    [TD]DDDDDDDDD[/TD]
    
    [TD]SSSSSSSSS[/TD]
    
    [TD]SETINDS[/TD]
    
    [TD]D,S[/TD]
    
    [TD]Inc/Dec INDA by S and INDB by D (-256..+255) lower/higher=$000/$1FF[/TD]
    
    [/TR]
    
    [TR]
    [TD]111000[/TD]
    
    [TD]Z[/TD]
    
    [TD]C[/TD]
    
    [TD]R[/TD]
    
    [TD]I[/TD]
    
    [TD]CCCC[/TD]
    
    [TD]DDDDDDDDD[/TD]
    
    [TD]SSSSSSSSS[/TD]
    
    [TD]SUBR[/TD]
    
    [TD]D,[#]S[/TD]
    
    [TD]Subtract (reverse) D=S-D[/TD]
    [/TR]
    [/TABLE]
    
  • cgraceycgracey Posts: 14,151
    edited 2012-12-18 21:29
    Cluso99 wrote: »
    Chip: I also presume that the instructions in opcode 000011 that do not have an operand (CACHEX, SYNCTRx, etc) have R=0 ?

    That's right. For many instructions Z, C, and R make no sense, but in the master list I posted, if they are shown, it means they are flexible in hardware. When I document the instruction set, though, I'll show them as the assembler in PNUT.EXE assembles them, which is with those bits cleared.

    The reason the master list shows them as flexible is because it comes from the Verilog source. So, those are more or less notes to myself. In practice, many of those bits will be inflexibly cleared to 0.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-12-18 21:51
    cgracey wrote: »
    That's right. For many instructions Z, C, and R make no sense, but in the master list I posted, if they are shown, it means they are flexible in hardware. When I document the instruction set, though, I'll show them as the assembler in PNUT.EXE assembles them, which is with those bits cleared.

    The reason the master list shows them as flexible is because it comes from the Verilog source. So, those are more or less notes to myself. In practice, many of those bits will be inflexibly cleared to 0.
    Thanks Chip. I will add them as 0 in the spreadsheet summary. This way, they could be used as a 1 for a different instruction later. As you know, it is quite common for micros to have undocumented 'features' for unused codes.

    Have you had time to check my posts #180 & #187? I am quite concerned about the possibility of a decoding bug.
  • cgraceycgracey Posts: 14,151
    edited 2012-12-18 22:22
    Cluso99 wrote: »
    Thanks Chip. I will add them as 0 in the spreadsheet summary. This way, they could be used as a 1 for a different instruction later. As you know, it is quite common for micros to have undocumented 'features' for unused codes.

    Have you had time to check my posts #180 & #187? I am quite concerned about the possibility of a decoding bug.

    Don't worry. There's no decoding problem. There's just some problem with the doc's you've got. I'll look into this pretty soon...
  • SapiehaSapieha Posts: 2,964
    edited 2012-12-18 22:35
    Hi Chip.

    Much of that come from.

    Propeller2DetailedPreliminaryFeatureList-v2.pdf


    cgracey wrote: »
    Don't worry. There's no decoding problem. There's just some problem with the doc's you've got. I'll look into this pretty soon...
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-12-18 22:45
    Thanks Chip.

    Here is the latest instruction summary spreadsheet zipped
    P2_Instructions(12).zip
  • SapiehaSapieha Posts: 2,964
    edited 2012-12-18 22:49
    Hi Cluso.

    After reformatting of my PC -- I don't have any program to show Yours files

    Cluso99 wrote: »
    Thanks Chip.

    Here is the latest instruction summary spreadsheet zipped
    P2_Instructions(12).zip
  • cgraceycgracey Posts: 14,151
    edited 2012-12-18 22:53
    Cluso99 wrote: »
    Thanks Chip.

    Here is the latest instruction summary spreadsheet zipped

    Look in post #151 for my own list. That will clear up things, I think. Also, JP/JNP/JPD/JNPD use the D register contents to point to a single pin 0..127, instead of acting as a mask, like the spreadsheet shows.

    Tomorrow I hope to get more documentation done.

    Maybe I should break from all the complicated stuff and just document the obvious instructions for a while.
  • SapiehaSapieha Posts: 2,964
    edited 2012-12-18 23:02
    Hi Chip.

    I post my file I generate my PDF's from.

    Maybe that will be simpler to You to edit in it what are incorect.


    Corrected.

    cgracey wrote: »
    Look in post #151 for my own list. That will clear up things, I think. Also, JP/JNP/JPD/JNPD use the D register contents to point to a single pin 0..127, instead of acting as a mask, like the spreadsheet shows.

    Tomorrow I hope to get more documentation done.

    Maybe I should break from all the complicated stuff and just document the obvious instructions for a while.
  • SapiehaSapieha Posts: 2,964
    edited 2012-12-18 23:28
    Hi Chip.

    I see PropTool garbled little it.

    Will repost edited in some time

    Sapieha wrote: »
    Hi Chip.

    I post my file I generate my PDF's from.

    Maybe that will be simpler to You to edit in it what are incorect.
  • BEEPBEEP Posts: 58
    edited 2012-12-19 09:14
    Prop2_Docs.txt to Prop2_Docs.pdf

    pdf is obsolete and removed.
  • Ym2413aYm2413a Posts: 630
    edited 2012-12-19 09:52
    Thanks for putting this document together. : ]
    I'm going to start making it my night time reading material until the official documentation is released.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-12-19 17:07
    cgracey wrote: »
    Look in post #151 for my own list. That will clear up things, I think. Also, JP/JNP/JPD/JNPD use the D register contents to point to a single pin 0..127, instead of acting as a mask, like the spreadsheet shows.

    Tomorrow I hope to get more documentation done.

    Maybe I should break from all the complicated stuff and just document the obvious instructions for a while.
    Thanks Chip.
    I have updated JP etc. I see that the SETP etc use D in the same way (pin 0..127). Additionally SETP etc can use #n.
    This is different to the WAITPxx where the PORTA is used with a bit mask [#]S.

    Yes, perhaps getting the obvious ones done might be worthwhile. It will give your brain a break, and we all can get those easy ones out of the way in the docs.

    Should you have to redo the logic, I can see a couple of ways to slightly modify the decoding that would perhaps increase the P2 functionality. Just PM me if this happens - it is nothing complicated.

    BTW I have realised (just had a senior moment here) the subtle differences between CMPS / SUBS and CMPSX / SUBSX and their C flag results.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-12-19 22:43
    Here is the latest spreadsheet, updated with Chip's post #181. There were quite a number of bit changes to the zcri flags.

    All the lines in light blue have been verified to this post. Lines in pink (and other colors) are because there is something unverified or I don't understand something to summarize properly.

    Once again, I have zipped the spreadsheet.
    P2_Instructions(13).zip
  • Ym2413aYm2413a Posts: 630
    edited 2012-12-20 06:07
    Wonderful, Thank you Cluso. : ]
  • SapiehaSapieha Posts: 2,964
    edited 2012-12-20 18:08
    Hi Chip.

    Any new info updates?
  • ctwardellctwardell Posts: 1,716
    edited 2012-12-21 13:39
    We need to make changes the "Starting four tasks" example.
    The current example is showing normal jumps where it should be using JMPTASK.

    current:

    JMP #task0 'task 0 begins here when the cog starts (this JMP takes 4 clocks)
    JMP #task1 'task 1 begins here after task 0 executes SETTASK (this JMP takes 1 clock)
    JMP #task2 'task 2 begins here after task 0 executes SETTASK (this JMP takes 1 clock)
    JMP #task3 'task 3 begins here after task 0 executes SETTASK (this JMP takes 1 clock)

    suggested:

    JMPTASK #task1,#%0010 'task 1 begins here after task 0 executes SETTASK (%0010 = Set PC1)
    JMPTASK #task2,#%0100 'task 2 begins here after task 0 executes SETTASK (%0010 = Set PC2)
    JMPTASK #task3,#%1000 'task 3 begins here after task 0 executes SETTASK (%0010 = Set PC3)

    We don't need a JMPTASK for PC0 (task 0) because PC0 is already at the correct location after executing the JMPTASK for task3.

    It might be a good idea to point out the use of the quaternary (%%) prefix used by SETTASK, I initial thought that was a typo.

    Thanks,

    C.W.

    Note to Chip: Chip, this multiitasking is ssswwweeeeetttttttt.
  • cgraceycgracey Posts: 14,151
    edited 2012-12-21 16:14
    I've rewritten the "PIPELINE" section of my docs to give a blanket definition of self-modifying-code timing and branch timing. I didn't get any new instruction-level doc's done, but I tried to explain the pipeline so that people can understand its timing and apply it to any case, on their own:

    Prop2_Docs.txt
  • SeairthSeairth Posts: 2,474
    edited 2012-12-21 19:53
    I'd like to recommend that the instruction bit patterns be removed from the main document and limited to the reference document. I think this will make the main document easier to read and will also help to avoid consistency errors.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-12-21 20:16
    Seairth wrote: »
    I'd like to recommend that the instruction bit patterns be removed from the main document and limited to the reference document. I think this will make the main document easier to read and will also help to avoid consistency errors.

    I think now that we have a separate detailed assembler reference section that we could just drop this column and yes, it is bound to be inconsistent and certainly just creates extra work trying to maintain it. I will remove those columns in the main document then.

    BTW, good to see you back on board!
  • BEEPBEEP Posts: 58
    edited 2012-12-22 06:36
    Prop2_Docs.txt to Prop2_Docs.pdf

    pdf is obsolete and removed.
  • ctwardellctwardell Posts: 1,716
    edited 2012-12-22 14:08
    I noticed that the multitasking section list REPS/REPD as NOT supporting multitasking, however the REPS/REPD section give a multitasking example.

    I see in the latest copy of Chip's txt file that REPS/REPD are no longer listed as not supporting multitasking, so I assume the example showing them supporting mutlitasking is correct and we can remove REPS/REPD from the list of excluded instructions for multitasking.

    Can Chip verify this?

    Thanks,

    C.W.
  • Ym2413aYm2413a Posts: 630
    edited 2012-12-22 15:04
    What?! Multitasking! That's awesome! : ]
    I like how simple it is too. yet powerful. I can already think of a few uses for it.

    I was total unaware of any kind of hardware multitasking support on a single COG.
    Great work!
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-12-23 02:33
    There are some restrictions using the REPD/S instructions with multitasking because there is only 1 internal register used for the REPx instructions.

    However, the most simple use of multitasking per cog is using up to 4 tasks where each task is interleaved. This is performed by hardware. There are other possibilities too.

    Don't forget, it is possible to run multitasking one each and every cog!
  • SeairthSeairth Posts: 2,474
    edited 2012-12-23 21:21
    I'm still running up against the limitations of Google Docs. While looking around for a solution to the performance issues, I came across Google Cloud Connect (https://tools.google.com/dlpage/cloudconnect). Anyone here familiar with it? It seems to provide google drive/docs integration for MS Office documents and enables some level of collaboration in the process. And it looks like the word documents are still sharable for those who only want/need read-only access.
Sign In or Register to comment.