Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Visitor
nilanka2
Posts: 2
Registered: ‎04-27-2012
0

System generator DSP signal flow graphs pipelining.

Hi Everyone, I'm a System Generator user who use it extensively to make arithmatic signal flow graphs for digital signal processing and I also use hardware cosimulation. When I create  a design I always manually set the "latency" parameter in each system generator block and also add "delay" elements as necessary to pipeline the design so it has higher throughput.

 

My question is if there's an automated tool which does this in one click? When I was doing it I felt a automated algorithm should be able to do it when a user set some parameters. Can the MATLAB fixed point tool do this? I'm sorry if this sounds like a stupid question.

 

 

Super Contributor
vlavruhin
Posts: 195
Registered: ‎12-08-2010
0

Re: System generator DSP signal flow graphs pipelining.

[ Edited ]

Hi.

 

Thanks for a good question and sharing your thoughts.


nilanka2 wrote:

My question is if there's an automated tool which does this in one click? When I was doing it I felt a automated algorithm should be able to do it when a user set some parameters.  


I am not aware of an existence of such automation tool. But it's possible to write MATLAB script file for an access to all desired blocks of model for changing value of Latency.  You can even build a whole model adding new blocks and connections between them using script programming.


 Can the MATLAB fixed point tool do this? 


Fixed-point tool allows only to tweak MATLAB native fixed-point number representation in Simulink models.

Best Regards,
Vitaly.
Visitor
nilanka2
Posts: 2
Registered: ‎04-27-2012
0

Re: System generator DSP signal flow graphs pipelining.

Hi vlavruhin,

 

Thanks for your answer.

By accessing all the blocks in a script and adding latency to one will not work correctly because each path could have different level.

The script you were talking about is it using programmatic access?

Is it possible to traverse forward in the graph using a script method?

I do not use programmatic access in my models.

So if I am to write my own algorithm for pipelining do I have to use programmatic access and

converte my models to a text file to do what your saying?

 

In my view i think this a common task for digital signal processing people and Xilinx should on develping such tool in future releases.

 

 

Super Contributor
vlavruhin
Posts: 195
Registered: ‎12-08-2010
0

Re: System generator DSP signal flow graphs pipelining.

Hi.


The script you were talking about is it using programmatic access?

Yes, I mean accessing to the blocks of a model using MATLAB commands executed from either console or script file.

 

Let me show one example. Suppose we have following model with four multipliers and one adder:

01.jpg

 

Now we would like to set Latency parameter of all blocks (Mult11, Mult12, Mult21, Mult22, AddSub) to 5.

To do that we can execute simple script (save this code in file latency_setter.m and run it):

% Find all blocks with Latency parameter
blocks = find_system(gcs, 'RegExp', 'on', 'MaskVariables', 'latency='); % Set new value of Latency parameter for i=1:length(blocks) set_param(blocks{i}, 'latency', '5'); end

After running this script, we get:

02.jpg

 

Of course, we can change latencies of subset of model's blocks. For example, to change Latency parameter to 10 in Mult11 and Mult12 blocks, we can use a name filter and should make small changes in the script:

% Find all blocks having part of Name 'Mult1' with Latency parameter
blocks = find_system(gcs, 'RegExp', 'on', 'Name', 'Mult1', 'MaskVariables', 'latency='); % Set new value of Latency parameter for i=1:length(blocks) set_param(blocks{i}, 'latency', '10'); end

03.jpg

 Or if we want to set Latency to 15 in Mult21, Mult22 and AddSub blocks, then following script will be helpful:

% Find all blocks having part of Name 'Mult2' or 'Add' with Latency parameter
blocks = find_system(gcs, 'RegExp', 'on', 'Name', 'Mult2|Add', 'MaskVariables', 'latency='); % Set new value of Latency parameter for i=1:length(blocks) set_param(blocks{i}, 'latency', '15'); end

04.jpg

 


By accessing all the blocks in a script and adding latency to one will not work correctly because each path could have different level.

It can be resolved using 'SearchDepth' parameter of find_system function. Also first parameter should be changed to [gcs '/YOUR_NAME_OF_THE_SUBSYSTEM'] in that case. Detailed description of this function is presented here:

http://www.mathworks.com/help/toolbox/simulink/slref/find_system.html


Is it possible to traverse forward in the graph using a script method?

Yes, it's possible too. To do that one should access to 'Ports' and 'PortConnectivity' parameters of block and follow ports connections:

http://www.mathworks.com/help/toolbox/simulink/slref/f23-7517.html

But there are many questions: When should we stop? How to treat fanouts?

 

As to me, the usage of find_system function seems to be easier way for changing parameters. You need just to give similar names to the blocks in one signal path (or to put them in one subsystem) and use name filters with regular expressions.

 


So if I am to write my own algorithm for pipelining do I have to use programmatic access and

converte my models to a text file to do what your saying?


No, there is no need for conversion. Just use scripts similar to shown above.

 

Hope this information will help you.

Best Regards,
Vitaly.
Xilinx Employee
Xilinx Employee
ywu
Posts: 2,861
Registered: ‎11-28-2007
0

Re: System generator DSP signal flow graphs pipelining.

As far as I know, no such a tool exists in system generator or Matlab to automatically pipeline the design to meet certain throughput or latency requirements. You may want to take a look at AutoESL, a high level synthesis tool that convert c code to hardware. It takes the clock frequency and latency requirements into consideration during synthesis and tries to generate HW to meet the requirements.

 


nilanka2 wrote:

Hi Everyone, I'm a System Generator user who use it extensively to make arithmatic signal flow graphs for digital signal processing and I also use hardware cosimulation. When I create  a design I always manually set the "latency" parameter in each system generator block and also add "delay" elements as necessary to pipeline the design so it has higher throughput.

 

My question is if there's an automated tool which does this in one click? When I was doing it I felt a automated algorithm should be able to do it when a user set some parameters. Can the MATLAB fixed point tool do this? I'm sorry if this sounds like a stupid question.

 

 




Cheers,
Jim