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.

Verilog/Sysverilog Test Bench Question

Status
Not open for further replies.

Digital-L0gik

Member level 2
Member level 2
Joined
Jan 26, 2009
Messages
44
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,288
Activity points
1,577
how to access register from testbench

I am writing a test bench for a DUT I designed. However, I would like to use some flag signals that are within the DUT hierarchy at the test bench level to kick off some testing procedures. These flag signals are not part of my primary i/o to the DUT. How can I utilize these lower level DUT signals in my higher level test bench?
 

testbench for register file in verilog

If you want to use the rtl signal that does not come out on the pin. you should access it hierarchically in the testbench.
 

Yeah I heard about doing that, but I am not sure what the syntax is do that. Is this how you do it? Will this also work for signals that are even lower than the dut?

Code:
module y(...);
.....
reg flag1;


endmodule: y
 

module x(...);
.....
reg flag2;

y  i1  (....)  //instantiate y

endmodule: x

//--------------------------------------------
module xtb();
x  i ( ....);   //instantiate dut.

always @(i.flag2 or i.i1.flag1)
case(i.flag)
....


endmodule: xtb
 

just like the common usage in SV , you can get the signal in the design !
 

For example if you have testbench file as top.v where u instantiated dut and in that dut u want to access a register x in the block blka

then u need to use top.dut.blka.x (u can use force n release to change irrespective what its driven to x)

hope this helps in clear understanding
 
hi pra, i agree with your point. but i think that kind of expression can only apply for verilog.

wut should be used for vhdl? i know in ncsim you can use some special function, but it can only be recognized with ncverilog.


pra said:
For example if you have testbench file as top.v where u instantiated dut and in that dut u want to access a register x in the block blka

then u need to use top.dut.blka.x (u can use force n release to change irrespective what its driven to x)

hope this helps in clear understanding
 

I am not confident on VHDL but I feel same will be there in that otherwise it becomes very tough to verify large designs in VHDL.
Lot of EDA companies will use VHDL for their designs too...
May be somebody who r expert in VHDL can tell you about this


fpga_asic_designer said:
hi pra, i agree with your point. but i think that kind of expression can only apply for verilog.

wut should be used for vhdl? i know in ncsim you can use some special function, but it can only be recognized with ncverilog.


pra said:
For example if you have testbench file as top.v where u instantiated dut and in that dut u want to access a register x in the block blka

then u need to use top.dut.blka.x (u can use force n release to change irrespective what its driven to x)

hope this helps in clear understanding
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top