литература / verilog_lec
.pdfEE577b ¾ Verilog for Behavioral Modeling
|
Outline |
∙ |
Introduction |
∙ |
Data types |
∙ |
Expressions |
∙ |
Assignments |
∙ |
Behavioral modeling |
∙ |
Hierarchical structures |
∙ |
System (built-in) functions |
========>∙ |
Example |
Nestoras Tzartzanis |
71 |
February 3, 1998 |
EE577b ¾ Verilog for Behavioral Modeling
Simulating a Simple Instruction Set Architecture
·A baby-instruction set:
7 |
6 |
|
3 |
2 |
0 |
|
||||
0 |
|
|
|
|
|
|
|
|
|
MV: Rd ¬ sign_ext(Imm) |
|
|
Imm |
|
|
Rd |
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
7 |
6 |
5 |
3 |
2 |
0 |
|
||||
|
|
|
|
|
|
|
|
|
ADD: Rd ¬ Rd + Rsr |
|
1 |
0 |
Rsr |
|
|
|
Rd |
|
|
||
7 |
6 |
5 |
3 |
2 |
0 |
|
||||
|
|
|
|
|
|
|
|
|
XOR: Rd ¬ Rd Å Rsr |
|
1 |
1 |
Rsr |
|
|
|
Rd |
|
|
||
·No memory instructions
·No control transfer instructions
·If the operand of an instruction is written by the previous one, the old value is read
Nestoras Tzartzanis |
72 |
February 3, 1998 |
EE577b ¾ Verilog for Behavioral Modeling
|
Block Diagram ¾ Data Path |
|
I-Memory |
|
CPU |
|
Counter |
ALU |
|
PC |
|
|
|
|
|
Register |
|
|
File |
|
|
Reset |
|
|
Instruction |
|
|
Decoder |
|
Nestoras Tzartzanis |
73 |
February 3, 1998 |
EE577b ¾ Verilog for Behavioral Modeling
A Data-Memory Example
Test Module |
|
Accessing the |
|
Memory |
D-Memory |
|
Address |
Data |
Rd/Wr |
∙An example where a module port should be declared as inout (i.e., the data bus)
∙Assuming a single phase clocking scheme, the data bus is actively driven by the test module during the first half cycle and by the memory during the second half cycle
∙Temporary register data type variables are required from both sides
∙The assign-statement should be used
Nestoras Tzartzanis |
74 |
February 3, 1998 |
