-
Hey cool project. I'd love to make sure of it since I've got an environment which uses python to generate C test bench parameters. I'm trying it out, but the first example isn't providing very good randomization. The b variable is almost always one extreme or the other. About 1 in 10 times it will venture out away from the bounds. Likewise d seems to mostly pick 255 which is it's upper bound. How should I fix this code to get better distribution? I'd expect a much better distribution from SV. I tacked on this following print functions:
Ran it for 30 iterations:
This results in:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Hi @qzcx, One thing you can do is to add dist constraints, just like you would in SystemVerilog. That said, there does appear to be an issue worth investigating here, and I'll plan to dig into it over the next week. Here's my best 'how the sausage is made' explanation of what's currently happening in case you're interested:
Again, thanks for pointing out this case. Random distribution is an area in which PyVSC continues to improve. For now, feel free to play around with dist weights, and I'll get back to you in a few days -- hopefully with news of an improvement. Best Regards, |
Beta Was this translation helpful? Give feedback.
-
Hi @qzcx, I have a couple detail bugs to tie up, and I'll get this into a release. Best Regards, |
Beta Was this translation helpful? Give feedback.
-
Hey Jon, Best Regards, |
Beta Was this translation helpful? Give feedback.
Hey Jon,
Apologies for the delay. At luck (?) would have it, I received a series of reports of non-uniform distribution around the time of the original report from you. Some responded well to how I planned to address this issue, and some not so much. I now believe I have a different approach that addresses all the issues. I just released that as 0.5.9 this morning. Please have a look and let me know of any feedback.
Best Regards,
Matthew