FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6356 Discussions

MATLAB/DSP Builder megablock timing issues

Altera_Forum
Honored Contributor II
1,147 Views

I am trying to use the fir_compiler_v11 Megablock in MATLAB/Simulink but can't figure out how to change the internal timing. I have 200 coefficients that I want to use only one multiplier with. I have set the Simulation frequency in Simulink to 2e-5 and when I run the simulation there is 200 seconds between each change in the output of the Megablock. I noticed a clock enable check box in the pop up control panel for the Megablock, does this have anything to do with it?

0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
286 Views

I'm not directly familiar with the parameterisation of the fir_compiler_v11 block, but if you want to configure it to use fewer resources the options will be in the Megawizard GUI not in Simulink itself. 

 

Thus changing the "Simulink frequency" (I assume you mean sample time) will have no impact. 

 

Looking at http://www.altera.com/literature/ug/fircompiler_ug.pdf (http://www.altera.com/literature/ug/fircompiler_ug.pdf) on page 3-9, there's a screenshot of the parameter window. One is called Structure and I think that's the one you should modify. On page 4-6, you can see descriptions of the various structures it's capable of.
0 Kudos
Altera_Forum
Honored Contributor II
286 Views

I did mean Simulink sample time. However when I open the Megablock GUI there is no way to modify the clock time of the block. I can change the amount of clocks to compute which changes the multipliers used accordingly. When I set the clocks to compute to compute to 200 (because I have 200 coefficients) and run the simulation in MATLAB the output changes every 200 seconds of simulation time. This tells me that the Megablock sample time is 1 second which doesn't make any sense.

0 Kudos
Altera_Forum
Honored Contributor II
286 Views

Simulink works in "seconds" and has doesnt really have a concept of real time in discreat mode. Consider each "second" as a clock tick, hence why you only get 1 result every 200 seconds, because 1 multiplier has to compute 200 values, and at only 1 per sample (as this is a speed of a multiplier) you only get a result every 200 clocks. 

 

Why do you want only 1 multiplier?
0 Kudos
Altera_Forum
Honored Contributor II
286 Views

To get what you want I suspect you need to use DSP Builder Advanced. The FIRs in DSP Builder Advanced are quite capable of what you ask.

0 Kudos
Reply