Sutherland Logo Graphic Motto Graphic
Home Workshop Descriptions eTutored™ Online Schedule Register for a Workshop Request Private Training Workshop Pricing & Terms Books by Stuart Sutherland Papers by Stuart Sutherland Online Reference Guides

"The instructor was clearly an expert, and extremely good at presenting the material."

Welcome

Sutherland HDL provides expert training workshops on Verilog and SystemVerilog.

 

 

 

Sutherland HDL training workshops help engineers become true Verilog and SystemVerilog wizards! Workshops are developed and presented by engineering experts with many years of experience in design and verification. Sutherland HDL has trained thousands of engineers throughout the United States, and in Canada, England, Germany, Japan, Malaysia, and Hong Kong.
 

Sutherland HDL's expert training workshops are now available online!

Sutherland HDL's eTutoredlive online workshops are instructor-led workshops that provide all the same learning benefits as classroom based training, but with greater flexibility to mix training and work responsibilities.

  • eTutoredlive workshops can be scheduled for a time that best meets your company's training needs, with a low minimum class size of just four engineers (request training).
  • Sutherland HDL also holds perioding public eTutoredlive workshops (check current schedule).

More...

 

Training Workshops

 

 

Stuart Sutherland, founder of Sutherland HDL, is a recognized Verilog and SystemVerilog expert, with more than 23 years of experience with Verilog and SystemVerilog. He is an active member of the IEEE Verilog and SystemVerilog standards group. He is also been a technical editor for every version of the IEEE Verilog and SystemVerilog Language Reference Manuals since the standards began. Mr. Sutherland has authored several popular books and conference papers on Verilog and SystemVerilog.

Stuart Sutherland holds a Bachelors Degree in Computer Science with an emphasis in Electronic Engineering Technology and a Masters Degree in Education with an emphasis on eLearning online course development.

 

Verilog and SystemVerilog Quiz and Tips

The following example illustrates a long-standing Verilog "gotcha".  The code is for a simple decoder that uses a "casex" statement with wildcard bits in order to simplify the lines of code required to decode all possible values of the 3-bit select input.  With casex, any bits in the comparison that are either X, Z or ? will match all possible values for that bit (in Verilog literal numbers, a ? represents high-impedance, and is the same as Z).

module decoder (output reg  [31:0] y,
                input  wire [31:0] a, b, c,
                input  wire [ 2:0] select
               );
  always @(select, a, b, c) begin
    casex (select)    // select is 3 bits wide
      3'b1??: y = a;  // matches if select is 3'b100, 3'b101, 3'b110, 3'b111
      3'b00?: y = b;  // matches if select is 3'b000, 3'b001
      3'b01?: y = c;  // matches if select is 3'b010, 3'b011
      default: $display("ERROR: select had an unexpected value of %b", select);
    endcase
  end
endmodule

Note that all valid 2-state values of select are decoded, and therefore the default branch should never be executed.  Should an invalid value of select occur, however, such as if select is X or Z, an error message is printed.  At least that is the intent...

The gotcha occurs if there is a problem with the select input to the module, and some of the bits are either X or Z.  For example, if the select input were inadvertently left unconnected, select would have the value of 3'bzzz.  It seems obvious in the code that this value is not decoded by the casex statement, and therefore the default branch will be executed and an error message will be printed.  Instead, however, y is assigned the value of the a input, and the invalid select value goes undetected.

Why?

See the answer

Coding Tips Sign-Up