Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Custom instruction

Altera_Forum
Honored Contributor II
941 Views

Hi, 

How can I control the clock enable and other signals for implemented custom instruction with hardware inside the NIOS II (sequential)?  

Maybe some more examples have Altera (not only combinatorial example leading_zero_detector)? 

Thank you for help
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
76 Views

I have the same problem. I need to know how to determine the number of clock cycles per instruction in order to get the results. Thanks in advance for any help you could give.

Altera_Forum
Honored Contributor II
76 Views

A lot of the logic of the custom instruction interface can be seen in the RTL viewer. 

I suspect that the 'clock enable' is the signal used to stop the cpu during pipeline stalls - so a variable length custom instruction must assert 'done' while clock enable is asserted (but need not otherwise look at it). 

A fixed length instruction (where the interface counts the clocks for you) will almost certainly have to apply the clock enable to everything.
Altera_Forum
Honored Contributor II
76 Views

Thanks for replying. I'm working with Quartus II 12.0 subscription edition. The problem is that I don't have a way to change the instructions to fixed length,because it's automatically assigned the instruction to variable length. Is there any way of doing that? 

 

Thanks in advance.
Altera_Forum
Honored Contributor II
76 Views

I would have thought it was best to generate the 'done' signal from within your own logic. 

After all you will have an internal signal (or can easily generate one) that is asserted when the result is available. 

I thought I remembered there being an option for 'fixed length', maybe it can only be set when you create the component. 

I do remember that it wasn't obvious how to edit the details - IIRC you have to run the component editor. 

 

There were certainly a pile of bugs in the version of the sopc builder I was using - it got very confused if you added and removed custom instructions from the cpu itself. 

 

All not helped by the only examples just describing how to tick the boxes to include the FP instructions.
Altera_Forum
Honored Contributor II
76 Views

Thanks. Yeah. I found the way of set it to fixed length, but we should know the number of cycles needed to set that. Therefore better to use variable length and set the done signal when we need the result. I'll try and check. 

 

Thanks for helping.
Reply