Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

custom instructions

Altera_Forum
Honored Contributor II
1,274 Views

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.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
388 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
388 Views

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.
0 Kudos
Reply