05.07.2013 Views

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

XST <strong>User</strong> <strong>Guide</strong><br />

RAMs<br />

Verilog<br />

Following is the Verilog code for resource sharing.<br />

module addsub(A, B, C, OPER, RES);<br />

input OPER;<br />

input [7:0] A;<br />

input [7:0] B;<br />

input [7:0] C;<br />

output [7:0] RES;<br />

reg [7:0] RES;<br />

always @(A or B or C or OPER)<br />

begin<br />

if (OPER==1'b0) RES = A + B;<br />

else RES = A - C;<br />

end<br />

endmodule<br />

If you do not want to instantiate RAM primitives in order to keep<br />

your HDL code technology independent, XST offers an automatic<br />

RAM recognition capability. XST can infer distributed as well as<br />

Block RAM. It covers the following characteristics, offered by these<br />

RAM types:<br />

• Synchronous write<br />

• Write enable<br />

• RAM enable<br />

• Asynchronous or synchronous read<br />

• Reset of the data output latches<br />

• Data output reset<br />

• Single, dual or multiple-port read<br />

• Single-port write<br />

The type of the inferred RAM depends on its description:<br />

• RAM descriptions with an asynchronous read generate a<br />

distributed RAM macro.<br />

2-120 <strong>Xilinx</strong> Development System

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!