Commit afb2a591 by SergeyDegtyar

Review 'misc' test group (help - select)

parent c12353b9
tee -q -o result.log help
tee -q -o result.log help -all
tee -q -o result.log help -cells
$dff (CLK, D, Q)
No help message for this cell type found.
Run 'help $dff+' to display the Verilog model for this cell type.
tee -q -o result.out help $dff
module \\$dff (CLK, D, Q);
parameter WIDTH = 0;
parameter CLK_POLARITY = 1'b1;
input CLK;
input \[WIDTH-1:0\] D;
output reg \[WIDTH-1:0\] Q;
wire pos_clk = CLK == CLK_POLARITY;
always @(posedge pos_clk) begin
Q <= D;
end
endmodule
tee -q -o result.out help $dff+
read_verilog \[options\] \[filename\]
tee -q -o result.out help read_verilog
No such command or cell type: u
read_verilog ../top.v
proc
hilomap
select -assert-count 1 t:$dffsr
select -assert-count 4 t:$mux
select -assert-count 2 t:$not
select -assert-count 2 t:dffsr
select -assert-none t:$dffsr t:$mux t:$not t:dffsr %% t:* %D
read_verilog ../top.v
proc
hilomap -hicell VCC V
select -assert-count 4 t:VCC
select -assert-count 0 t:GND
read_verilog ../top.v
proc
hilomap -locell GND G -hicell VCC V -singleton
select assert-count 1 t:VCC
select assert-count 1 t:GND
read_verilog ../top.v
proc
hilomap -hicell VCC V -singleton
select -assert-count 2 t:VCC
select -assert-count 0 t:GND
read_verilog ../top.v
proc
hilomap -locell GND G
select -assert-count 0 t:VCC
select -assert-count 6 t:GND
read_verilog ../top.v
proc
hilomap -locell GND G -singleton
select -assert-count 0 t:VCC
select -assert-count 2 t:GND
read_verilog ../top.v
proc
hilomap -singleton
module dffsr
( input d, clk, pre, clr, output reg q );
always @( posedge clk, posedge pre, posedge clr )
if ( pre )
q <= 1'b1;
else if ( clr )
q <= 1'b0;
else
q <= d;
endmodule
module top (
input clk,
input a,
output b,b2
);
dffsr u_dffsr (
.clk (clk ),
.clr (1'b0),
.pre (1'b1),
.d (a ),
.q (b )
);
dffsr u2_dffsr (
.clk (clk ),
.clr (1'b0),
.pre (1'b1),
.d (a ),
.q (b2 )
);
endmodule
read_verilog ../top.v
proc
synth
synth_xilinx
tee -o result.out history
(* black_box *) module top
(
input x,
input y,
input cin,
output A,
output cout
);
assign {cout,A} = cin + y + x;
endmodule
read_verilog ../top.v
synth
insbuf
select -assert-count 1 t:$_BUF_
read_verilog ../top.v
synth
insbuf -buf $_NOT_ A Y
select -assert-count 1 t:$_NOT_
read_verilog ../top.v
synth
insbuf buf
read_verilog ../top_wide.v
synth
insbuf
select -assert-count 16 t:$_BUF_
module top (
out,
i,
clk,
o,
in
);
output [7:0] out;
input clk, in;
reg [7:0] out;
input i;
output o;
always @(posedge clk)
begin
out <= out << 1;
out[0] <= in;
end
endmodule
module top (
out,
in
);
output [7:0] out;
input [7:0] in;
wire [7:0] o;
assign o = in;
assign out = o;
endmodule
tee -o result.log log "OK"
tee -o result.log log -n "OK"
tee -o result.log log -nolog "OK"
tee -o result.log log -stderr "OK"
tee -o result.log log -stdout "OK"
Longest topological path in top (length=3):
0: \\x
1: $add$../top.v:13$2_Y (via $add$../top.v:13$2)
2: \\A (via $procdff$4)
3: $add$../top.v:15$3_Y (via $add$../top.v:15$3)
read_verilog ../top.v
proc
tee -o result.out ltp
Warning: Detected loop at $and$../top_logic_loop.v:13$1_Y in top
Longest topological path in top (length=3):
0: \\x
1: $and$../top_logic_loop.v:13$1_Y (via $and$../top_logic_loop.v:13$1)
2: $and$../top_logic_loop.v:14$2_Y (via $and$../top_logic_loop.v:14$2)
3: $not$../top_logic_loop.v:15$3_Y (via $not$../top_logic_loop.v:15$3)
read_verilog ../top_logic_loop.v
proc
tee -o result.out ltp
Longest topological path in top (length=1):
0: \\x
1: $add$../top.v:13$2_Y (via $add$../top.v:13$2)
ff: \\A (via $procdff$4)
read_verilog ../top.v
proc
tee -o result.out ltp -noff
Warning: Ignoring module top because it contains processes (run 'proc' command first).
read_verilog ../top.v
tee -o result.out ltp
module top
(
input x,
input y,
input cin,
output reg A,
output cout
);
wire o;
always @(posedge cin)
A <= y + x;
assign cout = cin + A;
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
read_verilog -sv ../top.v
proc
tee -o result.log miter -assert -make_outputs top
tee -o result.log miter -assert -make_outputs middle
read_verilog -sv ../top_assert.v
proc
tee -o result.log miter -assert -make_outputs top miter
tee -o result.log miter -assert -make_outputs middle
read_verilog -sv ../top.v
proc
tee -o result.log miter -assert -flatten top
tee -o result.log miter -assert -flatten middle
read_verilog -sv ../top.v
proc
tee -o result.log miter -equiv top gate top
read_verilog -sv ../top.v
proc
tee -o result.log miter -equiv gold gate top
read_verilog -sv ../top.v
proc
tee -o result.log miter -assert t
read_verilog ../top_equiv.v
hierarchy -top dut
proc
memory -nomap
equiv_opt -run :prove -map +/ecp5/cells_sim.v synth_ecp5
memory
opt -full
miter -equiv -flatten -make_assert -make_outputs gold gate miter
read_verilog ../top_equiv.v
hierarchy -top dut
proc
memory -nomap
equiv_opt -run :prove -map +/ecp5/cells_sim.v synth_ecp5
memory
opt -full
miter -equiv -flatten -ignore_gold_x -make_assert -make_outputs gold gate miter
read_verilog ../top_equiv.v
hierarchy -top dut
proc
memory -nomap
equiv_opt -run :prove -map +/ecp5/cells_sim.v synth_ecp5
memory
opt -full
miter -equiv -flatten -make_outcmp -make_assert -make_outputs gold gate miter
read_verilog -sv ../top.v
proc
tee -o result.log miter
ERROR: No matching port in gate module was found for \\y!
read_verilog -sv ../top_err_1.v
proc
tee -o result.log miter -equiv middle u_rtl top1
ERROR: No matching port in gold module was found for \\y!
read_verilog -sv ../top_err_1.v
proc
tee -o result.log miter -equiv u_rtl middle top1
read_verilog -sv ../top.v
proc
tee -o result.log miter -equiv top middle top
module top
(
input x,
input y,
input cin,
output reg A,
output cout
);
parameter X = 1;
wire o;
`ifndef BUG
always @(posedge cin)
A <= o;
//assign cout = cin? y : x;
middle u_mid (.x(x),.o(o));
u_rtl inst_u_rtl (.x(x),.o(o));
`else
assign {cout,A} = cin - y * x;
`endif
endmodule
module middle
(
input x,
input y,
output o
);
assign o = x + y;
endmodule
module u_rtl
(
input x,
input y,
output o
);
assign o = x + y;
endmodule
module top
(
input x,
input y,
input cin,
output reg A,
output reg cout
);
reg ASSERT = 1;
(* anyconst *) reg foo;
(* anyseq *) reg too;
initial begin
begin
A = 0;
cout = 0;
end
end
`ifndef BUG
always @(posedge x) begin
if ($initstate)
A <= 0;
A <= y + cin + too;
assume(too);
assume(s_eventually too);
end
always @(negedge x) begin
if ($initstate)
cout <= 0;
cout <= y + A + foo;
assert(ASSERT);
assert(s_eventually ASSERT);
end
`else
assign {cout,A} = cin - y * x;
`endif
endmodule
module middle
(
input x,
input y,
output o
);
assign o = x + y;
endmodule
module dut(
input fast_clk, slow_clk,
input [3:0] waddr, raddr,
input [3:0] wdata,
input wen,
output [3:0] rdata
);
reg [3:0] mem[0:15];
reg [3:0] raddr_reg;
always @(posedge fast_clk) begin
if (wen)
mem[waddr] <= wdata;
end
always @(posedge slow_clk)
raddr_reg <= raddr;
assign rdata = mem[raddr_reg];
endmodule
module top
(
input x,
input y,
input cin,
output reg A,
output cout
);
parameter X = 1;
wire o;
`ifndef BUG
always @(posedge cin)
A <= o;
//assign cout = cin? y : x;
middle u_mid (.x(x),.o(o));
u_rtl inst_u_rtl (.x(x),.o(o));
`else
assign {cout,A} = cin - y * x;
`endif
endmodule
module middle
(
input x,
input y,
output o
);
assign o = x + y;
endmodule
module u_rtl
(
input x,
// input y,
output o
);
assign o = x;
endmodule
read_verilog ../top.v
mutate -list 512 -o mutate.yss
script mutate.yss
select -assert-count 2 t:$add
select -assert-count 9 t:$not
select -assert-count 3 t:$xnor
select -assert-count 1 t:$xor
read_verilog ../top.v
tee -o result.log mutate -mode cnot0 -module top -cell $add$../top.v:12$2 -port Y -portbit 0 -ctrlbit 1 -wire A -wirebit 0 -src ../top.v:7 -src ../top.v:12
select -assert-count 1 t:$xnor
read_verilog ../top.v
tee -o result.log mutate -mode cnot1 -module top -cell $add$../top.v:12$2 -port A -portbit 0 -ctrlbit 1 -src top.v:12
select -assert-count 1 t:$xor
read_verilog ../top.v
tee -o result.log mutate -mode const0 -module top -cell $add$../top.v:12$2 -port Y -portbit 0 -wire A -wirebit 0 -src ../top.v:7 -src ../top.v:12
stat
read_verilog ../top.v
tee -o result.log mutate -mode const1 -module top -cell $add$../top.v:12$2 -port Y -portbit 0 -wire A -wirebit 0 -src ../top.v:7 -src ../top.v:12
stat
read_verilog ../top.v
tee -o result.log mutate -cell $add$../top.v:12$1 -port \Y -portbit 0 -ctrlbit 0 -module top
read_verilog ../top.v
tee -o result.log mutate -mode inv -module top -cell $add$../top.v:12$2 -port Y -portbit 0 -wire A -wirebit 0 -src ../top.v:7 -src ../top.v:12
select -assert-count 1 t:$not
read_verilog ../top.v
tee -o result.log mutate -list 32
read_verilog ../top.v
tee -o result.log mutate -list 32 -cfg weight_cover 1
read_verilog ../top.v
tee -o result.log mutate -list 32 -ctrl A 1 1
read_verilog ../top.v
tee -o result.log mutate -list 32 -none
read_verilog ../top.v
tee -o result.log mutate -list 32 -o o.txt
read_verilog ../top.v
tee -o result.log mutate -list 32 -s s.txt
help mutate
read_verilog ../top.v
tee -o result.log mutate -list 32 -seed 5
read_verilog ../top_mem.v
mutate -list 512 -o mutate.yss
script mutate.yss
module top
(
input x,
input y,
input cin,
output A,
output cout
);
assign {cout,A} = cin + y + x;
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
read_verilog ../top.v
proc
select -assert-count 13 t:$mux
select -assert-count 1 t:$pmux
select -assert-count 28 t:$eq
muxpack
select -assert-count 1 t:$mux
select -assert-count 3 t:$pmux
select -assert-count 28 t:$eq
read_verilog ../top_reduce.v
proc
muxpack
select -assert-count 1 t:$pmux
select -assert-count 16 t:$eq
select -assert-count 8 t:$reduce_or
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 @*
if (S == 0) Y <= D[0];
else if (S == 1) Y <= D[1];
else if (S == 2) Y <= D[2];
else if (S == 3) Y <= D[3];
else Y <= 1'bx;
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 @*
if (S == 0) Y <= D[0];
else if (S == 1) Y <= D[1];
else if (S == 2) Y <= D[2];
else if (S == 3) Y <= D[3];
else if (S == 4) Y <= D[4];
else if (S == 5) Y <= D[5];
else if (S == 6) Y <= D[6];
else if (S == 7) Y <= D[7];
else Y <= 1'bx;
endmodule
module mux16 (D, S, Y);
input [15:0] D;
input [3:0] S;
output Y;
reg Y;
wire[3:0] S;
wire[15: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];
8 : Y = D[8];
9 : Y = D[9];
10 : Y = D[10];
11 : Y = D[11];
12 : Y = D[12];
13 : Y = D[13];
14 : Y = D[14];
15 : Y = D[15];
default: Y = 1'bx;
endcase
end
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
module mux (D, S, Y);
input [7:0] D;
input [3:0] S;
output Y;
reg Y;
wire[3:0] S;
wire[7:0] D;
always @*
begin
case( S )
0,1 : Y = D[0];
2,3 : Y = D[1];
4,5 : Y = D[2];
6,7 : Y = D[3];
8,9 : Y = D[4];
10,11 : Y = D[5];
12,13 : Y = D[6];
14,15 : Y = D[7];
default: Y = 1'bx;
endcase
end
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 @*
if (S != 0) Y <= D[0];
else if (S != 1) Y <= D[1];
else if (S != 2) Y <= D[2];
else if (S != 3) Y <= D[3];
else Y <= 1'bx;
endmodule
read_verilog ../top.v
proc
pmux2shiftx -onehot ignore
onehot
tee -o result.out
read_verilog ../top.v
proc
pmux2shiftx -onehot ignore
onehot -v
read_verilog ../top.v
proc
pmux2shiftx -onehot ignore
onehot -vv
read_verilog ../top_1.v
proc
pmux2shiftx -onehot ignore
onehot -vv
read_verilog ../top_2.v
proc
pmux2shiftx -onehot ignore
onehot -vv
read_verilog ../top_3.v
proc
pmux2shiftx -onehot ignore
onehot -vv
read_verilog ../top_4.v
proc
pmux2shiftx -onehot ignore
onehot -vv
read_verilog ../top_5.v
proc
pmux2shiftx -onehot ignore
onehot -vv
read_verilog ../top_6.v
proc
pmux2shiftx -onehot ignore
onehot -vv
read_verilog ../top_fsm.v
proc
pmux2shiftx -onehot ignore
onehot -vv
module top(C, S, Y);
input C;
input [1:0] S;
output reg [3:0] Y;
initial Y = 0;
always @(posedge C) begin
case (S)
2'b00: Y <= 4'b0001;
2'b01: Y <= 4'b0010;
2'b10: Y <= 4'b0100;
2'b11: Y <= 4'b1000;
endcase
end
endmodule
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