vivado IP核:VIO核的使用实例(位宽和变量数的改变)

为了在电脑端设置一系列的数据而不用使用拨位开关,我们这里使用VIO(Virtual Input-Output)核进行操作,按照https://www.cnblogs.com/kingstacker/p/9810704.html中的方法,如果我们想要使用虚拟IO代替拨位开关的话,可以将VIO核配置如下,然后在PROBE_OUT_Ports中将probe_width 设为16即可。
在这里插入图片描述
代码如下:

    wire [15:0] SW;
    vio_0 vio_inst(.clk(Clk),.probe_in0(),.probe_out0(SW));

多输出端口

重新生成bitstream之后要program!

如果我们有如下的分开赋值的操作,我们可能需要把这十六位分成两部分:

    assign Num1            = {SW[15:8]}; //2 bit BCD code
    assign Num2            = {SW[7:0]};

我们尝试添加新的VIO核和将原来的VIO核改为8输出然后实例化两次,都失败了,比如添加新的VIO的代码如下:

    vio_0 vio_inst0(.clk(Clk),.probe_in0(),.probe_out0(Num1));
    vio_1 vio_inst1(.clk(Clk),.probe_in0(),.probe_out0(Num2));

会得到如下的结果。猜测原因是一块Basys3上只有一个对应IP核?
在这里插入图片描述

可能并不是,具体没有测试,但是重新编辑IP核之后,移除先前的文件仍然会在srcs中保存,干扰配置。
在这里插入图片描述

这仍然不是核心解决方法。查看Tcl shell

WARNING: [Labtools 27-1972] Mismatch between the design programmed into the device xc7a35t (JTAG device index = 0) and the probes file(s) D:/OneDrive - pku.edu.cn/xilinxproj/lab4-final/lab4-final.runs/impl_1/Top_module.ltx.
 The core at location uuid_10B6415846A85B7596E07529A8F6E526 has different widths for VIO input port 0. Port width in the device core is 16, but port width in the probes file is 1.
Resolution: 
1. Reprogram device with the correct programming file and associated probes file(s) OR
2. Goto device properties and associate the correct probes file(s) with the programming file already programmed in the device.

随后重新配置,并尝试重新program即可在这里插入图片描述在这里插入图片描述

对应地,将代码改为

   vio_0 vio_inst0(.clk(Clk),.probe_in0(),.probe_out0(Num1),.probe_out1(Num2));

另外还可以调整进制,以使得输入变得更加自然。

在这里插入图片描述

  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值