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++
12745 ディスカッション

Strange clock cycle delay in Custom instruction

Altera_Forum
名誉コントリビューター II
1,275件の閲覧回数

Hi all!! 

 

I implemented a custom instruction with the "Multi-Cycle Custom Instruction" technique. 

I used: clock, clk_en, reset, start, dataa[31..0], result[31..0]. 

 

My custom instruction perform in only 1 clock-cycle, but it isn't a combinatorial logic; I used registers. 

I simulated it and it works!! I obtain the result in a single clock-cycle. 

 

But when I imported it in SOPC Builder, it works only if I write that the operation takes 2 clock-cycle.... http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif  

 

 

Anyone encountered this problem? 

 

Bye! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/rolleyes.gif
0 件の賞賛
4 返答(返信)
Altera_Forum
名誉コントリビューター II
572件の閲覧回数

Hi, 

 

My thought : 

 

If you use a multicycle instruction is it at minimum 2 cycles. The first is for setting up the data at your data input ports (from the register file), the second is to wait until it sees the ready signal.  

 

I did approximatly the same, and have also a minimum of 2 cycles. 

 

STefaan
Altera_Forum
名誉コントリビューター II
572件の閲覧回数

http://www.altera.com/literature/an/an188.pdf (http://www.altera.com/literature/an/an188.pdf

 

Page 14. You enable your logic with the start bit. If you use a register you can see that on the 2nd rising clock edge your data is latched so on the rising edge of the 3rd clock is when the NIOS latches your result (don&#39;t forget it needs to latch your data, so that&#39;s your 2 clocks of latency). 

 

So it&#39;s not really a problem, you just need one more stage of latency. Even if that start came out earlier, since you have a register you&#39;ll never get it down to 1 cycle. 

 

Cheers.
Altera_Forum
名誉コントリビューター II
572件の閲覧回数

Ok, thanks! 

 

It was only a conventional problem. 

 

My c.i. has start bit high at T1 and done bit high at T2 => i called it "1-clock cycle" instruction 

 

But it seems Nios speaks about "2 clock cycle" for a similar instruction. 

 

Ok. thanks 

 

Bye! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wink.gif
Altera_Forum
名誉コントリビューター II
572件の閲覧回数

Ya the latency is with respect to the NIOS itself and not your instruction. I usually just remember to add one to whatever my hardware needs.

返信