- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page