• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Hardware/Software Co-Development, Verification…
  3. verilog testbench simulation

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 49
  • Views 13995
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

verilog testbench simulation

sebgimi
sebgimi over 11 years ago

Hi,

I am trying to write and simulate my first code in verilog, but I can't simulate it. When I run simulation the chronograms stay empty .

My code is a simple 3-in AND gate:

module and3 (e1, e2, e3, s);

input e1;
input e2;
input e3;

output s;

assign s = e1 & e2 & e3;

endmodule

And below, the testbench I use:

`timescale 1ns / 10ps

module and3_tb;

reg e1_t, e2_t, e3_t;
wire s_t;

and3 and3( .e1(e1_t), .e2(e2_t), .e3(e3_t), .s(s_t) );

initial
begin

$monitor(e1_t, e2_t, e3_t, s_t);

e1_t = 1'b0;
e2_t = 1'b0;
e3_t = 1'b0;

#5

e1_t = 1'b0;
e2_t = 1'b0;
e3_t = 1'b1;

#5
e1_t = 1'b0;
e2_t = 1'b1;
e3_t = 1'b0;

#5
e1_t = 1'b0;
e2_t = 1'b1;
e3_t = 1'b1;

#5
e1_t = 1'b1;
e2_t = 1'b0;
e3_t = 1'b0;

#5
e1_t = 1'b1;
e2_t = 1'b0;
e3_t = 1'b1;

#5
e1_t = 1'b1;
e2_t = 1'b1;
e3_t = 1'b0;

#5
e1_t = 1'b1;
e2_t = 1'b1;
e3_t = 1'b1;

end

endmodule

I use ncvhdl/ncsim suit with incisiv, below its how I write the commands:

ncvlog -work work -message \
../modules/and3.vlog \
../modules/and3_tb.vlog

ncelab -cdslib cds.lib -hdlvar hdl.var -messages -access +r+w+c -update -timescale '1ns/10ps' -logfile ncelab.log work.and3

ncsim -gui -messages -nocopyright -log ncsim.log work.and3

So when I run ncsim, at the moment I choose the input/output of the module (e1,e2,e3,s here) the initials values are 'x', but when I compare with a simulation in vhdl these values are 'U'. So when this part is finish I run the simulation and nothing happens...

Can you help me please?

  • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information