Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with verilog testbench

Status
Not open for further replies.

zarakhan

Member level 2
Member level 2
Joined
Jul 26, 2006
Messages
42
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,593
verilog testbench

Hi.
I write a code for Full Adder simulation in verilog.I write a code for test it(Testbench).bbut when I run the code the following Error appears.(I am working with MaxPlusII)
Can you solve it?

module fa
(x,y,sum,carry);
input x;
input y;
output sum;
output carry;
//-----------------
wire x;
wire y;
reg sum;
reg carry;
//------------------
always @(x or y)
begin
carry=x & y;
sum=x ^ y;
end
endmodule



The following code is for test:

//‘timescale 10000 us / 10000 us
`include "fa.v"
module fa_tb();
reg x,y;
wire sum,carry;

//------
initial
begin
$monitor("%b,%b,%b,%b",x,y,sum,carry);
$dumpfile("fa.vcd");
x=0;
y=0;
#5 x=1;
#10 y=1;
#15 x=1;
#30 y=0;
end
endmodule


This Error Message Appears:
Error:project has no output or bidirectional pins in top-level design file.
 

verilog testbench tutorial

u have problem in the instantiation of the design in the testbench, u have used a include file, may be u can use the below code:

//‘timescale 10000 us / 10000 us

module fa_tb();
reg x,y;
wire sum,carry;

fa fa(.x(x),.y(y),.sum(sum),.carry(carry));

//------
initial
begin
$monitor("%b,%b,%b,%b",x,y,sum,carry);
$dumpfile("fa.vcd");
x=0;
y=0;
#5 x=1;
#10 y=1;
#15 x=1;
#30 y=0;
end
endmodule
 

modelsim verilog testbench

I can not view the testbench results automatically after compile this program(in Maxplus).
fa.vcd file does not create after compiling.

why?
 

is max plus 2 support test bench

u have run the simulation before viewing the vcd file, compilation itself is not sufficent.
 

    zarakhan

    Points: 2
    Helpful Answer Positive Rating
register file verilog test bench

I save/compile/simulate but VCD file dos not exist.
and the waveform editor dos not show the simulation waveform.
I examine it in Modelsim (not Maxplus) and there isnt any problem in it.
what is the problem?
 

how to define reg in testbench verilog

I dont think MaxPlus II can generate the VCD file. Its just a basic simulator that is provided by Altera. To generate and view VCD files you need to use ModelSim or VCS or SimVision. The same file will generate a VCD file when you run it on any of the above simulators.
 

verilog io testbench

i synthesize your code in xilinx ISE 9.1 and simulate by modelsim and i saw no ploblem but
i change your codes with remove codes below:

wire x;
wire y;
reg sum;
reg carry;


thats enough to define
input x;
input y;
output sum;
output carry;

i saw the same error in my project in the past
if you see this error sure you mistake in I/O definition in verilog module or testbench
or you define input or output in verilog module
and didnt define in testbench

at last i suggest you to use xilinx ISE 9.1 and modelsim. i did some complicated projects
using this software. thats very powerfull.

good lock
 

    zarakhan

    Points: 2
    Helpful Answer Positive Rating
bi-directional testbench verilog

www.hotbench.net

Hotbench (http://www.hotbench.net) is a low-cost test bench generation web-application. It helps engineers to intuitively create test bench with by using mouse clicks.
The application is fast and support both VHDL and Verilog HDLs for generating test bench.
Web-based application makes the tool unique in overcoming geographical boundaries and OS (platform) independence.
User management/GUI and login IDs for user ensures security.
The web application allows HDL users to login and select for HDL options from VHDL/Verilog.
And then enter the entity/module declaration that contains IO ports for their Unit Under Test (UUT).
The users then select for best patterns in order to test & verify their designs. The web application allows user then to download simulation ready test bench.
The generated code is transparent, thus users may wish to alter to fine tune his verification needs (e.g. system_clock etc).
Starting plan for single test bench is as low as 0.9 cent. Bulk purchase in credit of test-bench units (prepaid) allows even cheaper cost for per unit test bench generation operation.
Mode of payment is through secured Payment Gateway Interface of PayPal.
Ideally helpful to freelancers/freelance developers/professionals those are working with HDLs, Educational/Academic institutions & in turn students. Small & medium scale industries, product/turnkey service companies.
One time registration is free. One test-bench unit is free one registration for first time users*.
Quick tutorial available at following URL
http://www.hotbench.net/help.html
 

After giving "$dumpfile("fa.vcd");", paste the below:

$dumpvars(1, fa_tb.fa);

hope, now it may capture the signal activities.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top