2. Verilog有两类assignment:
2.1 continuous assignment:
assign (pull1, pull0) write_en = write_en_a | write_en_b;
2.2 Procedure assignment:
always @(posedge clk or negedge resetb)
if (!resetb)
count <= 8'b0;
else
count <= count+1;
3. Net:
3.1. wire, tri: both are same, just has different application purpose
wire: driven by logic gate or continuous assignment.
tri: multi-driven (没用过,synthesizable???)
3.2. wor, wand, trior, triand: wire and/or
3.3. tri0, tri1: used for pull down/pull up (Not synthesizable)
3.4. uwire: only allow one driver, in verilog-2005
3.5. supply1/supply0: used in verdor cell library
4. verilog中的相等: ==,!= Vs ===,!==
Logic equality: ==
“a==b”
Only
compare when a or b is 0 or 1
If a
or b is “x”, “z”, result is always “x”/false
tests
for 1 and 0, all other will result in x
Wildcard Equality: ==?, !=?
Make few bits in RHS as don't-cares
a =?= b
a equals
b, X and Z values act as wild cards
may result in X if the left operand
contains an x or Z
5. Verilog gate
nand #(5) (strong1, strong0) INAND0 (out, a, b)
bufif0 ar[3:0] (out, in, en); //array of 3-state buffer
pullup (strong1) p1 (neta), p2(netb);