SRL(移位寄存器)资源,在FPGA中都有,不过是叫不同的名字。Xilinx FPGA内部的LUT有个特殊功能,就是可以配置成可变长度SRL。
5输入的一个LUT可以变成32bit 的SRL
6输入的,可以变成64bit的SRL
所以,你写的SRL可能被综合成LUT。

可以定义移位长度的移位寄存器。
就是用一个lut可以实现16位的移位寄存器。

SRL16 的是 16bit移位寄存器查找表 // 16-Bit Shift Register Look-Up-Table (LUT)

在一个LUT中可以实现16个FF移位的功能!
SSRL16 SRL16_inst (
.Q(Q), // SRL data output
.A0(A0), // Select[0] input
.A1(A1), // Select[1] input
.A2(A2), // Select[2] input
.A3(A3), // Select[3] input
.CLK(CLK), // Clock input
.D(D) // SRL data input
);

Xilinx 官网的说明——原理

SRL16 is a shift register look up table (LUT). The inputs A3, A2, A1, and A0 select the output length of the shift register. The shift register may be of a fixed, static length or it may be dynamically adjusted.

The shift register LUT contents are initialized by assigning a four-digit hexadecimal number to an INIT attribute. The first, or the left-most, hexadecimal digit is the most significant bit. If an INIT value is not specified, it defaults to a value of four zeros (0000) so that the shift register LUT is cleared during configuration.
The data (D) is loaded into the first bit of the shift register during the Low-to-High clock (CLK) transition. During subsequent Low-to-High clock transitions data is shifted to the next highest bit position as new data is loaded. The data appears on the Q output when the shift register length determined by the address inputs is reached.

这里说了几点,
- 移位寄存器的初始值可以用INIT属性初始化;
- 移位寄存器的长度由地址线的取值决定;
- 移位数据从D端输入,Q端输出

- 先移入的数据是MSB

Xilinx 官网的说明——Static Length Mode
To get a fixed length shift register, drive the A3 through A0 inputs with static values. The length of the shift register can vary from 1 bit to 16 bits as determined from the following formula:

Length = (8*A3) +(4*A2) + (2*A1) + A0 +1

If A3, A2, A1, and A0 are all zeros (0000), the shift register is one bit long. If they are all ones (1111), it is 16 bits long.

Xilinx 官网的说明——Dynamic Length Mode
The length of the shift register can be changed dynamically by changing the values driving the A3 through A0 inputs. For example, if A2, A1, and A0 are all ones (111) and A3 toggles between a one (1) and a zero (0), the length of the shift register changes from 16 bits to 8 bits.

Internally, the length of the shift register is always 16 bits and the input lines A3 through A0 select which of the 16 bits reach the output.

Inputs Output

Am CLK D Q
Am X X Q(Am)
Am ↑ D Q(Am-1)
m= 0, 1, 2, 3

这里提示了几个要点:

- 移位寄存器是可变长度的
- 长度的改变由地址线来指定
- 内部的寄存器长度是不变的,只是截取的长度变了

- 数据先移入到A0,然后到A1,以此类推,最后从指定长度的Am-1处输出,比如A=8,则数据从地址0输入,从地址7输出,这样有效的移位长度就为8。

Xilinx 官网的说明——VHDL例化实例
-- SRL16: 16-bit shift register LUT operating on posedge of clock
-- All FPGAs
-- Xilinx HDL Libraries Guide version 7.1i
SRL16_inst : SRL16

-- The following generic declaration is only necessary if you wish to
-- change the initial contents of the SRL to anything other than all
-- zero's.
generic map (

INIT => X"0000")

port map (

Q => Q, -- SRL data output
A0 => A0, -- Select[0] input
A1 => A1, -- Select[1] input
A2 => A2, -- Select[2] input
A3 => A3, -- Select[3] input
CLK => CLK, -- Clock input
D => D -- SRL data input
);

-- End of SRL16_inst instantiation

复制代码

Xilinx 官网的说明——Verilog例化实例
-- SRL16: 16-bit shift register LUT operating on posedge of clock
- All FPGAs
-- Xilinx HDL Libraries Guide version 7.1i

SSRL16 SRL16_inst (
.Q(Q), // SRL data output
.A0(A0), // Select[0] input
.A1(A1), // Select[1] input
.A2(A2), // Select[2] input
.A3(A3), // Select[3] input
.CLK(CLK), // Clock input
.D(D) // SRL data input

);

