- Behavioral level.
- RTL level (does not have to be a goal level, but a primitive level.
- Mixed working module / testbench, all in one module. Not the best approach to design with Verilog, but it would be good for an example of training. In fact, this example is actually two modules:
Testbench, which can be considered behavioral even if it uses RTL encoding to create an instance of the module that will be tested on the registers and wires that are provided in testbench:
module testbench_dff; wire Q,Q_BAR; reg D,CLK; // Instantiate the unit under test dff_from_nand uut (.CLK(CLK), .D(D), .Q(Q), .Q_BAR(Q_BAR) ); // Testbench initial begin $monitor("CLK = %b D = %b Q = %b Q_BAR = %b",CLK, D, Q, Q_BAR); CLK = 0; D = 0;
Testable module under test (UUT), which is a module similar to this (which, obviously, is an RTL level -gate level-module module):
module dff_from_nand ( input wire CLK, input wire D, output wire Q, output wire Q_BAR ); wire X,Y; nand U1 (X,D,CLK) ; nand U2 (Y,X,CLK) ; nand U3 (Q,Q_BAR,X); nand U4 (Q_BAR,Q,Y); endmodule
I understand that an RTL level module is a module in which logical equations are an explanation. The behavioral module has processes (in Verilog using always blocks, although logical equations can be used inside these blocks). Any non-trivial Verilog design will have both.
source share