SystemVerilog语法

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
2 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Intro
SystemVerilog combines the Verification capabilties of HVL (Hardware Verification Language) with ease of Verilog to provide a single platform for both design and verification.
o typedef data_type type_identifier variable_dimension o typedef interface_instance_identifier type_identifier o typedef [ enum | struct | union | class ] type_identifier
6 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Data Types -
chandle data types
chandle data type is used for storing the pointer, while using Direct programming
14 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Data Types - new data types
Queues,
byte q1[$]; // A queue of bytes string names[$] = { "Bob" }; // A queue of strings with one element Method: size(), delete(), pop_front(), pop_back()…..
• equivalent to a packed array subdivided into named fields:
– example: 48 bit packed array – can be accessed as pack1[15:0] <= ‘b0; – can access pack1[9:4] <= 15;
12 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Data Types found in C language.
Structures and unions types
Structure and union declarations types are same as that
Data Types build in methods
ຫໍສະໝຸດ Baidu
string data types -3
10 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Data Types -
event data types
Syntax : event variable_name [= initial_value] Initial value can be another event variable, And can be null if you want variable_name to be triggered always.
Data Types -
void and null data values
void and null types value are same as in C language o void is used in functions to return no value. o null is used for comparing a variable to empty value, say comparing a string to empty string.
Data Types 2 state value integer data types are
Integer data types
4-state value integers data types are o logic : User defined vector types.
o shortint : 16-bit signed integer. o o o int : 32-bit signed integer. longint : 64-bit signed integer. byte : 8-bit signed integer, can be used for storing ASCII charater. bit : User defined vector types.
3 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Data Types -
intro
Highlights of SystemVerilog datatypes are below o shortint and longint data types. o shortreal (real was already defined in Verilog) data type. o string, chandle and class data types. o logic, bit and byte data type. o User defined types typedef.
8 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Data Types String Operators
string data types -2
9 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Intro_to_SystemVerilog
Amy Wu 12/2013
1 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Content
Intro Data Types Processes SystemVerilog Classes SystemVerilog Interfaces SystemVerilog Program Block SystemVerilog Clocking Random Constraints Functional coverage
packed : A packed structure consists of bit fields, which
are packed together in memory without gaps. unpacked : An unpacked structure has an
implementation-dependent packing, normally matching
dynamic
bit [3:0] nibble[]; integer mem[]; Method new[], size(), delete()
and associative arrays
bit[20:0] array_b[string]; event ev_array[myClass]; Method: num(), delete(); exists()... reduced memory usage, built-in support for searching and sorting
the C compiler. tagged : An Tagged union is a type-checked union.
13 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Data Types -
Structures and unions types
– can be accessed as pack1.d <= ‘b0;
– the whole struct can be resetted with pack1 <= ‘b0;
• unpacked struct (no “packed” keyword) allow only acces through the named fields (pack1.d <=‘b0);
o reg : User defined vector types.
o wire : User defined vector types.
o integer : 32-bit signed integer.
o time : 64-bit unsigned integer.
o
5 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
11 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Data Types -
User defined types
User defined types are same as found in C language or others. A type can be used before it is defined, provided it is first identified as a type by an empty typedef. Syntax
o struct, union, and class data types.
o void data type. o null data type.
o arrays, queue, associative array, dynamic array
4 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
New features
C type data types like int, typedef, struct, union, enum. Dynamic data types : struct, classes, dynamic queues, dynamic arrays.
New operators and built in methods.
Enhanced flow control like, foreach, return, break, continue. Semaphores, mailboxes, event extensions. classes for object oriented programming. Assertions. Coverage.
interface(DPI).
7 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
Data Types -
string data types -1
string data type is used for storing strings. the size of string data is dynamic. string data types come with build in methods
15 | Presentation Title | December 25, 2018 | AMD SRDC Confidential
相关文档
最新文档