Shop OBEX P1 Docs P2 Docs Learn Events
Propeller II update - BLOG - Page 105 — Parallax Forums

Propeller II update - BLOG

1102103105107108223

Comments

  • ctwardellctwardell Posts: 1,716
    edited 2013-11-30 19:00
    cgracey wrote: »
    Yes, that's right. We could even make it so a cog could offer its own slot to another cog before it takes the slot, itself.

    That is what I'd like to see when a COG sets the LSB to 0, it would always give up it's own slot and only use a donated slot.

    C.W.
  • potatoheadpotatohead Posts: 10,260
    edited 2013-11-30 19:02
    Agreed. (your message is too short, lol)
  • cgraceycgracey Posts: 14,133
    edited 2013-11-30 19:02
    Yanomani wrote: »
    Whatever it could be, I didn't yet had learned before, on the subject of written English, was suddenly injected in my mind, in the last hour or so.

    Improvements at blinking eyes pace!

    And the best part of it: there are no pals, trying to kill each other, simply by reading something about changes on the round robin scheme.

    Yanomani:smile:

    I think the controversy was bypassed when someone realized that each cog can keep its own slot, but when the slot is not used, someone else can have it - and this new behavior can be enabled - it's not automatic. So, standard round-robin access was not compromised. The secret sauce was not adulterated.
  • cgraceycgracey Posts: 14,133
    edited 2013-11-30 19:04
    ctwardell wrote: »
    That is what I'd like to see when a COG sets the LSB to 0, it would always give up it's own slot and only use a donated slot.

    C.W.

    A SETSLOT D/# value of %11111110 would mean 'any slot by my own'.
  • potatoheadpotatohead Posts: 10,260
    edited 2013-11-30 19:09
    Ok then.

    And of course, we need to plan for a "no-hub" COG, so that makes perfect sense. It gets used via Port D, or something.
  • cgraceycgracey Posts: 14,133
    edited 2013-11-30 19:11
    Looks good - but I wonder if instead of the eight 3 bit fields another eight bits might not suffice?

    ie lowest 8 bits = slots current cog can use

    next lowest 8 bits = slots of cogs that can "steal" this cogs slot.

    I am wondering if using relative cog indications will be difficult to document

    maybe it would be easier if COGID returned a cog bit mask instead ... ie %00000001 ... %10000000, a return of %00000000 would mean could not allocate cog

    then the cog references could be an absolute bit mask, allowing easier planning?
    other cog | this cog  
    can use   | claims
    76543210|76543210 cog id
    11111111|00000001 cog 1 says any cog can use its slot
    

    I like the bit mask, too, but it doesn't offer any prioritization.

    And, yes, eight 3-bit fields of relative cog numbers would be a pain to set up. Like in SETTASK, as soon as %000 was found in the offer order, that would mean anybody.

    Hey, maybe the 8-bit offer mask could be the top-priority, with everyone else being implied lower-priority. I think a single level of priority is all that is needed. Those not in the priority mask are flying stand-by.
  • ctwardellctwardell Posts: 1,716
    edited 2013-11-30 19:12
    potatohead wrote: »
    Ok then.

    And of course, we need to plan for a "no-hub" COG, so that makes perfect sense. It gets used via Port D, or something.

    Chip has you covered:

    "%00000000 just don't try to execute a hub instruction after setting this value - you'll hang."

    C.W.
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-11-30 19:13
    The forum sw blocks me from quoting when there is a percent sign embedded. I sit just my PC/IE10?

    re Chips post #3115 & others.

    I had thought that a cog could make its slot available to another specific cog, or the pool, when not required. But this makes existing drivers unfriendly to give up their unused slots.
    That is why I would think it better for a high priority cog to claim slots as low or high priority. If another cog claims the relevant slot as a priority, it now gets it. Tough luck - the programmer/sw just needs to handle this case.

    So I see each cog as enabling its ability to access other cogs free slots, and if it does so, then it can claim some of those as "I am highest priority". Its quite simple and basic.
    Only 1 cog will have priority, otherwise it is shared on a round-robbin basis from the cog# of the free slot.

    I don't really see the requirement for a cog to be able to yield its slot to another cog as priority. But if you think that's a good idea, then its another option.
  • potatoheadpotatohead Posts: 10,260
    edited 2013-11-30 19:14
    ctwardell wrote: »
    Chip has you covered:

    "000000 just don't try to execute a hub instruction after setting this value - you'll hang."

    C.W.

    Yes! I agreed with you, then saw Chip's post and realized it was already covered, meaning the original intent was the right intent, and that our side discussion really was just that.

    I didn't like, "if you do this, it will hang", but that's precisely what it should do. There is assembly language for you.
  • ctwardellctwardell Posts: 1,716
    edited 2013-11-30 19:16
    cgracey wrote: »
    I like the bit mask, too, but it doesn't offer any prioritization.

    And, yes, eight 3-bit fields of relative cog numbers would be a pain to set up. Like in SETTASK, as soon as %000 was found in the offer order, that would mean anybody.

    Hey, maybe the 8-bit offer mask could be the top-priority, with everyone else being implied lower-priority. I think a single level of priority is all that is needed. Those not in the priority mask are flying stand-by.

    We need some short-cut around the eight 3-bit fields, or some simple formula that is robust.

    How about make the values absolute instead of relative in both the mask and bitfields?

    It's going to take knowledge of what is loaded where anyway.

    C.W.
  • potatoheadpotatohead Posts: 10,260
    edited 2013-11-30 19:22
    That is what I was going to say. I don't think there is a formula without simplifying the model.

    We need a query instruction so that COGS can read the state of the HUB and potentially change behavior. Absolute bit fields will help sort this kind of thing out. And that all means people will need to just run specific COGS to have this all work for them, or leave the "slot offered" mode turned off.

    I like this. Was quite a shock for me. IMHO, priorities get complex. This way, the developer can plan and IMHO, should plan it all out.
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-11-30 19:27
    Do we really need to set anything at all?

    When a COG is waiting for the HUB I assume a flag is set. PENDING = TRUE
    When a HUB slot appears that is PENDING = FALSE, use it instead of waiting for the required slot.
    If COGS aren't used there automatically FREE slots for the other COGS.
    If all COGS are trying to access HIUB at the same time, normal default slots apply.

    This seems simple and automatic, or have I missed something?
  • ctwardellctwardell Posts: 1,716
    edited 2013-11-30 19:30
    ozpropdev wrote: »
    Do we really need to set anything at all?

    When a COG is waiting for the HUB I assume a flag is set. PENDING = TRUE
    When a HUB slot appears that is PENDING = FALSE, use it instead of waiting for the required slot.
    If COGS aren't used there automatically FREE slots for the other COGS.
    If all COGS are trying to access HIUB at the same time, normal default slots apply.

    This seems simple and automatic, or have I missed something?

    I think the goal is to have a way to make it deterministic if needed.

    C.W.
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-11-30 19:32
    ozpropdev wrote: »
    Do we really need to set anything at all?


    When a COG is waiting for the HUB I assume a flag is set. PENDING = TRUE
    When a HUB slot appears that is PENDING = FALSE, use it instead of waiting for the required slot.
    If COGS aren't used there automatically FREE slots for the other COGS.
    If all COGS are trying to access HIUB at the same time, normal default slots apply.

    This seems simple and automatic, or have I missed something?
    We have to maintain the existing 1:8 structure for deterministic code that may be bitbanging, etc. So we have to default back to the way it was.

    But, rather than just allocate the free slots on a first come basis, we want to be able to allocate it in at least a small priority, so that we can know that it will get at least a certain number of slots in 8, provided we control the cog(s) that must not use all their slots. This is the raw basics anyway.
  • cgraceycgracey Posts: 14,133
    edited 2013-11-30 19:33
    potatohead wrote: »
    That is what I was going to say. I don't think there is a formula without simplifying the model.

    We need a query instruction so that COGS can read the state of the HUB and potentially change behavior. Absolute bit fields will help sort this kind of thing out. And that all means people will need to just run specific COGS to have this all work for them, or leave the "slot offered" mode turned off.

    I like this. Was quite a shock for me. IMHO, priorities get complex. This way, the developer can plan and IMHO, should plan it all out.

    I think that if we had alterable priorities in the hub, some objects might get written someday to constantly reassign their own priority for some purpose, leading to flakiness. This would not be good. My gut tells me that slot assignment needs to be a private affair among participating cogs. Other cogs can live with their 1:8 slot timing and request more, but not tamper with others' priorities. There was something in the PC that I had to deal with once that was like this, and it was messy. I wish I could remember what it was.
  • potatoheadpotatohead Posts: 10,260
    edited 2013-11-30 19:33
    (determinsm)

    That is exactly the goal in my mind. People can write for the default case. Where more is needed, a programmer is going to have to sort through the COGS and free up that which is needed.
  • potatoheadpotatohead Posts: 10,260
    edited 2013-11-30 19:38
    cgracey wrote: »
    I think that if we had alterable priorities in thbiects might get writtensubay to constantly reassign their own priority for some purpose, leading to flakiness. This would not be good. My gut tells me that slot assignment needs to be a private affair among participating objects. Other objects can live with their 1:8 slot and request more, but not tamper with others' priorities. There was something in the PC that I had to deal with once that was like this, and it was messy.

    I agree with you.

    I meant alter their own behavior, such as lowering a bitrate, or offering a subset of their functionality, not alter how another COG is doing things.

    I like the model presented by the sets of bits. I don't think much of a general priority scheme.

    Edit: Maybe it is the best idea to keep it private. One cog could make an adjustment that affects behavior in another, etc... No query is best.
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-11-30 19:47
    cgracey wrote: »
    I think that if we had alterable priorities in the hub, some objects might get written someday to constantly reassign their own priority for some purpose, leading to flakiness. This would not be good. My gut tells me that slot assignment needs to be a private affair among participating cogs. Other cogs can live with their 1:8 slot timing and request more, but not tamper with others' priorities. There was something in the PC that I had to deal with once that was like this, and it was messy. I wish I could remember what it was.
    Yes, a cog should not be able to take another's slot unless that cog specifically yields it.
    We are only talking about if a cog can set a high or low priority to claim another cog's slot. Unless of course its available.

    So we are discussing how to implement the priority.
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-11-30 19:50
    ctwardell wrote: »
    I think the goal is to have a way to make it deterministic if needed.

    C.W.
    Cluso99 wrote: »
    We have to maintain the existing 1:8 structure for deterministic code that may be bitbanging, etc.

    The pace this forum is moving at has made the mind a bit foggy!

    At the moment we can't predict how many cycles a HUB instruction will take.
    So grabbing a FREE slot instead of the REAL slot doesn't change that.

    First glance a data collected with SETRACE shows pipeline STALL of varying cycles.
    I am talking multi-tasking of course. :)
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-11-30 19:58
    That (quoted below) could work too.

    Here is another thought.

    Basically, there are eight hub slots available.

    The prop is already good with nine bit values :-)

    Maybe we could have an eight entry table, sort of pseudo hub control registers, something like the following
    hub slot 0: AAABBBCCC
    hub slot 1: AAABBBCCC
    hub slot 2: AAABBBCCC
    hub slot 3: AAABBBCCC
    hub slot 4: AAABBBCCC
    hub slot 5: AAABBBCCC
    hub slot 6: AAABBBCCC
    hub slot 7: AAABBBCCC
    

    AAA = first priority claim slot, it is the cog number that has the first claim on this slot
    BBB = second priority claim slot, this is the cog that gets this slot of AAA does not have a pending access
    CCC = third priority claim slot, this is the cog if AAA and BBB don't need the slot

    If AAA=BBB, CCC=0, any cog can grab the slot, there is no priority
    if AAA=CCC, BBB=0, cog AAA does not get any slots

    SETHUB #0-7,D/#
    GETHUB reg,#0-7

    This would allow an "OS" to dynamically change hub priorities
    cgracey wrote: »
    I like the bit mask, too, but it doesn't offer any prioritization.

    And, yes, eight 3-bit fields of relative cog numbers would be a pain to set up. Like in SETTASK, as soon as %000 was found in the offer order, that would mean anybody.

    Hey, maybe the 8-bit offer mask could be the top-priority, with everyone else being implied lower-priority. I think a single level of priority is all that is needed. Those not in the priority mask are flying stand-by.
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-11-30 19:59
    Maybe the WC effect could be added to HUB ops like so
        RDLONG reg,addr WC     'where WC means use a FREE slot if available
    

    This gets around the determinism issue
  • YanomaniYanomani Posts: 1,524
    edited 2013-11-30 20:03
    cgracey wrote: »
    There was something in the PC that I had to deal with once that was like this, and it was messy. I wish I could remember what it was.

    Perhaps something about the many evolutionary video cards, and their secret, rock buried , video modes!

    They used to behave as a castle of cards; every newly loaded software could mess the whole thing, without any noticeable clue for the still running ones.

    Only the poor miserable user could ever notice, that some pigeon decided to build a nest, just on his tv set outdoor antenna, blasting in pieces the whole image.

    I'd become allergic to them, starting from this point!

    Blaaargh!

    Yanomani
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-11-30 20:06
    Good point, made while I was typing #3141 :-)

    Revised suggestion, still a hub table

    SETHUB hubslot, #RHBBBCCC

    As per messages after the one I am quoting

    - excellent point, a cog must voluntarily give up its hub slice, ie another may not grab it unless the cog is not using it
    - still an eight entry hub slot table would allow good control over "left over" hub bandwidth

    above SETUP defines the arguments as:

    hubslot = 0..7

    R = cogid voluntarily releases its slot if '1', only cogid can set this
    H = hog mode, coigid claims all available unused hub cycles (low priority non-deterministic hub access)

    BBB = cog that gets slot hubslot if cog(hubslot) does not need it (if BBB can use it)
    CCC = cog that gets slot hubslot if cog(hubslot) and cog(BBB) does not need it (if CCC can use it)

    BBB and CCC can be modified by any cog
    R and H can only be modified by default "owner" cog
    cgracey wrote: »
    I think that if we had alterable priorities in the hub, some objects might get written someday to constantly reassign their own priority for some purpose, leading to flakiness. This would not be good. My gut tells me that slot assignment needs to be a private affair among participating cogs. Other cogs can live with their 1:8 slot timing and request more, but not tamper with others' priorities. There was something in the PC that I had to deal with once that was like this, and it was messy. I wish I could remember what it was.
  • potatoheadpotatohead Posts: 10,260
    edited 2013-11-30 20:15
    I'm kind of laughing about "HOG COG" :)

    Somebody is gonna write one straight away too. What a HOG!
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-11-30 20:18
    :-)

    "Boss Hogg"

    ... but it could only take unused, voluntarily released cycles, so it would not impact determinism.

    As a matter of fact, a "Boss Hog" that released its own (guaranteed) slot, but claimed all unused slots, would be a useful benchmark of how much hub bandwidth is being unused.
    potatohead wrote: »
    I'm kind of laughing about "HOG COG" :)

    Somebody is gonna write one straight away too. What a HOG!
  • potatoheadpotatohead Posts: 10,260
    edited 2013-11-30 20:23
    Totally.

    One priority makes sense. Cogs either must have additional slots, or they want additional slots.

    So then, naming a COG for access recognizes the must have case, leaving the want case for all other times.
  • YanomaniYanomani Posts: 1,524
    edited 2013-11-30 20:26
    :-)

    "Boss Hogg"

    ... but it could only take unused, voluntarily released cycles, so it would not impact determinism.

    As a matter of fact, a "Boss Hog" that released its own (guaranteed) slot, but claimed all unused slots, would be a useful benchmark of how much hub bandwidth is being unused.

    Bill

    It's also a good point, for the systems programmer, enabling it to tune the many possibilities of task mixing and distribution, among a group of COGs!

    Yanomani
  • cgraceycgracey Posts: 14,133
    edited 2013-11-30 20:28
    Yanomani wrote: »
    Perhaps something about the many evolutionary video cards, and their secret, rock buried , video modes!

    They used to behave as a castle of cards; every newly loaded software could mess the whole thing, without any noticeable clue for the still running ones.

    Only the poor miserable user could ever notice, that some pigeon decided to build a nest, just on his tv set outdoor antenna, blasting in pieces the whole image.

    I'd become allergic to them, starting from this point!

    Blaaargh!

    Yanomani

    I had forgotten about all that. I remember it well, though. What a mess video modes were. I remember coaxing applications into using certain modes by modifying their support files. That was when EGA was transitioning to VGA and all APA modes were somewhat custom. What I miss about that time was how reliable the computer was, despite those kinds of issues.
  • potatoheadpotatohead Posts: 10,260
    edited 2013-11-30 20:32
    Very ugly times.

    If you were on higher end PC Video Systems at the time, there was also microcode cards and a complex dance of memory resident bits and pieces that all had to work to drive things like 1024x768 in an awesome 16 colors!

    Then again, sorting this paid well. (was my first indie consulting gig)
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-11-30 20:39
    I think there might be a little confusion.

    If the cog wants its slot, it get it. If a cog does not use its available slot, it is available and it has no part in the process. This is the normal default, and requires no settings. It remains deterministic. It makes no difference to this cog if another cog uses its unwanted slot, so any existing driver should work untouched.

    Optional (I am in two minds of whether this is even necessary)
    If the cog wants to yield its slot (even if it wants it), then it must set a yield flag and a cog# it will yield to. eg YIELD #0..7

    A cog can claim extra slots for itself by:
    Setting that it can use additional unused slots, and which unused slots it can use, with 2 settings - high priority and low priority.
    Note: If we implement the optional YIELD, then a priority slot with yield will steal that cogs slot if required.

    Each slot can only have a single high priority cog# assigned to it.
    Do we really require more than one priority?
    Does this sound acceptable? We can work out the best instruction if we can get the requirements done.
Sign In or Register to comment.