diff options
author | Ahmed Irfan <ahmedirfan1983@gmail.com> | 2014-01-03 10:54:54 +0100 |
---|---|---|
committer | Ahmed Irfan <ahmedirfan1983@gmail.com> | 2014-01-03 10:54:54 +0100 |
commit | 06482c046bcab4e2b9603f8954ce0f2fd501a73b (patch) | |
tree | d160ad05402768e4f468ff0685593b81658e6a5a /kernel/rtlil.cc | |
parent | 5da334fc2efd66c8a5efde925bb18212c34d0cef (diff) | |
parent | fb2bf934dc6d2c969906b350c9a1b09a972bfdd7 (diff) | |
download | yosys-06482c046bcab4e2b9603f8954ce0f2fd501a73b.tar.gz yosys-06482c046bcab4e2b9603f8954ce0f2fd501a73b.tar.bz2 yosys-06482c046bcab4e2b9603f8954ce0f2fd501a73b.zip |
Merge branch 'master' of https://github.com/cliffordwolf/yosys into btor
Diffstat (limited to 'kernel/rtlil.cc')
-rw-r--r-- | kernel/rtlil.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 9dfe196dc..1311f31cc 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -337,7 +337,7 @@ namespace { expected_ports.insert(name); } - void check_expected() + void check_expected(bool check_matched_sign = true) { for (auto ¶ : cell->parameters) if (expected_params.count(para.first) == 0) @@ -345,6 +345,13 @@ namespace { for (auto &conn : cell->connections) if (expected_ports.count(conn.first) == 0) error(__LINE__); + + if (expected_params.count("\\A_SIGNED") != 0 && expected_params.count("\\B_SIGNED") && check_matched_sign) { + bool a_is_signed = param("\\A_SIGNED") != 0; + bool b_is_signed = param("\\B_SIGNED") != 0; + if (a_is_signed != b_is_signed) + error(__LINE__); + } } void check_gate(const char *ports) @@ -370,7 +377,7 @@ namespace { void check() { - if (cell->type == "$not" || cell->type == "$pos" || cell->type == "$neg") { + if (cell->type == "$not" || cell->type == "$pos" || cell->type == "$bu0" || cell->type == "$neg") { param("\\A_SIGNED"); port("\\A", param("\\A_WIDTH")); port("\\Y", param("\\Y_WIDTH")); @@ -403,12 +410,12 @@ namespace { port("\\A", param("\\A_WIDTH")); port("\\B", param("\\B_WIDTH")); port("\\Y", param("\\Y_WIDTH")); - check_expected(); + check_expected(false); return; } if (cell->type == "$lt" || cell->type == "$le" || cell->type == "$eq" || cell->type == "$ne" || - cell->type == "$ge" || cell->type == "$gt") { + cell->type == "$eqx" || cell->type == "$nex" || cell->type == "$ge" || cell->type == "$gt") { param("\\A_SIGNED"); param("\\B_SIGNED"); port("\\A", param("\\A_WIDTH")); @@ -425,7 +432,7 @@ namespace { port("\\A", param("\\A_WIDTH")); port("\\B", param("\\B_WIDTH")); port("\\Y", param("\\Y_WIDTH")); - check_expected(); + check_expected(cell->type != "$pow"); return; } @@ -443,7 +450,7 @@ namespace { port("\\A", param("\\A_WIDTH")); port("\\B", param("\\B_WIDTH")); port("\\Y", param("\\Y_WIDTH")); - check_expected(); + check_expected(false); return; } @@ -560,6 +567,7 @@ namespace { param("\\MEMID"); param("\\CLK_ENABLE"); param("\\CLK_POLARITY"); + param("\\PRIORITY"); port("\\CLK", 1); port("\\EN", 1); port("\\ADDR", param("\\ABITS")); |