liveasic.com Blog

November 11, 2009

System Verilog 1 ‘TimeScale’

Filed under: System Verilog, Verification Languages — lasic @ 2:38 pm

In this edit, lets see the advancement is System Verilog over traditional Verilog as for as timescale is concerned.

In verilog lets see how a clock is implemented.

reg clock;

initial clock <= 1′b0;
forever #10 clock <= ~clock;

In the above example what is the frequency of the clock generated????
The answer is not readily available since it depends on more factors. It depends on the `timescale directive.

`timescale 1ns/10ps

The problem with depending on a compiler directive timescale is that, compiler directives are influenced by the compile order of the source code.

This issue has been pretty well fixed in System Verilog. In SV we can specify timescale and precision for each module and much more importantly its not a compiler directive.
These are implemented as declarative statements.

timeunits 1ns;
timeprecision 10ps;

The units specified for timeunits and timeprecision can be

s – seconds
ms – milliseconds
ns – nanoseconds
ps – picoseconds
fs – femtoseconds

There is one more option available is SV, you can even specify the timeunits in the clock declartion as below:

reg clock;

initial clock <= 1′b0;
forever #10ns clock <= ~clock;

Here we see that we can directly say #1ons as the clock period.


November 3, 2009

System Verilog and OVM Links … 2 (TLM)

Filed under: System Verilog — lasic @ 12:26 pm

System Verilog VMM and OVM links … 1

Filed under: System Verilog — lasic @ 12:19 pm

October 19, 2009

System Verilog, An intro to the tutorials in store

System Verilog is the world’s first HDVL (Hardware Design Verification Language).
The other languages like ‘e’ and ‘Vera’ have been HVLs (Hardware Verification Languages.

System Verilog has features for

  • RTL Design
    
  • Assertions
    
  • Verification

System Verilog has evolved borrowing features and aspects from

  • Verilog
  • Superlog
  • VHDL
  • PSL (Property Specification Language)
    
  • C
    
  • Vera

 
In the series of tutorials that we plan to publish, we will see the features of System Verilog including but not limited to
   

  • Data Types
    
  • Enum, struct, union, typedef
    
  • Packed and unpacked arrays/structs
    
  • Packages
    
  • Multidimensional Arrays
    
  • Strings
    
  • Dynamic Arrays
    
  • Associative Arrays
  • Classes with single inheritance
    
  • Constraints
    

Control and Procedural Statements
       

  1. if, case
        
  2. for, foreach, while, do while, 
  3. repeat, forever
        
  4. break, continue, return
    
  • Functions and Procedures
    
  • Fork, suspend, kill, wait, disable
    
  • DPI (Direct Programming Interface)
    
  • always_ff
    always_latch
    always_comb
    
  • Interfaces, Virtual Interaces, Advanced interfaces
    
  • Semaphore, Mailbox, Enhanced Events
  • Queues, Linked List
    
  • Constraint Randomization
    
  • Functional Coverage (covergroups, coverpoints)

We will go into detailed examples discussing all these features in the coming days. Happy Blogging.

Powered by WordPress