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.

How to force a signal to certain value from Verilog testbench?

Status
Not open for further replies.

gold_kiss

Full Member level 4
Joined
Sep 11, 2002
Messages
211
Helped
7
Reputation
14
Reaction score
4
Trophy points
1,298
Activity points
1,789
hi,
how do i force a signal to certain value from testbench. this signal is part of DUT and is deep inside the DUT hierarcy.

Thanks,
Gold_kiss
 

force signal in verilog

Pls use tb.dut_level1_dut_level2.dut_levelx.signal = value.

Good Luck
 

writing testbenches in verilog

yea i got this one ...

initial
begin

force tb_top.dut_top.dut_block.dut_signal = 1'b1;

#500 release tb_top.dut_top.dut_block.dut_signal;

end


thanks guys,
Gold_kiss
 

writing testbench verilog

you can also use assign deassign for reg
 

writing testbench in verilog

but what if the DUT was designed in VHDL?
 

writing verilog testbench

If the DUT was in VHDL, as such the language prevents you from doing this. However, simulators provide a mechanism to access internal variables in VHDL via VHPI/FLI - programming language interfaces. Which simulator do you use? I know MTI has SignalSpy (Spy is more for probing, but I believe they also have some thing to deposit value), NC has NC_MIRROR (NC_DEPOSIT).

Sometime ago I made a generci package (See http://www.noveldv.com/eda/probe.zip) that wraps these simulator specific calls into more generic ones, so that the user's TB code can remain simulator independent. I made this only for probing, but can easilyy extend this to deposit/force if there is enough interest in the community. Please email me @ ajeetha AT noveldv DOT com if you need this.

HTH
Ajeetha
http://www.noveldv.com
 

force release verilog signal

dadu said:
you can also use assign deassign for reg

I am confused for your opinion.
"assign" is for wire type.

We evaluate reg in "initial" in the testbench.

Good Luck
 

how to force a signal in verilog

AlexWan said:
dadu said:
you can also use assign deassign for reg

I am confused for your opinion.
"assign" is for wire type.

We evaluate reg in "initial" in the testbench.

Good Luck

There is also a "procedural assign" in Verilog - less used though.

Ajeetha
http://www.noveldv.com
 

verilog force signal

Forcing internal signals in design is not a good testbench writing practice.
Try to minimize this as much as possible. This limits testbench reusability.
I mean there will be problem if you change design hirarchy or if instead of
rtl you want the same testbench for netlist.
 

verilog forcing signals

It's better to drive input signals to force interal signals.Driving interal signals directly is not good!
 

verilog deposit

your can use force ... release to do it
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top