Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solve_order()'s after argument, when list is used, ends up in before_l list #213

Open
mlausinTT opened this issue Mar 18, 2024 · 1 comment

Comments

@mlausinTT
Copy link

Hi,

I think there is an error in solve_order() when after argument is passed as a list, it is filling before_l instead of after_l

before_l.append(a_e.fm)

@alwilson
Copy link
Contributor

I didn't realize you could pass lists to solve_order()! Easy fix, but might be good to add an example to the docs and a testcase with it.

Example:

@vsc.randobj
class my_s(object):

    def __init__(self):
        self.a = vsc.rand_bit_t(1)
        self.b = vsc.rand_bit_t(16)

    @vsc.constraint
    def ab_c(self):
        vsc.solve_order(self.a, [self.b])
        with vsc.implies(self.a == 0): self.b < 5

obj = my_s()
obj.randomize(debug=True)

Debug snippet:

    constraint ab_c {
        solve a,b before 
        (a == 0) -> {
            (b < 5);
        }
    }

alwilson added a commit to alwilson/pyvsc that referenced this issue Jul 15, 2024
Addresses fvutils#213
Adds a unit test for the various ways to call solve_order.
Update the solve_order docs with a snippet using lists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants