Xilinx IOBUF 的用法
Xilinx IOBUF 的用法
文章目录
- Xilinx IOBUF 的用法
- 一、概念
- 1. 基本概念
- 2. 硬件结构
- 2.1 IOBUF
- 2.2 OBUFT
- 二、实例
- 三、参考文献
一、概念
1. 基本概念
应用场景: 在vivado中,连接的管脚的信号一般都会自动添加OBUF或IBUF。但是对于inout类型的接口,不会主动添加IOBUF,因为in/out切换需要控制信号,需要用户自己分配好。
Xilinx官网原文: The IOBUF primitive is needed when bidirectional signals require both an input buffer and a 3-state output buffer with an active-High 3-state T pin. The IOBUF is a generic IOBUF. A logic-High on the T pin disables the output buffer. When the output buffer is 3-stated (T = High), the input buffer and any on-die receiver termination (uncalibrated or DCI) are ON. When the output buffer is not 3-stated (T = Low), any on-die receiver termination (uncalibrated or DCI) is disabled.
I/O attributes that do not impact the logic function of the component such as IOSTANDARD, DRIVE and SLEW should be supplied to the top-level port via an appropriate property. For details on applying such properties to the associated port, see the Vivado Design Suite Properties Reference Guide (UG912).
个人翻译: 当双向信号需要输入缓冲区和带active-High 3态T引脚的3态输出缓冲区时,需要IOBUF原语。IOBUF是一个通用的IOBUF。T为高电平时关闭output buffer(I端口)。当output buffer为3-state (T = High)时,input buffer和任何固定接收器终端(未校准或DCI)均为有效。当输出缓冲区不是3-state (T = Low)时,任何固定接收器终端(未校准或DCI)都是禁用的。
不影响组件逻辑功能的I/O属性(如IOSTANDARD、DRIVE和kill)应该通过适当的属性提供给顶级端口。有关将这些属性应用到相关端口的详细信息,请参见Vivado设计套件属性参考指南(UG912)。
Vivado原语:
// IOBUF: Single-ended Bi-directional Buffer
// All devices
// Xilinx HDL Language Template, version 2017.2IOBUF #(.DRIVE(12), // Specify the output drive strength.IBUF_LOW_PWR("TRUE"), // Low Power - "TRUE", High Performance = "FALSE".IOSTANDARD("DEFAULT"), // Specify the I/O standard.SLEW("SLOW") // Specify the output slew rate) IOBUF_inst (.O(O), // 1-bit output: Buffer output.I(I), // 1-bit input: Buffer input.IO(IO), // 1-bit inout: Buffer inout (connect directly to top-level port).T(T) // 1-bit input: 3-state enable input);
个人理解: 这玩意儿的解释有点绕,我们结合结构图
、原文
、原语
来总结一下,大致是这么个意思:
首先,我为什么说它绕,因为IOBUF的O指的是IO_pin >> FPGA
,也就是说这里的Output输出的主语是IO_pin,而不是FPGA;这里的 I 指的是IO_Pin << FPGA
,同样主语是IO_pin,这里指的是输入到IO_pin。所以第一次使用的时候容易弄混。
再与结构图结合就很容易理解了,三态门T控制的是I端口能否有效输入:
- T拉高时,I端口停止工作,O端口向FPGA内部输出信号;
- T拉低时,I端口向IO_pin输入来自FPGA内部的信号,此时 O = I(因为O端口从这个方向上来说也是 I 的分支);
2. 硬件结构
2.1 IOBUF
官网原图:
Vivado综合后的RTL视图:
真值表:
Inputs | Bidirectional | Outputs | |
---|---|---|---|
T | I | IO | O |
1 | X | Z | IO |
0 | 1 | 1 | 1 |
0 | 0 | 0 | 0 |
接口描述:
Port | Direction | Width | Function | 带有个人情感色彩的翻译 |
---|---|---|---|---|
I | Input | 1 | Input of OBUF. Connect to the logic driving the output port. | OBUF的输入端,连接到Output端口的逻辑驱动 |
IO | Inout | 1 | Bidirectional port to be connected directly to top-level inout port. | 双向端口被直接连接到顶层的inout端口 |
O | Output | 1 | Output path of the buffer. | IOBUF的输出路径 |
T | Input | 1 | 3-state enable input signifying whether the buffer acts as an input or output. | 3态门启用输入,表示IOBUF是作为输入还是作为输出。 |
2.2 OBUFT
真值表:
Inputs | Outputs | |
---|---|---|
T | I | O |
1 | X | Z |
0 | 1 | 1 |
0 | 0 | 0 |
接口描述:
Port | Direction | Width | Function | 带有个人偏见的翻译 |
---|---|---|---|---|
I | Input | 1 | Input of OBUF. Connect to the logic driving the output port. | OBUF的输入端,连接到Output端口的逻辑驱动 |
O | Output | 1 | Output of OBUF to be connected directly to top-level output port. | OBUF的输出端被直接连接到顶层的output端口 |
T | Input | 1 | 3-state enable input. | 三态门使能输入 |
二、实例
首先我们想象这样一个应用场景:
因为某些原因,ARM不能直接连接到PHY芯片上,所以需要通过FPGA间接与PHY芯片相连接,这个时候我们就有以下引脚:
input i_arm_mdc,
inout io_arm_mdio,
output o_phy_mdc,
inout io_phy_mdio
而根据MDIO协议:
IO端口切换输入输出模式的根据是OP位而定的,所以我们可以先设置一系列寄存器来存储io_arm_mdio
的input内容,以及读写变化使能。
reg s_mdio_rd_en;
reg [35:00] s_mdio_word ;
reg [01:00] s_mdio_op ;
reg [05:00] s_cnt_mdio ;
reg s_add_mdio ;
wire s_arm_out ;
wire s_phy_out ;assign o_phy_mdc = i_arm_mdc ;always @(posedge i_arm_mdc or negedge i_rst_n)begin if(!i_rst_n) begins_mdio_word <= 36'b0;endelse begins_mdio_word <= {s_mdio_word[34:00],s_arm_out};end
end/* ---- mdio contrl ---- */
always @(posedge i_arm_mdc or negedge i_rst_n) beginif (!i_rst_n) begins_add_mdio <= 1'b0;s_mdio_op <= 1'b0;end else beginif((s_mdio_word==36'hffffffff6||s_mdio_word==36'hffffffff5) && s_mdio_trans_cnt == 8'd35)s_add_mdio <= 1'b1;else if(s_cnt_mdio >= 16'd27)s_add_mdio <= 1'b0;else s_add_mdio <= s_add_mdio;if (s_add_mdio) s_cnt_mdio <= s_cnt_mdio + 1'b1;elses_cnt_mdio <= 1'b0;if(s_mdio_word==36'hffffffff6 && s_mdio_trans_cnt == 8'd35)s_mdio_op <= Read_bits;else if (s_mdio_word==36'hffffffff5 && s_mdio_trans_cnt == 8'd35)s_mdio_op <= Write_bits;elses_mdio_op <= s_mdio_op;end
endalways @(posedge i_arm_mdc or negedge i_rst_n)begin if(!i_rst_n)begins_mdio_rd_en <= 1'b0;endelse beginif(s_cnt_mdio>=6'd9 && s_mdio_op == Read_bits)/* 5-bit PHY_ADDR + 5-bit Reg_ADDR = 10-bit */s_mdio_rd_en <= 1'b1;elses_mdio_rd_en <= 1'b0;end
end
在需要的参数都准备好后,就可以开始使用原语了:
IOBUF #(.DRIVE(12), // Specify the output drive strength.IBUF_LOW_PWR("TRUE"), // Low Power - "TRUE", High Performance = "FALSE".IOSTANDARD("DEFAULT"), // Specify the I/O standard.SLEW("SLOW") // Specify the output slew rate) IOBUF_inst_arm (.O (s_arm_out ), // .IO(io_arm_mdio ), // .I (s_phy_out ), // .T (!s_mdio_rd_en ) // 3-state enable input, high=input, low=output);
IOBUF #(.DRIVE(12), // Specify the output drive strength.IBUF_LOW_PWR("TRUE"), // Low Power - "TRUE", High Performance = "FALSE".IOSTANDARD("DEFAULT"), // Specify the I/O standard.SLEW("SLOW") // Specify the output slew rate) IOBUF_inst_phy (.O (s_phy_out ), // .IO(io_phy_mdio ), // .I (s_arm_out ), // .T (s_mdio_rd_en ) // 3-state enable input, high=input, low=output);
最后综合出来的结果就是这个样子:
三、参考文献
Xilinx: IOBUF English
Xilinx: OBUFT English
KevinChase:【FPGA】xilinx IOBUF的用法
Xilinx IOBUF 的用法相关推荐
- Xilinx原语的用法
Xilinx公司原语的使用方法 原语,其英文名字为Primitive,是Xilinx针对其器件特征开发的一系列常用模块的名字,用户可以将其看成Xilinx公司为用户提供的库函数,类似于C++中的&qu ...
- xilinx oddr idelay用法简单介绍
我们知道xilinx FPGA的selectio中有ilogic和ologic资源,可以实现iddr/oddr,idelay和odelay等功能.刚入门时可能对xilinx的原语不太熟练,在vivad ...
- vivado里那些看不懂的原语
遇到一段代码 GLOBAL sw_clk(.in (SWCLK),.out (swck)); 是Intel风格的,可以用xilinx的BUFG进行替代 // BUFG 分配时钟专用资源,指定信号走专门 ...
- PHY_MDIO 接口设计
在以太网通信中,设备之间的物理局链路均由 PHY 芯片建立.PHY 芯片内部含有一些列寄存器,用户可通过这些寄存器来配置 PHY 芯片的工作模式以及获取 PHY 芯片的若干状态信息,如连接速率.双工模 ...
- zynq tcp如何从网口发数据_基于TCP/IP协议的电口通信
之前有介绍过TCP/IP协议的实现是通过轻量级LWIP协议实现的,具体在FPGA中实现又可以分为多种方式,具体如下: 图8‑98 LWIP协议在FPGA中的实现方式 LWIP可以通过硬核实现或者软核实 ...
- 基于DE2的开源片上系统Freedom E310移植
引言:伯克利大学于2014年发布了开源指令集架构RISC-V,其目标是成为指令集架构领域的Linux,应用覆盖IoT(Internet of Things)设备.桌面计算机.高性能计算机等众多领域[1 ...
- Aurora 8B/10B光口通信
8.5.8.1 概述 本课程内容参考XILINX 官方文档PG046(https://www.xilinx.com/support/documentation/ip_documentation/aur ...
- Microblaze搭建LWIP
K7平台的Microblaze搭建LWIP 1.概述 lwip 是瑞典计算机科学院(SICS)的 Adam Dunkels 开发的一个小型开源的 TCP/IP 协议栈.实现的重点是在保持 TCP 协议 ...
- 利用 IBERT 进行 GTX 信号眼图测试
利用 IBERT 进行 GTX 信号眼图测试 8.5.4.1 概述 Vivado中提供了1种IBERT工具用于对Xilinx FPGA芯片的高速串行收发器进行板级硬件测试.通过IBERT我们可以获取误 ...
最新文章
- mysql自定义函数实现,自定义oracle中decode方法
- linux7.4安装语言包,CentOS 7.4安装时报错最简单最直接的解决办法
- 扩展springmvc组件——当页面跳转时,需要在Controller里面创建一个空方法去跳转或者是创建一个配置类 ||日期格式化说明||自定义格式化器||消息转化器扩展fastjson
- SQL Server---触发
- 超微服务器硬盘红灯_硬盘亮红灯服务器崩溃的解决方法
- AutoValue:生成的不可变值类
- pv实现前趋图_Excel 数据透视图实现简易交互式数据面板
- 小白也能看懂!教你如何快速搭建实用的爬虫管理平台
- windows、Linux下nginx搭建集群
- c语言中32位整数用谁标识,int占几个字节
- 为什么有符号数0XFFFF FFFF代表-1?
- mysql网站倒计时代码_最简单的一个网页倒计时代码 时间到期后会显示出提醒内容 收藏版...
- java实现qq页面登陆界面
- XMind思维导图使用详解
- uClinux on Blackfin BF533 STAMP - A DSP Linux Port
- Java 利用Graphics2D 合并图片(png格式可设置透明)
- math.h中常用的函数(C语言)
- Python爬虫项目分享二:《爬取周杰伦的歌曲评论》
- BEM实战之扒一扒淘票票页面
- 基于Visual Graph快速开发出电力系统