Forum Discussion

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

custom instructions

Is there an easy way to write custom instructions which read and write to SDRAM?

In particular, we're trying to make an compare-and-swap instruction in order to do multi-threading.

Also, though, this would be useful for matrix multiplication instructions and vector instructions as well.

Any pointers towards a simpler interface to SDRAM than directly banging on the SDRAM controller would be appreciated; in particular if there's any way to coordinate with load and store instructions (I presume that each one doesn't implement its own interface to sdram -- is there any way to reuse their interface?).

Thanks.

2 Replies

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

    You'd have to interface with an SDRAM controller so it's not impossible, but I wouldn't want to try either. SDRAM needs a controller to talk to it due to the complexity of SDRAM in general.

    I don't understand the idea you have all that well so I can't offer an alternative. I'm sure if someone gets this one they may have something else for you.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Basically, in order to do multi-threading safely and efficiently, you need to have some instruction which can read from a location in memory, do something to it, and write the result back to the same location in memory. The functions can vary -- add, decrement, compare and swap; it's not so important as being able to have an atomic load-operate-store instruction.

    Also, one needs this for simd instructions like vector or matrix multiplications.