3-RTL Modifications SV

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Om Namah Shivaya

Modification in RTL between Verilog and system Verilog

module RTL_Modifications_SV ;

////// NEW OPERATORS////


// +=, -=, == used similar to C //

///// LOOP STATEMENTS ////


// while, do-while, break, continue, enhanced 'for' loop, 'foreach'//

int a[4];
initial
begin
$display("--------------FOR LOOP---------------------------------------------------");
for(int i=0;i<5;i++) $display("\t Value of i = %0d",i);
$display("-----------------------------------------------------------------");

$display("--------------FOREACH LOOP---------------------------------------------------");
foreach(a[i]) a[i] = i;
foreach(a[i]) $display("\tValue of a[%0d]=%0d",i,a[i]);
$display("-----------------------------------------------------------------");
end

// Labeling: In Verilog, we label only in the begining of block eg :


// begin : a_label ..
// In system verilog we can label any procedural statement and this label may be put in begining and
end.
// module MyModule ...
// ...
// endmodule : MyModule

// PORT CONNECTION SHORT forms


// In verilog we use Design DUT ( .Clock(Clock), .Reset(Reset), .Data(Data), .Q(Q) );
// System verilog :
// Design DUT ( .Clock, .Reset, .Data, .Q ); (If signal names in module and top level are same, no
need to repeat
// Design DUT ( .* );

// SYNTHESIS IDIOMS : 3 key words always_comb, always_ff, always_latch

// always_comb is used to describe combinational logic.


// It implicitly creates a complete sensitivity list by looking at the variables and nets that are read in
the process, just like always @* in Verilog-2001.
// it implicitly puts its sensitivity list at the end of the process, so that it is evaluated just once at time
zero and therefore all its outputs
// take up appropriate values before simulation time starts to progress.

// always_ff and always_latch are used for infering latches and flipflops.
/*
always_ff @(posedge clock or posedge reset)
if (reset)
q <= 0;
else if (enable)
q++;
*/

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy