Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
xst.pdf
Скачиваний:
141
Добавлен:
11.06.2015
Размер:
5.64 Mб
Скачать

R

Pipelined Distributed RAM HDL Coding Techniques

6'b001110: data <= 20'h04001; 6'b001111: data <= 20'h02500; 6'b010000: data <= 20'h00340; 6'b010001: data <= 20'h00241; 6'b010010: data <= 20'h04002; 6'b010011: data <= 20'h08300; 6'b010100: data <= 20'h08201; 6'b010101: data <= 20'h00500; 6'b010110: data <= 20'h08101; 6'b010111: data <= 20'h00602; 6'b011000: data <= 20'h04003; 6'b011001: data <= 20'h0241E; 6'b011010: data <= 20'h00301; 6'b011011: data <= 20'h00102; 6'b011100: data <= 20'h02122; 6'b011101: data <= 20'h02021; 6'b011110: data <= 20'h00301; 6'b011111: data <= 20'h00102;

endcase

end

endmodule

6'b101110: data <= 20'h04004; 6'b101111: data <= 20'h00301; 6'b110000: data <= 20'h00102; 6'b110001: data <= 20'h02137; 6'b110010: data <= 20'h02036; 6'b110011: data <= 20'h00301; 6'b110100: data <= 20'h00102; 6'b110101: data <= 20'h02237; 6'b110110: data <= 20'h04004; 6'b110111: data <= 20'h00304; 6'b111000: data <= 20'h04040; 6'b111001: data <= 20'h02500; 6'b111010: data <= 20'h02500; 6'b111011: data <= 20'h02500; 6'b111100: data <= 20'h0030D; 6'b111101: data <= 20'h02341; 6'b111110: data <= 20'h08201; 6'b111111: data <= 20'h0400D;

Pipelined Distributed RAM HDL Coding Techniques

This section discusses Pipelined Distributed RAM HDL Coding Techniques, and includes:

“About Pipelined Distributed RAM”

“Pipelined Distributed RAM Log File”

“Pipelined Distributed RAM Related Constraints”

“Pipelined Distributed RAM Coding Examples”

About Pipelined Distributed RAM

To increase the speed of designs, XST can infer pipelined distributed RAM. By interspersing registers between the stages of distributed RAM, pipelining can significantly increase the overall frequency of your design. The effect of pipelining is similar to flip-flop retiming which is described in “Flip-Flop Retiming.”

To insert pipeline stages, describe the necessary registers in your HDL code and place them after any distributed RAM, then set the “RAM Style (RAM_STYLE)” constraint to pipe_distributed.

When it detects valid registers for pipelining and RAM _STYLE is set to pipe_distributed, XST uses the maximum number of available registers to reach the maximum distributed RAM speed. XST automatically calculates the maximum number of registers for each RAM to obtain the best frequency.

If you have not specified sufficient register stages and RAM _STYLE is coded directly on a signal, the XST HDL Advisor advises you to specify the optimum number of register stages. XST does this during the Advanced HDL Synthesis step. If the number of registers placed after the multiplier exceeds the maximum required, and shift register extraction is activated, then XST implements the unused stages as shift registers.

XST cannot pipeline RAM if registers contain asynchronous set/reset signals. XST can pipeline RAM if registers contain synchronous reset signals.

XST User Guide

www.xilinx.com

235

10.1

Chapter 2: XST HDL Coding Techniques

R

Pipelined Distributed RAM Log File

Following is the log file for Pipelined Distributed RAM.

====================================================================

* HDL Synthesis *

====================================================================

Synthesizing Unit <rams_22>.

Related source file is "rams_22.vhd".

Found 64x4-bit single-port RAM for signal <RAM>. Found 4-bit register for signal <do>.

Summary:

 

 

inferred

1

RAM(s).

inferred

4

D-type flip-flop(s).

Unit <rams_22> synthesized.

=========================================================================

HDL Synthesis Report

Macro Statistics

 

 

#

RAMs

: 1

 

64x4-bit single-port RAM

: 1

#

Registers

:

1

 

4-bit register

:

1

=========================================================================

====================================================================

* Advanced HDL Synthesis *

====================================================================

INFO:Xst - Unit <rams_22> : The RAM <Mram_RAM> will be implemented as a distributed RAM, absorbing the following register(s): <do>.

