主要内容

Prepare IP-XACT File for Import

要自定义要生成的组件的TLM接口,您可以将自己的IP-XACT XML文件导入到TLM Generator中。

有关导入IP-XACT文件的更多信息,请参阅选择TLM映射选项

Required Information for Imported IP-XACT Files

All IP-XACT XML files must contain information specific to MathWorks®, defined in elements within the component. If this information is not present, the TLM generator cannot parse the IP-XACT file.

需要以下参数名称值对:

  • <精神:参数>

    <精神:名字>Mwvendor

    <精神:价值>MathWorks

  • <精神:参数>

    <精神:名字>mwversion

    <精神:价值>1.0

  • <精神:参数>

    <精神:名字>mwmodel

    <精神:价值>name_of_model

  • <精神:参数>

    <精神:名字>MWBlock

    <精神:价值>name_of_block

该图像在IP-XACT XML文件中显示了这些必需的元素。

没有内存图的总线接口定义

一般准则

根据IEEE为您的模型编写公共汽车定义®IP-XACT的标准1685-2009。

如果您想使用simulink金宝app®mapping, all bus interfaces that contain Simulink mapping must be slave interfaces.

每一个bus interface with no memory map must have one of the following element arrangements for Simulink mapping:

  • 没有映射to Simulink

  • 映射到Simulink金宝app输入,Simulink输出或输入和输出的混合

  • 映射到模拟可调参数金宝app

Although each bus interface can have only one arrangement, the IP-XACT file can contain multiple bus interface definitions, each having a different arrangement.

金宝app没有内存图的映射

每一个包含Simulink映射的定义映射到TLM目标插金宝app座。在<精神:参数>tag, add<精神:参数>name-value pairs that define the Simulink mapping. For example:

  mwmapinput   input_1  

This image shows some bus interfaces that are mapped to Simulink inputs.

The inputs are mapped together in one bus interface definition. The outputs are in a separate bus interface. The filter coefficients are in another, separate bus interface.

另外,您可以在单个总线接口定义中定义输入和输出。但是,滤波器系数必须保留在其自己的单独的总线接口定义中。

Bus Interface Definition with Memory Mapping

一般准则

根据IP-XACT 1685-2009的IEEE标准编写模型的总线定义。以下权限适用:

  • Input registers — Write-only or read-write

  • Output registers — Read-only or read-write

  • Parameters register — Read-only, write-only, or read-write, depending on your requirements

Make the spirit size of each register, in bits, greater than or equal to the size of that Simulink input, output, or parameter.

如果您想使用simulink金宝appmapping, all bus interfaces that contain the Simulink mapping must be slave interfaces.

金宝appMapping Within a Memory Map

If you have a memory map reference in the bus interface, then you must express the Simulink mapping in the memory map, not in the bus interface.

每个寄存金宝app器的Simulink映射可以包含以下元素安排:

  • 没有映射to Simulink (that is, no mapping information is needed in the register)

  • 映射到Simulink金宝app输入,Simulink输出或输入和输出的混合

  • 映射到模拟可调参数金宝app

寄存器不能具有多个输入输出。但是,可以将总线接口映射到多个寄存器,每个寄存器都有不同的排列。

To add inputs, outputs, or parameters to the IP-XACT file, follow these steps.

  1. 每一个包含Simulink映射的定义映射到TLM目标插金宝app座。Add a<精神:参数>名称值对向TLM Generator指示内存映射中有Simulink映射。金宝app

    <精神:参数> <精神:名称> mwmap   true  
  2. In eachsection, in each定义,在<精神:参数>tag, add a<精神:参数>name-value pair with the Simulink mapping.

      mwmapinput   input1  

    此图像为Simulink输入演示了此布置。金宝app

  3. 要选择地指定寄存器中的字段位置,请指定一个definition in the。Use the<精神:bitwidth>tags to define each。Include the<精神:参数>名称值对与Simulink映射金宝appdefinition.

      output_1   32   32  读取 <精神:参数><精神:参数><精神:名字>mwmapOutput output_1   
  4. To optionally exclude a register from the Simulink mapping, add a<精神:参数>名称值对definition. Specify the name asmwmap和价值为错误的to exclude the register from the memory map.

    <精神:注册>  excluded_reg_1   0x38   size> 64   读取 <精神:参数><精神:参数><精神:名字>mwmap<精神:价值>错误的 

    要从Simulink内存映射中排除地址块,请添加一个金宝app<精神:参数>名称值对definition. Specify the name asmwmap和价值为错误的to exclude the address block from the memory map.

     EXCLUDED_BANK 0x00030000 128 64 register  EXCLUDED_REG_2 0x00 64 read-only   EXCLUDED_REG_3 0x08 64 read-only    MWMap false   

有关Simulink内存映射到TLM组件的完整示例,金宝app请参见Imported IP-XACT with Memory Map

映射到信号端口

您可以生成未注册的sc_signal港口。执行步骤功能时,它读取sc_in端口,将它们全部传递到步骤函数,执行步骤函数并写入步骤函数结果侦察端口。

要添加输入和输出端口,请在IP-XACT文件中指定以下内容:

  1. Specify the port asof type

  2. Specify the port direction as。将方向设置为,生成一个sc_in港口。Set direction to出去to generate an侦察港口。

  3. By default, the data type of the port is the same as the subsystem input or output. You can optionally define a data type for the port by describing it in

  4. To define the mapping of the TLM port to a Simulink input or output, specify the name-value pairmwmapinput或者mwmapOutputwithin a<精神:vendorextension> <精神:参数> <精神:参数>标签。

此图显示了映射到端口的示例。

相关话题

外部网站