SystemGenerator可以搭建模块,并且按照需求对其进行仿真测试,下面是一个简单的例子,通过对一个常数进行延时后,通过仿真测试将其进行显示:

通过运行搭建的模块,我们将数据格式Display出,常数254数据格式为无符号8位整数和0位整数定点数,通过GatewayOut输出双精度double,并在Display模块中进行仿真显示,从运行结果看得出我们的结果的正确性。

通过 SystemGenerator模块进行参数设置,通过设置时钟引脚,可自动生成.xdc 文件

自动生成 .xdc 文件

SystemGenerator 可以按照用户配置的器件参数,以及搭建的用户模块来自动生成相应的.bit 文件,从而可以直接下载到开发板,进行软硬件协调操作。
我们通过在MATLAB命令行输入下面的指令,从而生成相关开发板的配置文件,
// 编译生成相关开发板的文件,其中addBoard的参数包括三部分:第一是开发板型号;第二是当前搭建模块的路径;第三是Vivado按照路径中的相应开饭板型号的参数文件
>>xilinx.environment.addBoard('Zedboard','E:\matlab\Examples\Ex1','D:\xilinx\Vivado\2015.2\data\boards\zynq\ZED\revD')
>>xilinx.environment.rehashCompilationTarget
// 我们可以通过下面的指令来对Xilinx的缓冲进行清除,进而实现对新器件参数的缓冲实现
>>xilinx.environment.getcachepath %% 获取cache 路径
>>rmdir(xilinx.environment.getcachepath,'s') %% 清除 cache
// 下面的指令可以实现对器件参数进行设置,同设置System Generator模块的参数一致
you have to create a structure thatcaptures all the settings for automatic generation.
An example is shown below:
>> settings = struct('Family','virtex7', ...%Device Family
'Device', 'xc7vx485t', ...%Part name
'Speed', '-1', ...%Speed Grade being used
'Package', 'ffg1157',...%Package Name being used
'SynthesisTool', 'Vivado',...%Synthesis Tool setting
'SynthesisLanguage', 'VHDL',...%Synthesis Language Setting
'SynthesisStrategy', 'Vivado Synthesis Defaults',...%Synthesis StrategyUsing defaults
'ImplementationStrategy', 'Vivado ImplementationDefaults',...%Implementation Strategy
'TargetDirectory', './netlist',…%Code Generation directory
‘Testbench’,’on’);…%The Test bench option
Finally, to generate the design, you needto execute the following command:
>>xilinxModelObject.generate(setting);