Share common tests
authorMiodrag Milanovic <mmicko@gmail.com>
Fri, 18 Oct 2019 10:19:59 +0000 (12:19 +0200)
committerMiodrag Milanovic <mmicko@gmail.com>
Fri, 18 Oct 2019 10:19:59 +0000 (12:19 +0200)
114 files changed:
tests/arch/anlogic/add_sub.v [deleted file]
tests/arch/anlogic/add_sub.ys
tests/arch/anlogic/counter.v [deleted file]
tests/arch/anlogic/counter.ys
tests/arch/anlogic/dffs.v [deleted file]
tests/arch/anlogic/dffs.ys
tests/arch/anlogic/fsm.v [deleted file]
tests/arch/anlogic/fsm.ys
tests/arch/anlogic/latches.v [deleted file]
tests/arch/anlogic/latches.ys
tests/arch/anlogic/logic.ys [new file with mode: 0644]
tests/arch/anlogic/mux.v [deleted file]
tests/arch/anlogic/mux.ys
tests/arch/anlogic/shifter.v [deleted file]
tests/arch/anlogic/shifter.ys
tests/arch/anlogic/tribuf.v [deleted file]
tests/arch/anlogic/tribuf.ys
tests/arch/common/add_sub.v [new file with mode: 0644]
tests/arch/common/adffs.v [new file with mode: 0644]
tests/arch/common/counter.v [new file with mode: 0644]
tests/arch/common/dffs.v [new file with mode: 0644]
tests/arch/common/fsm.v [new file with mode: 0644]
tests/arch/common/latches.v [new file with mode: 0644]
tests/arch/common/logic.v [new file with mode: 0644]
tests/arch/common/mul.v [new file with mode: 0644]
tests/arch/common/mux.v [new file with mode: 0644]
tests/arch/common/shifter.v [new file with mode: 0644]
tests/arch/common/tribuf.v [new file with mode: 0644]
tests/arch/ecp5/add_sub.v [deleted file]
tests/arch/ecp5/add_sub.ys
tests/arch/ecp5/adffs.v [deleted file]
tests/arch/ecp5/adffs.ys
tests/arch/ecp5/counter.v [deleted file]
tests/arch/ecp5/counter.ys
tests/arch/ecp5/dffs.v [deleted file]
tests/arch/ecp5/dffs.ys
tests/arch/ecp5/fsm.v [deleted file]
tests/arch/ecp5/fsm.ys
tests/arch/ecp5/latches.v [deleted file]
tests/arch/ecp5/latches.ys
tests/arch/ecp5/logic.v [deleted file]
tests/arch/ecp5/logic.ys
tests/arch/ecp5/mul.v [deleted file]
tests/arch/ecp5/mul.ys
tests/arch/ecp5/mux.v [deleted file]
tests/arch/ecp5/mux.ys
tests/arch/ecp5/shifter.v [deleted file]
tests/arch/ecp5/shifter.ys
tests/arch/ecp5/tribuf.v [deleted file]
tests/arch/ecp5/tribuf.ys
tests/arch/efinix/add_sub.v [deleted file]
tests/arch/efinix/add_sub.ys
tests/arch/efinix/adffs.v [deleted file]
tests/arch/efinix/adffs.ys
tests/arch/efinix/counter.v [deleted file]
tests/arch/efinix/counter.ys
tests/arch/efinix/dffs.v [deleted file]
tests/arch/efinix/dffs.ys
tests/arch/efinix/fsm.v [deleted file]
tests/arch/efinix/fsm.ys
tests/arch/efinix/latches.v [deleted file]
tests/arch/efinix/latches.ys
tests/arch/efinix/logic.v [deleted file]
tests/arch/efinix/logic.ys
tests/arch/efinix/mux.v [deleted file]
tests/arch/efinix/mux.ys
tests/arch/efinix/shifter.v [deleted file]
tests/arch/efinix/shifter.ys
tests/arch/efinix/tribuf.v [deleted file]
tests/arch/efinix/tribuf.ys
tests/arch/ice40/add_sub.v [deleted file]
tests/arch/ice40/add_sub.ys
tests/arch/ice40/adffs.v [deleted file]
tests/arch/ice40/adffs.ys
tests/arch/ice40/counter.v [deleted file]
tests/arch/ice40/counter.ys
tests/arch/ice40/dffs.v [deleted file]
tests/arch/ice40/dffs.ys
tests/arch/ice40/fsm.v [deleted file]
tests/arch/ice40/fsm.ys
tests/arch/ice40/latches.v [deleted file]
tests/arch/ice40/latches.ys
tests/arch/ice40/logic.v [deleted file]
tests/arch/ice40/logic.ys
tests/arch/ice40/mul.v [deleted file]
tests/arch/ice40/mul.ys
tests/arch/ice40/mux.v [deleted file]
tests/arch/ice40/mux.ys
tests/arch/ice40/shifter.v [deleted file]
tests/arch/ice40/shifter.ys
tests/arch/ice40/tribuf.v [deleted file]
tests/arch/ice40/tribuf.ys
tests/arch/xilinx/add_sub.v [deleted file]
tests/arch/xilinx/add_sub.ys
tests/arch/xilinx/adffs.v [deleted file]
tests/arch/xilinx/adffs.ys
tests/arch/xilinx/counter.v [deleted file]
tests/arch/xilinx/counter.ys
tests/arch/xilinx/dffs.v [deleted file]
tests/arch/xilinx/dffs.ys
tests/arch/xilinx/fsm.v [deleted file]
tests/arch/xilinx/fsm.ys
tests/arch/xilinx/latches.v [deleted file]
tests/arch/xilinx/latches.ys
tests/arch/xilinx/logic.v [deleted file]
tests/arch/xilinx/logic.ys
tests/arch/xilinx/mul.v [deleted file]
tests/arch/xilinx/mul.ys
tests/arch/xilinx/mux.v [deleted file]
tests/arch/xilinx/mux.ys
tests/arch/xilinx/shifter.v [deleted file]
tests/arch/xilinx/shifter.ys
tests/arch/xilinx/tribuf.v [deleted file]
tests/arch/xilinx/tribuf.ys

diff --git a/tests/arch/anlogic/add_sub.v b/tests/arch/anlogic/add_sub.v
deleted file mode 100644 (file)
index 177c32e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-module top
-(
- input [3:0] x,
- input [3:0] y,
-
- output [3:0] A,
- output [3:0] B
- );
-
-assign A =  x + y;
-assign B =  x - y;
-
-endmodule
index b8b67cc4669f0a60c111ce583c329c5b12842890..5396ce7ec5029cefa21ab56cb41fefa2d215fc06 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog add_sub.v
+read_verilog ../common/add_sub.v
 hierarchy -top top
 proc
 equiv_opt -assert -map +/anlogic/cells_sim.v synth_anlogic # equivalency check
diff --git a/tests/arch/anlogic/counter.v b/tests/arch/anlogic/counter.v
deleted file mode 100644 (file)
index 52852f8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-module top    (\r
-out,\r
-clk,\r
-reset\r
-);\r
-    output [7:0] out;\r
-    input clk, reset;\r
-    reg [7:0] out;\r
-\r
-    always @(posedge clk, posedge reset)\r
-               if (reset) begin\r
-                       out <= 8'b0 ;\r
-               end else\r
-                       out <= out + 1;\r
-\r
-\r
-endmodule\r
index 036fdba465f2bfffced288e4fa9f2f99b0ab26b0..d363ec24e017df4a0fda6c2b5391532cdb1ebe32 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog counter.v
+read_verilog ../common/counter.v
 hierarchy -top top
 proc
 flatten
diff --git a/tests/arch/anlogic/dffs.v b/tests/arch/anlogic/dffs.v
deleted file mode 100644 (file)
index 3418787..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-module dff
-    ( input d, clk, output reg q );
-       always @( posedge clk )
-            q <= d;
-endmodule
-
-module dffe
-    ( input d, clk, en, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk )
-               if ( en )
-                       q <= d;
-endmodule
index 9cbe5fce7939c80d8afdbc1aba88de76ff743e61..d3281ab89d5a6a37201b5af5afc354625afae751 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog dffs.v
+read_verilog ../common/dffs.v
 design -save read
 
 hierarchy -top dff
