diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-08-09 17:09:24 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-08-09 17:09:24 +0200 |
commit | c8763301b436d05c1040adb1615e75ccbfde93e8 (patch) | |
tree | 2ff9f7d45c98f567cd86be154cba405549f1903c /tests/simple/operators.v | |
parent | 376150c9265e01a7b012d716db0325af3776b6b0 (diff) | |
download | yosys-c8763301b436d05c1040adb1615e75ccbfde93e8.tar.gz yosys-c8763301b436d05c1040adb1615e75ccbfde93e8.tar.bz2 yosys-c8763301b436d05c1040adb1615e75ccbfde93e8.zip |
Added $div and $mod technology mapping
Diffstat (limited to 'tests/simple/operators.v')
-rw-r--r-- | tests/simple/operators.v | 61 |
1 files changed, 40 insertions, 21 deletions
diff --git a/tests/simple/operators.v b/tests/simple/operators.v index b9bbc13c8..6ca6ca7a8 100644 --- a/tests/simple/operators.v +++ b/tests/simple/operators.v @@ -1,8 +1,7 @@ - module test(clk, mode, u1, s1, u2, s2, y); input clk; -input [5:0] mode; +input [6:0] mode; input [3:0] u1, u2; input signed [3:0] s1, s2; @@ -72,25 +71,45 @@ always @(posedge clk) begin 46: y <= s1 - u2; 47: y <= s1 - s2; - 48: y <= +u1; - 49: y <= -u1; - 50: y <= +s1; - 51: y <= -s1; - - 52: y <= { &u1, ~&u1, |u1, ~|u1, ^u1, ~^u1, ^~u1 }; - 53: y <= { &s1, ~&s1, |s1, ~|s1, ^s1, ~^s1, ^~s1 }; - 54: y <= { &u1[1:0], ~&u1[1:0], |u1[1:0], ~|u1[1:0], ^u1[1:0], ~^u1[1:0], ^~u1[1:0] }; - 55: y <= { &s1[1:0], ~&s1[1:0], |s1[1:0], ~|s1[1:0], ^s1[1:0], ~^s1[1:0], ^~s1[1:0] }; - - 56: y <= { u1[1:0] && u2[1:0], u1[1:0] && u2[1:0], !u1[1:0] }; - 57: y <= {4{u1[1:0]}}; - 58: y <= {u1, u2} ^ {s1, s2}; - 59: y <= {u1, u2} & {s1, s2}; - - 60: y <= u1[0] ? u1 : u2; - 61: y <= u1[0] ? u1 : s2; - 62: y <= u1[0] ? s1 : u2; - 63: y <= u1[0] ? s1 : s2; + 48: y <= u1 * u2; + 49: y <= u1 * s2; + 50: y <= s1 * u2; + 51: y <= s1 * s2; + + 52: y <= u1 / u2; + 53: y <= u1 / s2; + 54: y <= s1 / u2; + 55: y <= s1 / s2; + + 56: y <= u1 % u2; + 57: y <= u1 % s2; + 58: y <= s1 % u2; + 59: y <= s1 % s2; + + 60: y <= +u1; + 61: y <= -u1; + 62: y <= ~u1; + 63: y <= !u1; + + 64: y <= +s1; + 65: y <= -s1; + 66: y <= ~s1; + 67: y <= !s1; + + 68: y <= { &u1, ~&u1, |u1, ~|u1, ^u1, ~^u1, ^~u1 }; + 69: y <= { &s1, ~&s1, |s1, ~|s1, ^s1, ~^s1, ^~s1 }; + 70: y <= { &u1[1:0], ~&u1[1:0], |u1[1:0], ~|u1[1:0], ^u1[1:0], ~^u1[1:0], ^~u1[1:0] }; + 71: y <= { &s1[1:0], ~&s1[1:0], |s1[1:0], ~|s1[1:0], ^s1[1:0], ~^s1[1:0], ^~s1[1:0] }; + + 72: y <= { u1[1:0] && u2[1:0], u1[1:0] && u2[1:0], !u1[1:0] }; + 73: y <= {4{u1[1:0]}}; + 74: y <= {u1, u2} ^ {s1, s2}; + 75: y <= {u1, u2} & {s1, s2}; + + 76: y <= u1[0] ? u1 : u2; + 77: y <= u1[0] ? u1 : s2; + 78: y <= u1[0] ? s1 : u2; + 79: y <= u1[0] ? s1 : s2; endcase end |