-------------------------------------------------------------

| aspect ratio

| 64-word x

4-bit

|

|

| clock

| connected

to

signal <clk>

| rise

|

| write enable

| connected

to

signal <we>

| high

|

| address

| connected

to

signal <addr>

|

|

| data in

| connected

to

signal <di>

|

|

| data out

| connected to

internal node

|

|

| ram_style

| distributed

 

|

|

-------------------------------------------------------------

Synthesizing (advanced) Unit <rams_22>.

Found pipelined ram on signal <_varindex0000>:

- 1 pipeline level(s) found in a register on signal <_varindex0000>. Pushing register(s) into the ram macro.

INFO:Xst:2390 - HDL ADVISOR - You can improve the performance of the ram Mram_RAM by adding 1 register level(s) on output signal _varindex0000.

Unit <rams_22> synthesized (advanced).

=========================================================================

Advanced HDL Synthesis Report

Macro Statistics

 

 

# RAMs

:

1

64x4-bit registered single-port distributed RAM

:

1

=========================================================================

236

www.xilinx.com

XST User Guide

 

 

10.1

R

Pipelined Distributed RAM HDL Coding Techniques

Pipelined Distributed RAM Related Constraints

“RAM Extraction (RAM_EXTRACT)”

“RAM Style (RAM_STYLE)”

“ROM Extraction (ROM_EXTRACT)”

“ROM Style (ROM_STYLE)”

“BRAM Utilization Ratio (BRAM_UTILIZATION_RATIO)”

“Automatic BRAM Packing (AUTO_BRAM_PACKING)”

Pipelined Distributed RAM Coding Examples

The coding examples in this section are accurate as of the date of publication. Download updates from ftp://ftp.xilinx.com/pub/documentation/misc/examples_v9.zip.

“Pipelined Distributed RAM”

Pipelined Distributed RAM

This section discusses Pipelined Distributed RAM, and includes:

“Pipelined Distributed RAM Diagram”

“Pipelined Distributed RAM Pin Descriptions”

“Pipelined Distributed RAM VHDL Coding Example”

“Pipelined Distributed RAM Verilog Coding Example”

WE

 

 

 

 

 

 

 

 

 

 

DO

 

 

 

 

 

 

 

 

 

 

DI

 

 

 

Block

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ADDR

 

 

 

 

RAM

 

CE

 

 

CLK

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X10572

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 2-73: Pipelined Distributed RAM Diagram

Table 2-91: Pipelined Distributed RAM Pin Descriptions

 

 

 

 

 

IO Pins

 

 

Description

 

 

 

 

 

clk

 

 

Positive-Edge Clock

 

 

 

 

 

we

 

 

Synchronous Write Enable (Active High)

 

 

 

 

 

addr

 

 

Read/Write Address

 

 

 

 

 

 

 

 

 

 

 

 

XST User Guide

www.xilinx.com

237

10.1

Chapter 2: XST HDL Coding Techniques

Table 2-91: Pipelined Distributed RAM Pin Descriptions

IO Pins

Description

di

 

Data Input

 

do

 

Data Output

 

 

 

Pipelined Distributed RAM VHDL Coding Example

--

-- Pipeline distributed RAMs

--

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all;

entity rams_22

is

port (clk

: in std_logic;

we

: in std_logic;

addr

: in std_logic_vector(8 downto 0);

di

: in std_logic_vector(3 downto 0);

do

: out std_logic_vector(3 downto 0));

end rams_22;

 

architecture syn of rams_22 is

type ram_type is array (511 downto 0) of std_logic_vector (3 downto 0); signal RAM : ram_type;

signal pipe_reg: std_logic_vector(3 downto 0);

attribute ram_style: string;

attribute ram_style of RAM: signal is "pipe_distributed"; begin

process (clk) begin

if clk'event and clk = '1' then if we = '1' then

RAM(conv_integer(addr)) <= di;

else

pipe_reg <= RAM( conv_integer(addr)); end if;

do <= pipe_reg; end if;

end process;

end syn;

Pipelined Distributed RAM Verilog Coding Example

//

// Pipeline distributed RAMs

//

module v_rams_22 (clk, we, addr, di, do);

R

238

www.xilinx.com

XST User Guide

 

 

10.1

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]