初生牛犊不怕虎,拿着EDN.com的大作在这里瞎搞,练手!对原作者以及EDN说声“抱歉”
许多设计要求FIFO弹性缓冲器在具有不同的时钟频率的子系统和接入设备之间形成一座桥梁。然而,在某些应用中,你需要使用FIFO缓冲器进行数据转换。一个例子是,你需要通过FIFO缓冲器连接8位ADC和16位数据总线微处理器(图1)。不幸的是,大多数现有的FIFO缓冲器不适合这种应用。这种设计理念阐述了如何为一种基于FPGA的带有不同位宽的读写数据端口的FIFO数据位宽转换器实现共同时钟速率(同步版),你可以实现这一FIFO缓冲器,通过使用Xilinx( www.xilinx.com)的Spartan II 系列的FPGA 。该方法采用了一个片上的DLL
(延时锁定回路)宏观、分布式存储器以及简单的逻辑柜(图2 )。FIFO缓冲器的输入数据宽度是8位;然而,输出数据宽度是16位。你只能使用一个共同的时钟完成读和写。诀窍在于使用一个频率的DLL,这种dll不仅最大限度地使时钟偏离,而且还提供了双频率输出时钟。所以,你在输入以及写入数据时可以实现双倍数据输入速率。靠监测DLL中的输出时钟的某样本,该DLL可以补偿路由网络的延迟,有效消除在一个设备上从外部输入端口到自身时钟装置的数据处理延时。这种设计采用分布式存储器取代块存储器在FIFO缓冲器中进行数据处理。事实上,选择块存储器或分布式存储器取决于FIFO缓冲器在你的系统中的重要性。如果不是非常关键,你可能会考虑采用分布式存储器。
你可以把内存存储于FPGA的你喜欢的任何地方,如果你坚持用块存储器,你可以轻松修改vhdl代码。你可以仅仅使用一些RAM取代分布式存储器。点击这里为FIFO缓冲器下载VHDL代码。FIFOS普遍使用格雷码计数器或线性反馈移位寄存器作为读或写的计数器。为使逻辑分析最小化,这种设计一般采用从0到7中的两个整数计数,连带一个辅助计数器。当读写计数器的计数相等,附带的辅助计数器计数为零,先进先出缓冲器计数为空,当写计数器计数加一就等于读取计数器的计数那么附带的辅助计数器为一,先进先出缓冲器计数为满。
RAM macros ?
clocked DLL ?
the logic size ?
上面问号处为几个不知道如何翻译为好的地方,希望大虾可以指点!
另外,这些翻译只是自己练习的东西,不能保证别人能看明白,只是自己经过一次翻译后,基本上自己可以明白的了。
由于来自EDN.com,所以可能在EDNChina.com已经有编辑翻译好的标准中文版了,只是我还没有找到,如果有找到的,希望能贴出地址,让我去查查自己的差距,继续学习!
-----------原文———————
Many designs require FIFO elastic buffers to form a bridge between subsystems
with different clock rates and access requirements. However, in some
applications, you need FIFO buffers for data conversion. One example is the
case in which you need to connect an 8-bit ADC to a 16-bit data-bus
microprocessor through a FIFO buffer (Figure 1). Unfortunately, most currently
available FIFO buffers are unsuitable for this application. This Design Idea
describes how to implement a common clock (synchronous version) for an
FPGA-based FIFO for data-width conversion with different-width read and write
data ports. You can implement this FIFO using a Xilinx (www.xilinx.com)
Spartan II Series FPGA. The method uses an on-chip DLL (delay-locked-loop)
macro, distributed memories, and simple counter logic (Figure 2).
The width of the input data of the FIFO is 8 bits; however, the width of the
output data is 16 bits. You use only one common clock for both read and write
actions. The trick is to use a clocked DLL, which not only minimizes clock
skews, but also offers a double-frequency output clock. So, you can implement
a double data rate for the input data, write_data_in. By monitoring a sample
of the DLL output clock, the DLL can compensate for the delay on the routing
network, efficiently eliminating the delay from the external input port to the
individual clock loads within the device. Instead of using block memory, this
design employs distributed memory to hold the data in FIFO. In fact, choosing
block memory or distributed memory depends on how important this FIFO is in
your system. If it is not critical, you may want to consider using distributed
memory.
You can put the memory anywhere you like within the FPGA. If you insist on
using block memory, you can easily modify the VHDL code. You can just use some
RAM macros to replace distributed memories. Click here to download the VHDL
code for the FIFO. FIFOs commonly use Gray-code counters or linear-feedback
shift registers as read or write counters. To minimize the logic size, this
design uses only two integers ranging from 0 to 7 together with a carry for
the counters. When the read and write counters are equal and the carry is
zero, the FIFO is empty. When the write counter plus one is equal to the read
counter and the carry is one, the FIFO is full.
原文来自EDN.com http://www.edn.com/article/CA244151.html
zwj-gg_818035047 2007-10-12 12:41