// The following defparam declaration is only necessary if you wish to
// change the initial contents of the SRL to anything other than all
// zero's. If the instance name to the SRL is changed, that change
// needs to be reflected in the defparam statements.

defparam SRL16_inst.INIT = 16'h0000;

// End of SRL16_inst instantiation

然后具体例子:
基于SRL16的分布式RAM不再支持V5、S6和V6等器件,但是SRL16是所有XIlinx器件都支持的,并且在设计中应用非常频繁,因此可通过调用原语的方法来调用SRL16E甚至SRL32E来实现原来ISE分布式RAM IP核的设计。下面给出一段示例代码

module s2p_8channels_srl16(
       a, d, clk, we, qspo
    );

input   [3:0]   a;
    input   [4:0] d;
      input           clk;
      input           we;
      output [4:0] qspo;

SRL16E #(
   .INIT(16'h0000) // Initial Value of Shift Register
   ) SRL16_inst_1 (
   .Q(qspo[0]), // SRL data output
   .A0(a[0]), // Select[0] input
   .A1(a[1]), // Select[1] input
   .A2(a[2]), // Select[2] input
   .A3(a[3]), // Select[3] input
   .CE(we),
   .CLK(clk),      // Clock input
   .D(d[0]) // SRL data input
   );

SRL16E #(
   .INIT(16'h0000) // Initial Value of Shift Register
   ) SRL16_inst_2 (
   .Q(qspo[1]), // SRL data output
   .A0(a[0]), // Select[0] input
   .A1(a[1]), // Select[1] input
   .A2(a[2]), // Select[2] input
   .A3(a[3]), // Select[3] input
   .CE(we),
   .CLK(clk),      // Clock input
   .D(d[1]) // SRL data input
   );

SRL16E #(
   .INIT(16'h0000) // Initial Value of Shift Register
   ) SRL16_inst_3 (
   .Q(qspo[2]), // SRL data output
   .A0(a[0]), // Select[0] input
   .A1(a[1]), // Select[1] input
   .A2(a[2]), // Select[2] input
   .A3(a[3]), // Select[3] input
   .CE(we),
   .CLK(clk),      // Clock input
   .D(d[2]) // SRL data input
   );    
  
   SRL16E #(
   .INIT(16'h0000) // Initial Value of Shift Register
   ) SRL16_inst_4 (
   .Q(qspo[3]), // SRL data output
   .A0(a[0]), // Select[0] input
   .A1(a[1]), // Select[1] input
   .A2(a[2]), // Select[2] input
   .A3(a[3]), // Select[3] input
   .CE(we),
   .CLK(clk),      // Clock input
   .D(d[3]) // SRL data input
   );    
  
   SRL16E #(
   .INIT(16'h0000) // Initial Value of Shift Register
   ) SRL16_inst_5 (
   .Q(qspo[4]), // SRL data output
   .A0(a[0]), // Select[0] input
   .A1(a[1]), // Select[1] input
   .A2(a[2]), // Select[2] input
   .A3(a[3]), // Select[3] input
   .CE(we),
   .CLK(clk),      // Clock input
   .D(d[4]) // SRL data input
   );

endmodule

