aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/common/simlib.v
diff options
context:
space:
mode:
authorAhmed Irfan <irfan@ubuntu.(none)>2014-01-18 18:10:31 +0100
committerAhmed Irfan <irfan@ubuntu.(none)>2014-01-18 18:10:31 +0100
commit1dd797ab09d2fb6a4ab903cfa050fa51cfcc6dcd (patch)
tree3c254e7a3ca11831e463d9a4ce88b5aea0677952 /techlibs/common/simlib.v
parent66198d8591a66b8ec34237c1151d992c7f4d5224 (diff)
parentbef17eeb109dd2dc4eaba6eb808a0172c0c53265 (diff)
downloadyosys-1dd797ab09d2fb6a4ab903cfa050fa51cfcc6dcd.tar.gz
yosys-1dd797ab09d2fb6a4ab903cfa050fa51cfcc6dcd.tar.bz2
yosys-1dd797ab09d2fb6a4ab903cfa050fa51cfcc6dcd.zip
Merge branch 'master' of https://github.com/cliffordwolf/yosys
Diffstat (limited to 'techlibs/common/simlib.v')
-rw-r--r--techlibs/common/simlib.v22
1 files changed, 22 insertions, 0 deletions
diff --git a/techlibs/common/simlib.v b/techlibs/common/simlib.v
index 034244ca6..f3d652f0e 100644
--- a/techlibs/common/simlib.v
+++ b/techlibs/common/simlib.v
@@ -55,6 +55,28 @@ endmodule
// --------------------------------------------------------
+module \$bu0 (A, Y);
+
+parameter A_SIGNED = 0;
+parameter A_WIDTH = 0;
+parameter Y_WIDTH = 0;
+
+`INPUT_A
+output [Y_WIDTH-1:0] Y;
+
+generate
+ if (!A_SIGNED && 0 < A_WIDTH && A_WIDTH < Y_WIDTH) begin:A
+ assign Y[A_WIDTH-1:0] = A_BUF.val;
+ assign Y[Y_WIDTH-1:A_WIDTH] = 0;
+ end else begin:B
+ assign Y = +A_BUF.val;
+ end
+endgenerate
+
+endmodule
+
+// --------------------------------------------------------
+
module \$pos (A, Y);
parameter A_SIGNED = 0;