Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17257 Discussions

How to find output of variable latency modules

Altera_Forum
Honored Contributor II
1,171 Views

Instantiating Altera Megafunctions in my code, specifically Altera Floating Point megafunctions I find that these megafunctions don't have an 'output valid' or 'done' output bit with which I can ascertain whether or not the module has finished processing. I thought that since the latency will be fixed I'll assign a counter and manually raise a signal everytime number of fixed latency cycles of a given module are completed and at that time take the output. But now running testbenches on these modules I find that the latency is also variable i.e. at times the blocks produce the output pretty quickly in maybe 5 clock cycles and at times they can take longer 14-15 clock cycles for certain inputs. What mechanism can I use to find if the block has finished calculating the output? 

Any help is most appreciated. Thanks.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
487 Views

The latency is always fixed. There is a parameter called "pipeline" that sets the latency. Then you just store a valid signal in parrallel to the data. You shouldnt use a counter. The output will produce 1 result every clock cycle, just delayed by "pipeline" clocks.

0 Kudos
Altera_Forum
Honored Contributor II
487 Views

@Tricky-Thanks for your reply. Could you clarify a few questions of mine: 

 

1. Do I have to set this parameter "pipeline" while instantiating the megafunction in my code? I was thinking that any parameters for the megafunctions are set automatically using the megawizard plugin manager at the time of adding the megafunction to your design. 

 

2. What are the acceptable values for the the parameter "pipeline"? For example for the altfp_mult (floating point multiplication) megafunction, would I have to set "parameter pipeline=5" as this was the latency I chose using the drop-down box while adding this megafunction to my project with the plugin manager. 

 

I'm guessing then that the following would be an apt way to set the parameter and instantiate the megafunction in my code: 

 

 

 

 

float_multiply_megafunc  

# ( 

.pipeline(5) //setting the parameter 

 

 

instance0 ( 

.aclr ( aclr ), 

.clock ( clk ), 

.dataa ( x ), 

.datab ( y ), 

.nan ( nan ), 

.overflow ( overflow ), 

.result ( result ), 

.underflow ( underflow ), 

.zero ( zero ) 

); 

 

Thanks for your help.
0 Kudos
Reply