diff --git a/tests/arch/anlogic/fsm.v b/tests/arch/anlogic/fsm.v
deleted file mode 100644 (file)
index 368fbaa..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
- module fsm (\r
- clock,\r
- reset,\r
- req_0,\r
- req_1,\r
- gnt_0,\r
- gnt_1\r
- );\r
- input   clock,reset,req_0,req_1;\r
- output  gnt_0,gnt_1;\r
- wire    clock,reset,req_0,req_1;\r
- reg     gnt_0,gnt_1;\r
-\r
- parameter SIZE = 3           ;\r
- parameter IDLE  = 3'b001,GNT0 = 3'b010,GNT1 = 3'b100,GNT2 = 3'b101 ;\r
-\r
- reg [SIZE-1:0] state;\r
- reg [SIZE-1:0] next_state;\r
-\r
- always @ (posedge clock)\r
- begin : FSM\r
- if (reset == 1'b1) begin\r
-   state <=  #1  IDLE;\r
-   gnt_0 <= 0;\r
-   gnt_1 <= 0;\r
- end else\r
-  case(state)\r
-    IDLE : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT0;\r
-                 gnt_0 <= 1;\r
-               end else if (req_1 == 1'b1) begin\r
-                 gnt_1 <= 1;\r
-                 state <=  #1  GNT0;\r
-               end else begin\r
-                 state <=  #1  IDLE;\r
-               end\r
-    GNT0 : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT0;\r
-               end else begin\r
-                 gnt_0 <= 0;\r
-                 state <=  #1  IDLE;\r
-               end\r
-    GNT1 : if (req_1 == 1'b1) begin\r
-                 state <=  #1  GNT2;\r
-                                gnt_1 <= req_0;\r
-               end\r
-    GNT2 : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT1;\r
-                                gnt_1 <= req_1;\r
-               end\r
-    default : state <=  #1  IDLE;\r
- endcase\r
- end\r
-\r
-endmodule\r
index 452ef92513bb85169074c2f8cf110e4ef30696ec..f45951b13fe40061d04dbcf2060bc9b5dc18425f 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog fsm.v
+read_verilog ../common/fsm.v
 hierarchy -top fsm
 proc
 #flatten
diff --git a/tests/arch/anlogic/latches.v b/tests/arch/anlogic/latches.v
deleted file mode 100644 (file)
index adb5d53..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-module latchp
-    ( input d, clk, en, output reg q );
-       always @*
-               if ( en )
-                       q <= d;
-endmodule
-
-module latchn
-    ( input d, clk, en, output reg q );
-       always @*
-               if ( !en )
-                       q <= d;
-endmodule
-
-module latchsr
-    ( input d, clk, en, clr, pre, output reg q );
-       always @*
-               if ( clr )
-                       q <= 1'b0;
-               else if ( pre )
-                       q <= 1'b1;
-               else if ( en )
-                       q <= d;
-endmodule
index c00c7a25db0003dde9a5f4c3629705d2607bbc34..8d66f77b3c708a7ad41e78bc2d72b2b3720a4003 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog latches.v
+read_verilog ../common/latches.v
 design -save read
 
 hierarchy -top latchp
diff --git a/tests/arch/anlogic/logic.ys b/tests/arch/anlogic/logic.ys
new file mode 100644 (file)
index 0000000..125ee5d
--- /dev/null
@@ -0,0 +1,11 @@
+read_verilog ../common/logic.v
+hierarchy -top top
+proc
+equiv_opt -assert -map +/anlogic/cells_sim.v synth_anlogic # equivalency check
+design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
+cd top # Constrain all select calls below inside the top module
+
+select -assert-count 1 t:AL_MAP_LUT1
+select -assert-count 6 t:AL_MAP_LUT2
+select -assert-count 2 t:AL_MAP_LUT4
+select -assert-none t:AL_MAP_LUT1 t:AL_MAP_LUT2 t:AL_MAP_LUT4 %% t:* %D
diff --git a/tests/arch/anlogic/mux.v b/tests/arch/anlogic/mux.v
deleted file mode 100644 (file)
index 27bc0bf..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-module mux2 (S,A,B,Y);
-    input S;
-    input A,B;
-    output reg Y;
-
-    always @(*)
-               Y = (S)? B : A;
-endmodule
-
-module mux4 ( S, D, Y );
-
-input[1:0] S;
-input[3:0] D;
-output Y;
-
-reg Y;
-wire[1:0] S;
-wire[3:0] D;
-
-always @*
-begin
-    case( S )
-       0 : Y = D[0];
-       1 : Y = D[1];
-       2 : Y = D[2];
-       3 : Y = D[3];
-   endcase
-end
-
-endmodule
-
-module mux8 ( S, D, Y );
-
-input[2:0] S;
-input[7:0] D;
-output Y;
-
-reg Y;
-wire[2:0] S;
-wire[7:0] D;
-
-always @*
-begin
-   case( S )
-       0 : Y = D[0];
-       1 : Y = D[1];
-       2 : Y = D[2];
-       3 : Y = D[3];
-       4 : Y = D[4];
-       5 : Y = D[5];
-       6 : Y = D[6];
-       7 : Y = D[7];
-   endcase
-end
-
-endmodule
-
-module mux16 (D, S, Y);
-       input  [15:0] D;
-       input  [3:0] S;
-       output Y;
-
-assign Y = D[S];
-
-endmodule
index 64ed2a2bddb34b640c51807e53dc435d27ea2558..3d5fe7c9a61d883a26b0150638b579de3b18079c 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog mux.v
+read_verilog ../common/mux.v
 design -save read
 
 hierarchy -top mux2
diff --git a/tests/arch/anlogic/shifter.v b/tests/arch/anlogic/shifter.v
deleted file mode 100644 (file)
index 04ae49d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-module top    (\r
-out,\r
-clk,\r
-in\r
-);\r
-    output [7:0] out;\r
-    input signed clk, in;\r
-    reg signed [7:0] out = 0;\r
-\r
-    always @(posedge clk)\r
-       begin\r
-               out    <= out >> 1;\r
-               out[7] <= in;\r
-       end\r
-\r
-endmodule\r
index 5eaed30a3391d590d7ee4d37636d97e2a6ed1798..12df44b2a5d7f37e556ae71dc949e5942f4560b0 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog shifter.v
+read_verilog ../common/shifter.v
 hierarchy -top top
 proc
 flatten
diff --git a/tests/arch/anlogic/tribuf.v b/tests/arch/anlogic/tribuf.v
deleted file mode 100644 (file)
index 90dd314..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-module tristate (en, i, o);
-    input en;
-    input i;
-    output o;
-
-       assign o = en ? i : 1'bz;
-
-endmodule
index 0eb1338ac8d4d6a0fb16f9a191cb88035be13dba..eaa0737508b2f55d73e1f611f804f495f5beed77 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog tribuf.v
+read_verilog ../common/tribuf.v
 hierarchy -top tristate
 proc
 flatten
diff --git a/tests/arch/common/add_sub.v b/tests/arch/common/add_sub.v
new file mode 100644 (file)
index 0000000..177c32e
--- /dev/null
@@ -0,0 +1,13 @@
+module top
+(
+ input [3:0] x,
+ input [3:0] y,
+
+ output [3:0] A,
+ output [3:0] B
+ );
+
+assign A =  x + y;
+assign B =  x - y;
+
+endmodule
diff --git a/tests/arch/common/adffs.v b/tests/arch/common/adffs.v
new file mode 100644 (file)
index 0000000..223b52d
--- /dev/null
@@ -0,0 +1,47 @@
+module adff
+    ( input d, clk, clr, output reg q );
+    initial begin
+      q = 0;
+    end
+       always @( posedge clk, posedge clr )
+               if ( clr )
+                       q <= 1'b0;
+               else
+            q <= d;
+endmodule
+
+module adffn
+    ( input d, clk, clr, output reg q );
+    initial begin
+      q = 0;
+    end
+       always @( posedge clk, negedge clr )
+               if ( !clr )
+                       q <= 1'b0;
+               else
+            q <= d;
+endmodule
+
+module dffs
+    ( input d, clk, pre, clr, output reg q );
+    initial begin
+      q = 0;
+    end
+       always @( posedge clk )
+               if ( pre )
+                       q <= 1'b1;
+               else
+            q <= d;
+endmodule
+
+module ndffnr
+    ( input d, clk, pre, clr, output reg q );
+    initial begin
+      q = 0;
+    end
+       always @( negedge clk )
+               if ( !clr )
+                       q <= 1'b0;
+               else
+            q <= d;
+endmodule
diff --git a/tests/arch/common/counter.v b/tests/arch/common/counter.v
new file mode 100644 (file)
index 0000000..52852f8
--- /dev/null
@@ -0,0 +1,17 @@
+module top    (\r
+out,\r
+clk,\r
+reset\r
+);\r
+    output [7:0] out;\r
+    input clk, reset;\r
+    reg [7:0] out;\r
+\r
+    always @(posedge clk, posedge reset)\r
+               if (reset) begin\r
+                       out <= 8'b0 ;\r
+               end else\r
+                       out <= out + 1;\r
+\r
+\r
+endmodule\r
diff --git a/tests/arch/common/dffs.v b/tests/arch/common/dffs.v
new file mode 100644 (file)
index 0000000..3418787
--- /dev/null
@@ -0,0 +1,15 @@
+module dff
+    ( input d, clk, output reg q );
+       always @( posedge clk )
+            q <= d;
+endmodule
+
+module dffe
+    ( input d, clk, en, output reg q );
+    initial begin
+      q = 0;
+    end
+       always @( posedge clk )
+               if ( en )
+                       q <= d;
+endmodule
diff --git a/tests/arch/common/fsm.v b/tests/arch/common/fsm.v
new file mode 100644 (file)
index 0000000..368fbaa
--- /dev/null
@@ -0,0 +1,55 @@
+ module fsm (\r
+ clock,\r
+ reset,\r
+ req_0,\r
+ req_1,\r
+ gnt_0,\r
+ gnt_1\r
+ );\r
+ input   clock,reset,req_0,req_1;\r
+ output  gnt_0,gnt_1;\r
+ wire    clock,reset,req_0,req_1;\r
+ reg     gnt_0,gnt_1;\r
+\r
+ parameter SIZE = 3           ;\r
+ parameter IDLE  = 3'b001,GNT0 = 3'b010,GNT1 = 3'b100,GNT2 = 3'b101 ;\r
+\r
+ reg [SIZE-1:0] state;\r
+ reg [SIZE-1:0] next_state;\r
+\r
+ always @ (posedge clock)\r
+ begin : FSM\r
+ if (reset == 1'b1) begin\r
+   state <=  #1  IDLE;\r
+   gnt_0 <= 0;\r
+   gnt_1 <= 0;\r
+ end else\r
+  case(state)\r
+    IDLE : if (req_0 == 1'b1) begin\r
+                 state <=  #1  GNT0;\r
+                 gnt_0 <= 1;\r
+               end else if (req_1 == 1'b1) begin\r
+                 gnt_1 <= 1;\r
+                 state <=  #1  GNT0;\r
+               end else begin\r
+                 state <=  #1  IDLE;\r
+               end\r
+    GNT0 : if (req_0 == 1'b1) begin\r
+                 state <=  #1  GNT0;\r
+               end else begin\r
+                 gnt_0 <= 0;\r
+                 state <=  #1  IDLE;\r
+               end\r
+    GNT1 : if (req_1 == 1'b1) begin\r
+                 state <=  #1  GNT2;\r
+                                gnt_1 <= req_0;\r
+               end\r
+    GNT2 : if (req_0 == 1'b1) begin\r
+                 state <=  #1  GNT1;\r
+                                gnt_1 <= req_1;\r
+               end\r
+    default : state <=  #1  IDLE;\r
+ endcase\r
+ end\r
+\r
+endmodule\r
diff --git a/tests/arch/common/latches.v b/tests/arch/common/latches.v
new file mode 100644 (file)
index 0000000..adb5d53
--- /dev/null
@@ -0,0 +1,24 @@
+module latchp
+    ( input d, clk, en, output reg q );
+       always @*
+               if ( en )
+                       q <= d;
+endmodule
+
+module latchn
+    ( input d, clk, en, output reg q );
+       always @*
+               if ( !en )
+                       q <= d;
+endmodule
+
+module latchsr
+    ( input d, clk, en, clr, pre, output reg q );
+       always @*
+               if ( clr )
+                       q <= 1'b0;
+               else if ( pre )
+                       q <= 1'b1;
+               else if ( en )
+                       q <= d;
+endmodule
diff --git a/tests/arch/common/logic.v b/tests/arch/common/logic.v
new file mode 100644 (file)
index 0000000..e5343ca
--- /dev/null
@@ -0,0 +1,18 @@
+module top
+(
+ input [0:7] in,
+ output B1,B2,B3,B4,B5,B6,B7,B8,B9,B10
+ );
+
+   assign     B1 =  in[0] & in[1];
+   assign     B2 =  in[0] | in[1];
+   assign     B3 =  in[0] ~& in[1];
+   assign     B4 =  in[0] ~| in[1];
+   assign     B5 =  in[0] ^ in[1];
+   assign     B6 =  in[0] ~^ in[1];
+   assign     B7 =  ~in[0];
+   assign     B8 =  in[0];
+   assign     B9 =  in[0:1] && in [2:3];
+   assign     B10 =  in[0:1] || in [2:3];
+
+endmodule
diff --git a/tests/arch/common/mul.v b/tests/arch/common/mul.v
new file mode 100644 (file)
index 0000000..d5b48b1
--- /dev/null
@@ -0,0 +1,11 @@
+module top
+(
+ input [5:0] x,
+ input [5:0] y,
+
+ output [11:0] A,
+ );
+
+assign A =  x * y;
+
+endmodule
diff --git a/tests/arch/common/mux.v b/tests/arch/common/mux.v
new file mode 100644 (file)
index 0000000..27bc0bf
--- /dev/null
@@ -0,0 +1,65 @@
+module mux2 (S,A,B,Y);
+    input S;
+    input A,B;
+    output reg Y;
+
+    always @(*)
+               Y = (S)? B : A;
+endmodule
+
+module mux4 ( S, D, Y );
+
+input[1:0] S;
+input[3:0] D;
+output Y;
+
+reg Y;
+wire[1:0] S;
+wire[3:0] D;
+
+always @*
+begin
+    case( S )
+       0 : Y = D[0];
+       1 : Y = D[1];
+       2 : Y = D[2];
+       3 : Y = D[3];
+   endcase
+end
+
+endmodule
+
+module mux8 ( S, D, Y );
+
+input[2:0] S;
+input[7:0] D;
+output Y;
+
+reg Y;
+wire[2:0] S;
+wire[7:0] D;
+
+always @*
+begin
+   case( S )
+       0 : Y = D[0];
+       1 : Y = D[1];
+       2 : Y = D[2];
+       3 : Y = D[3];
+       4 : Y = D[4];
+       5 : Y = D[5];
+       6 : Y = D[6];
+       7 : Y = D[7];
+   endcase
+end
+
+endmodule
+
+module mux16 (D, S, Y);
+       input  [15:0] D;
+       input  [3:0] S;
+       output Y;
+
+assign Y = D[S];
+
+endmodule
diff --git a/tests/arch/common/shifter.v b/tests/arch/common/shifter.v
new file mode 100644 (file)
index 0000000..04ae49d
--- /dev/null
@@ -0,0 +1,16 @@
+module top    (\r
+out,\r
+clk,\r
+in\r
+);\r
+    output [7:0] out;\r
+    input signed clk, in;\r
+    reg signed [7:0] out = 0;\r
+\r
+    always @(posedge clk)\r
+       begin\r
+               out    <= out >> 1;\r
+               out[7] <= in;\r
+       end\r
+\r
+endmodule\r
diff --git a/tests/arch/common/tribuf.v b/tests/arch/common/tribuf.v
new file mode 100644 (file)
index 0000000..c644682
--- /dev/null
@@ -0,0 +1,8 @@
+module tristate (en, i, o);
+    input en;
+    input i;
+    output reg o;
+    
+    always @(en or i)
+               o <= (en)? i : 1'bZ;
+endmodule
diff --git a/tests/arch/ecp5/add_sub.v b/tests/arch/ecp5/add_sub.v
deleted file mode 100644 (file)
index 177c32e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-module top
-(
- input [3:0] x,
- input [3:0] y,
-
- output [3:0] A,
- output [3:0] B
- );
-
-assign A =  x + y;
-assign B =  x - y;
-
-endmodule
index ee72d732f785ecbf77e6c3d7f7939bfef2ab0b96..d85ce792ee65985699177d327362ea38cc3415b7 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog add_sub.v
+read_verilog ../common/add_sub.v
 hierarchy -top top
 proc
 equiv_opt -assert -map +/ecp5/cells_sim.v synth_ecp5 # equivalency check
diff --git a/tests/arch/ecp5/adffs.v b/tests/arch/ecp5/adffs.v
deleted file mode 100644 (file)
index 223b52d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-module adff
-    ( input d, clk, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk, posedge clr )
-               if ( clr )
-                       q <= 1'b0;
-               else
-            q <= d;
-endmodule
-
-module adffn
-    ( input d, clk, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk, negedge clr )
-               if ( !clr )
-                       q <= 1'b0;
-               else
-            q <= d;
-endmodule
-
-module dffs
-    ( input d, clk, pre, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk )
-               if ( pre )
-                       q <= 1'b1;
-               else
-            q <= d;
-endmodule
-
-module ndffnr
-    ( input d, clk, pre, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( negedge clk )
-               if ( !clr )
-                       q <= 1'b0;
-               else
-            q <= d;
-endmodule
index c6780e565dd6c8eb4e01f0c8aa023ffaca28793c..01605df7071eef3534f602a5b6c84d18cbf7972d 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog adffs.v
+read_verilog ../common/adffs.v
 design -save read
 
 hierarchy -top adff
diff --git a/tests/arch/ecp5/counter.v b/tests/arch/ecp5/counter.v
deleted file mode 100644 (file)
index 52852f8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-module top    (\r
-out,\r
-clk,\r
-reset\r
-);\r
-    output [7:0] out;\r
-    input clk, reset;\r
-    reg [7:0] out;\r
-\r
-    always @(posedge clk, posedge reset)\r
-               if (reset) begin\r
-                       out <= 8'b0 ;\r
-               end else\r
-                       out <= out + 1;\r
-\r
-\r
-endmodule\r
index 8ef70778f52cacfee36d863708d4899f64fee6ad..f9f60fbff69cd552e48a19f294c02f682dafd65d 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog counter.v
+read_verilog ../common/counter.v
 hierarchy -top top
 proc
 flatten
diff --git a/tests/arch/ecp5/dffs.v b/tests/arch/ecp5/dffs.v
deleted file mode 100644 (file)
index 3418787..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-module dff
-    ( input d, clk, output reg q );
-       always @( posedge clk )
-            q <= d;
-endmodule
-
-module dffe
-    ( input d, clk, en, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk )
-               if ( en )
-                       q <= d;
-endmodule
index a4f45d2fb064b7af059eead1624c5bf343c36ef9..be97972dbfeb4a66b191bf42eaf5bbc45e09d18c 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog dffs.v
+read_verilog ../common/dffs.v
 design -save read
 
 hierarchy -top dff
diff --git a/tests/arch/ecp5/fsm.v b/tests/arch/ecp5/fsm.v
deleted file mode 100644 (file)
index 368fbaa..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
- module fsm (\r
- clock,\r
- reset,\r
- req_0,\r
- req_1,\r
- gnt_0,\r
- gnt_1\r
- );\r
- input   clock,reset,req_0,req_1;\r
- output  gnt_0,gnt_1;\r
- wire    clock,reset,req_0,req_1;\r
- reg     gnt_0,gnt_1;\r
-\r
- parameter SIZE = 3           ;\r
- parameter IDLE  = 3'b001,GNT0 = 3'b010,GNT1 = 3'b100,GNT2 = 3'b101 ;\r
-\r
- reg [SIZE-1:0] state;\r
- reg [SIZE-1:0] next_state;\r
-\r
- always @ (posedge clock)\r
- begin : FSM\r
- if (reset == 1'b1) begin\r
-   state <=  #1  IDLE;\r
-   gnt_0 <= 0;\r
-   gnt_1 <= 0;\r
- end else\r
-  case(state)\r
-    IDLE : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT0;\r
-                 gnt_0 <= 1;\r
-               end else if (req_1 == 1'b1) begin\r
-                 gnt_1 <= 1;\r
-                 state <=  #1  GNT0;\r
-               end else begin\r
-                 state <=  #1  IDLE;\r
-               end\r
-    GNT0 : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT0;\r
-               end else begin\r
-                 gnt_0 <= 0;\r
-                 state <=  #1  IDLE;\r
-               end\r
-    GNT1 : if (req_1 == 1'b1) begin\r
-                 state <=  #1  GNT2;\r
-                                gnt_1 <= req_0;\r
-               end\r
-    GNT2 : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT1;\r
-                                gnt_1 <= req_1;\r
-               end\r
-    default : state <=  #1  IDLE;\r
- endcase\r
- end\r
-\r
-endmodule\r
index ded91e5f7deaed58b3a0155adccf0df034477cac..f834a4c6b43cc8dc6eb15f3d069ac589660f72bb 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog fsm.v
+read_verilog ../common/fsm.v
 hierarchy -top fsm
 proc
 flatten
diff --git a/tests/arch/ecp5/latches.v b/tests/arch/ecp5/latches.v
deleted file mode 100644 (file)
index adb5d53..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-module latchp
-    ( input d, clk, en, output reg q );
-       always @*
-               if ( en )
-                       q <= d;
-endmodule
-
-module latchn
-    ( input d, clk, en, output reg q );
-       always @*
-               if ( !en )
-                       q <= d;
-endmodule
-
-module latchsr
-    ( input d, clk, en, clr, pre, output reg q );
-       always @*
-               if ( clr )
-                       q <= 1'b0;
-               else if ( pre )
-                       q <= 1'b1;
-               else if ( en )
-                       q <= d;
-endmodule
index fc15a6910af59da5df76ade2c8fcfd843a52a169..3d011d74f5160098f4ab97032e2e4cffa6dadcda 100644 (file)
@@ -1,5 +1,4 @@
-
-read_verilog latches.v
+read_verilog ../common/latches.v
 design -save read
 
 hierarchy -top latchp
diff --git a/tests/arch/ecp5/logic.v b/tests/arch/ecp5/logic.v
deleted file mode 100644 (file)
index e5343ca..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-module top
-(
- input [0:7] in,
- output B1,B2,B3,B4,B5,B6,B7,B8,B9,B10
- );
-
-   assign     B1 =  in[0] & in[1];
-   assign     B2 =  in[0] | in[1];
-   assign     B3 =  in[0] ~& in[1];
-   assign     B4 =  in[0] ~| in[1];
-   assign     B5 =  in[0] ^ in[1];
-   assign     B6 =  in[0] ~^ in[1];
-   assign     B7 =  ~in[0];
-   assign     B8 =  in[0];
-   assign     B9 =  in[0:1] && in [2:3];
-   assign     B10 =  in[0:1] || in [2:3];
-
-endmodule
index 4f113a130708b04364f93291d61514ea3a7efe17..3298b198f0d8e2bfc75f742a9b4743751280a4e4 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog logic.v
+read_verilog ../common/logic.v
 hierarchy -top top
 proc
 equiv_opt -assert -map +/ecp5/cells_sim.v synth_ecp5 # equivalency check
diff --git a/tests/arch/ecp5/mul.v b/tests/arch/ecp5/mul.v
deleted file mode 100644 (file)
index d5b48b1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-module top
-(
- input [5:0] x,
- input [5:0] y,
-
- output [11:0] A,
- );
-
-assign A =  x * y;
-
-endmodule
index 0a91f892e75c30b1358a0e43568a7c608ebd7de6..2105be52ce7a71f24cde6c030cb71567ab2bc0ee 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog mul.v
+read_verilog ../common/mul.v
 hierarchy -top top
 proc
 # Blocked by issue #1358 (Missing ECP5 simulation models)
diff --git a/tests/arch/ecp5/mux.v b/tests/arch/ecp5/mux.v
deleted file mode 100644 (file)
index 782424a..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-module mux2 (S,A,B,Y);
-    input S;
-    input A,B;
-    output reg Y;
-
-    always @(*)
-               Y = (S)? B : A;
-endmodule
-
-module mux4 ( S, D, Y );
-
-input[1:0] S;
-input[3:0] D;
-output Y;
-
-reg Y;
-wire[1:0] S;
-wire[3:0] D;
-
-always @*
-begin
-    case( S )
-       0 : Y = D[0];
-       1 : Y = D[1];
-       2 : Y = D[2];
-       3 : Y = D[3];
-   endcase
-end
-
-endmodule
-
-module mux8 ( S, D, Y );
-
-input[2:0] S;
-input[7:0] D;
-output Y;
-
-reg Y;
-wire[2:0] S;
-wire[7:0] D;
-
-always @*
-begin
-   case( S )
-       0 : Y = D[0];
-       1 : Y = D[1];
-       2 : Y = D[2];
-       3 : Y = D[3];
-       4 : Y = D[4];
-       5 : Y = D[5];
-       6 : Y = D[6];
-       7 : Y = D[7];
-   endcase
-end
-
-endmodule
-
-module mux16 (D, S, Y);
-       input  [15:0] D;
-       input  [3:0] S;
-       output Y;
-
-assign Y = D[S];
-
-endmodule
-
index 8cfbd541be9a06d6447d8fc8215675fb5978996e..92463aa3248d064fbf0d3543c15c6fbd77d3e012 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog mux.v
+read_verilog ../common/mux.v
 design -save read
 
 hierarchy -top mux2
diff --git a/tests/arch/ecp5/shifter.v b/tests/arch/ecp5/shifter.v
deleted file mode 100644 (file)
index 04ae49d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-module top    (\r
-out,\r
-clk,\r
-in\r
-);\r
-    output [7:0] out;\r
-    input signed clk, in;\r
-    reg signed [7:0] out = 0;\r
-\r
-    always @(posedge clk)\r
-       begin\r
-               out    <= out >> 1;\r
-               out[7] <= in;\r
-       end\r
-\r
-endmodule\r
index e1901e1a88a9eb2eb1c46e0e8b94c07b07fddce0..3f0079f4a5e2765b7392fa75ab88adf70201499f 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog shifter.v
+read_verilog ../common/shifter.v
 hierarchy -top top
 proc
 flatten
diff --git a/tests/arch/ecp5/tribuf.v b/tests/arch/ecp5/tribuf.v
deleted file mode 100644 (file)
index 90dd314..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-module tristate (en, i, o);
-    input en;
-    input i;
-    output o;
-
-       assign o = en ? i : 1'bz;
-
-endmodule
index a6e9c9598346c6c5ef419773a14c6385ba09fea8..0118705a267c5191e288a78c8a3243d280a90b59 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog tribuf.v
+read_verilog ../common/tribuf.v
 hierarchy -top tristate
 proc
 flatten
diff --git a/tests/arch/efinix/add_sub.v b/tests/arch/efinix/add_sub.v
deleted file mode 100644 (file)
index 177c32e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-module top
-(
- input [3:0] x,
- input [3:0] y,
-
- output [3:0] A,
- output [3:0] B
- );
-
-assign A =  x + y;
-assign B =  x - y;
-
-endmodule
index 8bd28c68e2125ff64cbf1b99cbc426020970b5e7..20523c059342454ef82e20dee067ac449b6c0982 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog add_sub.v
+read_verilog ../common/add_sub.v
 hierarchy -top top
 proc
 equiv_opt -assert -map +/efinix/cells_sim.v synth_efinix # equivalency check
diff --git a/tests/arch/efinix/adffs.v b/tests/arch/efinix/adffs.v
deleted file mode 100644 (file)
index 223b52d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-module adff
-    ( input d, clk, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk, posedge clr )
-               if ( clr )
-                       q <= 1'b0;
-               else
-            q <= d;
-endmodule
-
-module adffn
-    ( input d, clk, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk, negedge clr )
-               if ( !clr )
-                       q <= 1'b0;
-               else
-            q <= d;
-endmodule
-
-module dffs
-    ( input d, clk, pre, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk )
-               if ( pre )
-                       q <= 1'b1;
-               else
-            q <= d;
-endmodule
-
-module ndffnr
-    ( input d, clk, pre, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( negedge clk )
-               if ( !clr )
-                       q <= 1'b0;
-               else
-            q <= d;
-endmodule
index 1069c6c5cfd863a9a24a913a0bf0177791ab3a84..49dc7f256426a3867568c7139eb485528e681ec5 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog adffs.v
+read_verilog ../common/adffs.v
 design -save read
 
 hierarchy -top adff
diff --git a/tests/arch/efinix/counter.v b/tests/arch/efinix/counter.v
deleted file mode 100644 (file)
index 52852f8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-module top    (\r
-out,\r
-clk,\r
-reset\r
-);\r
-    output [7:0] out;\r
-    input clk, reset;\r
-    reg [7:0] out;\r
-\r
-    always @(posedge clk, posedge reset)\r
-               if (reset) begin\r
-                       out <= 8'b0 ;\r
-               end else\r
-                       out <= out + 1;\r
-\r
-\r
-endmodule\r
index 82e61d39b7013c73f264208a2d75271b3e8b44b9..d20b8ae271fa670c9099ea806c63de4e2fe30cae 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog counter.v
+read_verilog ../common/counter.v
 hierarchy -top top
 proc
 flatten
diff --git a/tests/arch/efinix/dffs.v b/tests/arch/efinix/dffs.v
deleted file mode 100644 (file)
index 3418787..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-module dff
-    ( input d, clk, output reg q );
-       always @( posedge clk )
-            q <= d;
-endmodule
-
-module dffe
-    ( input d, clk, en, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk )
-               if ( en )
-                       q <= d;
-endmodule
index cdd288233520baef27e4187a4a28dc4f9b121a74..af787ab670f1a91e29a233aa271f8f648d02b3a4 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog dffs.v
+read_verilog ../common/dffs.v
 design -save read
 
 hierarchy -top dff
diff --git a/tests/arch/efinix/fsm.v b/tests/arch/efinix/fsm.v
deleted file mode 100644 (file)
index 368fbaa..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
- module fsm (\r
- clock,\r
- reset,\r
- req_0,\r
- req_1,\r
- gnt_0,\r
- gnt_1\r
- );\r
- input   clock,reset,req_0,req_1;\r
- output  gnt_0,gnt_1;\r
- wire    clock,reset,req_0,req_1;\r
- reg     gnt_0,gnt_1;\r
-\r
- parameter SIZE = 3           ;\r
- parameter IDLE  = 3'b001,GNT0 = 3'b010,GNT1 = 3'b100,GNT2 = 3'b101 ;\r
-\r
- reg [SIZE-1:0] state;\r
- reg [SIZE-1:0] next_state;\r
-\r
- always @ (posedge clock)\r
- begin : FSM\r
- if (reset == 1'b1) begin\r
-   state <=  #1  IDLE;\r
-   gnt_0 <= 0;\r
-   gnt_1 <= 0;\r
- end else\r
-  case(state)\r
-    IDLE : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT0;\r
-                 gnt_0 <= 1;\r
-               end else if (req_1 == 1'b1) begin\r
-                 gnt_1 <= 1;\r
-                 state <=  #1  GNT0;\r
-               end else begin\r
-                 state <=  #1  IDLE;\r
-               end\r
-    GNT0 : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT0;\r
-               end else begin\r
-                 gnt_0 <= 0;\r
-                 state <=  #1  IDLE;\r
-               end\r
-    GNT1 : if (req_1 == 1'b1) begin\r
-                 state <=  #1  GNT2;\r
-                                gnt_1 <= req_0;\r
-               end\r
-    GNT2 : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT1;\r
-                                gnt_1 <= req_1;\r
-               end\r
-    default : state <=  #1  IDLE;\r
- endcase\r
- end\r
-\r
-endmodule\r
index 2ec75215dbab0125ba2fa86ffde11bab2cc93938..a8ba70fdbada70dcf6d8dc36d05fdb60a87a83c5 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog fsm.v
+read_verilog ../common/fsm.v
 hierarchy -top fsm
 proc
 flatten
diff --git a/tests/arch/efinix/latches.v b/tests/arch/efinix/latches.v
deleted file mode 100644 (file)
index adb5d53..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-module latchp
-    ( input d, clk, en, output reg q );
-       always @*
-               if ( en )
-                       q <= d;
-endmodule
-
-module latchn
-    ( input d, clk, en, output reg q );
-       always @*
-               if ( !en )
-                       q <= d;
-endmodule
-
-module latchsr
-    ( input d, clk, en, clr, pre, output reg q );
-       always @*
-               if ( clr )
-                       q <= 1'b0;
-               else if ( pre )
-                       q <= 1'b1;
-               else if ( en )
-                       q <= d;
-endmodule
index 899d024ce536ca6cf85eb0496ddff46bf994064e..1b1c000237310e1d45174c8ae73e117244ea387b 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog latches.v
+read_verilog ../common/latches.v
 design -save read
 
 hierarchy -top latchp
diff --git a/tests/arch/efinix/logic.v b/tests/arch/efinix/logic.v
deleted file mode 100644 (file)
index e5343ca..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-module top
-(
- input [0:7] in,
- output B1,B2,B3,B4,B5,B6,B7,B8,B9,B10
- );
-
-   assign     B1 =  in[0] & in[1];
-   assign     B2 =  in[0] | in[1];
-   assign     B3 =  in[0] ~& in[1];
-   assign     B4 =  in[0] ~| in[1];
-   assign     B5 =  in[0] ^ in[1];
-   assign     B6 =  in[0] ~^ in[1];
-   assign     B7 =  ~in[0];
-   assign     B8 =  in[0];
-   assign     B9 =  in[0:1] && in [2:3];
-   assign     B10 =  in[0:1] || in [2:3];
-
-endmodule
index fdedb337be1272f2a3f68c1116811d5eccf59722..76e98e079998862c749fd3b65b50506e52fd8829 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog logic.v
+read_verilog ../common/logic.v
 hierarchy -top top
 proc
 equiv_opt -assert -map +/efinix/cells_sim.v synth_efinix # equivalency check
diff --git a/tests/arch/efinix/mux.v b/tests/arch/efinix/mux.v
deleted file mode 100644 (file)
index 27bc0bf..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-module mux2 (S,A,B,Y);
-    input S;
-    input A,B;
-    output reg Y;
-
-    always @(*)
-               Y = (S)? B : A;
-endmodule
-
-module mux4 ( S, D, Y );
-
-input[1:0] S;
-input[3:0] D;
-output Y;
-
-reg Y;
-wire[1:0] S;
-wire[3:0] D;
-
-always @*
-begin
-    case( S )
-       0 : Y = D[0];
-       1 : Y = D[1];
-       2 : Y = D[2];
-       3 : Y = D[3];
-   endcase
-end
-
-endmodule
-
-module mux8 ( S, D, Y );
-
-input[2:0] S;
-input[7:0] D;
-output Y;
-
-reg Y;
-wire[2:0] S;
-wire[7:0] D;
-
-always @*
-begin
-   case( S )
-       0 : Y = D[0];
-       1 : Y = D[1];
-       2 : Y = D[2];
-       3 : Y = D[3];
-       4 : Y = D[4];
-       5 : Y = D[5];
-       6 : Y = D[6];
-       7 : Y = D[7];
-   endcase
-end
-
-endmodule
-
-module mux16 (D, S, Y);
-       input  [15:0] D;
-       input  [3:0] S;
-       output Y;
-
-assign Y = D[S];
-
-endmodule
index 71a9681de8b212a17eb16aff8a3f359a587a581e..b46f641e16bc65583d818eae0a9aaa8df39d719e 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog mux.v
+read_verilog ../common/mux.v
 design -save read
 
 hierarchy -top mux2
diff --git a/tests/arch/efinix/shifter.v b/tests/arch/efinix/shifter.v
deleted file mode 100644 (file)
index ce2c81d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-module top    (\r
-out,\r
-clk,\r
-in\r
-);\r
-    output [7:0] out;\r
-    input signed clk, in;\r
-    reg signed [7:0] out = 0;\r
-\r
-    always @(posedge clk)\r
-       begin\r
-               out    <= out << 1;\r
-               out[7] <= in;\r
-       end\r
-\r
-endmodule\r
index 1a6b5565c6cb60d68adecc33112fc48133067125..54f71167fc259650562bb11ef3bcf4e718e7dedb 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog shifter.v
+read_verilog ../common/shifter.v
 hierarchy -top top
 proc
 flatten
diff --git a/tests/arch/efinix/tribuf.v b/tests/arch/efinix/tribuf.v
deleted file mode 100644 (file)
index c644682..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-module tristate (en, i, o);
-    input en;
-    input i;
-    output reg o;
-    
-    always @(en or i)
-               o <= (en)? i : 1'bZ;
-endmodule
index 2e2ab9e653411204e8b104fc2bb7e29cf0d283d9..47904f2d5f542f275cdd3e0fcc603b962f7c505e 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog tribuf.v
+read_verilog ../common/tribuf.v
 hierarchy -top tristate
 proc
 tribuf
diff --git a/tests/arch/ice40/add_sub.v b/tests/arch/ice40/add_sub.v
deleted file mode 100644 (file)
index 177c32e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-module top
-(
- input [3:0] x,
- input [3:0] y,
-
- output [3:0] A,
- output [3:0] B
- );
-
-assign A =  x + y;
-assign B =  x - y;
-
-endmodule
index 4a998d98d3098ea2ad159b7bccddbfc110edb827..578ec080380a0b2e47f61aa0b8774429b0ba67c5 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog add_sub.v
+read_verilog ../common/add_sub.v
 hierarchy -top top
 equiv_opt -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
 design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
diff --git a/tests/arch/ice40/adffs.v b/tests/arch/ice40/adffs.v
deleted file mode 100644 (file)
index 09dc360..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-module adff
-    ( input d, clk, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk, posedge clr )
-               if ( clr )
-                       q <= 1'b0;
-               else
-            q <= d;
-endmodule
-
-module adffn
-    ( input d, clk, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk, negedge clr )
-               if ( !clr )
-                       q <= 1'b0;
-               else
-            q <= d;
-endmodule
-
-module dffs
-    ( input d, clk, pre, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk, posedge pre )
-               if ( pre )
-                       q <= 1'b1;
-               else
-            q <= d;
-endmodule
-
-module ndffnr
-    ( input d, clk, pre, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( negedge clk, negedge pre )
-               if ( !pre )
-                       q <= 1'b1;
-               else
-            q <= d;
-endmodule
-
-module top (
-input clk,
-input clr,
-input pre,
-input a,
-output b,b1,b2,b3
-);
-
-dffs u_dffs (
-        .clk (clk ),
-        .clr (clr),
-        .pre (pre),
-        .d (a ),
-        .q (b )
-    );
-
-ndffnr u_ndffnr (
-        .clk (clk ),
-        .clr (clr),
-        .pre (pre),
-        .d (a ),
-        .q (b1 )
-    );
-
-adff u_adff (
-        .clk (clk ),
-        .clr (clr),
-        .d (a ),
-        .q (b2 )
-    );
-
-adffn u_adffn (
-        .clk (clk ),
-        .clr (clr),
-        .d (a ),
-        .q (b3 )
-    );
-
-endmodule
index 548060b665d7bcda9758e6727cc0251d99aefd79..e5dbabb43d899165873c9ffa0962e57c945400b3 100644 (file)
@@ -1,11 +1,39 @@
-read_verilog adffs.v
+read_verilog ../common/adffs.v
+design -save read
+
+hierarchy -top adff
 proc
-flatten
-equiv_opt -multiclock -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
+equiv_opt -async2sync -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
 design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
-cd top # Constrain all select calls below inside the top module
-select -assert-count 1 t:SB_DFFNS
-select -assert-count 2 t:SB_DFFR
-select -assert-count 1 t:SB_DFFS
-select -assert-count 2 t:SB_LUT4
-select -assert-none t:SB_DFFNS t:SB_DFFR t:SB_DFFS t:SB_LUT4 %% t:* %D
+cd adff # Constrain all select calls below inside the top module
+select -assert-count 1 t:SB_DFFR
+select -assert-none t:SB_DFFR %% t:* %D
+
+design -load read
+hierarchy -top adffn
+proc
+equiv_opt -async2sync -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
+design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
+cd adffn # Constrain all select calls below inside the top module
+select -assert-count 1 t:SB_DFFR
+select -assert-count 1 t:SB_LUT4
+select -assert-none t:SB_DFFR t:SB_LUT4 %% t:* %D
+
+design -load read
+hierarchy -top dffs
+proc
+equiv_opt -async2sync -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
+design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
+cd dffs # Constrain all select calls below inside the top module
+select -assert-count 1 t:SB_DFFSS
+select -assert-none t:SB_DFFSS %% t:* %D
+
+design -load read
+hierarchy -top ndffnr
+proc
+equiv_opt -async2sync -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
+design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
+cd ndffnr # Constrain all select calls below inside the top module
+select -assert-count 1 t:SB_DFFNSR
+select -assert-count 1 t:SB_LUT4
+select -assert-none t:SB_DFFNSR t:SB_LUT4 %% t:* %D
diff --git a/tests/arch/ice40/counter.v b/tests/arch/ice40/counter.v
deleted file mode 100644 (file)
index 52852f8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-module top    (\r
-out,\r
-clk,\r
-reset\r
-);\r
-    output [7:0] out;\r
-    input clk, reset;\r
-    reg [7:0] out;\r
-\r
-    always @(posedge clk, posedge reset)\r
-               if (reset) begin\r
-                       out <= 8'b0 ;\r
-               end else\r
-                       out <= out + 1;\r
-\r
-\r
-endmodule\r
index c65c21622bcdfba16187e7468c35183ff6f6bd70..f112eb97d8f729708533fd1558a8f188d1c1f31b 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog counter.v
+read_verilog ../common/counter.v
 hierarchy -top top
 proc
 flatten
diff --git a/tests/arch/ice40/dffs.v b/tests/arch/ice40/dffs.v
deleted file mode 100644 (file)
index d97840c..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-module dff
-    ( input d, clk, output reg q );
-       always @( posedge clk )
-            q <= d;
-endmodule
-
-module dffe
-    ( input d, clk, en, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk )
-               if ( en )
-                       q <= d;
-endmodule
-
-module top (
-input clk,
-input en,
-input a,
-output b,b1,
-);
-
-dff u_dff (
-        .clk (clk ),
-        .d (a ),
-        .q (b )
-    );
-
-dffe u_ndffe (
-        .clk (clk ),
-        .en (en),
-        .d (a ),
-        .q (b1 )
-    );
-
-endmodule
index ee7f884b1dfc2ae11bb92a5843acfdce03d46e3b..b28a5a91f403ea2ba1bf0faa13165fb725da7ff6 100644 (file)
@@ -1,10 +1,19 @@
-read_verilog dffs.v
-hierarchy -top top
+read_verilog ../common/dffs.v
+design -save read
+
+hierarchy -top dff
 proc
-flatten
 equiv_opt -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
 design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
-cd top # Constrain all select calls below inside the top module
+cd dff # Constrain all select calls below inside the top module
 select -assert-count 1 t:SB_DFF
+select -assert-none t:SB_DFF %% t:* %D
+
+design -load read
+hierarchy -top dffe
+proc
+equiv_opt -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
+design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
+cd dffe # Constrain all select calls below inside the top module
 select -assert-count 1 t:SB_DFFE
-select -assert-none t:SB_DFF t:SB_DFFE %% t:* %D
+select -assert-none t:SB_DFFE %% t:* %D
\ No newline at end of file
diff --git a/tests/arch/ice40/fsm.v b/tests/arch/ice40/fsm.v
deleted file mode 100644 (file)
index 0605bd1..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
- module fsm (\r
- clock,\r
- reset,\r
- req_0,\r
- req_1,\r
- gnt_0,\r
- gnt_1\r
- );\r
- input   clock,reset,req_0,req_1;\r
- output  gnt_0,gnt_1;\r
- wire    clock,reset,req_0,req_1;\r
- reg     gnt_0,gnt_1;\r
-\r
- parameter SIZE = 3           ;\r
- parameter IDLE  = 3'b001,GNT0 = 3'b010,GNT1 = 3'b100,GNT2 = 3'b101 ;\r
-\r
- reg [SIZE-1:0] state;\r
- reg [SIZE-1:0] next_state;\r
-\r
- always @ (posedge clock)\r
- begin : FSM\r
- if (reset == 1'b1) begin\r
-   state <=  #1  IDLE;\r
-   gnt_0 <= 0;\r
-   gnt_1 <= 0;\r
- end else\r
-  case(state)\r
-    IDLE : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT0;\r
-                 gnt_0 <= 1;\r
-               end else if (req_1 == 1'b1) begin\r
-                 gnt_1 <= 1;\r
-                 state <=  #1  GNT0;\r
-               end else begin\r
-                 state <=  #1  IDLE;\r
-               end\r
-    GNT0 : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT0;\r
-               end else begin\r
-                 gnt_0 <= 0;\r
-                 state <=  #1  IDLE;\r
-               end\r
-    GNT1 : if (req_1 == 1'b1) begin\r
-                 state <=  #1  GNT2;\r
-                                gnt_1 <= req_0;\r
-               end\r
-    GNT2 : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT1;\r
-                                gnt_1 <= req_1;\r
-               end\r
-    default : state <=  #1  IDLE;\r
- endcase\r
- end\r
-\r
- endmodule\r
-\r
- module top (\r
-input clk,\r
-input rst,\r
-input a,\r
-input b,\r
-output g0,\r
-output g1\r
-);\r
-\r
-fsm u_fsm ( .clock(clk),\r
-            .reset(rst),\r
-            .req_0(a),\r
-            .req_1(b),\r
-            .gnt_0(g0),\r
-            .gnt_1(g1));\r
-\r
-endmodule\r
index 4cc8629d69684b997fe317967312ac6ffb5a163f..5aacc6c738a6eb6d5b30ff47fba9c444ac424732 100644 (file)
@@ -1,10 +1,10 @@
-read_verilog fsm.v
-hierarchy -top top
+read_verilog ../common/fsm.v
+hierarchy -top fsm
 proc
 flatten
 equiv_opt -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
 design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
-cd top # Constrain all select calls below inside the top module
+cd fsm # Constrain all select calls below inside the top module
 
 select -assert-count 2 t:SB_DFFESR
 select -assert-count 2 t:SB_DFFSR
diff --git a/tests/arch/ice40/latches.v b/tests/arch/ice40/latches.v
deleted file mode 100644 (file)
index 9dc43e4..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-module latchp
-    ( input d, clk, en, output reg q );
-       always @*
-               if ( en )
-                       q <= d;
-endmodule
-
-module latchn
-    ( input d, clk, en, output reg q );
-       always @*
-               if ( !en )
-                       q <= d;
-endmodule
-
-module latchsr
-    ( input d, clk, en, clr, pre, output reg q );
-       always @*
-               if ( clr )
-                       q <= 1'b0;
-               else if ( pre )
-                       q <= 1'b1;
-               else if ( en )
-                       q <= d;
-endmodule
-
-
-module top (
-input clk,
-input clr,
-input pre,
-input a,
-output b,b1,b2
-);
-
-
-latchp u_latchp (
-        .en (clk ),
-        .d (a ),
-        .q (b )
-    );
-
-
-latchn u_latchn (
-        .en (clk ),
-        .d (a ),
-        .q (b1 )
-    );
-
-
-latchsr u_latchsr (
-        .en (clk ),
-        .clr (clr),
-        .pre (pre),
-        .d (a ),
-        .q (b2 )
-    );
-
-endmodule
index 708734e4487d78219c8c362c986a99b3935bfd9b..b06dd630bba972669b4fd419d0836e3f2730f368 100644 (file)
@@ -1,12 +1,33 @@
-read_verilog latches.v
+read_verilog ../common/latches.v
+design -save read
 
+hierarchy -top latchp
 proc
-flatten
 # Can't run any sort of equivalence check because latches are blown to LUTs
-#equiv_opt -async2sync -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
+synth_ice40
+cd latchp # Constrain all select calls below inside the top module
+select -assert-count 1 t:SB_LUT4
+
+select -assert-none t:SB_LUT4 %% t:* %D
+
+
+design -load read
+hierarchy -top latchn
+proc
+# Can't run any sort of equivalence check because latches are blown to LUTs
+synth_ice40
+cd latchn # Constrain all select calls below inside the top module
+select -assert-count 1 t:SB_LUT4
+
+select -assert-none t:SB_LUT4 %% t:* %D
+
 
-#design -load preopt
+design -load read
+hierarchy -top latchsr
+proc
+# Can't run any sort of equivalence check because latches are blown to LUTs
 synth_ice40
-cd top
-select -assert-count 4 t:SB_LUT4
+cd latchsr # Constrain all select calls below inside the top module
+select -assert-count 2 t:SB_LUT4
+
 select -assert-none t:SB_LUT4 %% t:* %D
diff --git a/tests/arch/ice40/logic.v b/tests/arch/ice40/logic.v
deleted file mode 100644 (file)
index e5343ca..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-module top
-(
- input [0:7] in,
- output B1,B2,B3,B4,B5,B6,B7,B8,B9,B10
- );
-
-   assign     B1 =  in[0] & in[1];
-   assign     B2 =  in[0] | in[1];
-   assign     B3 =  in[0] ~& in[1];
-   assign     B4 =  in[0] ~| in[1];
-   assign     B5 =  in[0] ^ in[1];
-   assign     B6 =  in[0] ~^ in[1];
-   assign     B7 =  ~in[0];
-   assign     B8 =  in[0];
-   assign     B9 =  in[0:1] && in [2:3];
-   assign     B10 =  in[0:1] || in [2:3];
-
-endmodule
index fc5e5b1d8072be6b827df31030ebe88a4a09dca6..7432f5b1f8b987250f365a2d120e0445e4d320c3 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog logic.v
+read_verilog ../common/logic.v
 hierarchy -top top
 equiv_opt -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
 design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
diff --git a/tests/arch/ice40/mul.v b/tests/arch/ice40/mul.v
deleted file mode 100644 (file)
index d5b48b1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-module top
-(
- input [5:0] x,
- input [5:0] y,
-
- output [11:0] A,
- );
-
-assign A =  x * y;
-
-endmodule
index 8a0822a84024a86d23597f834d23e8322fd6f758..9891b77d6331d9ff00a46e9396520d81f5b14c85 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog mul.v
+read_verilog ../common/mul.v
 hierarchy -top top
 equiv_opt -assert -map +/ice40/cells_sim.v synth_ice40 -dsp # equivalency check
 design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
diff --git a/tests/arch/ice40/mux.v b/tests/arch/ice40/mux.v
deleted file mode 100644 (file)
index 0814b73..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-module mux2 (S,A,B,Y);
-    input S;
-    input A,B;
-    output reg Y;
-
-    always @(*)
-               Y = (S)? B : A;
-endmodule
-
-module mux4 ( S, D, Y );
-
-input[1:0] S;
-input[3:0] D;
-output Y;
-
-reg Y;
-wire[1:0] S;
-wire[3:0] D;
-
-always @*
-begin
-    case( S )
-       0 : Y = D[0];
-       1 : Y = D[1];
-       2 : Y = D[2];
-       3 : Y = D[3];
-   endcase
-end
-
-endmodule
-
-module mux8 ( S, D, Y );
-
-input[2:0] S;
-input[7:0] D;
-output Y;
-
-reg Y;
-wire[2:0] S;
-wire[7:0] D;
-
-always @*
-begin
-   case( S )
-       0 : Y = D[0];
-       1 : Y = D[1];
-       2 : Y = D[2];
-       3 : Y = D[3];
-       4 : Y = D[4];
-       5 : Y = D[5];
-       6 : Y = D[6];
-       7 : Y = D[7];
-   endcase
-end
-
-endmodule
-
-module mux16 (D, S, Y);
-       input  [15:0] D;
-       input  [3:0] S;
-       output Y;
-
-assign Y = D[S];
-
-endmodule
-
-
-module top (
-input [3:0] S,
-input [15:0] D,
-output M2,M4,M8,M16
-);
-
-mux2 u_mux2 (
-        .S (S[0]),
-        .A (D[0]),
-        .B (D[1]),
-        .Y (M2)
-    );
-
-
-mux4 u_mux4 (
-        .S (S[1:0]),
-        .D (D[3:0]),
-        .Y (M4)
-    );
-
-mux8 u_mux8 (
-        .S (S[2:0]),
-        .D (D[7:0]),
-        .Y (M8)
-    );
-
-mux16 u_mux16 (
-        .S (S[3:0]),
-        .D (D[15:0]),
-        .Y (M16)
-    );
-
-endmodule
index 182b49499e80bf836a5c4966043a7b7f43509591..99822391d49d1d7e083ace0f992e3f5bf56cf641 100644 (file)
@@ -1,8 +1,40 @@
-read_verilog mux.v
+read_verilog ../common/mux.v
+design -save read
+
+hierarchy -top mux2
 proc
-flatten
 equiv_opt -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
 design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
-cd top # Constrain all select calls below inside the top module
-select -assert-count 19 t:SB_LUT4
+cd mux2 # Constrain all select calls below inside the top module
+select -assert-count 1 t:SB_LUT4
+select -assert-none t:SB_LUT4 %% t:* %D
+
+design -load read
+hierarchy -top mux4
+proc
+equiv_opt -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
+design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
+cd mux4 # Constrain all select calls below inside the top module
+select -assert-count 2 t:SB_LUT4
+
+select -assert-none t:SB_LUT4 %% t:* %D
+
+design -load read
+hierarchy -top mux8
+proc
+equiv_opt -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
+design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
+cd mux8 # Constrain all select calls below inside the top module
+select -assert-count 5 t:SB_LUT4
+
+select -assert-none t:SB_LUT4 %% t:* %D
+
+design -load read
+hierarchy -top mux16
+proc
+equiv_opt -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
+design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
+cd mux16 # Constrain all select calls below inside the top module
+select -assert-count 11 t:SB_LUT4
+
 select -assert-none t:SB_LUT4 %% t:* %D
diff --git a/tests/arch/ice40/shifter.v b/tests/arch/ice40/shifter.v
deleted file mode 100644 (file)
index c556325..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-module top    (\r
-out,\r
-clk,\r
-in\r
-);\r
-    output [7:0] out;\r
-    input signed clk, in;\r
-    reg signed [7:0] out = 0;\r
-\r
-    always @(posedge clk)\r
-       begin\r
-`ifndef BUG\r
-               out    <= out >> 1;\r
-               out[7] <= in;\r
-`else\r
-\r
-               out    <= out << 1;\r
-               out[7] <= in;\r
-`endif\r
-       end\r
-\r
-endmodule\r
index 47d95d298123a732530cee870bab692b94bc6091..08ea64f3da45897e7620d410ce1be0241d22f252 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog shifter.v
+read_verilog ../common/shifter.v
 hierarchy -top top
 proc
 flatten
diff --git a/tests/arch/ice40/tribuf.v b/tests/arch/ice40/tribuf.v
deleted file mode 100644 (file)
index 870a025..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-module tristate (en, i, o);
-    input en;
-    input i;
-    output o;
-
-       assign o = en ? i : 1'bz;
-
-endmodule
-
-
-module top (
-input en,
-input a,
-output b
-);
-
-tristate u_tri (
-        .en (en ),
-        .i (a ),
-        .o (b )
-    );
-
-endmodule
index d1e1b3108475a31312eeb523328c835399236260..10cded9547e99a4fa4460e910be8a5c1dcfde527 100644 (file)
@@ -1,9 +1,11 @@
-read_verilog tribuf.v
-hierarchy -top top
+read_verilog ../common/tribuf.v
+hierarchy -top tristate
 proc
+tribuf
 flatten
+synth
 equiv_opt -assert -map +/ice40/cells_sim.v -map +/simcells.v synth_ice40 # equivalency check
 design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
-cd top # Constrain all select calls below inside the top module
+cd tristate # Constrain all select calls below inside the top module
 select -assert-count 1 t:$_TBUF_
 select -assert-none t:$_TBUF_ %% t:* %D
diff --git a/tests/arch/xilinx/add_sub.v b/tests/arch/xilinx/add_sub.v
deleted file mode 100644 (file)
index 177c32e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-module top
-(
- input [3:0] x,
- input [3:0] y,
-
- output [3:0] A,
- output [3:0] B
- );
-
-assign A =  x + y;
-assign B =  x - y;
-
-endmodule
index f06e7fa01180d3885649d9e03a3b88c7145345b2..9dbddce4709a706237c20e27fdfbcadab6b36ff4 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog add_sub.v
+read_verilog ../common/add_sub.v
 hierarchy -top top
 proc
 equiv_opt -assert -map +/xilinx/cells_sim.v synth_xilinx # equivalency check
diff --git a/tests/arch/xilinx/adffs.v b/tests/arch/xilinx/adffs.v
deleted file mode 100644 (file)
index 223b52d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-module adff
-    ( input d, clk, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk, posedge clr )
-               if ( clr )
-                       q <= 1'b0;
-               else
-            q <= d;
-endmodule
-
-module adffn
-    ( input d, clk, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk, negedge clr )
-               if ( !clr )
-                       q <= 1'b0;
-               else
-            q <= d;
-endmodule
-
-module dffs
-    ( input d, clk, pre, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk )
-               if ( pre )
-                       q <= 1'b1;
-               else
-            q <= d;
-endmodule
-
-module ndffnr
-    ( input d, clk, pre, clr, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( negedge clk )
-               if ( !clr )
-                       q <= 1'b0;
-               else
-            q <= d;
-endmodule
index 1923b9802908f963d5ad35d707fa9ab38e5babe5..12c34415eccd9893226e2c009cba828e24d460e6 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog adffs.v
+read_verilog ../common/adffs.v
 design -save read
 
 hierarchy -top adff
diff --git a/tests/arch/xilinx/counter.v b/tests/arch/xilinx/counter.v
deleted file mode 100644 (file)
index 52852f8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-module top    (\r
-out,\r
-clk,\r
-reset\r
-);\r
-    output [7:0] out;\r
-    input clk, reset;\r
-    reg [7:0] out;\r
-\r
-    always @(posedge clk, posedge reset)\r
-               if (reset) begin\r
-                       out <= 8'b0 ;\r
-               end else\r
-                       out <= out + 1;\r
-\r
-\r
-endmodule\r
index 459541656b7503a17412200ae3a1820d2321fb32..57b645d19700ff394dcf7bca7e507e8b7009079b 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog counter.v
+read_verilog ../common/counter.v
 hierarchy -top top
 proc
 flatten
diff --git a/tests/arch/xilinx/dffs.v b/tests/arch/xilinx/dffs.v
deleted file mode 100644 (file)
index 3418787..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-module dff
-    ( input d, clk, output reg q );
-       always @( posedge clk )
-            q <= d;
-endmodule
-
-module dffe
-    ( input d, clk, en, output reg q );
-    initial begin
-      q = 0;
-    end
-       always @( posedge clk )
-               if ( en )
-                       q <= d;
-endmodule
index f1716dabb9303dcb55b8ce65805262538c54ad2a..0bba4858f515f311141a12aab7842c54056d1b17 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog dffs.v
+read_verilog ../common/dffs.v
 design -save read
 
 hierarchy -top dff
diff --git a/tests/arch/xilinx/fsm.v b/tests/arch/xilinx/fsm.v
deleted file mode 100644 (file)
index 368fbaa..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
- module fsm (\r
- clock,\r
- reset,\r
- req_0,\r
- req_1,\r
- gnt_0,\r
- gnt_1\r
- );\r
- input   clock,reset,req_0,req_1;\r
- output  gnt_0,gnt_1;\r
- wire    clock,reset,req_0,req_1;\r
- reg     gnt_0,gnt_1;\r
-\r
- parameter SIZE = 3           ;\r
- parameter IDLE  = 3'b001,GNT0 = 3'b010,GNT1 = 3'b100,GNT2 = 3'b101 ;\r
-\r
- reg [SIZE-1:0] state;\r
- reg [SIZE-1:0] next_state;\r
-\r
- always @ (posedge clock)\r
- begin : FSM\r
- if (reset == 1'b1) begin\r
-   state <=  #1  IDLE;\r
-   gnt_0 <= 0;\r
-   gnt_1 <= 0;\r
- end else\r
-  case(state)\r
-    IDLE : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT0;\r
-                 gnt_0 <= 1;\r
-               end else if (req_1 == 1'b1) begin\r
-                 gnt_1 <= 1;\r
-                 state <=  #1  GNT0;\r
-               end else begin\r
-                 state <=  #1  IDLE;\r
-               end\r
-    GNT0 : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT0;\r
-               end else begin\r
-                 gnt_0 <= 0;\r
-                 state <=  #1  IDLE;\r
-               end\r
-    GNT1 : if (req_1 == 1'b1) begin\r
-                 state <=  #1  GNT2;\r
-                                gnt_1 <= req_0;\r
-               end\r
-    GNT2 : if (req_0 == 1'b1) begin\r
-                 state <=  #1  GNT1;\r
-                                gnt_1 <= req_1;\r
-               end\r
-    default : state <=  #1  IDLE;\r
- endcase\r
- end\r
-\r
-endmodule\r
index a9e94c2c0f91fc5aaea46334f5f958a8278d43a8..d2b481421ade65ad538edb6dbeddd552b7614c28 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog fsm.v
+read_verilog ../common/fsm.v
 hierarchy -top fsm
 proc
 flatten
diff --git a/tests/arch/xilinx/latches.v b/tests/arch/xilinx/latches.v
deleted file mode 100644 (file)
index adb5d53..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-module latchp
-    ( input d, clk, en, output reg q );
-       always @*
-               if ( en )
-                       q <= d;
-endmodule
-
-module latchn
-    ( input d, clk, en, output reg q );
-       always @*
-               if ( !en )
-                       q <= d;
-endmodule
-
-module latchsr
-    ( input d, clk, en, clr, pre, output reg q );
-       always @*
-               if ( clr )
-                       q <= 1'b0;
-               else if ( pre )
-                       q <= 1'b1;
-               else if ( en )
-                       q <= d;
-endmodule
index 3eb550a423ac4bced3b0d0869839739128163142..fe7887e8d7effd18196647a44516809b0c02a602 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog latches.v
+read_verilog ../common/latches.v
 design -save read
 
 hierarchy -top latchp
diff --git a/tests/arch/xilinx/logic.v b/tests/arch/xilinx/logic.v
deleted file mode 100644 (file)
index e5343ca..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-module top
-(
- input [0:7] in,
- output B1,B2,B3,B4,B5,B6,B7,B8,B9,B10
- );
-
-   assign     B1 =  in[0] & in[1];
-   assign     B2 =  in[0] | in[1];
-   assign     B3 =  in[0] ~& in[1];
-   assign     B4 =  in[0] ~| in[1];
-   assign     B5 =  in[0] ^ in[1];
-   assign     B6 =  in[0] ~^ in[1];
-   assign     B7 =  ~in[0];
-   assign     B8 =  in[0];
-   assign     B9 =  in[0:1] && in [2:3];
-   assign     B10 =  in[0:1] || in [2:3];
-
-endmodule
index 9ae5993aa44a91eb91761ac56eccd54932841726..c0f6da3023cc18ce83e65df6cc06c63d56ecdc2e 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog logic.v
+read_verilog ../common/logic.v
 hierarchy -top top
 proc
 equiv_opt -assert -map +/xilinx/cells_sim.v synth_xilinx # equivalency check
diff --git a/tests/arch/xilinx/mul.v b/tests/arch/xilinx/mul.v
deleted file mode 100644 (file)
index d5b48b1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-module top
-(
- input [5:0] x,
- input [5:0] y,
-
- output [11:0] A,
- );
-
-assign A =  x * y;
-
-endmodule
index 66a06efdc9bcd78add69b8213c2e38f71cb0711c..d7681496660f36887d92442a45407ab9a100d4e7 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog mul.v
+read_verilog ../common/mul.v
 hierarchy -top top
 proc
 equiv_opt -assert -map +/xilinx/cells_sim.v synth_xilinx # equivalency check
diff --git a/tests/arch/xilinx/mux.v b/tests/arch/xilinx/mux.v
deleted file mode 100644 (file)
index 27bc0bf..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-module mux2 (S,A,B,Y);
-    input S;
-    input A,B;
-    output reg Y;
-
-    always @(*)
-               Y = (S)? B : A;
-endmodule
-
-module mux4 ( S, D, Y );
-
-input[1:0] S;
-input[3:0] D;
-output Y;
-
-reg Y;
-wire[1:0] S;
-wire[3:0] D;
-
-always @*
-begin
-    case( S )
-       0 : Y = D[0];
-       1 : Y = D[1];
-       2 : Y = D[2];
-       3 : Y = D[3];
-   endcase
-end
-
-endmodule
-
-module mux8 ( S, D, Y );
-
-input[2:0] S;
-input[7:0] D;
-output Y;
-
-reg Y;
-wire[2:0] S;
-wire[7:0] D;
-
-always @*
-begin
-   case( S )
-       0 : Y = D[0];
-       1 : Y = D[1];
-       2 : Y = D[2];
-       3 : Y = D[3];
-       4 : Y = D[4];
-       5 : Y = D[5];
-       6 : Y = D[6];
-       7 : Y = D[7];
-   endcase
-end
-
-endmodule
-
-module mux16 (D, S, Y);
-       input  [15:0] D;
-       input  [3:0] S;
-       output Y;
-
-assign Y = D[S];
-
-endmodule
index 420dece4e072167b57b40271beb8443c0ee39392..821d0fab7381fa035f6446c68c9acc893879e5cf 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog mux.v
+read_verilog ../common/mux.v
 design -save read
 
 hierarchy -top mux2
diff --git a/tests/arch/xilinx/shifter.v b/tests/arch/xilinx/shifter.v
deleted file mode 100644 (file)
index 04ae49d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-module top    (\r
-out,\r
-clk,\r
-in\r
-);\r
-    output [7:0] out;\r
-    input signed clk, in;\r
-    reg signed [7:0] out = 0;\r
-\r
-    always @(posedge clk)\r
-       begin\r
-               out    <= out >> 1;\r
-               out[7] <= in;\r
-       end\r
-\r
-endmodule\r
index 84e16f41eb5abbb7cac09e6513d9b1bca772041b..455437f185a77a348d120c5c7da56f11afe8a6c3 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog shifter.v
+read_verilog ../common/shifter.v
 hierarchy -top top
 proc
 flatten
diff --git a/tests/arch/xilinx/tribuf.v b/tests/arch/xilinx/tribuf.v
deleted file mode 100644 (file)
index c644682..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-module tristate (en, i, o);
-    input en;
-    input i;
-    output reg o;
-    
-    always @(en or i)
-               o <= (en)? i : 1'bZ;
-endmodule
index c9cfb85468e313d7f7c9a6948592da13cd8937fb..4697703cae5608db3144c2137d79a59eb6691d90 100644 (file)
@@ -1,4 +1,4 @@
-read_verilog tribuf.v
+read_verilog ../common/tribuf.v
 hierarchy -top tristate
 proc
 tribuf