Verilog, the Next Generation: Accellera's Systemverilog

Verilog, the Next Generation: Accellera's Systemverilog

Verilog, The Next Generation: Accellera’s SystemVerilog Stuart Sutherland Sutherland HDL, Inc., Portland, Oregon [email protected] Abstract technical subcommittee include experts in simulation engines, synthesis compilers, verification methodologies, This paper provides an overview of the proposed Accellera SystemVerilog standard. SystemVerilog is a blend of C, members of the IEEE Verilog Standards Group, and senior C++, SUPERLOG and Verilog, which greatly extends the design and verification engineers. ability to model designs at an abstract architectural level. The paper also discusses the current status of the proposed 2. Interfaces standard. Background: Verilog connects one module to another through module ports. This requires a detailed knowledge 1. Introduction of the intended hardware design, in order to define the specific ports of each module that makes up the design. Moore's law is still proving to be true; the designs we are Early in a design cycle, this detail may not be well creating keep getting larger and larger at an amazing pace. established, yet it is difficult to change the port Hardware design and verification languages need to keep configurations of a design once the initial module ports up with the pace of ever increasing design sizes. The IEEE 1,2 have been defined. In addition, several modules often have 1364 Verilog-2001 standard helps, with many significant many of the same ports, requiring redundant port enhancements to the Verilog language. But, the IEEE definitions for each module. Every module connected to a standardization process is slow and cumbersome. It took PCI bus, for example, must have the same ports defined. four years from the time work was started on Verilog-2001 until the IEEE ratified the standard. By time Verilog-2001 SystemVerilog provides a new, high level of abstraction for was approved, our design needs were already demanding module connections, called interfaces. An interface is more from the language. We cannot wait another 4 years defined independent from modules, between the keywords for the next set of enhancements to the Verilog language. interface and endinterface. Modules can use an interface the same as if it were a single port. To provide Verilog designers with greater capability, at a faster pace, Accellera—the combined VHDL International In its simplest form, an interface can be considered a and Open Verilog International organizations—has bundle of wires. All the signals that make up a PCI bus, for proposed a set of high-level extensions to the Verilog example, can be bundled together as an interface. Using 3 interfaces makes it possible to begin a design without first language, known as SystemVerilog . These extensions establishing all of the interconnections between modules. provide powerful enhancements to Verilog, These As the details of design become more established, the extensions provide powerful enhancements to Verilog, specific signals within the interfaces can be easily be such as C language data types, structures, packed and represented; any changes within the interfaces will be unpacked arrays, interfaces, assertions, and much more. reflected in all modules using the interfaces, without Origins of SystemVerilog: SystemVerilog began with having to change each module.. donations of major portions of the SUPERLOG language interface chip_bus; // Define the interface by Co-design4, and assertions work by Verplex. These wire read_request, read_grant; donations were made about July, 2001. The Accellera wire [7:0] address, data; endinterface: chip_bus HDL+ subcommittee then met an average of twice monthly to standardize these donations. A major part of module RAM(chip_bus io, //use the interface input clk); this standardization effort has been to ensure that //io.read_request references a signal in SystemVerilog is fully compatible with the IEEE 1364- // the interface 2001 Verilog standard. Members of the Accellera HDL+ endmodule module CPU(chip_bus io, input clk); 4. Time unit and precision ... endmodule Background: In Verilog, time values are specified as a number, without any time unit. For example: module top; forever #5 clock = ~clock; reg clk = 0; chip_bus a; //instantiate the interface The Verilog standard does not specify a default unit or time or time precision (where precision is the maximum number //connect interface to module instances of decimal points used in time values). The time units and RAM mem(a, clk); precision are a property of each module, set by the CPU cpu(a, clk); endmodule compiler directive ‘timescale. There is an inherent danger with compiler directives, however, because they are SystemVerilog interfaces go beyond just representing dependent on source code order. If there are multiple bundles or interconnecting signals. An interface can also ‘timescale directives in the source code, the last include functionality that is shared by each module that directive encountered before a module is elaborated uses the interface. In addition, an interface can include determines the time units of the module. If a module is not built-in protocol checking. Shared functionality and preceded by a ‘timescale directive, the time units and protocol checking is possible because SystemVerilog precision of that module become dependent on the order interfaces can include parameters, constants, variables, the source code is compiled. This can potentially cause structures, functions, tasks, initial blocks, always blocks, different simulation runs to have different results. and continuous assignments. SystemVerilog adds two significant enhancements to control the time units of time values. First, time values can 3. Global declarations and statements have an explicit unit specified. The unit is one of s, ms, ns, ps or fs, for seconds down to femtoseconds. The time unit Background: Verilog does not have a global space, other is a suffix to the time value, and cannot be preceded by a than that the names of modules can be referenced from any white space. For example: other module, as module instances. Verilog also allows any number of top-level modules, which creates unrelated forever #5ns clock = ~clock; hierarchy trees. Second, SystemVerilog allows the time units and time precision to be specified with new keywords, timeunit and SystemVerilog adds an implicit top-level hierarchy, called timeprecision. These declarations can be specified within $root. Any declarations or statements outside of a module any module, or globally, in the $root space. The units and boundary will be in the $root space. All modules, precision must be a power of 10, ranging from seconds anywhere in the design hierarchy, can refer to names down to femtoseconds. declared in $root. This allows global variables, functions and other information to be declared, that are shared by all timeunits 1ns; timeprecision 10ps; levels of hierarchy in the design. reg error _flag; //global variable 5. Abstract data types function compare (...); //global function Background: Verilog provides hardware-centric net, reg and variable data types. These types represent 4-state logic always @(error_flag) //global statement ... values, and are used to model and verify hardware behavior at a detailed level. The net data types also have module test; multiple strength levels and resolution functions for zero or chip1 u1 (...) multiple drivers of the net. endmodule SystemVerilog includes the C language char and int data module chip1 (...); types, which allows C and C++ code to be directly used in FSM u2 (...); Verilog models and verification routines. The Verilog PLI always @(data) is no longer needed to integrate Bus Functional Models, error_flag = compare(data, expected); algorithmic models, and C functions. SystemVerilog also endmodule adds several new data types to Verilog, which allow module FSM (...); hardware to modeled at more abstract levels. ... • char — a 2-state signed variable, that is the same as the always @(state) char error_flag = compare(state, expected); C data type, which may be an 8 bit integer (ASCII) endmodule or a short int (Unicode). • int — a 2-state signed variable, that is similar to the C 6. Signed and unsigned modifiers int data type, but is defined to be exactly 32 bits. Background: By default, the Verilog net and reg data • shortint — a 2-state signed variable, that is defined to types are unsigned types, and the integer type is a signed be exactly 16 bits. type. The Verilog-2001 standard allows the unsigned types • longint — a 2-state signed variable, that is defined to to be explicitly declared as signed data types using the be exactly 64 bits, similar to the C long long type. signed keyword. • byte — a 2-state signed variable, that is defined to be SystemVerilog adds the counterpart, the capability to exactly 8 bits. explicitly declare signed data types to be unsigned, using • bit — a 2-state unsigned data type of any vector width, the unsigned keyword. For example: that can be used in place of the Verilog reg data type. int unsigned j; • logic — a 4-state unsigned data type of any vector It should be noted that unsigned is a reserved word in the width, that can be used in place of either a Verilog net or Verilog language, but is not used by the Verilog standard. reg data type, but with some restrictions. • shortreal — a 2-state single-precision floating point 7. User defined types variable, that is the same as the C float type. Background: Verilog does not allow users to define new • void — represents no value, and can be specified as the data types. return value of a function, the same as in C. SystemVerilog provides a method to define new data types The SystemVerilog bit and other data types allow using typedef, similar to C. The user-defined type can modeling designs using 2-state logic, which is much more then be used in declarations the same as with any data type. efficient for simulation performance. Since the Verilog typedef unsigned int uint; language does not have a two-state data type, many uint a, b; simulators have provided the capability as an option to the A user-defined type can be used before it is defined, simulator.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us