From 266c1ae1226656d90ee6416c214ef64fe8b5906f Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 18 Jul 2019 15:38:09 -0700 Subject: synth_ice40 to decompose into 16x16 --- techlibs/ice40/synth_ice40.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 0474e76e9..66446deb7 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -265,8 +265,10 @@ struct SynthIce40Pass : public ScriptPass run("techmap -map +/cmp2lut.v -D LUT_WIDTH=4"); run("opt_expr"); run("opt_clean"); - if (help_mode || dsp) + if (help_mode || dsp) { + run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_NAME=$__MUL16X16"); run("ice40_dsp", "(if -dsp)"); + } run("alumacc"); run("opt"); run("fsm"); -- cgit v1.2.3 From bddd641290d3c01d86144362cd0e16c82e0bcfd8 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 18 Jul 2019 21:03:54 -0700 Subject: Fix SB_MAC sim model -- do not sign extend internal products? --- techlibs/ice40/cells_sim.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/cells_sim.v b/techlibs/ice40/cells_sim.v index 609facc93..4402f8d36 100644 --- a/techlibs/ice40/cells_sim.v +++ b/techlibs/ice40/cells_sim.v @@ -1363,9 +1363,9 @@ module SB_MAC16 ( wire [15:0] p_Ah_Bh, p_Al_Bh, p_Ah_Bl, p_Al_Bl; wire [15:0] Ah, Al, Bh, Bl; assign Ah = {A_SIGNED ? {8{iA[15]}} : 8'b0, iA[15: 8]}; - assign Al = {A_SIGNED ? {8{iA[ 7]}} : 8'b0, iA[ 7: 0]}; + assign Al = {A_SIGNED && MODE_8x8 ? {8{iA[ 7]}} : 8'b0, iA[ 7: 0]}; assign Bh = {B_SIGNED ? {8{iB[15]}} : 8'b0, iB[15: 8]}; - assign Bl = {B_SIGNED ? {8{iB[ 7]}} : 8'b0, iB[ 7: 0]}; + assign Bl = {B_SIGNED && MODE_8x8 ? {8{iB[ 7]}} : 8'b0, iB[ 7: 0]}; assign p_Ah_Bh = Ah * Bh; assign p_Al_Bh = Al * Bh; assign p_Ah_Bl = Ah * Bl; -- cgit v1.2.3 From 3dc3c749d5c7c10e1aa504f48794ef0a87513a82 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 19 Jul 2019 11:41:00 -0700 Subject: Add DSP_MINWIDTH=11 for ice40 since ice40_dsp uses this threshold --- techlibs/ice40/synth_ice40.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 5053e445d..77bd0ac81 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -266,7 +266,7 @@ struct SynthIce40Pass : public ScriptPass run("opt_expr"); run("opt_clean"); if (help_mode || dsp) { - run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_NAME=$__MUL16X16"); + run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_MINWIDTH=11 -D DSP_NAME=$__MUL16X16", "(if -dsp)"); run("ice40_dsp", "(if -dsp)"); } run("alumacc"); -- cgit v1.2.3 From 47fd042b9f8a92df1e1d59042068e7846c4ce808 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 19 Jul 2019 20:20:33 -0700 Subject: Indirection via $__soft_mul --- techlibs/ice40/synth_ice40.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 77bd0ac81..fcb177491 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -268,6 +268,7 @@ struct SynthIce40Pass : public ScriptPass if (help_mode || dsp) { run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_MINWIDTH=11 -D DSP_NAME=$__MUL16X16", "(if -dsp)"); run("ice40_dsp", "(if -dsp)"); + run("chtype -set $mul t:$__soft_mul"); } run("alumacc"); run("opt"); -- cgit v1.2.3 From 5e70b8a22bf38e622943b0546255befd539fa884 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 22 Jul 2019 13:48:33 -0700 Subject: opt and wreduce necessary for -dsp --- techlibs/ice40/synth_ice40.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index fcb177491..ce88a0542 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -267,8 +267,10 @@ struct SynthIce40Pass : public ScriptPass run("opt_clean"); if (help_mode || dsp) { run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_MINWIDTH=11 -D DSP_NAME=$__MUL16X16", "(if -dsp)"); - run("ice40_dsp", "(if -dsp)"); - run("chtype -set $mul t:$__soft_mul"); + run("opt_expr", " (if -dsp)"); + run("wreduce", " (if -dsp)"); + run("ice40_dsp", " (if -dsp)"); + run("chtype -set $mul t:$__soft_mul","(if -dsp)"); } run("alumacc"); run("opt"); -- cgit v1.2.3 From 4d71ab384d640f53435d2e4773b2277f385cda27 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 22 Jul 2019 15:08:26 -0700 Subject: Rename according to vendor doc TN1295 --- techlibs/ice40/synth_ice40.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index ce88a0542..50e071a1a 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -271,6 +271,7 @@ struct SynthIce40Pass : public ScriptPass run("wreduce", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); run("chtype -set $mul t:$__soft_mul","(if -dsp)"); + run("dump A:top"); } run("alumacc"); run("opt"); -- cgit v1.2.3 From cb505c50d3572a0622110b31b950b43cffc995db Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 22 Jul 2019 16:14:15 -0700 Subject: Remove debug --- techlibs/ice40/synth_ice40.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 50e071a1a..ce88a0542 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -271,7 +271,6 @@ struct SynthIce40Pass : public ScriptPass run("wreduce", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); run("chtype -set $mul t:$__soft_mul","(if -dsp)"); - run("dump A:top"); } run("alumacc"); run("opt"); -- cgit v1.2.3 From 915f4e34bfdf1fd2b9f97d1c15a55e2c4c49f428 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 1 Aug 2019 13:20:34 -0700 Subject: DSP_MINWIDTH -> DSP_{A,B,Y}_MINWIDTH --- techlibs/ice40/synth_ice40.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index ce88a0542..2cc5fd5fd 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -266,7 +266,7 @@ struct SynthIce40Pass : public ScriptPass run("opt_expr"); run("opt_clean"); if (help_mode || dsp) { - run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_MINWIDTH=11 -D DSP_NAME=$__MUL16X16", "(if -dsp)"); + run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 -D DSP_NAME=$__MUL16X16", "(if -dsp)"); run("opt_expr", " (if -dsp)"); run("wreduce", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); -- cgit v1.2.3 From a206aed977e92a63aa52137690e20897f27df458 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Wed, 7 Aug 2019 13:59:07 -0700 Subject: Run "opt_expr -fine" instead of "wreduce" due to #1213 --- techlibs/ice40/synth_ice40.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 2cc5fd5fd..09759f359 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -267,8 +267,7 @@ struct SynthIce40Pass : public ScriptPass run("opt_clean"); if (help_mode || dsp) { run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 -D DSP_NAME=$__MUL16X16", "(if -dsp)"); - run("opt_expr", " (if -dsp)"); - run("wreduce", " (if -dsp)"); + run("opt_expr -fine", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); run("chtype -set $mul t:$__soft_mul","(if -dsp)"); } -- cgit v1.2.3 From 2c0be7aa5d7dcdf18678fb7b09ba1b3b5dd00998 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 8 Aug 2019 12:56:05 -0700 Subject: Rework ice40_dsp to map to SB_MAC16 earlier, and check before packing --- techlibs/ice40/Makefile.inc | 1 + techlibs/ice40/dsp_map.v | 34 ++++++++++++++++++++++++++++++++++ techlibs/ice40/synth_ice40.cc | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 techlibs/ice40/dsp_map.v (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/Makefile.inc b/techlibs/ice40/Makefile.inc index d258d5a5d..b0eadab44 100644 --- a/techlibs/ice40/Makefile.inc +++ b/techlibs/ice40/Makefile.inc @@ -28,6 +28,7 @@ $(eval $(call add_share_file,share/ice40,techlibs/ice40/cells_sim.v)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/latches_map.v)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/brams.txt)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/brams_map.v)) +$(eval $(call add_share_file,share/ice40,techlibs/ice40/dsp_map.v)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_hx.box)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_hx.lut)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_lp.box)) diff --git a/techlibs/ice40/dsp_map.v b/techlibs/ice40/dsp_map.v new file mode 100644 index 000000000..06fa73956 --- /dev/null +++ b/techlibs/ice40/dsp_map.v @@ -0,0 +1,34 @@ +module \$__MUL16X16 (input [15:0] A, input [15:0] B, output [31:0] Y); + parameter A_SIGNED = 0; + parameter B_SIGNED = 0; + parameter A_WIDTH = 0; + parameter B_WIDTH = 0; + parameter Y_WIDTH = 0; + + SB_MAC16 #( + .NEG_TRIGGER(1'b0), + .C_REG(1'b0), + .A_REG(1'b0), + .B_REG(1'b0), + .D_REG(1'b0), + .TOP_8x8_MULT_REG(1'b0), + .BOT_8x8_MULT_REG(1'b0), + .PIPELINE_16x16_MULT_REG1(1'b0), + .PIPELINE_16x16_MULT_REG2(1'b0), + .TOPOUTPUT_SELECT(2'b11), + .TOPADDSUB_LOWERINPUT(2'b0), + .TOPADDSUB_UPPERINPUT(1'b0), + .TOPADDSUB_CARRYSELECT(2'b0), + .BOTOUTPUT_SELECT(2'b11), + .BOTADDSUB_LOWERINPUT(2'b0), + .BOTADDSUB_UPPERINPUT(1'b0), + .BOTADDSUB_CARRYSELECT(2'b0), + .MODE_8x8(1'b0), + .A_SIGNED(A_SIGNED), + .B_SIGNED(B_SIGNED) + ) _TECHMAP_REPLACE_ ( + .A(A), + .B(B), + .O(Y), + ); +endmodule diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 09759f359..9c3670c7c 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -266,7 +266,7 @@ struct SynthIce40Pass : public ScriptPass run("opt_expr"); run("opt_clean"); if (help_mode || dsp) { - run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 -D DSP_NAME=$__MUL16X16", "(if -dsp)"); + run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 -D DSP_NAME=$__MUL16X16", "(if -dsp)"); run("opt_expr -fine", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); run("chtype -set $mul t:$__soft_mul","(if -dsp)"); -- cgit v1.2.3 From 6d254f2de802ccd71b6514b0f5e4c0b44c415ae4 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 9 Aug 2019 17:05:56 -0700 Subject: Add wreduce to synth_ice40 -dsp as well --- techlibs/ice40/synth_ice40.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 9c3670c7c..02598401c 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -268,6 +268,7 @@ struct SynthIce40Pass : public ScriptPass if (help_mode || dsp) { run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 -D DSP_NAME=$__MUL16X16", "(if -dsp)"); run("opt_expr -fine", " (if -dsp)"); + run("wreduce", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); run("chtype -set $mul t:$__soft_mul","(if -dsp)"); } -- cgit v1.2.3 From 3b9b0fcd0630133092b23a18453eb420534b2369 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 19 Sep 2019 14:57:38 -0700 Subject: Tidy up synth_ice40, only restrict DSP_B_MINWIDTH=2 --- techlibs/ice40/synth_ice40.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 55aa72aa7..284bc90d0 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -273,7 +273,9 @@ struct SynthIce40Pass : public ScriptPass run("opt_expr"); run("opt_clean"); if (help_mode || dsp) { - run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 -D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 -D DSP_NAME=$__MUL16X16", "(if -dsp)"); + run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 " + "-D DSP_A_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " + "-D DSP_NAME=$__MUL16X16", "(if -dsp)"); run("opt_expr -fine", " (if -dsp)"); run("wreduce", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); -- cgit v1.2.3 From e4f4f6a9d5cf8bb23870fc483f16f66c80ceebab Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 20 Sep 2019 08:41:40 -0700 Subject: Move mul2dsp before wreduce --- techlibs/ice40/synth_ice40.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 284bc90d0..225603475 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -265,6 +265,10 @@ struct SynthIce40Pass : public ScriptPass run("opt_clean"); run("check"); run("opt"); + if (help_mode || dsp) + run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 " + "-D DSP_A_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " + "-D DSP_NAME=$__MUL16X16", "(if -dsp)"); run("wreduce"); run("peepopt"); run("opt_clean"); @@ -273,11 +277,6 @@ struct SynthIce40Pass : public ScriptPass run("opt_expr"); run("opt_clean"); if (help_mode || dsp) { - run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 " - "-D DSP_A_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " - "-D DSP_NAME=$__MUL16X16", "(if -dsp)"); - run("opt_expr -fine", " (if -dsp)"); - run("wreduce", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); run("chtype -set $mul t:$__soft_mul","(if -dsp)"); } -- cgit v1.2.3 From 829e4f5d2c8a521b5e4f80e85b9d58191d64f0d5 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 20 Sep 2019 08:56:16 -0700 Subject: Revert "Move mul2dsp before wreduce" This reverts commit e4f4f6a9d5cf8bb23870fc483f16f66c80ceebab. --- techlibs/ice40/synth_ice40.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 225603475..284bc90d0 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -265,10 +265,6 @@ struct SynthIce40Pass : public ScriptPass run("opt_clean"); run("check"); run("opt"); - if (help_mode || dsp) - run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 " - "-D DSP_A_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " - "-D DSP_NAME=$__MUL16X16", "(if -dsp)"); run("wreduce"); run("peepopt"); run("opt_clean"); @@ -277,6 +273,11 @@ struct SynthIce40Pass : public ScriptPass run("opt_expr"); run("opt_clean"); if (help_mode || dsp) { + run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 " + "-D DSP_A_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " + "-D DSP_NAME=$__MUL16X16", "(if -dsp)"); + run("opt_expr -fine", " (if -dsp)"); + run("wreduce", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); run("chtype -set $mul t:$__soft_mul","(if -dsp)"); } -- cgit v1.2.3 From 289cf688b76328d62c7416d1327d2d6777b0ffd9 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 20 Sep 2019 09:02:29 -0700 Subject: Re-add DSP_A_MINWIDTH, remove unnec. opt_expr -fine from synth_ice40 --- techlibs/ice40/synth_ice40.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 284bc90d0..7a8f3d70c 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -274,9 +274,8 @@ struct SynthIce40Pass : public ScriptPass run("opt_clean"); if (help_mode || dsp) { run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 " - "-D DSP_A_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " + "-D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " "-D DSP_NAME=$__MUL16X16", "(if -dsp)"); - run("opt_expr -fine", " (if -dsp)"); run("wreduce", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); run("chtype -set $mul t:$__soft_mul","(if -dsp)"); -- cgit v1.2.3 From 63940913d21fcfb18cd844d7e5b9c8b41a82295b Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Wed, 25 Sep 2019 17:22:04 -0700 Subject: Only wreduce on t:$add --- techlibs/ice40/synth_ice40.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 7a8f3d70c..98d3e44e3 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -276,7 +276,7 @@ struct SynthIce40Pass : public ScriptPass run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 " "-D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " "-D DSP_NAME=$__MUL16X16", "(if -dsp)"); - run("wreduce", " (if -dsp)"); + run("wreduce t:$add", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); run("chtype -set $mul t:$__soft_mul","(if -dsp)"); } -- cgit v1.2.3 From 27e5bf5aad229ef330bfea932f6b194ec5c09b68 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 26 Sep 2019 09:57:11 -0700 Subject: Stop trying to be too smart by prematurely optimising --- techlibs/ice40/synth_ice40.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 98d3e44e3..694782e5b 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -276,9 +276,11 @@ struct SynthIce40Pass : public ScriptPass run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 " "-D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " "-D DSP_NAME=$__MUL16X16", "(if -dsp)"); - run("wreduce t:$add", " (if -dsp)"); - run("ice40_dsp", " (if -dsp)"); - run("chtype -set $mul t:$__soft_mul","(if -dsp)"); + run("opt_expr -fine a:mul2dsp", " (if -dsp)"); + run("wreduce a:mul2dsp", " (if -dsp)"); + run("ice40_dsp", " (if -dsp)"); + run("setattr -unset mul2dsp a:mul2dsp", "(if -dsp)"); + run("chtype -set $mul t:$__soft_mul", " (if -dsp)"); } run("alumacc"); run("opt"); -- cgit v1.2.3 From 781dda6175c86fcb2b08d055565d3d99a687e636 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 26 Sep 2019 10:15:05 -0700 Subject: select once --- techlibs/ice40/synth_ice40.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 694782e5b..52e13bdc2 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -276,11 +276,13 @@ struct SynthIce40Pass : public ScriptPass run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 " "-D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " "-D DSP_NAME=$__MUL16X16", "(if -dsp)"); - run("opt_expr -fine a:mul2dsp", " (if -dsp)"); - run("wreduce a:mul2dsp", " (if -dsp)"); - run("ice40_dsp", " (if -dsp)"); - run("setattr -unset mul2dsp a:mul2dsp", "(if -dsp)"); - run("chtype -set $mul t:$__soft_mul", " (if -dsp)"); + run("select a:mul2dsp", " (if -dsp)"); + run("opt_expr -fine", " (if -dsp)"); + run("wreduce", " (if -dsp)"); + run("setattr -unset mul2dsp", " (if -dsp)"); + run("select -clear", " (if -dsp)"); + run("ice40_dsp", " (if -dsp)"); + run("chtype -set $mul t:$__soft_mul", "(if -dsp)"); } run("alumacc"); run("opt"); -- cgit v1.2.3 From b3d8a60cbd94176076f23c4ea6c94ec24e6773e0 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 27 Sep 2019 14:32:07 -0700 Subject: Re-order --- techlibs/ice40/synth_ice40.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 52e13bdc2..841f10244 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -277,9 +277,9 @@ struct SynthIce40Pass : public ScriptPass "-D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " "-D DSP_NAME=$__MUL16X16", "(if -dsp)"); run("select a:mul2dsp", " (if -dsp)"); + run("setattr -unset mul2dsp", " (if -dsp)"); run("opt_expr -fine", " (if -dsp)"); run("wreduce", " (if -dsp)"); - run("setattr -unset mul2dsp", " (if -dsp)"); run("select -clear", " (if -dsp)"); run("ice40_dsp", " (if -dsp)"); run("chtype -set $mul t:$__soft_mul", "(if -dsp)"); -- cgit v1.2.3 From c0f54d3fd5e2492afbe1717a67ea78f3be7f6b39 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 4 Oct 2019 10:34:16 -0700 Subject: Ohmilord this wasn't added all this time!?! --- techlibs/ice40/abc_model.v | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 techlibs/ice40/abc_model.v (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/abc_model.v b/techlibs/ice40/abc_model.v new file mode 100644 index 000000000..89961b51d --- /dev/null +++ b/techlibs/ice40/abc_model.v @@ -0,0 +1,29 @@ +(* abc9_box_id = 1, lib_whitebox *) +module \$__ICE40_CARRY_WRAPPER ( + (* abc_carry *) + output CO, + output O, + input A, B, + (* abc_carry *) + input CI, + input I0, I3 +); + parameter LUT = 0; + SB_CARRY carry ( + .I0(A), + .I1(B), + .CI(CI), + .CO(CO) + ); + SB_LUT4 #( + .LUT_INIT(LUT) + ) adder ( + .I0(I0), + .I1(A), + .I2(B), + .I3(I3), + .O(O) + ); +endmodule + + -- cgit v1.2.3 From 4e11782cde412ce80ee8125dd9d55fe21945737f Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 4 Oct 2019 10:36:02 -0700 Subject: Oops --- techlibs/ice40/abc_model.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/abc_model.v b/techlibs/ice40/abc_model.v index 89961b51d..8e1827043 100644 --- a/techlibs/ice40/abc_model.v +++ b/techlibs/ice40/abc_model.v @@ -1,4 +1,4 @@ -(* abc9_box_id = 1, lib_whitebox *) +(* abc_box_id = 1, lib_whitebox *) module \$__ICE40_CARRY_WRAPPER ( (* abc_carry *) output CO, -- cgit v1.2.3 From 9fef1df3c1431cff2e097a10a502f77f04986a60 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 4 Oct 2019 10:48:44 -0700 Subject: Panic over. Model was elsewhere. Re-arrange for consistency --- techlibs/ice40/Makefile.inc | 1 + techlibs/ice40/abc_model.v | 2 -- techlibs/ice40/cells_sim.v | 28 ---------------------------- techlibs/ice40/synth_ice40.cc | 3 ++- 4 files changed, 3 insertions(+), 31 deletions(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/Makefile.inc b/techlibs/ice40/Makefile.inc index 92a9956ea..0fbca9034 100644 --- a/techlibs/ice40/Makefile.inc +++ b/techlibs/ice40/Makefile.inc @@ -28,6 +28,7 @@ $(eval $(call add_share_file,share/ice40,techlibs/ice40/latches_map.v)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/brams.txt)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/brams_map.v)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/dsp_map.v)) +$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_model.v)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_hx.box)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_hx.lut)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_lp.box)) diff --git a/techlibs/ice40/abc_model.v b/techlibs/ice40/abc_model.v index 8e1827043..fe31b8811 100644 --- a/techlibs/ice40/abc_model.v +++ b/techlibs/ice40/abc_model.v @@ -25,5 +25,3 @@ module \$__ICE40_CARRY_WRAPPER ( .O(O) ); endmodule - - diff --git a/techlibs/ice40/cells_sim.v b/techlibs/ice40/cells_sim.v index 8e5e0358e..16a893226 100644 --- a/techlibs/ice40/cells_sim.v +++ b/techlibs/ice40/cells_sim.v @@ -145,34 +145,6 @@ module SB_CARRY (output CO, input I0, I1, CI); assign CO = (I0 && I1) || ((I0 || I1) && CI); endmodule -(* abc_box_id = 1, lib_whitebox *) -module \$__ICE40_CARRY_WRAPPER ( - (* abc_carry *) - output CO, - output O, - input A, B, - (* abc_carry *) - input CI, - input I0, I3 -); - parameter LUT = 0; - SB_CARRY carry ( - .I0(A), - .I1(B), - .CI(CI), - .CO(CO) - ); - SB_LUT4 #( - .LUT_INIT(LUT) - ) adder ( - .I0(I0), - .I1(A), - .I2(B), - .I3(I3), - .O(O) - ); -endmodule - // Max delay from: https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_hx1k.txt#L90 // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_lp1k.txt#L90 // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_up5k.txt#L102 diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 841f10244..2e4684c19 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -245,7 +245,7 @@ struct SynthIce40Pass : public ScriptPass define = "-D ICE40_U"; else define = "-D ICE40_HX"; - run("read_verilog -icells " + define + " -lib +/ice40/cells_sim.v"); + run("read_verilog " + define + " -lib +/ice40/cells_sim.v"); run(stringf("hierarchy -check %s", help_mode ? "-top " : top_opt.c_str())); run("proc"); } @@ -349,6 +349,7 @@ struct SynthIce40Pass : public ScriptPass } if (!noabc) { if (abc == "abc9") { + run("read_verilog -icells -lib +/ice40/abc_model.v"); int wire_delay; if (device_opt == "lp") wire_delay = 400; -- cgit v1.2.3 From aae2b9fd9c8dc915fadacc24962436dd7aedff36 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 4 Oct 2019 11:04:10 -0700 Subject: Rename abc_* names/attributes to more precisely be abc9_* --- techlibs/ice40/Makefile.inc | 14 ++-- techlibs/ice40/abc9_hx.box | 13 ++++ techlibs/ice40/abc9_hx.lut | 6 ++ techlibs/ice40/abc9_lp.box | 13 ++++ techlibs/ice40/abc9_lp.lut | 6 ++ techlibs/ice40/abc9_model.v | 27 ++++++++ techlibs/ice40/abc9_u.box | 13 ++++ techlibs/ice40/abc9_u.lut | 6 ++ techlibs/ice40/abc_hx.box | 13 ---- techlibs/ice40/abc_hx.lut | 6 -- techlibs/ice40/abc_lp.box | 13 ---- techlibs/ice40/abc_lp.lut | 6 -- techlibs/ice40/abc_model.v | 27 -------- techlibs/ice40/abc_u.box | 13 ---- techlibs/ice40/abc_u.lut | 6 -- techlibs/ice40/cells_sim.v | 157 +++++++++++++++++++++--------------------- techlibs/ice40/synth_ice40.cc | 4 +- 17 files changed, 171 insertions(+), 172 deletions(-) create mode 100644 techlibs/ice40/abc9_hx.box create mode 100644 techlibs/ice40/abc9_hx.lut create mode 100644 techlibs/ice40/abc9_lp.box create mode 100644 techlibs/ice40/abc9_lp.lut create mode 100644 techlibs/ice40/abc9_model.v create mode 100644 techlibs/ice40/abc9_u.box create mode 100644 techlibs/ice40/abc9_u.lut delete mode 100644 techlibs/ice40/abc_hx.box delete mode 100644 techlibs/ice40/abc_hx.lut delete mode 100644 techlibs/ice40/abc_lp.box delete mode 100644 techlibs/ice40/abc_lp.lut delete mode 100644 techlibs/ice40/abc_model.v delete mode 100644 techlibs/ice40/abc_u.box delete mode 100644 techlibs/ice40/abc_u.lut (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/Makefile.inc b/techlibs/ice40/Makefile.inc index 0fbca9034..3c33fcb06 100644 --- a/techlibs/ice40/Makefile.inc +++ b/techlibs/ice40/Makefile.inc @@ -28,13 +28,13 @@ $(eval $(call add_share_file,share/ice40,techlibs/ice40/latches_map.v)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/brams.txt)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/brams_map.v)) $(eval $(call add_share_file,share/ice40,techlibs/ice40/dsp_map.v)) -$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_model.v)) -$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_hx.box)) -$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_hx.lut)) -$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_lp.box)) -$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_lp.lut)) -$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_u.box)) -$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc_u.lut)) +$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc9_model.v)) +$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc9_hx.box)) +$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc9_hx.lut)) +$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc9_lp.box)) +$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc9_lp.lut)) +$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc9_u.box)) +$(eval $(call add_share_file,share/ice40,techlibs/ice40/abc9_u.lut)) $(eval $(call add_gen_share_file,share/ice40,techlibs/ice40/brams_init1.vh)) $(eval $(call add_gen_share_file,share/ice40,techlibs/ice40/brams_init2.vh)) diff --git a/techlibs/ice40/abc9_hx.box b/techlibs/ice40/abc9_hx.box new file mode 100644 index 000000000..3ea70bc91 --- /dev/null +++ b/techlibs/ice40/abc9_hx.box @@ -0,0 +1,13 @@ +# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_hx8k.txt + +# NB: Inputs/Outputs must be ordered alphabetically +# (with exceptions for carry in/out) + +# Inputs: A B I0 I3 CI +# Outputs: O CO +# (NB: carry chain input/output must be last +# input/output and have been moved there +# overriding the alphabetical ordering) +$__ICE40_CARRY_WRAPPER 1 1 5 2 +400 379 449 316 316 +259 231 - - 126 diff --git a/techlibs/ice40/abc9_hx.lut b/techlibs/ice40/abc9_hx.lut new file mode 100644 index 000000000..3b3bb11e2 --- /dev/null +++ b/techlibs/ice40/abc9_hx.lut @@ -0,0 +1,6 @@ +# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_hx8k.txt +# I3 I2 I1 I0 +1 1 316 +2 1 316 379 +3 1 316 379 400 +4 1 316 379 400 449 diff --git a/techlibs/ice40/abc9_lp.box b/techlibs/ice40/abc9_lp.box new file mode 100644 index 000000000..473e92fe9 --- /dev/null +++ b/techlibs/ice40/abc9_lp.box @@ -0,0 +1,13 @@ +# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_lp8k.txt + +# NB: Inputs/Outputs must be ordered alphabetically +# (with exceptions for carry in/out) + +# Inputs: A B I0 I3 CI +# Outputs: O CO +# (NB: carry chain input/output must be last +# input/output and have been moved there +# overriding the alphabetical ordering) +$__ICE40_CARRY_WRAPPER 1 1 5 2 +589 558 661 465 465 +675 609 - - 186 diff --git a/techlibs/ice40/abc9_lp.lut b/techlibs/ice40/abc9_lp.lut new file mode 100644 index 000000000..e72f760a2 --- /dev/null +++ b/techlibs/ice40/abc9_lp.lut @@ -0,0 +1,6 @@ +# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_lp8k.txt +# I3 I2 I1 I0 +1 1 465 +2 1 465 558 +3 1 465 558 589 +4 1 465 558 589 661 diff --git a/techlibs/ice40/abc9_model.v b/techlibs/ice40/abc9_model.v new file mode 100644 index 000000000..26cf6cc22 --- /dev/null +++ b/techlibs/ice40/abc9_model.v @@ -0,0 +1,27 @@ +(* abc9_box_id = 1, lib_whitebox *) +module \$__ICE40_CARRY_WRAPPER ( + (* abc9_carry *) + output CO, + output O, + input A, B, + (* abc9_carry *) + input CI, + input I0, I3 +); + parameter LUT = 0; + SB_CARRY carry ( + .I0(A), + .I1(B), + .CI(CI), + .CO(CO) + ); + SB_LUT4 #( + .LUT_INIT(LUT) + ) adder ( + .I0(I0), + .I1(A), + .I2(B), + .I3(I3), + .O(O) + ); +endmodule diff --git a/techlibs/ice40/abc9_u.box b/techlibs/ice40/abc9_u.box new file mode 100644 index 000000000..f00e247b8 --- /dev/null +++ b/techlibs/ice40/abc9_u.box @@ -0,0 +1,13 @@ +# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_up5k.txt + +# NB: Inputs/Outputs must be ordered alphabetically +# (with exceptions for carry in/out) + +# Inputs: A B I0 I3 CI +# Outputs: O CO +# (NB: carry chain input/output must be last +# input/output and have been moved there +# overriding the alphabetical ordering) +$__ICE40_CARRY_WRAPPER 1 1 5 2 +1231 1205 1285 874 874 +675 609 - - 278 diff --git a/techlibs/ice40/abc9_u.lut b/techlibs/ice40/abc9_u.lut new file mode 100644 index 000000000..1e4fcadb6 --- /dev/null +++ b/techlibs/ice40/abc9_u.lut @@ -0,0 +1,6 @@ +# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_up5k.txt +# I3 I2 I1 I0 +1 1 874 +2 1 874 1205 +3 1 874 1205 1231 +4 1 874 1205 1231 1285 diff --git a/techlibs/ice40/abc_hx.box b/techlibs/ice40/abc_hx.box deleted file mode 100644 index 3ea70bc91..000000000 --- a/techlibs/ice40/abc_hx.box +++ /dev/null @@ -1,13 +0,0 @@ -# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_hx8k.txt - -# NB: Inputs/Outputs must be ordered alphabetically -# (with exceptions for carry in/out) - -# Inputs: A B I0 I3 CI -# Outputs: O CO -# (NB: carry chain input/output must be last -# input/output and have been moved there -# overriding the alphabetical ordering) -$__ICE40_CARRY_WRAPPER 1 1 5 2 -400 379 449 316 316 -259 231 - - 126 diff --git a/techlibs/ice40/abc_hx.lut b/techlibs/ice40/abc_hx.lut deleted file mode 100644 index 3b3bb11e2..000000000 --- a/techlibs/ice40/abc_hx.lut +++ /dev/null @@ -1,6 +0,0 @@ -# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_hx8k.txt -# I3 I2 I1 I0 -1 1 316 -2 1 316 379 -3 1 316 379 400 -4 1 316 379 400 449 diff --git a/techlibs/ice40/abc_lp.box b/techlibs/ice40/abc_lp.box deleted file mode 100644 index 473e92fe9..000000000 --- a/techlibs/ice40/abc_lp.box +++ /dev/null @@ -1,13 +0,0 @@ -# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_lp8k.txt - -# NB: Inputs/Outputs must be ordered alphabetically -# (with exceptions for carry in/out) - -# Inputs: A B I0 I3 CI -# Outputs: O CO -# (NB: carry chain input/output must be last -# input/output and have been moved there -# overriding the alphabetical ordering) -$__ICE40_CARRY_WRAPPER 1 1 5 2 -589 558 661 465 465 -675 609 - - 186 diff --git a/techlibs/ice40/abc_lp.lut b/techlibs/ice40/abc_lp.lut deleted file mode 100644 index e72f760a2..000000000 --- a/techlibs/ice40/abc_lp.lut +++ /dev/null @@ -1,6 +0,0 @@ -# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_lp8k.txt -# I3 I2 I1 I0 -1 1 465 -2 1 465 558 -3 1 465 558 589 -4 1 465 558 589 661 diff --git a/techlibs/ice40/abc_model.v b/techlibs/ice40/abc_model.v deleted file mode 100644 index fe31b8811..000000000 --- a/techlibs/ice40/abc_model.v +++ /dev/null @@ -1,27 +0,0 @@ -(* abc_box_id = 1, lib_whitebox *) -module \$__ICE40_CARRY_WRAPPER ( - (* abc_carry *) - output CO, - output O, - input A, B, - (* abc_carry *) - input CI, - input I0, I3 -); - parameter LUT = 0; - SB_CARRY carry ( - .I0(A), - .I1(B), - .CI(CI), - .CO(CO) - ); - SB_LUT4 #( - .LUT_INIT(LUT) - ) adder ( - .I0(I0), - .I1(A), - .I2(B), - .I3(I3), - .O(O) - ); -endmodule diff --git a/techlibs/ice40/abc_u.box b/techlibs/ice40/abc_u.box deleted file mode 100644 index f00e247b8..000000000 --- a/techlibs/ice40/abc_u.box +++ /dev/null @@ -1,13 +0,0 @@ -# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_up5k.txt - -# NB: Inputs/Outputs must be ordered alphabetically -# (with exceptions for carry in/out) - -# Inputs: A B I0 I3 CI -# Outputs: O CO -# (NB: carry chain input/output must be last -# input/output and have been moved there -# overriding the alphabetical ordering) -$__ICE40_CARRY_WRAPPER 1 1 5 2 -1231 1205 1285 874 874 -675 609 - - 278 diff --git a/techlibs/ice40/abc_u.lut b/techlibs/ice40/abc_u.lut deleted file mode 100644 index 1e4fcadb6..000000000 --- a/techlibs/ice40/abc_u.lut +++ /dev/null @@ -1,6 +0,0 @@ -# From https://github.com/cliffordwolf/icestorm/blob/be0bca0/icefuzz/timings_up5k.txt -# I3 I2 I1 I0 -1 1 874 -2 1 874 1205 -3 1 874 1205 1231 -4 1 874 1205 1231 1285 diff --git a/techlibs/ice40/cells_sim.v b/techlibs/ice40/cells_sim.v index 16a893226..f9e79a61d 100644 --- a/techlibs/ice40/cells_sim.v +++ b/techlibs/ice40/cells_sim.v @@ -2,9 +2,9 @@ `define SB_DFF_REG reg Q = 0 // `define SB_DFF_REG reg Q -`define ABC_ARRIVAL_HX(TIME) `ifdef ICE40_HX (* abc_arrival=TIME *) `endif -`define ABC_ARRIVAL_LP(TIME) `ifdef ICE40_LP (* abc_arrival=TIME *) `endif -`define ABC_ARRIVAL_U(TIME) `ifdef ICE40_U (* abc_arrival=TIME *) `endif +`define ABC9_ARRIVAL_HX(TIME) `ifdef ICE40_HX (* abc9_arrival=TIME *) `endif +`define ABC9_ARRIVAL_LP(TIME) `ifdef ICE40_LP (* abc9_arrival=TIME *) `endif +`define ABC9_ARRIVAL_U(TIME) `ifdef ICE40_U (* abc9_arrival=TIME *) `endif // SiliconBlue IO Cells @@ -152,9 +152,9 @@ endmodule // Positive Edge SiliconBlue FF Cells module SB_DFF ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, D ); @@ -163,9 +163,9 @@ module SB_DFF ( endmodule module SB_DFFE ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, E, D ); @@ -175,9 +175,9 @@ module SB_DFFE ( endmodule module SB_DFFSR ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, R, D ); @@ -189,9 +189,9 @@ module SB_DFFSR ( endmodule module SB_DFFR ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, R, D ); @@ -203,9 +203,9 @@ module SB_DFFR ( endmodule module SB_DFFSS ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, S, D ); @@ -217,9 +217,9 @@ module SB_DFFSS ( endmodule module SB_DFFS ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, S, D ); @@ -231,9 +231,9 @@ module SB_DFFS ( endmodule module SB_DFFESR ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, E, R, D ); @@ -247,9 +247,9 @@ module SB_DFFESR ( endmodule module SB_DFFER ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, E, R, D ); @@ -261,9 +261,9 @@ module SB_DFFER ( endmodule module SB_DFFESS ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, E, S, D ); @@ -277,9 +277,9 @@ module SB_DFFESS ( endmodule module SB_DFFES ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, E, S, D ); @@ -293,9 +293,9 @@ endmodule // Negative Edge SiliconBlue FF Cells module SB_DFFN ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, D ); @@ -304,9 +304,9 @@ module SB_DFFN ( endmodule module SB_DFFNE ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, E, D ); @@ -316,9 +316,9 @@ module SB_DFFNE ( endmodule module SB_DFFNSR ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, R, D ); @@ -330,9 +330,9 @@ module SB_DFFNSR ( endmodule module SB_DFFNR ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, R, D ); @@ -344,9 +344,9 @@ module SB_DFFNR ( endmodule module SB_DFFNSS ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, S, D ); @@ -358,9 +358,9 @@ module SB_DFFNSS ( endmodule module SB_DFFNS ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, S, D ); @@ -372,9 +372,9 @@ module SB_DFFNS ( endmodule module SB_DFFNESR ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, E, R, D ); @@ -388,9 +388,9 @@ module SB_DFFNESR ( endmodule module SB_DFFNER ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, E, R, D ); @@ -402,9 +402,9 @@ module SB_DFFNER ( endmodule module SB_DFFNESS ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, E, S, D ); @@ -418,9 +418,9 @@ module SB_DFFNESS ( endmodule module SB_DFFNES ( - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output `SB_DFF_REG, input C, E, S, D ); @@ -434,9 +434,9 @@ endmodule // SiliconBlue RAM Cells module SB_RAM40_4K ( - `ABC_ARRIVAL_HX(2146) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_hx1k.txt#L401 - `ABC_ARRIVAL_LP(3163) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_lp1k.txt#L401 - `ABC_ARRIVAL_U(1179) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_up5k.txt#L13026 + `ABC9_ARRIVAL_HX(2146) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_hx1k.txt#L401 + `ABC9_ARRIVAL_LP(3163) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_lp1k.txt#L401 + `ABC9_ARRIVAL_U(1179) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_up5k.txt#L13026 output [15:0] RDATA, input RCLK, RCLKE, RE, input [10:0] RADDR, @@ -605,9 +605,9 @@ module SB_RAM40_4K ( endmodule module SB_RAM40_4KNR ( - `ABC_ARRIVAL_HX(2146) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_hx1k.txt#L401 - `ABC_ARRIVAL_LP(3163) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_lp1k.txt#L401 - `ABC_ARRIVAL_U(1179) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_up5k.txt#L13026 + `ABC9_ARRIVAL_HX(2146) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_hx1k.txt#L401 + `ABC9_ARRIVAL_LP(3163) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_lp1k.txt#L401 + `ABC9_ARRIVAL_U(1179) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_up5k.txt#L13026 output [15:0] RDATA, input RCLKN, RCLKE, RE, input [10:0] RADDR, @@ -673,9 +673,9 @@ module SB_RAM40_4KNR ( endmodule module SB_RAM40_4KNW ( - `ABC_ARRIVAL_HX(2146) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_hx1k.txt#L401 - `ABC_ARRIVAL_LP(3163) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_lp1k.txt#L401 - `ABC_ARRIVAL_U(1179) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_up5k.txt#L13026 + `ABC9_ARRIVAL_HX(2146) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_hx1k.txt#L401 + `ABC9_ARRIVAL_LP(3163) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_lp1k.txt#L401 + `ABC9_ARRIVAL_U(1179) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_up5k.txt#L13026 output [15:0] RDATA, input RCLK, RCLKE, RE, input [10:0] RADDR, @@ -741,9 +741,9 @@ module SB_RAM40_4KNW ( endmodule module SB_RAM40_4KNRNW ( - `ABC_ARRIVAL_HX(2146) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_hx1k.txt#L401 - `ABC_ARRIVAL_LP(3163) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_lp1k.txt#L401 - `ABC_ARRIVAL_U(1179) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_up5k.txt#L13026 + `ABC9_ARRIVAL_HX(2146) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_hx1k.txt#L401 + `ABC9_ARRIVAL_LP(3163) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_lp1k.txt#L401 + `ABC9_ARRIVAL_U(1179) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_up5k.txt#L13026 output [15:0] RDATA, input RCLKN, RCLKE, RE, input [10:0] RADDR, @@ -813,9 +813,9 @@ endmodule module ICESTORM_LC ( input I0, I1, I2, I3, CIN, CLK, CEN, SR, output LO, - `ABC_ARRIVAL_HX(540) - `ABC_ARRIVAL_LP(796) - `ABC_ARRIVAL_U(1391) + `ABC9_ARRIVAL_HX(540) + `ABC9_ARRIVAL_LP(796) + `ABC9_ARRIVAL_U(1391) output O, output COUT ); @@ -1417,7 +1417,6 @@ module SB_MAC16 ( input ADDSUBTOP, ADDSUBBOT, input OHOLDTOP, OHOLDBOT, input CI, ACCUMCI, SIGNEXTIN, - //`ABC_ARRIVAL_U(1984) // https://github.com/cliffordwolf/icestorm/blob/95949315364f8d9b0c693386aefadf44b28e2cf6/icefuzz/timings_up5k.txt#L13026 output [31:0] O, output CO, ACCUMCO, SIGNEXTOUT ); diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 2e4684c19..b66c6bf57 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -349,7 +349,7 @@ struct SynthIce40Pass : public ScriptPass } if (!noabc) { if (abc == "abc9") { - run("read_verilog -icells -lib +/ice40/abc_model.v"); + run("read_verilog -icells -lib +/ice40/abc9_model.v"); int wire_delay; if (device_opt == "lp") wire_delay = 400; @@ -357,7 +357,7 @@ struct SynthIce40Pass : public ScriptPass wire_delay = 750; else wire_delay = 250; - run(abc + stringf(" -W %d -lut +/ice40/abc_%s.lut -box +/ice40/abc_%s.box", wire_delay, device_opt.c_str(), device_opt.c_str()), "(skip if -noabc)"); + run(abc + stringf(" -W %d -lut +/ice40/abc9_%s.lut -box +/ice40/abc9_%s.box", wire_delay, device_opt.c_str(), device_opt.c_str()), "(skip if -noabc)"); } else run(abc + " -dress -lut 4", "(skip if -noabc)"); -- cgit v1.2.3 From 3b405d985e789ecf0082f724d2d62d3752e4b60c Mon Sep 17 00:00:00 2001 From: "N. Engelhardt" Date: Thu, 17 Oct 2019 21:33:54 +0200 Subject: Call memory_dff before DSP mapping to reserve registers (fixes #1447) --- techlibs/ice40/synth_ice40.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index b66c6bf57..c942126e1 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -273,6 +273,7 @@ struct SynthIce40Pass : public ScriptPass run("opt_expr"); run("opt_clean"); if (help_mode || dsp) { + run("memory_dff"); run("techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v -D DSP_A_MAXWIDTH=16 -D DSP_B_MAXWIDTH=16 " "-D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_Y_MINWIDTH=11 " "-D DSP_NAME=$__MUL16X16", "(if -dsp)"); -- cgit v1.2.3 From 82f60ba938749ab20694f9070f1046e393f16f3c Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sat, 19 Oct 2019 14:04:52 +0800 Subject: Makefile: don't assume python is called `python3` On some architectures, notably on Windows, the official name for the Python binary from python.org is `python`. The build system assumes that python is called `python3`, which breaks under this architecture. There is already infrastructure in place to determine the name of the Python binary when building PYOSYS. Since Python is now always required to build Yosys, enable this check universally which sets the `PYTHON_EXECUTABLE` variable. Then, reuse this variable in other Makefiles as necessary, rather than hardcoding `python3` everywhere. Signed-off-by: Sean Cross --- techlibs/ice40/Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/Makefile.inc b/techlibs/ice40/Makefile.inc index 3c33fcb06..31478e80e 100644 --- a/techlibs/ice40/Makefile.inc +++ b/techlibs/ice40/Makefile.inc @@ -14,7 +14,7 @@ EXTRA_OBJS += techlibs/ice40/brams_init.mk techlibs/ice40/brams_init.mk: techlibs/ice40/brams_init.py $(Q) mkdir -p techlibs/ice40 - $(P) python3 $< + $(P) $(PYTHON_EXECUTABLE) $< $(Q) touch techlibs/ice40/brams_init.mk techlibs/ice40/brams_init1.vh: techlibs/ice40/brams_init.mk -- cgit v1.2.3 From 37dd3ad3fe434243303e11c22831579569324def Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 20 Oct 2019 10:24:47 +0100 Subject: ice40: Support for post-pnr timing simulation Signed-off-by: David Shah --- techlibs/ice40/cells_sim.v | 108 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 96 insertions(+), 12 deletions(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/cells_sim.v b/techlibs/ice40/cells_sim.v index f9e79a61d..4e008ed5e 100644 --- a/techlibs/ice40/cells_sim.v +++ b/techlibs/ice40/cells_sim.v @@ -1,4 +1,4 @@ - +`timescale 1ps / 1ps `define SB_DFF_REG reg Q = 0 // `define SB_DFF_REG reg Q @@ -81,6 +81,37 @@ module SB_IO ( if (PIN_TYPE[5:4] == 2'b11) assign PACKAGE_PIN = outena_q ? dout : 1'bz; endgenerate `endif +`ifdef TIMING +specify + (INPUT_CLK => D_IN_0) = (0:0:0, 0:0:0); + (INPUT_CLK => D_IN_1) = (0:0:0, 0:0:0); + (PACKAGE_PIN => D_IN_0) = (0:0:0, 0:0:0); + (OUTPUT_CLK => PACKAGE_PIN) = (0:0:0, 0:0:0); + (D_OUT_0 => PACKAGE_PIN) = (0:0:0, 0:0:0); + (OUTPUT_ENABLE => PACKAGE_PIN) = (0:0:0, 0:0:0); + + $setuphold(posedge OUTPUT_CLK, posedge D_OUT_0, 0:0:0, 0:0:0); + $setuphold(posedge OUTPUT_CLK, negedge D_OUT_0, 0:0:0, 0:0:0); + $setuphold(negedge OUTPUT_CLK, posedge D_OUT_1, 0:0:0, 0:0:0); + $setuphold(negedge OUTPUT_CLK, negedge D_OUT_1, 0:0:0, 0:0:0); + $setuphold(negedge OUTPUT_CLK, posedge D_OUT_0, 0:0:0, 0:0:0); + $setuphold(negedge OUTPUT_CLK, negedge D_OUT_0, 0:0:0, 0:0:0); + $setuphold(posedge OUTPUT_CLK, posedge D_OUT_1, 0:0:0, 0:0:0); + $setuphold(posedge OUTPUT_CLK, negedge D_OUT_1, 0:0:0, 0:0:0); + $setuphold(posedge INPUT_CLK, posedge CLOCK_ENABLE, 0:0:0, 0:0:0); + $setuphold(posedge INPUT_CLK, negedge CLOCK_ENABLE, 0:0:0, 0:0:0); + $setuphold(posedge OUTPUT_CLK, posedge CLOCK_ENABLE, 0:0:0, 0:0:0); + $setuphold(posedge OUTPUT_CLK, negedge CLOCK_ENABLE, 0:0:0, 0:0:0); + $setuphold(posedge INPUT_CLK, posedge PACKAGE_PIN, 0:0:0, 0:0:0); + $setuphold(posedge INPUT_CLK, negedge PACKAGE_PIN, 0:0:0, 0:0:0); + $setuphold(negedge INPUT_CLK, posedge PACKAGE_PIN, 0:0:0, 0:0:0); + $setuphold(negedge INPUT_CLK, negedge PACKAGE_PIN, 0:0:0, 0:0:0); + $setuphold(posedge OUTPUT_CLK, posedge OUTPUT_ENABLE, 0:0:0, 0:0:0); + $setuphold(posedge OUTPUT_CLK, negedge OUTPUT_ENABLE, 0:0:0, 0:0:0); + $setuphold(negedge OUTPUT_CLK, posedge OUTPUT_ENABLE, 0:0:0, 0:0:0); + $setuphold(negedge OUTPUT_CLK, negedge OUTPUT_ENABLE, 0:0:0, 0:0:0); +endspecify +`endif endmodule module SB_GB_IO ( @@ -127,6 +158,11 @@ module SB_GB ( output GLOBAL_BUFFER_OUTPUT ); assign GLOBAL_BUFFER_OUTPUT = USER_SIGNAL_TO_GLOBAL_BUFFER; +`ifdef TIMING +specify + (USER_SIGNAL_TO_GLOBAL_BUFFER => GLOBAL_BUFFER_OUTPUT) = (0:0:0, 0:0:0); +endspecify +`endif endmodule // SiliconBlue Logic Cells @@ -830,33 +866,81 @@ module ICESTORM_LC ( parameter [0:0] CIN_CONST = 0; parameter [0:0] CIN_SET = 0; + wire I0_pd = (I0 === 1'bz) ? 1'b0 : I0; + wire I1_pd = (I1 === 1'bz) ? 1'b0 : I1; + wire I2_pd = (I2 === 1'bz) ? 1'b0 : I2; + wire I3_pd = (I3 === 1'bz) ? 1'b0 : I3; + wire SR_pd = (SR === 1'bz) ? 1'b0 : SR; + wire CEN_pu = (CEN === 1'bz) ? 1'b1 : CEN; + wire mux_cin = CIN_CONST ? CIN_SET : CIN; - assign COUT = CARRY_ENABLE ? (I1 && I2) || ((I1 || I2) && mux_cin) : 1'bx; + assign COUT = CARRY_ENABLE ? (I1_pd && I2_pd) || ((I1_pd || I2_pd) && 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]; - wire [1:0] lut_s1 = I1 ? lut_s2[ 3:2] : lut_s2[1:0]; - wire lut_o = I0 ? lut_s1[ 1] : lut_s1[ 0]; + wire [7:0] lut_s3 = I3_pd ? LUT_INIT[15:8] : LUT_INIT[7:0]; + wire [3:0] lut_s2 = I2_pd ? lut_s3[ 7:4] : lut_s3[3:0]; + wire [1:0] lut_s1 = I1_pd ? lut_s2[ 3:2] : lut_s2[1:0]; + wire lut_o = I0_pd ? lut_s1[ 1] : lut_s1[ 0]; assign LO = lut_o; wire polarized_clk; assign polarized_clk = CLK ^ NEG_CLK; - reg o_reg; + reg o_reg = 1'b0; always @(posedge polarized_clk) - if (CEN) - o_reg <= SR ? SET_NORESET : lut_o; + if (CEN_pu) + o_reg <= SR_pd ? SET_NORESET : lut_o; - reg o_reg_async; + reg o_reg_async = 1'b0; always @(posedge polarized_clk, posedge SR) - if (SR) + if (SR_pd) o_reg <= SET_NORESET; - else if (CEN) + else if (CEN_pu) o_reg <= lut_o; assign O = DFF_ENABLE ? ASYNC_SR ? o_reg_async : o_reg : lut_o; +`ifdef TIMING +specify + (I0 => O) = (0:0:0, 0:0:0); + (I1 => O) = (0:0:0, 0:0:0); + (I2 => O) = (0:0:0, 0:0:0); + (I3 => O) = (0:0:0, 0:0:0); + (I0 => LO) = (0:0:0, 0:0:0); + (I1 => LO) = (0:0:0, 0:0:0); + (I2 => LO) = (0:0:0, 0:0:0); + (I3 => LO) = (0:0:0, 0:0:0); + (I1 => COUT) = (0:0:0, 0:0:0); + (I2 => COUT) = (0:0:0, 0:0:0); + (CIN => COUT) = (0:0:0, 0:0:0); + (CLK => O) = (0:0:0, 0:0:0); + (SR => O) = (0:0:0, 0:0:0); + $setuphold(posedge CLK, posedge I0, 0:0:0, 0:0:0); + $setuphold(posedge CLK, negedge I0, 0:0:0, 0:0:0); + $setuphold(negedge CLK, posedge I0, 0:0:0, 0:0:0); + $setuphold(negedge CLK, negedge I0, 0:0:0, 0:0:0); + $setuphold(posedge CLK, posedge I1, 0:0:0, 0:0:0); + $setuphold(posedge CLK, negedge I1, 0:0:0, 0:0:0); + $setuphold(negedge CLK, posedge I1, 0:0:0, 0:0:0); + $setuphold(negedge CLK, negedge I1, 0:0:0, 0:0:0); + $setuphold(posedge CLK, posedge I2, 0:0:0, 0:0:0); + $setuphold(posedge CLK, negedge I2, 0:0:0, 0:0:0); + $setuphold(negedge CLK, posedge I2, 0:0:0, 0:0:0); + $setuphold(negedge CLK, negedge I2, 0:0:0, 0:0:0); + $setuphold(posedge CLK, posedge I3, 0:0:0, 0:0:0); + $setuphold(posedge CLK, negedge I3, 0:0:0, 0:0:0); + $setuphold(negedge CLK, posedge I3, 0:0:0, 0:0:0); + $setuphold(negedge CLK, negedge I3, 0:0:0, 0:0:0); + $setuphold(posedge CLK, posedge CEN, 0:0:0, 0:0:0); + $setuphold(posedge CLK, negedge CEN, 0:0:0, 0:0:0); + $setuphold(negedge CLK, posedge CEN, 0:0:0, 0:0:0); + $setuphold(negedge CLK, negedge CEN, 0:0:0, 0:0:0); + $setuphold(posedge CLK, posedge SR, 0:0:0, 0:0:0); + $setuphold(posedge CLK, negedge SR, 0:0:0, 0:0:0); + $setuphold(negedge CLK, posedge SR, 0:0:0, 0:0:0); + $setuphold(negedge CLK, negedge SR, 0:0:0, 0:0:0); +endspecify +`endif endmodule // SiliconBlue PLL Cells -- cgit v1.2.3 From e135ed5d809ae97b0d4d25ff454456aea44af8fc Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 23 Oct 2019 18:44:34 +0100 Subject: ice40: Add post-pnr ICESTORM_RAM model and fix FFs Signed-off-by: David Shah --- techlibs/ice40/cells_sim.v | 342 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 340 insertions(+), 2 deletions(-) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/cells_sim.v b/techlibs/ice40/cells_sim.v index 4e008ed5e..7d1b37fd6 100644 --- a/techlibs/ice40/cells_sim.v +++ b/techlibs/ice40/cells_sim.v @@ -895,9 +895,9 @@ module ICESTORM_LC ( reg o_reg_async = 1'b0; always @(posedge polarized_clk, posedge SR) if (SR_pd) - o_reg <= SET_NORESET; + o_reg_async <= SET_NORESET; else if (CEN_pu) - o_reg <= lut_o; + o_reg_async <= lut_o; assign O = DFF_ENABLE ? ASYNC_SR ? o_reg_async : o_reg : lut_o; `ifdef TIMING @@ -1660,3 +1660,341 @@ module SB_MAC16 ( assign LCI = (BOTADDSUB_CARRYSELECT == 0) ? 1'b0 : (BOTADDSUB_CARRYSELECT == 1) ? 1'b1 : (BOTADDSUB_CARRYSELECT == 2) ? ACCUMCI : CI; assign O = {Oh, Ol}; endmodule + +// Post-place-and-route RAM model +module ICESTORM_RAM( + output RDATA_15, RDATA_14, RDATA_13, RDATA_12, RDATA_11, RDATA_10, RDATA_9, RDATA_8, RDATA_7, RDATA_6, RDATA_5, RDATA_4, RDATA_3, RDATA_2, RDATA_1, RDATA_0, + input RCLK, RCLKE, RE, + input RADDR_10, RADDR_9, RADDR_8, RADDR_7, RADDR_6, RADDR_5, RADDR_4, RADDR_3, RADDR_2, RADDR_1, RADDR_0, + input WCLK, WCLKE, WE, + input WADDR_10, WADDR_9, WADDR_8, WADDR_7, WADDR_6, WADDR_5, WADDR_4, WADDR_3, WADDR_2, WADDR_1, WADDR_0, + input MASK_15, MASK_14, MASK_13, MASK_12, MASK_11, MASK_10, MASK_9, MASK_8, MASK_7, MASK_6, MASK_5, MASK_4, MASK_3, MASK_2, MASK_1, MASK_0, + input WDATA_15, WDATA_14, WDATA_13, WDATA_12, WDATA_11, WDATA_10, WDATA_9, WDATA_8, WDATA_7, WDATA_6, WDATA_5, WDATA_4, WDATA_3, WDATA_2, WDATA_1, WDATA_0 +); + parameter WRITE_MODE = 0; + parameter READ_MODE = 0; + + parameter NEG_CLK_R = 1'b0; + parameter NEG_CLK_W = 1'b0; + + parameter INIT_0 = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_1 = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_2 = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_3 = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_4 = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_5 = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_6 = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_7 = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_8 = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_9 = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_A = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_B = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_C = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_D = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_E = 256'h0000000000000000000000000000000000000000000000000000000000000000; + parameter INIT_F = 256'h0000000000000000000000000000000000000000000000000000000000000000; + + // Pull-down and pull-up functions + function pd; + input x; + begin + pd = (x === 1'bz) ? 1'b0 : x; + end + endfunction + + function pu; + input x; + begin + pu = (x === 1'bz) ? 1'b1 : x; + end + endfunction + + SB_RAM40_4K #( + .WRITE_MODE(WRITE_MODE), + .READ_MODE (READ_MODE ), + .INIT_0 (INIT_0 ), + .INIT_1 (INIT_1 ), + .INIT_2 (INIT_2 ), + .INIT_3 (INIT_3 ), + .INIT_4 (INIT_4 ), + .INIT_5 (INIT_5 ), + .INIT_6 (INIT_6 ), + .INIT_7 (INIT_7 ), + .INIT_8 (INIT_8 ), + .INIT_9 (INIT_9 ), + .INIT_A (INIT_A ), + .INIT_B (INIT_B ), + .INIT_C (INIT_C ), + .INIT_D (INIT_D ), + .INIT_E (INIT_E ), + .INIT_F (INIT_F ) + ) RAM ( + .RDATA({RDATA_15, RDATA_14, RDATA_13, RDATA_12, RDATA_11, RDATA_10, RDATA_9, RDATA_8, RDATA_7, RDATA_6, RDATA_5, RDATA_4, RDATA_3, RDATA_2, RDATA_1, RDATA_0}), + .RCLK (pd(RCLK) ^ NEG_CLK_R), + .RCLKE(pu(RCLKE)), + .RE (pd(RE)), + .RADDR({pd(RADDR_10), pd(RADDR_9), pd(RADDR_8), pd(RADDR_7), pd(RADDR_6), pd(RADDR_5), pd(RADDR_4), pd(RADDR_3), pd(RADDR_2), pd(RADDR_1), pd(RADDR_0)}), + .WCLK (pd(WCLK) ^ NEG_CLK_W), + .WCLKE(pu(WCLKE)), + .WE (pd(WE)), + .WADDR({pd(WADDR_10), pd(WADDR_9), pd(WADDR_8), pd(WADDR_7), pd(WADDR_6), pd(WADDR_5), pd(WADDR_4), pd(WADDR_3), pd(WADDR_2), pd(WADDR_1), pd(WADDR_0)}), + .MASK ({pd(MASK_15), pd(MASK_14), pd(MASK_13), pd(MASK_12), pd(MASK_11), pd(MASK_10), pd(MASK_9), pd(MASK_8), + pd(MASK_7), pd(MASK_6), pd(MASK_5), pd(MASK_4), pd(MASK_3), pd(MASK_2), pd(MASK_1), pd(MASK_0)}), + .WDATA({pd(WDATA_15), pd(WDATA_14), pd(WDATA_13), pd(WDATA_12), pd(WDATA_11), pd(WDATA_10), pd(WDATA_9), pd(WDATA_8), + pd(WDATA_7), pd(WDATA_6), pd(WDATA_5), pd(WDATA_4), pd(WDATA_3), pd(WDATA_2), pd(WDATA_1), pd(WDATA_0)}) + ); + +`ifdef TIMING +specify + (RCLK => RDATA_15) = (0:0:0, 0:0:0); + (RCLK => RDATA_14) = (0:0:0, 0:0:0); + (RCLK => RDATA_13) = (0:0:0, 0:0:0); + (RCLK => RDATA_12) = (0:0:0, 0:0:0); + (RCLK => RDATA_11) = (0:0:0, 0:0:0); + (RCLK => RDATA_10) = (0:0:0, 0:0:0); + (RCLK => RDATA_9) = (0:0:0, 0:0:0); + (RCLK => RDATA_8) = (0:0:0, 0:0:0); + (RCLK => RDATA_7) = (0:0:0, 0:0:0); + (RCLK => RDATA_6) = (0:0:0, 0:0:0); + (RCLK => RDATA_5) = (0:0:0, 0:0:0); + (RCLK => RDATA_4) = (0:0:0, 0:0:0); + (RCLK => RDATA_3) = (0:0:0, 0:0:0); + (RCLK => RDATA_2) = (0:0:0, 0:0:0); + (RCLK => RDATA_1) = (0:0:0, 0:0:0); + (RCLK => RDATA_0) = (0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RCLKE, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RCLKE, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RCLKE, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RCLKE, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RE, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RE, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RE, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RE, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RADDR_10, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RADDR_10, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RADDR_10, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RADDR_10, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RADDR_9, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RADDR_9, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RADDR_9, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RADDR_9, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RADDR_8, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RADDR_8, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RADDR_8, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RADDR_8, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RADDR_7, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RADDR_7, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RADDR_7, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RADDR_7, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RADDR_6, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RADDR_6, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RADDR_6, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RADDR_6, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RADDR_5, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RADDR_5, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RADDR_5, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RADDR_5, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RADDR_4, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RADDR_4, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RADDR_4, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RADDR_4, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RADDR_3, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RADDR_3, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RADDR_3, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RADDR_3, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RADDR_2, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RADDR_2, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RADDR_2, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RADDR_2, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RADDR_1, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RADDR_1, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RADDR_1, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RADDR_1, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, posedge RADDR_0, 0:0:0, 0:0:0); + $setuphold(posedge RCLK, negedge RADDR_0, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, posedge RADDR_0, 0:0:0, 0:0:0); + $setuphold(negedge RCLK, negedge RADDR_0, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WCLKE, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WCLKE, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WCLKE, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WCLKE, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WE, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WE, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WE, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WE, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WADDR_10, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WADDR_10, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WADDR_10, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WADDR_10, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WADDR_9, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WADDR_9, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WADDR_9, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WADDR_9, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WADDR_8, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WADDR_8, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WADDR_8, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WADDR_8, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WADDR_7, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WADDR_7, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WADDR_7, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WADDR_7, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WADDR_6, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WADDR_6, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WADDR_6, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WADDR_6, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WADDR_5, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WADDR_5, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WADDR_5, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WADDR_5, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WADDR_4, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WADDR_4, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WADDR_4, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WADDR_4, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WADDR_3, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WADDR_3, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WADDR_3, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WADDR_3, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WADDR_2, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WADDR_2, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WADDR_2, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WADDR_2, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WADDR_1, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WADDR_1, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WADDR_1, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WADDR_1, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WADDR_0, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WADDR_0, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WADDR_0, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WADDR_0, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_15, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_15, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_15, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_15, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_14, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_14, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_14, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_14, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_13, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_13, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_13, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_13, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_12, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_12, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_12, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_12, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_11, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_11, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_11, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_11, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_10, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_10, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_10, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_10, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_9, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_9, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_9, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_9, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_8, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_8, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_8, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_8, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_7, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_7, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_7, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_7, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_6, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_6, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_6, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_6, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_5, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_5, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_5, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_5, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_4, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_4, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_4, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_4, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_3, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_3, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_3, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_3, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_2, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_2, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_2, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_2, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_1, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_1, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_1, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_1, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge MASK_0, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge MASK_0, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge MASK_0, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge MASK_0, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_15, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_15, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_15, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_15, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_14, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_14, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_14, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_14, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_13, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_13, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_13, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_13, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_12, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_12, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_12, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_12, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_11, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_11, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_11, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_11, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_10, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_10, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_10, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_10, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_9, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_9, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_9, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_9, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_8, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_8, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_8, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_8, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_7, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_7, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_7, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_7, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_6, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_6, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_6, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_6, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_5, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_5, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_5, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_5, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_4, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_4, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_4, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_4, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_3, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_3, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_3, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_3, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_2, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_2, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_2, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_2, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_1, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_1, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_1, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_1, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, posedge WDATA_0, 0:0:0, 0:0:0); + $setuphold(posedge WCLK, negedge WDATA_0, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, posedge WDATA_0, 0:0:0, 0:0:0); + $setuphold(negedge WCLK, negedge WDATA_0, 0:0:0, 0:0:0); + +endspecify +`endif +endmodule -- cgit v1.2.3 From 07c854b7afc793a589df06c7fce200260378b379 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 13 Nov 2019 13:41:16 +0100 Subject: Add "autoname" pass and use it in "synth_ice40" Signed-off-by: Clifford Wolf --- techlibs/ice40/synth_ice40.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'techlibs/ice40') diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index c942126e1..901194b06 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -380,6 +380,7 @@ struct SynthIce40Pass : public ScriptPass if (check_label("check")) { + run("autoname"); run("hierarchy -check"); run("stat"); run("check -noinit"); -- cgit v1.2.3