Documente Academic
Documente Profesional
Documente Cultură
endmodule
The test module also declares four ports, corresponding to the ports of the half-adder module. It also
declares two “register” variables using the keyword reg, which will store the test values. A register variable
in Verilog is a behavioral construct that abstracts the features of an actual register. Registers represent
signal values which remain constant until modified. They are typically used in test bench modules to store
the input values of the structural model under test. The size of all port and register variables in this
example is one bit.
The top level module Top declares an instance of the test-bench module testAdd, named testBencha, and
an instance of the module to be tested, halfAdd, named ha.