#870 Strength resolution, inout ports and buses

v0.9
closed-fixed
nobody
7
2011-12-09
2011-12-06
Adrian Wise
No

I've come across a regression in 0.9.5 affecting gate-level simulation. I've not isolated the exact situation that causes the problem, but I have extracted a small test-case from my failing test-bench and design. The issue seems to be something to do with nodes with multiple drivers where strength resolution is required, and one of the drivers is an inout port that has been broken out of a bus.

When run on a series of icarus 0.9.x versions I see:

Version 0.9.1
Expect: x = 0, pp = z0, nn = z1 p=0, n=1
Actual: x = 0, pp = z0, nn = z1 p=0, n=1
Version 0.9.2
Expect: x = 0, pp = z0, nn = z1 p=0, n=1
Actual: x = 0, pp = z0, nn = z1 p=0, n=1
Version 0.9.3
Expect: x = 0, pp = z0, nn = z1 p=0, n=1
Actual: x = 0, pp = z0, nn = z1 p=0, n=1
Version 0.9.4
Expect: x = 0, pp = z0, nn = z1 p=0, n=1
Actual: x = 0, pp = z0, nn = z1 p=0, n=1
Version 0.9.5
Expect: x = 0, pp = z0, nn = z1 p=0, n=1
Actual: x = 0, pp = z0, nn = z1 p=z, n=z

In version 0.9.5 the nodes n and p in the sr_latch module remain un-driven.

Discussion

  • Adrian Wise
    Adrian Wise
    2011-12-06

    Testcase illustrating the issue

     
    Attachments
  • Cary R.
    Cary R.
    2011-12-06

    I can confirm this appears to only be an issue in V0.9.5 and the current V0.9 from git. Both V0.8 and development from git generate the expected results. Since this is incorrect results without a warning I'm bumping the priority. git bisect can be used to find which patch created the problem in the V0.9 branch. Though scanning the logs for things that changed between V0.9.4 and V0.9.5 may be faster.

    I'll try to look at this later if no one else has claimed it. I'm expecting the example as provided is enough for us to figure out the problem.

     
  • Cary R.
    Cary R.
    2011-12-06

    • priority: 5 --> 7
     
  • Cary R.
    Cary R.
    2011-12-07

    This appears to be caused by the patch to fix pr3296466 committed on 2011-06-12. I did not verify this for sure. I did verify that the output from development modified to fit the old V0.9 syntax has the problem so this strongly suggests the bug is in the run time not the compiler. inout ports are made using tran gates and the previously mentioned patch is the only one that modifies the tran (island) code.

    I'm going to ask the original author of the patch if he will look at this. If he is unable to look at it either Steve or I will try to look at it.

    I'm also including a slightly modified version of your test code that has automatic checks.

     
  • Cary R.
    Cary R.
    2011-12-07

    test suite ready test code

     
    Attachments
    • status: open --> closed-fixed
     
  • The tran island rework included an optimisation to reduce unnecessary iterations during network initialisation. However, v0.9 does not correctly propagate initial values through the network in all cases (this is a known issue with v0.9), which means this optimisation is unsafe. I have submitted a patch on the patch tracker to remove this optimisation for v0.9.