Assigning weak1 and weak0 to an input pin to verify pulldown

Hi All,

I’m trying to verify the effect of pulldown on an input pin. This is the first time I ever had to deal with weak values so I request to suggest me a robust approach.

Overview : There is an input pin ‘P’ which has a pulldown to it. This pulldown can be controlled (either enable or disable) using a register setting ‘r’. This pin is connected to a VIP. I disconnected this to check for the pulldown in my test. This is how I did that.

in the interface file (dut_if.sv):

assign P = vip.out; // vip output connected to this pin.

To disconnect the vip, I changed this to

assign P = (pulldown_verif) ? (test_drive) : (vip.out); // either send vip output or the value driven from test

In run_phase of my test :

if(r == 1) begin
dut_if.pulldown_verif = 1;
dut_if.test_drive = weak1;
end

The above statement does not work. I’m not sure if that is how we drive a weak1.

Please suggest :

  1. How do we drive a weak value on the pin ?
  2. How can I automate the test to check that pulldown actually worked? I mean how can I probe the node and find out what the strength of the node is?
  3. What are the other scenarios I need to consider for this pulldown verification

In reply to szy0014:

Drive strength has to be set using a continous assigment.

In reply to chr_sue:

Yes. “dut_if.test_drive = weak1” is not a working statement. This just represents the kind of functionality I need.

I tried something like

assign (weak1, weak0) P = (pulldown_verif) ? (test_drive) : (vip.out);

and in my run phase I have :

if(r == 1) begin
dut_if.pulldown_verif = 1;
dut_if.test_drive = 1;
end

But doing this, I need to add more logic in the dut_if file (for all combinations of drive strengths) which I want to avoid. Is it okay if I do this task as shown above?

In reply to szy0014:

Drive strength does not play a role in an class-based environment. It is usually used in direct contact to the DUT. Best is to have some additional assigments in your SV interfaace construct. This does not generate aditional logic because will not be synthesized.

In reply to szy0014:

All you really need to do here is have two continuous assignment statements to the same pin, one that controls driving the vip, and the other that controls driving the weak signal.

assign P = (pulldown_verif) ? 'z : (vip.out)
assign (weak0, highz1) = !pulldown_verif;

The first assign statement conditionally drive your vip out. When pulldown_verif is true, it drives a 'z on P. Driving a 'z on a signal is essentially removing the drive from the assign statement

The second assign statement is given two driving strengths, when driving a 0 it has weak strength, and when driving a 1 it has a highz strength. Again driving a highz strength dynamically removes drive. So when pulldown_verif is 0, it drives a weak 0, but when it is 1, there is no drive at all.

There is really no need to check the internal strength of the input pin. You should be able to write a test to ensure the input pin resolves to a 1 when no VIP is connected. i.e. you should check that your DUT behaves as it should when the pin is a 1 and you are driving a weak0.

But if you insist on checking the strength of a signal, you can always use the %v format specifier to print the signal strength to string.

if ($sformatf("%v",dut_if.P) == "Pu1") ...