11.1 A CounterThe following Verilog code models a "black box" that contains a 50 MHz clock (period 20 ns), counts from 0 to 7, resets, and then begins counting at 0 again:
Verilog keywords (reserved words that are part of the Verilog language) are shown in bold type in the code listings (but not in the text). References in this chapter such as [Verilog LRM 1.1] refer you to the IEEE Verilog LRM. The following output is from
the Cadence Verilog-XL simulator. This example includes the system input
so you can see how the tool is run and when it is finished. Some of the
banner information is omitted in the listing that follows to save space
(we can use "quiet" mode using a > verilog counter.v VERILOG-XL 2.2.1 Apr 17, 1996 11:48:18 ... Banner information omitted here... Compiling source file "counter.v" Highest level modules: counter time = 20 count = 1 time = 40 count = 2 (... 12 lines omitted...) time = 300 count = 7 time = 320 count = 0 L10 "counter.v": at simulation time 340 223 simulation events CPU time: 0.6 secs to compile + 0.2 secs to link + 0.0 secs in simulation End of VERILOG-XL 2.2.1 Apr 17, 1996 11:48:20 > Here is the output of the VeriWell simulator from the console window (future examples do not show all of the compiler output-- just the model output): Veriwell -k VeriWell.key -l VeriWell.log -s :counter.v ... banner information omitted .... Memory Available: 0 Entering Phase I... Compiling source file : :counter.v The size of this model is [1%, 1%] of the capacity of the free version Entering Phase II... Entering Phase III... No errors in compilation Top-level modules: counter C1> . time = 20 count = 1 time = 40 count = 2 (... 12 lines omitted...) time = 300 count = 7 time = 320 count = 0 Exiting VeriWell for Macintosh at time 340 0 Errors, 0 Warnings, Memory Used: 29468 Compile time = 0.6, Load time = 0.7, Simulation time = 4.7 Normal exit Thank you for using VeriWell for Macintosh |
|
||||||||||||
|
|||||||||||||
|
|||||||||||||