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

Chapter 7: XST Verilog Language Support

R

Verilog System Tasks and Functions Supported in XST

Table 7-33: Verilog System Tasks and Functions Supported in XST

System Task or Function

Supported/Unsupported

Comment

 

 

 

$display

Supported

Escape sequences are limited

 

 

to %d, %b, %h, %o, %c and %s

 

 

 

$fclose

Supported

 

 

 

 

$fdisplay

Supported

 

 

 

 

$fgets

Supported

 

 

 

 

$finish

Supported

$finish is supported for

 

 

statically never active

 

 

conditional branches only

 

 

 

$fopen

Supported

 

 

 

 

$fscanf

Supported

Escape sequences are limited

 

 

to %b and %d

 

 

 

$fwrite

Supported

 

 

 

 

$monitor

Ignored

 

 

 

 

$random

Ignored

 

 

 

 

$readmemb

Supported

 

 

 

 

$readmemh

Supported

 

 

 

 

$signed

Supported

 

 

 

 

$stop

Ignored

 

 

 

 

$strobe

Ignored

 

 

 

 

$time

Ignored

 

 

 

 

$unsigned

Supported

 

 

 

 

$write

Supported

Escape sequences are limited

 

 

to %d, %b, %h, %o, %c and %s

 

 

 

all others

Ignored

 

 

 

 

The XST Verilog compiler ignores unsupported system tasks.

The $signed and $unsigned system tasks can be called on any expression using the following syntax:

$signed(expr) or $unsigned(expr)

The return value from these calls is the same size as the input value. Its sign is forced regardless of any previous sign.

The $readmemb and $readmemh system tasks can be used to initialize block memories. For more information, see “Initializing RAM From an External File.”

Use $readmemb for binary and $readmemh for hexadecimal representation. To avoid the possible difference between XST and simulator behavior, Xilinx recommends that you use index parameters in these system tasks. See the following coding example:

518

www.xilinx.com

XST User Guide

 

 

10.1

R

Verilog Primitives

$readmemb("rams_20c.data",ram, 0, 7);

The remainder of the system tasks can be used to display information to your computer screen and log file during processing, or to open and use a file during synthesis. You must call these tasks from within initial blocks. XST supports a subset of escape sequences, specifically:

%h

%d

%o

%b

%c

%s

Verilog $display Syntax Example

The following example shows the syntax for $display that reports the value of a binary constant in decimal format:

parameter c = 8'b00101010; initial

begin

$display ("The value of c is %d", c); end

The following information is written to the log file during the HDL Analysis phase:

Analyzing top module <example>. c = 8'b00101010

"foo.v" line 9: $display : The value of c is 42

Verilog Primitives

This section discusses Verilog Primitives, and includes:

“About Verilog Primitives”

“Verilog Primitives Support”

About Verilog Primitives

XST supports certain gate-level primitives. The supported syntax is:

gate_type instance_name (output, inputs, ...);

Following is a gate-level primitive instantiations coding example:

and U1 (out, in1, in2);

bufif1 U2 (triout, data, trienable);

XST User Guide

www.xilinx.com

519

10.1

Chapter 7: XST Verilog Language Support

R

Verilog Primitives Support

XST supports the following Verilog primitives:

“Verilog Gate-Level Primitives Supported in XST”

“Verilog Switch-Level Primitives Supported in XST”

“Verilog User-Defined Primitives Supported in XST”

Table 7-34: Verilog Gate-Level Primitives Supported in XST

Primitive

Supported/Unsupported

 

 

and nand nor or xnor xor

Supported

 

 

buf not

Supported

 

 

bufif0 bufif1 notif0 notif1

Supported

 

 

pulldown pullup

Unsupported

 

 

drive strength

Ignored

 

 

delay

Ignored

 

 

array of primitives

Supported

 

 

Table 7-35: Verilog Switch-Level Primitives Supported in XST

 

 

Primitive

Supported/Unsupported

 

 

cmos nmos pmos rcmos

Unsupported

rnmos rpmos

 

 

 

rtran rtranif0 rtranif1 tran

Unsupported

tranif0 tranif1

 

 

 

Table 7-36: Verilog User-Defined Primitives Supported in XST

 

 

Primitive

Supported/Unsupported

 

 

All user-defined primitives

Unsupported

 

 

Verilog Reserved Keywords

Keywords marked with an asterisk (*) are reserved by Verilog, but are not supported by XST.

Table 7-37: Verilog Reserved Keywords

always

and

assign

automatic

 

 

 

 

begin

buf

bufif0

bufif1

 

 

 

 

case

casex

casez

cell*

 

 

 

 

cmos

config*

deassign

default

 

 

 

 

defparam

design*

disable

edge

 

 

 

 

else

end

endcase

endconfig*

 

 

 

 

endfunction

endgenerate

endmodule

endprimitive

 

 

 

 

520

www.xilinx.com

XST User Guide

 

 

10.1

R

Verilog-2001 Support in XST

Table 7-37: Verilog Reserved Keywords (Cont’d)

endspecify

endtable

endtask

event

 

 

 

 

for

force

forever

fork

 

 

 

 

function

generate

genvar

highz0

 

 

 

 

highz1

if

ifnone

incdir*

 

 

 

 

include*

initial

inout

input

 

 

 

 

instance*

integer

join

large

 

 

 

 

liblist*

library*

localparam*

macromodule

 

 

 

 

medium

module

nand

negedge

 

 

 

 

nmos

nor

noshow-cancelled*

not

 

 

 

 

notif0

notif1

or

output

 

 

 

 

parameter

pmos

posedge

primitive

 

 

 

 

pull0

pull1

pullup

pulldown

 

 

 

 

pulsestyle-

pulsestyle-

rcmos

real

_ondetect*

_onevent*

 

 

 

 

 

 

realtime

reg

release

repeat

 

 

 

 

rnmos

rpmos

rtran

rtranif0

 

 

 

 

rtranif1

scalared

show-cancelled*

signed

 

 

 

 

small

specify

specparam

strong0

 

 

 

 

strong1

supply0

supply1

table

 

 

 

 

task

time

tran

tranif0

 

 

 

 

tranif1

tri

tri0

tri1

 

 

 

 

triand

trior

trireg

use*

 

 

 

 

vectored

wait

wand

weak0

 

 

 

 

weak1

while

wire

wor

 

 

 

 

xnor

xor

 

 

 

 

 

 

Verilog-2001 Support in XST

XST supports the following Verilog-2001 features. For more information, see Verilog-2001: A Guide to the New Features by Stuart Sutherland, or IEEE Standard Verilog Hardware Description Language manual, (IEEE Standard 1364-2001).

Generate statements

Combined port/data type declarations

ANSI-style port lists

Module parameter port lists

ANSI C style task/function declarations

XST User Guide

www.xilinx.com

521

10.1

Chapter 7: XST Verilog Language Support

R

Comma separated sensitivity list

Combinatorial logic sensitivity

Default nets with continuous assigns

Disable default net declarations

Indexed vector part selects

Multi-dimensional arrays

Arrays of net and real data types

Array bit and part selects

Signed reg, net, and port declarations

Signed based integer numbers

Signed arithmetic expressions

Arithmetic shift operators

Automatic width extension past 32 bits

Power operator

N sized parameters

Explicit in-line parameter passing

Fixed local parameters

Enhanced conditional compilation

File and line compiler directives

Variable part selects

Recursive Tasks and Functions

Constant Functions

522

www.xilinx.com

XST User Guide

 

 

10.1

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