ModelComponentToVerilogConverter can now convert TriStateBuffers
[Mograsim.git] / plugins / net.mograsim.logic.model.verilog / src / net / mograsim / logic / model / verilog / model / expressions / Expression.java
index b5fa9b3..dacf1df 100644 (file)
@@ -11,6 +11,14 @@ public abstract class Expression
        public Expression(int width)
        {
                this.width = width;
+
+               check();
+       }
+
+       private void check()
+       {
+               if (width < 0)
+                       throw new IllegalArgumentException("Width can't be negative");
        }
 
        public int getWidth()