05.07.2013 Views

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Assignment Extension Past 32 Bits<br />

If the expression on the left-hand side of an assignment is wider than<br />

the expression on the right-hand side, the left-hand side will be<br />

padded to the left according to the following rules.<br />

• If the right-hand expression is signed, the left-hand expression<br />

will be padded with the sign bit (0 for positive, 1 for negative, z<br />

for high impedance or x for unknown).<br />

• If the right-hand expression is unsigned, the left-hand expression<br />

will be padded with 0s.<br />

• For unsized x or z constants only the following rule applies. If the<br />

value of the right-hand expression’s left-most bit is z (high<br />

impedance) or x (unknown), regardless of whether the righthand<br />

expression is signed or unsigned, the left-hand expression<br />

will be padded with that value (z or x, respectively).<br />

Note The above rules follow the Verilog-2001 standard, and are not<br />

backward compatible with Verilog-1995.<br />

Tasks and Functions<br />

The declaration of a function or task is intended for handling blocks<br />

used multiple times in a design. They must be declared and used in a<br />

module. The heading part contains the parameters: input parameters<br />

(only) for functions and input/output/inout parameters for tasks.<br />

The return value of a function can be declared either signed or<br />

unsigned. The content is similar to the combinatorial always block<br />

content. Recursive function and task calls are not supported.<br />

Example 7-9 shows a function declared within a module. The ADD<br />

function declared is a single-bit adder. This function is called 4 times<br />

with the proper parameters in the architecture to create a 4-bit adder.<br />

The same example, described with a task, is shown in Example 7-10.<br />

7-22 <strong>Xilinx</strong> Development System

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

Saved successfully!

Ooh no, something went wrong!