Question: Is it possible to disable X propagation and treat Xs as zeroes? #1025
-
Hi! My apologies, the answer is probably somewhere but I could really not find it yet 😿 . Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
[moved to Discussions] You would need to either cast them to a 2-state type or assign them to a 2-state variable. |
Beta Was this translation helpful? Give feedback.
-
I agree with what Martin said, it sounds like you need to cast these to two state equivalents. We do not currently have an option to do this in the compiler, though you could easily write a script to alter the code. I doubt it would be that hard to add this to Icarus. Are you doing this for a functionality reason to match what verilator does or are you trying to get a faster simulation? In theory two state simulations should be faster, but that is in general not currently true in Icarus. Also note that even if you switch to two state variables there is at least one place where you will still get a four state result as mandated by the standard (division by zero). In most cases this would likely get mapped to 0/false eventually, but there are corner cases (e.g. I believe verilator is completely two state for both speed and simplicity and just blindly maps all operations to two-state so it may not handle this specific case correctly. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answers! The goal is functionality indeed. I will keep an eye on what you said about divisions by zero. If you have it on top of your mind, do you have a link to a list of these corner cases? Thanks! |
Beta Was this translation helpful? Give feedback.
[moved to Discussions]
You would need to either cast them to a 2-state type or assign them to a 2-state variable.