37
 Switching Circuit & Logic Design Basic Logic Design Practicing - Qu artus Sc hema ti c t o Veril og 1

Lab1 Verilog Gate guide

  • View
    3

  • Download
    0

Embed Size (px)

DESCRIPTION

Lab1 Verilog Gate guide

Citation preview

 
Introduction to Gate Level Verilog HDL --Convert Quartus II Schematic to Verilog
Lecturer: TA (BL-421) [email protected]
3. Compile & simulate
4. Verify & debug
For Combinational & Gate-level only
 – Express the concurrency
 – Verify the design
• Why not C++ ?
 – Natively an imperative
• Every time every signals change their
values, we need to trace them &
interact with each other
is still imperative
“simulated”
“design HW” & “simulate it”
 – Without the information of the architecture
• Functional level(Register transfer level)
 – Data flow between registers
6
 – All modules run concurrently
• Wire declaration
You can skip the word “wire” at I/O pin
module name (class name)
• endmodule
9
Module interface declaration
Descripting the timing / delay
information for simulation
(min TPLH : avg TPLH : max TPLH , min TPHL : avg TPHL : max TPHL)
TPLH: propagation delay from low to high
TPHL: propagation delay from high to low
10
• <base_format> - followed by arithmetic base of number
 – d or D – decimal (default if no base format given)
 – h or H – hexadecimal
 – o or O – octal
 – b or B – binary
 – _ can be used for reading clarity
 – 0 extended
12
• Convert all .bdf files to verilog by Quartus
2. Prepare verilog testbench
• Convert a .vwf file to verilog by Quartus
3. Compilation & Simulation
14
1 choose a bdf 2
3 4 choose verilog5
• For Windows, you can use Notepad++
If you want to run Verilog
simulation outside Quartus
into .v files.
(.bsf not needed)
The file we need
Then open it
add codes here
all signals for you to see
save this f ile
ls
If you have problem sourcing verdi, please try:
source /usr/spring_soft/CIC/verdi.cshrc
24
Double click all of the signals you want to observe
1
2
3
27
Pretty like simulation result as .vwf does
But this time, the logic gates have it’s own delay (Not functional simulation only)
So there are hazards & latency
Correct result with some latency
[Hint] Default format: Hex,
Waveform→Signal Value Radix→[You want]
hazards
28
 – ncverilog on workstation is much more powerful
• iVerilog is free, it has some tools that can act as nWave
parts
module
write Verilog codes
 – Connection of sub-modules
values at right timing slots
• Usually describe in behavioral level
• Not real hardware, just like software
programming (e.g. C/C++)
Quartus
Schematic
Module
C++
Object
Object
Module Block Symbol File
with I/O port info.
Object
Verilog
HDL
instance of the class used in somewhere of the program
32
hierarchical architecture
• But hard to scale up for large designs
• Hard for programs to read
HDL Design
reading & processing
language (HDL) first
• Higher level logic design (ex. RT level)
33
34
 – Ver. 1: Chen-han Tsai
 – Ver. 2: Chih-hao Chao
 – Ver. 3: Xin-Yu Shi
 – Ver. 4: Bo-Yuan Peng
36
Reference
• Textbook
 – Fundamentals of Logic Design, Charles H. Roth, Jr., Larry L. Kinney
• Dclab lecture:
• CVSD lecture:
37