Hierarchy
Verilog HDL has a simple organization. All data, functions and tasks are in modules except for system tasks and functions, which are global, and can be defined in the PLI. A Verilog module can contain instances of other modules. Any uninstantiated module is at the top level. This does not apply to libraries, which therefore have a different status and a different procedure for analyzing them.
A hierarchical name can be used to specify any named object from anywhere in the instance hierarchy. The module hierarchy is often arbitrary and a lot of effort is spent in maintaining port lists.
SystemVerilog adds many enhancements for representing design hierarchy:
» Packages containing declarations such as data, types, classes, tasks and functions
» Separate compilation support
» A compilation-unit scope visible only within a compilation unit
» Nested module declarations, to aid in representing self-contained models and libraries
» Relaxed rules on port declarations
» Simplified named port connections, using .name
» Implicit port connections, using .*
» Time unit and time precision specifications bound to modules
» A concept of interfaces to bundle connections between modules.
Packages:
SystemVerilog packages provide an additional mechanism for sharing
» parameters
» data type
» task
» function
» sequence
» property declarations amongst multiple SystemVerilog modules
interfaces and program Packages are explicitly named scopes appearing at the outermost level of the source text. Types, variables, tasks, functions, sequences, and properties may be declared within a package. Such declarations may be referenced within modules, macromodules, interfaces, programs, and other packages by either import or fully resolved name.
Above can be shared across SystemVerilog modules, macromodule interfaces and programs. Few rules that should be followed with packages are.
» Packages can not contain any assign statement.
» Variable declaration assignments within the package shall occur before any initial, always, always_comb, always_latch, or always_ff blocks
» Items within packages cannot have hierarchical references.
» Assign statment on any net type is not allowed.
Accessing data, functions or types in packages there are two ways.
» By class scope resolution operator ::
» By import statement : The import statement provides direct visibility of identifiers within packages.
package ComplexPkg;
typedef struct {
float i, r;
} Complex;
function Complex add(Complex a, b);
add.r = a.r + b.r;
add.i = a.i + b.i;
endfunction
function Complex mul(Complex a, b);
mul.r = (a.r * b.r) - (a.i * b.i);
mul.i = (a.r * b.i) + (a.i * b.r);
endfunction
endpackage : ComplexPkg
Referencing data in packages
Packages must exist in order for the items they define to be recognized by the scopes in which they are imported. One way to use declarations made in a package is to reference them using the scope resolution operator “::”.
ComplexPkg::Complex cout = ComplexPkg::mul(a, b);
An alternate method for utilizing package declarations is via the import statement.
Compilation unit support
SystemVerilog supports separate compilation using compiled units. The following terms and definitions are provided:
compilation unit: a collection of one or more SystemVerilog source files compiled together
compilation-unit scope: a scope that is local to the compilation unit. It contains all declarations that lie outside of any other scope
$unit: the name used to explicitly access the identifiers in the compilation-unit scope
Top-level instance:
The name $root is added to unambiguously refer to a top level instance, or to an instance path starting from the root of the instantiation tree. $root is the root of the instantiation tree.
For example:
$root.A.B // item B within top instance A
$root.A.B.C // item C within instance B within instance A
This blog contains all the information, latest technologies in VLSI and interview questions for freshers
Subscribe to:
Post Comments (Atom)
Popular Posts
-
http://www.mediafire.com/?n77dan3ovdwyoy3 http://www.mediafire.com/?8ncruxr37o1dbqb http://www.mediafire.com/?jqhvobf6j4gbp6e ...
-
Verilog code for an 8-bit shift-left register with a positive-edge clock, serial in and serial out. module shift (clk, si, so);...
-
Verilog code for a 4-bit unsigned up counter with asynchronous clear. module counter (clk, clr, q); input ...
-
seminar topics with ppts if u need any topics below mail me: bsnspkumar_484@yahoo.co.in Analysis of the Performance of DOA Algorithms in sma...
-
ECE Seminar topics These are the seminar topics based on Electronics and Communications. If u need abstracts of the below seminar topics u c...
-
// memory module `timescale 1ns/1ns module ram(wr_ad,rd_ad,wr_en,rd_en,clk,wr_dat,rd_dat); //parameter addr_width=4; //parameter depth=16; /...
-
Verilog code for single-port RAM in read-first mode. module raminfr (clk, en, we, addr, di, do); input clk; input ...
-
If inverted output of D flip-flop is connected to its input how the flip-flop behaves? Design a circuit to divide input frequency by 2...
-
Synthesizeable constructs and VHDL templates VHDL is frequently used for two different goals: simulation of electronic designs and synthesis...
-
http://www.mediafire.com/?h1bj9w1bx8kja69 http://www.mediafire.com/?yot1d4b0u344lmc http://www.mediafire.com/?hzqj1m6j91mg9td http://ww...
No comments:
Post a Comment