Verilog and VeriWell Bo Cheng.

Slides:



Advertisements
Similar presentations
Verilog in transistor level using Microwind
Advertisements

//HDL Example 4-10 // //Gate-level description of circuit of Fig. 4-2 module analysis (A,B,C,F1,F2); input.
Verilog.
Simulation executable (simv)
The Verilog Hardware Description Language
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Supplement on Verilog adder examples
Chapter 11 Verilog HDL Application-Specific Integrated Circuits Michael John Sebastian Smith Addison Wesley, 1997.
Verilog Intro: Part 1.
Hardware Description Language (HDL)
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
CSE 341 Verilog HDL An Introduction. Hardware Specification Languages Verilog  Similar syntax to C  Commonly used in  Industry (USA & Japan) VHDL 
Verilog - 1 Writing Hardware Programs in Abstract Verilog  Abstract Verilog is a language with special semantics  Allows fine-grained parallelism to.
First Steps in Verilog CPSC 321 Computer Architecture Andreas Klappenecker.
CS 61C L25 Verilog I (1) Garcia, Fall 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures.
© UC Berkeley EECS Components and Design Techniques for Digital Systems Lec 04 – Hardware Description Languages / Verilog 9/6/2007 David Culler Electrical.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
ECE 4680 Computer Architecture Verilog Presentation I. Verilog HDL.
Verilog Lab This presentation includes some material that is selected from BUCKNELL VERILOG HANDBOOK. Instructor: Dr. Charles Liu Prepared by John Ren.
2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.
1 EECS Components and Design Techniques for Digital Systems Lec 04 – Hardware Description Languages / Verilog 9/9-04 David Culler Electrical Engineering.
Digital System Design Verilog ® HDL Tasks and Functions Maziar Goudarzi.
CS 61C L31 Verilog I (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
Generic Multiplexers: Parameters Discussion D7.5 Example 8.
Computer Organization Lecture Set – 03 Introduction to Verilog Huei-Yung Lin.
2/3/03ΗΥ220 - Μαυροειδής Ιάκωβος1 Delays in Behavioral Verilog - Interassignment Delay  Key idea: unlike blocking delay, RHS is evaluated before delay.
Quad 2-to-1 Multiplexer Discussion D7.4 Example 7.
University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Spring 2002EECS150 - Lec0-intro Page 1 EECS150 - Digital Design Lecture 8 - Hardware Description Languages February 14, 2002 John Wawrzynek.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Overview Logistics Last lecture Today HW5 due today
Tasks and Functions Programmable Logic Design (40-493) Fall 2001 Computer Engineering Department Sharif University of Technology Maziar Gudarzi.
ECE 2372 Modern Digital System Design
Workshop Topics - Outline
Verilog Language Concepts
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
CS 61C L4.2.2 Verilog II (1) K. Meinz, Summer 2004 © UCB CS61C : Machine Structures Lecture Verilog II Kurt Meinz inst.eecs.berkeley.edu/~cs61c.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Module 1.3 Verilog Basics UNIT 1 : Introduction to Verilog Data Types.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
1 Verilog Digital System Design Z. Navabi, 2006 Verilog Language Concepts.
ELEN 468 Lecture 131 ELEN 468 Advanced Logic Design Lecture 13 Synthesis of Combinational Logic II.
Verilog A Hardware Description Language (HDL ) is a machine readable and human readable language for describing hardware. Verilog and VHDL are HDLs.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Sharif University of Technology Department of Computer Engineering Verilog ® HDL Basic Concepts Alireza Ejlali.
 A test bench is an HDL program used for applying stimulus to an HDL design in order to test it and observe its response during simulation.  In addition.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-1 Chapter 3: Dataflow Modeling.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
1 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Introduction to FPGAs Getting Started with Xilinx.
Overview Logistics Last lecture Today HW5 due today
Hardware Description Languages: Verilog
An Introduction to Verilog: Transitioning from VHDL
TODAY’S OUTLINE Introduction to Verilog Verilog coding format
Reg and Wire:.
KARTHIK.S Lecturer/ECE S.N.G.C.E
Verilog-HDL-3 by Dr. Amin Danial Asham.
Hardware Description Languages: Verilog
Behavioral Modeling in Verilog
Chapter 3: Dataflow Modeling
Introduction To Verilog-HDL
Levels in computer design
Review Advancing technology changes the trade-offs and design techniques 2x transistors per chip every 18 months ASIC, Programmable Logic, Microprocessor.
The Verilog Hardware Description Language
The Verilog Hardware Description Language
Supplement on Verilog combinational circuit examples
COE 202 Introduction to Verilog
Presentation transcript:

Verilog and VeriWell Bo Cheng

Resources http://www.asic-world.com/verilog/tools.html http://www-inst.eecs.berkeley.edu/~cs61c/resources/verilogTutorial.pdf http://www-ee.eng.hawaii.edu/~sasaki/EE361/Fall04/

Veriwell Tool Free verilog simulators Acquired by syncad Syncad offers verilog and other HDL tools. In particular, they have FREE demonstration verilog simulation tool called Verilogger Pro.

Veriwell Installation C:\Program Files\VeriWell\exe

Two-input Multiplexor Example module mux2 (in0, in1, select, out); input in0,in1,select; output out; wire s0,w0,w1; not (s0, select); and (w0, s0, in0), (w1, select, in1); or (out, w0, w1); endmodule // mux2

Testing the Multiplexor module testmux; reg a, b, s; wire f; reg expected; mux2 myMux (.select(s), .in0(a), .in1(b), .out(f)); initial begin #0 s=0; a=0; b=1; expected=0; #10 a=1; b=0; expected=1; #10 s=1; a=0; b=1; expected=1; #10 $finish; end $monitor( "select=%b in0=%b in1=%b out=%b, expected out=%b time=%d", s, a, b, f, expected, $time); endmodule // testmux

Notation “initial” keyword to say that everything in the following block should be done once at the start of simulation. #n By default, the unit of time is the nanosecond (ns). In testmux, the first set of assignments are made at 0ns from the start of simulation, the second at 10ns from the previous, etc. $finish exits the simulator back to the operating system.

http://www.doe.carleton.ca/~shams/97350/PetervrlK.pdf Syntax A reg is a Verilog variable type and does not necessarily imply a physical register. A wire represents a physical wire in a circuit and is used to connect gates or modules. Declare input, output and bidirectional ports of a module or task.

$display, $strobe, $monitor display their values as text on the screen during simulation. $display and $strobe display once every time they are executed $strobe displays the parameters at the very end of the current simulation time unit. $monitor displays every time one of its parameters changes. The format string is like that in C/C++, and may contain format characters. Format characters include %d (decimal), %h (hexadecimal), %b (binary), %c (character), %s (string) and %t (time).

$time, $stime, $realtime These return the current simulation time as a 64-bit integer, a 32-bit integer, and a real number, respectively.

Adding Delay to the Multiplexor Example module mux2 (in0, in1, select, out); input in0,in1,select; output out; wire s0,w0,w1; not #1 (s0, select); and #1 (w0, s0, in0), (w1, select, in1); or #1 (out, w0, w1); endmodule // mux2

module testmux2; reg [2:0] c; wire f; reg expected; mux2 myMux (.select(c[2]), .in0(c[0]), .in1(c[1]), .out(f)); initial Begin #0 c = 3’b000; expected=1’b0; repeat(7) begin #10 c = c + 3’b001; if (c[2]) expected=c[1]; else expected=c[0]; end #10 $finish; $display("Test of mux2."); $monitor("[select in1 in0]=%b out=%b expected=%b time=%d", c, f, expected, $time); endmodule // testmux2

Building a Circuit Hierarchy //4-input multiplexor built from 3 2-input multiplexors module mux4 (in0, in1, in2, in3, select, out); input in0,in1,in2,in3; input [1:0] select; output out; wire w0,w1; mux2 m0 (.select(select[0]), .in0(in0), .in1(in1), .out(w0)), m1 (.select(select[0]), .in0(in2), .in1(in3), .out(w1)), m3 (.select(select[1]), .in0(w0), .in1(w1), .out(out)); endmodule // mux4