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.

Behavioral Verilog Features<br />

Verilog Language Support<br />

This section contains descriptions of the behavioral features of<br />

Verilog.<br />

Variable Declaration<br />

Variables in Verilog may be declared as integers or real. These<br />

declarations are intended only for use in test code. Verilog provides<br />

data types such as reg and wire for actual hardware description.<br />

The difference between reg and wire is whether the variable is given<br />

its value in a procedural block (reg) or in a continuous assignment<br />

(wire) Verilog code. Both reg and wire have a default width being one<br />

bit wide (scalar). To specify an N-bit width (vectors) for a declared<br />

reg or wire, the left and right bit positions are defined in square<br />

brackets separated by a colon. In Verilog 2001, both reg and wire data<br />

types can be signed or unsigned.<br />

Example:<br />

reg [3:0] arb_priority;<br />

wire [31:0] arb_request;<br />

wire signed [8:0] arb_signed;<br />

where arb_request[31] is the MSB and arb_request[0] is the LSB.<br />

Arrays<br />

Verilog allows arrays of reg and wires to be defined as in the<br />

following two examples:<br />

reg [3:0] mem_array [31:0];<br />

The above describes an array of 32 elements each, 4 bits wide which<br />

can be assigned via behavioral verilog code.<br />

wire [7:0] mem_array [63:0];<br />

The above describes an array of 64 elements each 8 bits wide which<br />

can only be assigned via structural Verilog code.<br />

Multi-dimensional Arrays<br />

XST supports multi-dimensional array types of up to two<br />

dimensions. Multi-dimensional arrays can be wire or reg data type.<br />

You can do assignments and arithmetic operations with arrays, but<br />

XST <strong>User</strong> <strong>Guide</strong> 7-3

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

Saved successfully!

Ooh no, something went wrong!