Forum Discussion
Altera_Forum
Honored Contributor
17 years agoVerilog design and testbench
How to differentiate verilog design and testbench syntax? Is it depending on the some symbol like# , $ and so on? is all the syntax with symbol for testbench? $random is for test bench? ...
Altera_Forum
Honored Contributor
17 years agoOk, now I understand. Basically Verilog syntax is the same for a DUT and testbench. The main difference that if the DUT should be synthesized is written in RTL style. RTL style contains mostly only synthesizable constructs, and a testbench can contain whatever you want.
Generaly a testbench can be recognized that it doesn't have ports, i.e: module tb (); It has initial block which cannot exist in the DUT. It has a clock generator which cannot be in the RTL style: always # 5 clk = ! clk; And can contain nonsynthesisable tasks as $monitor, $display, $finish etc.