Commit 05c2477c by SergeyDegtyar

Review 'misc' test group (abc - eval)

parent c0b775eb
*/work_*/
/.stamp
/run-test.mk
PYTHON_EXECUTABLE := $(shell if python3 -c ""; then echo "python3"; else echo "python"; fi)
all::
run-test.mk: ../generate.py
@$(PYTHON_EXECUTABLE) ../generate.py > run-test.mk
include run-test.mk
.PHONY: all clean
read_verilog ../top.v
proc
dff2dffe
synth -top top
abc
select -assert-count 3 t:$_NAND_
select -assert-count 2 t:$_XOR_
select -assert-none t:$_NAND_ t:$_XOR_ %% t:* %D
read_verilog ../top.v
proc
dff2dffe
synth -top top
tee -o result.out abc -D 2
read_verilog ../top.v
synth -top top
tee -o result.log abc -S 2
ERROR: Can't open ABC output file
read_verilog ../top.v
synth -top top
tee -o result.out abc -liberty -constr
abc -liberty -constr
read_verilog ../top.v
synth -top top
tee -o result.out abc -dff -clk u
abc -dff -clk u
read_verilog ../top.v
synth -top top
tee -o result.out abc -liberty -constr top.lib
ERROR: Got -constr but no -liberty!
read_verilog ../top.v
synth -top top
tee -o result.out abc -constr -liberty
abc -constr -liberty
read_verilog ../top_dff.v
synth -top top
dff2dffe
tee -o result.log abc -dff
abc -dff
read_verilog ../top_dff.v
synth -top top
tee -o result.log abc -keepff
abc -dff
read_verilog ../top_div_mul.v
proc
dff2dffe
synth -top top
tee -o result.out abc
read_verilog ../top_dff.v
proc
dff2dffe
synth -top top
tee -o result.out abc
read_verilog ../top_dff.v
proc
dff2dffe
synth -top top
tee -o result.out abc -clk clk
read_verilog ../top_fsm.v
synth -top top
tee -o result.out abc
read_verilog ../top_fsm.v
synth -top top
tee -o result.out abc -g all
read_verilog ../top_fsm.v
synth -top top
tee -o result.out abc -g all
read_verilog ../top_fsm.v
synth -top top
abc -g cmos4
select -assert-count 6 t:$_AOI3_
select -assert-count 1 t:$_AOI4_
select -assert-count 2 t:$_OAI3_
read_verilog ../top_fsm.v
synth -top top
abc -g gates
read_verilog ../top.v
synth -top top
abc -g aig
select -assert-count 2 t:$_AND_
select -assert-count 3 t:$_NAND_
select -assert-count 2 t:$_OR_
read_verilog ../top.v
synth -top top
abc -g cmos
select -assert-count 1 t:$_NAND_
select -assert-count 1 t:$_NOT_
select -assert-count 1 t:$_OAI3_
select -assert-count 2 t:$_XNOR_
read_verilog ../top.v
synth -top top
abc -g cmos2
select -assert-count 4 t:$_NAND_
select -assert-count 5 t:$_NOR_
select -assert-count 3 t:$_NOT_
read_verilog ../top.v
proc
dff2dffe
synth -top top
abc -g simple
select -assert-count 2 t:$_AND_
select -assert-count 1 t:$_OR_
select -assert-count 2 t:$_NOT_
read_verilog ../top.v
synth -top top
tee -o result.log abc -I 4
abc -dff
read_verilog ../top.v
synth -top top
tee -o result.out abc -luts :
abc -liberty -luts :
read_verilog ../top_logic.v
proc
synth -top top
tee -o result.out abc
read_verilog ../top_logic_loop.v
proc
synth -top top
tee -o result.out abc
read_verilog ../top.v
synth -top top
tee -o result.log abc -lut 4
abc -lut 3
stat
ERROR: Got -lut and -liberty! This two options are exclusive.
read_verilog ../top.v
synth -top top
tee -o result.out abc -lut 2 -liberty top.lib
abc -lut 2 -liberty top.lib
read_verilog ../top.v
synth -top top
tee -o result.log abc -lut -4
abc -lut -3:1
read_verilog ../top.v
synth -top top
tee -o result.log abc -luts 3:4
read_verilog ../top_dff.v
proc
dff2dffe
synth -top top
tee -o result.out abc -markgroups
read_verilog ../top_mux.v
proc
synth -top top
abc
select -assert-count 139 t:$_MUX_
read_verilog ../top_mux.v
synth -top top
tee -o result.log abc -mux16
stat
read_verilog ../top_mux.v
synth -top top
abc -mux4
select -assert-count 75 t:$_MUX4_
read_verilog ../top_mux.v
synth -top top
tee -o result.log abc -mux8
stat
read_verilog ../top_mux.v
synth -top top
tee -o result.out abc -g cmos3
abc -g cmos3
select -assert-count 144 t:$_AOI3_
select -assert-count 169 t:$_OAI3_
read_verilog ../top_mux.v
synth -top top
tee -o result.out abc -g cmos4
abc -g cmos4
select -assert-count 111 t:$_AOI3_
select -assert-count 28 t:$_AOI4_
select -assert-count 111 t:$_AOI3_
select -assert-count 24 t:$_OAI4_
read_verilog ../top.v
tee -o result.out abc
read_verilog ../top.v
proc
tee -o result.out abc
read_verilog ../top.v
synth -top top
tee -o result.log abc -P 4
abc -dff
read_verilog ../top.v
synth -top top
tee -o result.out abc -g XOR
abc -g XOR
ERROR: Can't open ABC output file
read_verilog ../top.v
synth -top top
tee -o result.out abc -script o
abc -script o
ERROR: Can't open ABC output file
read_verilog ../top.v
synth -top top
tee -o result.out abc -script top.yss
abc -script top.yss
read_verilog ../top_dff.v
tee -o result.out abc
ERROR: Command syntax error: Unsupported gate type: XO
read_verilog ../top.v
synth -top top
tee -o result.out abc -g XO
abc -g XO
(* black_box *) module top
(
input x,
input y,
input cin,
output A,
output cout
);
assign {cout,A} = cin + y + x;
endmodule
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 dffe
( input d, clk, en, output reg q );
initial begin
q = 0;
end
always @( posedge clk )
if ( en )
q <= d;
endmodule
module dffsr
( input d, clk, pre, clr, output reg q );
initial begin
q = 0;
end
always @( posedge clk, posedge pre, posedge clr )
if ( clr )
q <= 1'b0;
else if ( pre )
q <= 1'b1;
else
q <= d;
endmodule
module ndffnsnr
( input d, clk, pre, clr, output reg q );
initial begin
q = 0;
end
always @( negedge clk, negedge pre, negedge clr )
if ( !clr )
q <= 1'b0;
else if ( !pre )
q <= 1'b1;
else
q <= d;
endmodule
module top (
input clk,
input clr,
input pre,
input a,
output b,b1,b2,b3,b4
);
dffsr u_dffsr (
.clk (clk ),
.clr (clr),
.pre (pre),
.d (a ),
.q (b )
);
ndffnsnr u_ndffnsnr (
.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 )
);
dffe u_dffe (
.clk (clk ),
.en (clr),
.d (a ),
.q (b4 )
);
endmodule
module top
(
input x,
input y,
input cin,
output A,
output cout
);
assign cout = x / y * cin;
endmodule
module FSM ( clk,rst, en, ls, rs, stop, busy, finish);
input wire clk;
input wire rst;
input wire en;
input wire ls;
input wire rs;
output wire stop;
output wire busy;
output wire finish;
parameter S0 = 4'b0000, S1 = 4'b0001, S2 = 4'b0010, S3 = 4'b0011, S4 = 4'b0100, S5 = 4'b0101, S6 = 4'b0110, S7 = 4'b0111, S8 = 4'b1000, S9 = 4'b1001, S10 = 4'b1010, S11 = 4'b1011, S12 = 4'b1100, S13 = 4'b1101, S14 = 4'b1110;
reg [3:0] ns, st;
reg [2:0] count;
always @(posedge clk)
begin : CurrstProc
if (rst)
st <= S0;
else
st <= ns;
end
always @*
begin : NextstProc
ns = st;
case (st)
S0: ns = S1;
S1: ns = S2;
S2:
if (rs == 1'b1)
ns = S3;
else
ns = S4;
S3: ns = S1;
S4: if (count > 7)
ns = S10;
else
ns = S5;
S5: if (ls == 1'b0)
ns = S6;
else
ns = S3;
S6:
if (ls == 1'b1)
ns = S7;
else
ns = S8;
S7:
if (ls == 1'b1 && rs == 1'b1)
ns = S5;
else
ns = S13;
S8: ns = S9;
S9: ns = S8;
S10:
if (ls == 1'b1 || rs == 1'b1)
ns = S11;
else
ns = S4;
S11: ns = S12;
S12: ns = S10;
S13: ;
default: ns = S0;
endcase;
end
always @(posedge clk)
if(~rst)
count <= 0;
else
begin
if(st == S4)
if (count > 7)
count <= 0;
else
count <= count + 1;
end
//FSM outputs (combinatorial)
assign stop = (st == S3 || st == S12) ? 1'b1 : 1'b0;
assign finish = (st == S13) ? 1'b1 : 1'b0;
assign busy = (st == S8 || st == S9) ? 1'b1 : 1'b0;
endmodule
module top (
input clk,
input rst,
input en,
input a,
input b,
output s,
output bs,
output f
);
FSM u_FSM ( .clk(clk),
.rst(rst),
.en(en),
.ls(a),
.rs(b),
.stop(s),
.busy(bs),
.finish(f));
endmodule
module top
(
input x,
input y,
input cin,
output reg A,
output reg cout
);
reg A1,cout1,A2,cout2;
initial begin
A = 0;
cout = 0;
end
always @(posedge x) begin
A1 <= ~y + &cin;
end
always @(posedge x) begin
cout1 <= cin ? |y : ^A;
end
always @(posedge x) begin
A <= A1|y~&cin~^A1;
end
always @(posedge x) begin
cout <= cout1&cin~|y;
end
always @(posedge x) begin
A2 <= ~(y | cin);
end
always @(posedge x) begin
cout2 <= cin ~|y;
end
endmodule
module top
(
input x,
input y,
input z,
output A,
output B
);
wire A1,B1,A2,B2;
assign A1 = x & A2;
assign A2 = A1 & y;
assign A = ~A2;
endmodule
module top (
input [7:0] S,
input [255:0] D,
output M256
);
assign M256 = D[S];
endmodule
read_verilog ../top.v
proc
dff2dffe
synth -top top
abc9 -D 2 -lut 2
read_verilog ../top.v
proc
dff2dffe
synth -top top
abc9 -W -lut 2
abc9 -box box.txt -lut 2
read_verilog ../top_dff.v
proc
dff2dffe
synth -top top
abc9 -lut 5
abc9 -lut 5
read_verilog ../top_dff.v
proc
dff2dffe
synth -top top
abc9 -lut 5 -nomfs
abc9 -lut 5
read_verilog ../top_dff.v
proc
dff2dffe
techmap
abc9 -lut 5
abc9 -lut 5
read_verilog ../top.v
proc
dff2dffe
synth -top top
abc9 -fast -lut 2
read_verilog ../top.v
abc9 -luts 2:2:2:/2
read_verilog ../top.v
proc
dff2dffe
synth -top top
abc9 -lut 2
read_verilog ../top.v
proc
dff2dffe
synth -top top
abc9 -luts 2,3,4
read_verilog ../top.v
proc
dff2dffe
synth -top top
abc9 -markgroups -lut 2
read_verilog ../top_mem.v
proc
dff2dffe
synth -top top
abc9 -D 2 -lut 2
read_verilog ../top_mux.v
proc
synth -top top
abc9 -lut 2
read_verilog ../top.v
proc
dff2dffe
synth -top top
abc9 -nocleanup -lut 2
abc9 -script box.txt -lut 2
read_verilog ../top.v
proc
dff2dffe
synth -top top
abc9 -showtmp -lut 2
read_verilog ../top_mux.v
proc
techmap
abc9 -lut 2
read_verilog ../top_dff.v
abc9 -lut 2
read_verilog ../top_mux.v
proc
abc9 -lut 2
(* black_box *) module top
(
input x,
input y,
input cin,
output A,
output cout
);
assign {cout,A} = cin + y + x;
endmodule
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 dffe
( input d, clk, en, output reg q );
initial begin
q = 0;
end
always @( posedge clk )
if ( en )
q <= d;
endmodule
module dffsr
( input d, clk, pre, clr, output reg q );
initial begin
q = 0;
end
always @( posedge clk, posedge pre, posedge clr )
if ( clr )
q <= 1'b0;
else if ( pre )
q <= 1'b1;
else
q <= d;
endmodule
module ndffnsnr
( input d, clk, pre, clr, output reg q );
initial begin
q = 0;
end
always @( negedge clk, negedge pre, negedge clr )
if ( !clr )
q <= 1'b0;
else if ( !pre )
q <= 1'b1;
else
q <= d;
endmodule
module top (
input clk,
input clr,
input pre,
input a,
output b,b1,b2,b3,b4
);
dffsr u_dffsr (
.clk (clk ),
.clr (clr),
.pre (pre),
.d (a ),
.q (b )
);
ndffnsnr u_ndffnsnr (
.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 )
);
dffe u_dffe (
.clk (clk ),
.en (clr),
.d (a ),
.q (b4 )
);
endmodule
module top
(
input [7:0] data_a, data_b,
input [6:1] addr_a, addr_b,
input we_a, we_b, re_a, re_b, clka, clkb,
output reg [7:0] q_a, q_b
);
// Declare the RAM variable
reg [7:0] ram[63:0];
initial begin
q_a <= 8'h00;
q_b <= 8'd0;
end
// Port A
always @ (posedge clka)
begin
if (we_a)
begin
ram[addr_a] <= data_a;
q_a <= data_a;
end
if (re_b)
begin
q_a <= ram[addr_a];
end
end
// Port B
always @ (posedge clkb)
begin
if (we_b)
begin
ram[addr_b] <= data_b;
q_b <= data_b;
end
if (re_b)
begin
q_b <= ram[addr_b];
end
end
endmodule
module top (
input [7:0] S,
input [255:0] D,
output M256
);
parameter i = 3;
assign M256 = D[S];
endmodule
read_verilog ../top.v
add -wire w 0
tee -o result.out dump
ERROR: Found incompatible object with same name in module \\top2!
read_verilog ../top.v
add -input i 2
add -wire i 2
tee -o result.log dump
wire width 32000 input 6 \\gi
read_verilog ../top.v
add -global_input gi 32000
tee -o result.out dump
wire width 3 inout 6 \\34
read_verilog ../top.v
add -inout \34 3
tee -o result.out dump
wire width 2 input 6 \\i
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment