Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

faster FP accumulation

Hi,

I'm working on a project that requires accumulation. The input comes from a pipeline that outputs node id and value, and the accumulation result must be stored in a block ram. So this involves a memory read, an addition(single precision FP), and a memory write. Is there any way to do this? or do I have to halt the pipeline? (afaik the shortest latency for a single-precision FP adder by Altera IP is 6 cycles.)

Thanks in advance for suggestions!

8 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Not halt the pipeline, but perform an interleaved write. Trying to desig a FP adder without latency wouldn't give good results, I fear.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for the reply, but I'm a little bit confused - what so you mean by "interleaved" write?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I understand that each result has to be stored to a different RAM address, otherwise no RAM would be needed.

    My suggestion is to store the result after 6 pipeline clocks.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I know what you're saying - but what I worry about is what if data to the same address shows up within 6 cycles. I.e.

    Cycle 0 comes in with id 15, data 12.5

    cycle 1 comes in with id 20, data 32.5

    cycle 2 comes in with id 15,data 13.5

    ...

    The question here is, what should I do if in cycle 4 comes id 15?the first addition for id15 hasn't Finished yet(it finishes at cycle 8)

    hope this clarifies my question a little bit. Thanks
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yes, I understand that you have arbitrary addresses, I didn't asume this. The suggestion doesn't work in this case and I fear, there is no simple solution at all. Designing a special FP adder with a higher grade of parallelization (and higher resource requirement) may be the only feasible way.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ok thank you very much for the replies. I guess I'll go for stalling the pipeline, it's easier to implement, at the price of lowering performance.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    maybe you could have a small manifest of what IDs already exist in the read-modify-write pipeline, and only halt when an ID value shows up that is already being prodcessed, otherwise just let it flow.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    maybe you could have a small manifest of what IDs already exist in the read-modify-write pipeline, and only halt when an ID value shows up that is already being prodcessed, otherwise just let it flow.

    --- Quote End ---

    That's the general idea I'm thinking. However, lots of detailed stuff to be considered. Thanks for the reply.