Download svlib user guide and specification
Transcript
2 Introduction and Overview This document describes svlib, a utility library for SystemVerilog. It provides functionality that we have found lacking in SystemVerilog for our day-to-day verification work: string processing, operating system interface and many other useful operations. Section 3 describes how to integrate svlib with your simulator and your own SystemVerilog code. Section 4 discusses some underlying principles and conventions of svlib, to help you use it with confidence. Section 5 documents features of svlib that support string manipulations and operations that are not available in the base SystemVerilog language. Section 6 introduces the regular expression matching and substitution features. Section 7 gives details of the Pathname class, which makes it easy to perform common manipulations on a typical filename such as determining the directory, assembling a pathname from its directory components, finding a file's extension, etc. These operations are just specialized string functions; they do not make any access to the file system. Section 8 looks at svlib facilities for querying the file system. It allows you to find properties of files such as "does this file exist", "on what date was the file last modified", "can I write to this file", "is it a directory" and many others. Section 9 offers a collection of operating system query functions. You can easily discover the current (wall-clock) time and date, render a date in various humanreadable formats, explore the OS's environment variables, get the contents of a directory as a queue of strings, and read a high-resolution (sub-microsecond) timer. Section 10 discusses how errors are handled in svlib. By default errors are reported on the simulation console, but you can customize the error handling in various ways and even take full responsibility for handling errors under control of your own SystemVerilog code. Section 12 details classes and functions that support reading and writing configuration files in .ini or YAML format, and explains how to transfer configuration data between your own custom configuration classes and svlib's internal Document Object Model (DOM) representation. Section 13 describes a small group of functions allowing running simulations to query the simulation environment. In particular, full details of the simulator command line arguments and options can easily be retrieved. Section 14 describes a set of utility functions that make it easier to work with SystemVerilog enumeration types. Section 15 describes some convenience features, provided in the form of SystemVerilog macros. Finally, section 16 provides a number of ready-to-run examples that show svlib facilities in practical use. 3