打印

Xilinx FPGA哪些型号有SRL-type的资源?

[复制链接]
3759|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
AutoESL|  楼主 | 2011-6-28 16:51 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 AutoESL 于 2011-10-3 09:04 编辑

v6s6的用户手册里面有这样的说明:
XST implements inferred shift registers on SRL-type resources such as SRL16, SRL16E, SRLC16, SRLC16E, and SRLC32E.

我想知道其他的里面有没有这个资源呢?
v2,v4,v5 ...
spartan3 ...
这些里面有没有这类资源呢?

除了一个一个的use guide查询,还有什么更好的方式吗?

相关帖子

沙发
ertu| | 2011-6-29 13:42 | 只看该作者
不太了解,帮你定下

使用特权

评论回复
板凳
ertu| | 2011-6-29 13:42 | 只看该作者
超版估计在午休

使用特权

评论回复
地板
dan_xb| | 2011-7-8 09:57 | 只看该作者
哦,这个都有,不过是叫不同的名字
Xilinx FPGA内部的LUT有个特殊功能,就是可以配置成可变长度SRL
5输入的一个LUT可以变成32bit 的SRL
6输入的,可以变成64bit的SRL
所以,你写的SRL可能被综合成LUT

使用特权

评论回复
5
GoldSunMonkey| | 2011-7-8 13:12 | 只看该作者
本帖最后由 GoldSunMonkey 于 2011-7-8 13:50 编辑

1# AutoESL
这个看你怎么理解了。如果有具体的,你可以拿个例子,我来给你分析下。

先给你简单介绍下吧:

在一个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

使用特权

评论回复
评分
参与人数 1威望 +1 收起 理由
AutoESL + 1
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:天使宝贝 博客IT人生 From C/C++/SystemC to Xilinx FPGA

0

主题

2517

帖子

3

粉丝