SV_UVM_Infant Posted July 9, 2021 Report Share Posted July 9, 2021 Hi, We use the below constraint wrt "unaligned_transfer". //-------------------------------------------------------------------------- constraint axi_narrow_unaligned_c { unaligned_transfer dist {1'b0 := 10 , 1'b1 := 90}; soft unaligned_addr_offset == 'h0; solve unaligned_transfer before unaligned_addr_offset; (unaligned_transfer == 1'b1) -> unaligned_addr_offset inside {'h1,'h2,'h3}; } //-------------------------------------------------------------------------- There is a soft value = 0, provided for unaligned_addr_offset, and a weighted distribution allowed for unaligned_transfer What we observe is that the simulator always select "unaligned_transfer" = 0. Looks like its trying to prioritise the soft constraint. Is this expected? Could you someone please point the LRM section where I can try to understand the expected simulator behaviour here? Thanks Melvin Quote Link to comment Share on other sites More sharing options...
Mark Strickland Posted July 9, 2021 Report Share Posted July 9, 2021 Section 18.5.14 of the 2017 LRM says "when there is no solution that satisfies all active hard constraints (if any) simultaneously with a constraint defined as soft, the solver shall discard that soft constraint and find a solution that satisfies the remaining constraints". In this case, there is a solution that satisfies all the constraints, unaligned_transfer == 0. I am guessing you hoped that the "solve..before" would mean unaligned_transfer was first chosen sometimes to be 1, thus making the soft constraint not satisfiable. However, 18.5.10 states "solve..before" does not change legal sets, just distributions within the legal set: "Adding this order constraint does not change the set of legal value combinations, but alters their probability of occurrence" Quote Link to comment Share on other sites More sharing options...
SV_UVM_Infant Posted July 26, 2021 Author Report Share Posted July 26, 2021 Thank you Mark for the crisp answer! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.