Xilinx FPGA中SRL(移位寄存器)资源相关推荐

  1. Xilinx FPGA中全局时钟资源的使用方法

    1. IBUFG 即输入全局缓冲,是与专用全局时钟输入管脚相连接的首级全局缓冲.所有从全局时钟管脚输入的信号必须经过IBUFG单元,否则在布局布线时会报错.IBUFG支持AGP,CTT,GTL,GTL ...

  2. (Xilinx)FPGA中的差分信号

    LVDS LVDS:Low Voltage Differential Signaling,低电压差分信号.不同电路系统之间的高速信号传送都可以应用低压差分传送技术来实现,LVDS传输支持速率一般在15 ...

  3. Xilinx FPGA中HP HR HD bank分别是什么用途

    在开发FPGA绑定管脚时,经常会看到HP Bank.HR Bank和HD Bank,它们分别是什么意思?分别可以适用于哪些应用个?   首先我们要明确一点,这几个概念都是在7系列之后才有的,其中7系列 ...

  4. Xilinx Altera FPGA中的逻辑资源(Slices VS LE)比较

    前言 经常有朋友会问我,"我这个方案是用A家的FPGA还是X家的FPGA呢?他们的容量够不够呢?他们的容量怎么比较呢?"当然,在大部分时候,我在给客户做设计的时候,直接会用到最高容 ...

  5. Xilinx Altera FPGA中的逻辑资源(Slices VS LE)比较

    前言 经常有朋友会问我,"我这个方案是用A家的FPGA还是X家的FPGA呢?他们的容量够不够呢?他们的容量怎么比较呢?"当然,在大部分时候,我在给客户做设计的时候,直接会用到最高容 ...

  6. FPGA基础知识2(Xilinx Altera FPGA中的逻辑资源 --Slices VS LE比较)

    来源:http://www.union-rnd.com/xilinx-vs-altera-slices-vs-les/ 前言 经常有朋友会问我,"我这个方案是用A家的FPGA还是X家的FPG ...

  7. FPGA基础知识 2(Xilinx/Altera FPGA 中的逻辑资源--Slices VS LE 比较)

    前言 经常有朋友会问我,"我这个方案是用A家的FPGA还是X家的FPGA呢?他们的容量够不够呢?他们的容量怎么比较呢?"当然,在大部分时候,我在给客户做设计的时候,直接会用到最高容 ...

  8. Xilinx FPGA中HR、HD、HP bank说明

      HR bank HP bank HD bank 全称 High Range High Performance High Desity 名称 高范围bank 高性能bank 高密度bank 电压范围 ...

  9. Xilinx FPGA时钟资源的使用

    赛灵思FPGA时钟资源的类型:DCM.PLL.PMCD.MMCM DCM:数字时钟管理器 PLL:锁相环 PMCD:相位匹配时钟分频器 MMCM:混合模式时钟管理器 DCM实际上就是一个DLL(延迟锁 ...

最新文章

  1. eclipse不支持泛型_C++ 泛型编程(一)
  2. RMAN删除归档日志不释放问题
  3. Mocha BSM产品亮点——以Portal为展现中心的监控管理平台
  4. sigmoid函数_常用的激活(激励)函数——深度学习笔记(建议收藏)
  5. VB中DoEvents的注意事项
  6. JDBC批量插入数据优化,使用addBatch和executeBatch
  7. Elasticsearch结构化搜索_filter执行原理深度剖析(bitset机制与caching机制)
  8. jquery.ui.dialog 1.81在IE8中出现滚动条bug解决方法
  9. 5 EDA技术实用教程【基本语句2】
  10. 谷歌翻译api_Deepl:一款优秀的专业翻译软件
  11. python压缩视频_如何压缩视频大小?
  12. pdg是什么格式文件怎么打开
  13. HS0038红外接收模块遇到的问题
  14. 8-9 魔术师_动画魔术师:将作弊变成艺术形式的8种方法
  15. u盘容量影响计算机运行速度,插u盘导致电脑运行速度慢的解决方法
  16. 路由来源、优先级和度量值
  17. 百度连续四年亮相全球量子信息处理顶会QIP 宣布量子战略规划升级
  18. 剑指offer55 二叉树的深度 捏软柿子
  19. c#如何实现叫号操作_基于.NET的排队语音叫号系统设计与实现
  20. ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

热门文章

  1. RT-Thread与智能车比赛
  2. 2020年人工神经网络第二次作业-参考答案第五题
  3. linux中double大小,linux 下 float 和 double 精度计算差别
  4. usb扩展坞同时接键盘鼠标_这个多功能扩展坞,增加多个接口,笔记本秒变工作站...
  5. android 5.0 ios 8,iOS 8与Android 5.0大比拼:功能相同 体验不同
  6. python玩王者荣耀皮肤_利用Python完成对王者荣耀英雄全皮肤的下载
  7. chmod 赋权所有_Linux中利用sudo进行赋权的方法详解
  8. mongodb mysql 事务_MongoDB数据库两阶段提交实现事务的方法详解 _ 蚂蚁视界
  9. mpp文件转换excel_怎么将pdf文件转换成excel表格格式呢?
  10. python selenium自动化断言_python+selenium自动化登录测试,设计不同场景进行登录,两种方式断言,截图保存...