diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-09-06 20:30:46 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-09-06 20:30:46 +0200 |
commit | 9329a768181d3765a08c3b264c8b0031b732c0d4 (patch) | |
tree | 092793d2517d97851d50307f8777aead6924173d /techlibs/common | |
parent | 98e6463ca78d8c0a342c9b86d9223dbeb45c093c (diff) | |
download | yosys-9329a768181d3765a08c3b264c8b0031b732c0d4.tar.gz yosys-9329a768181d3765a08c3b264c8b0031b732c0d4.tar.bz2 yosys-9329a768181d3765a08c3b264c8b0031b732c0d4.zip |
Various bug fixes (related to $macc model testing)
Diffstat (limited to 'techlibs/common')
-rw-r--r-- | techlibs/common/simlib.v | 2 | ||||
-rw-r--r-- | techlibs/common/techmap.v | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/techlibs/common/simlib.v b/techlibs/common/simlib.v index b1f871d9b..465efc0a7 100644 --- a/techlibs/common/simlib.v +++ b/techlibs/common/simlib.v @@ -768,7 +768,7 @@ module \$macc (A, B, Y); localparam integer num_bits = CONFIG[3:0]; localparam integer num_ports = (CONFIG_WIDTH-4) / (2 + 2*num_bits); - localparam integer num_abits = $clog2(A_WIDTH); + localparam integer num_abits = $clog2(A_WIDTH) > 0 ? $clog2(A_WIDTH) : 1; function [2*num_ports*num_abits-1:0] get_port_offsets; input [CONFIG_WIDTH-1:0] cfg; diff --git a/techlibs/common/techmap.v b/techlibs/common/techmap.v index f0397858f..3fc6ccb8e 100644 --- a/techlibs/common/techmap.v +++ b/techlibs/common/techmap.v @@ -594,7 +594,7 @@ module \$macc (A, B, Y); localparam integer num_bits = CONFIG[3:0]; localparam integer num_ports = (CONFIG_WIDTH-4) / (2 + 2*num_bits); - localparam integer num_abits = $clog2(A_WIDTH); + localparam integer num_abits = $clog2(A_WIDTH) > 0 ? $clog2(A_WIDTH) : 1; function [2*num_ports*num_abits-1:0] get_port_offsets; input [CONFIG_WIDTH-1:0] cfg; |