We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Showing results for 
Search instead for 
Did you mean: 
Observer m7888
Registered: ‎06-27-2015

Sysgen : How to read the input port data type, width and rate dynamically in a masked subsystem ?

Hello everybody,

     I am designing a general purpose block in system generator. I pass the user parameters to the block through masking it. Some user parameters can change the block configuration. The input port data type, width and rate can also affect the block configuration.

     The problem is that these values (input port data type, width and rate) are subject to change. So I should read them dynamically, then change the block configuration through programming the "Initialization Commands" field. But unfortunately there is no straight way to read the input port information.

     There are some methods in for example the "Black Box". these are:

input_width = this_block.port('din').width;
input_rate = this_block.port('din').rate;


But these methods are not applicable to a masked subsystem.

I have tried other ways also. You can find them below. None of them worked.

Does anybody know how can I solve this problem?


Other ways I tried:







ts = Simulink.Block.getSampleTimes([gcb '/Input'])


0 Kudos
2 Replies
Xilinx Employee
Xilinx Employee
Registered: ‎08-01-2008

Re: Sysgen : How to read the input port data type, width and rate dynamically in a masked subsystem ?

Today we rely on Simulink to perform parameterization of your designs in two ways:

  1. Parameterizable Subsystems and Blocks : Parameters themselves can be MATLAB expressions that need to be evaluated for which we need the MATLAB interpreter
  2. The very useful Rate and Type propagation or Simulink compilation that allows us to specify types & rates in one location that gets systematically propagated to all.


To truly make the HDL Netlist that is generated from SysGen parameterizable, we would have to implement some of this capability in the HDL netlist itself by:

  1. Using Generics(VHDL) or Parameters(Verilog) - We would have to capture the bit width(type) propagation through levels of hierarchies and finally parameterize the IP itself based on this value
    1. Since IP itself does not have this capability through generics, we would have to package a separate tcl script that updates the IP parameterization appropriately in response to top level parameters(or GUI parameters)
  2. Interpreting MATLAB expressions and translating them into VHDL/Verilog expressions (alternatively tcl expressions of IP). In simulink, mask parameters can be passed from one level to the next. Also parameterization of a block can be composed of Matlab expressions using variables from ancestor masks & the MATLAB interpreter – so we will need to somehow capture that as well.


Thanks and Regards
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Observer m7888
Registered: ‎06-27-2015

Re: Sysgen : How to read the input port data type, width and rate dynamically in a masked subsystem ?

Thanks Balkris for your help.

But still the problem is unsolved.

I have seen this topic around on the internet and none of them have been answered properly. You can find them in the following links:









0 Kudos