aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/ice40/cells_sim.v
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-07-13 13:09:18 +0200
committerDavid Shah <davey1576@gmail.com>2018-07-13 13:09:18 +0200
commitcd65eeb3b3a2410e6e42f35e8ab58be4276fd104 (patch)
treed46090966fc9939667f82b8db203c2b1d6a6d1de /techlibs/ice40/cells_sim.v
parent8b92ddb9d2635c30636b17ff3d24bc09a44b8551 (diff)
downloadyosys-cd65eeb3b3a2410e6e42f35e8ab58be4276fd104.tar.gz
yosys-cd65eeb3b3a2410e6e42f35e8ab58be4276fd104.tar.bz2
yosys-cd65eeb3b3a2410e6e42f35e8ab58be4276fd104.zip
ice40: Add CIN_CONST and CIN_SET parameters to ICESTORM_LC
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'techlibs/ice40/cells_sim.v')
-rw-r--r--techlibs/ice40/cells_sim.v8
1 files changed, 6 insertions, 2 deletions
diff --git a/techlibs/ice40/cells_sim.v b/techlibs/ice40/cells_sim.v
index 45a02111f..9f73aeb07 100644
--- a/techlibs/ice40/cells_sim.v
+++ b/techlibs/ice40/cells_sim.v
@@ -657,7 +657,12 @@ module ICESTORM_LC (
parameter [0:0] SET_NORESET = 0;
parameter [0:0] ASYNC_SR = 0;
- assign COUT = CARRY_ENABLE ? (I1 && I2) || ((I1 || I2) && CIN) : 1'bx;
+ parameter [0:0] CIN_CONST = 0;
+ parameter [0:0] CIN_SET = 0;
+
+ wire mux_cin = CIN_CONST ? CIN_SET : CIN;
+
+ assign COUT = CARRY_ENABLE ? (I1 && I2) || ((I1 || I2) && mux_cin) : 1'bx;
wire [7:0] lut_s3 = I3 ? LUT_INIT[15:8] : LUT_INIT[7:0];
wire [3:0] lut_s2 = I2 ? lut_s3[ 7:4] : lut_s3[3:0];
@@ -1226,4 +1231,3 @@ module SB_IO_OD (
endgenerate
`endif
endmodule
-