Commit 386ec389 by SergeyDegtyar

Add tests for MISC task list; Add test for write_table command

MISC
=====
Tasks in this group are just generating some output, so no traditional
test bench could be made. Writing output from yosys and checking if
result is expected is advised.

1.http://scratch.clifford.at/coverage_html/passes/tests/test_abcloop.cc.gcov.html
This represents some internal tests for ABC loops
2.
http://scratch.clifford.at/coverage_html/passes/tests/test_cell.cc.gcov.html
note that you need to provide multiple tests in order to cover testing
of all cell types. Also output should be checked if it contain "Fail" or
"Error" in it
3.
http://scratch.clifford.at/coverage_html/passes/cmds/torder.cc.gcov.html
Use some verilog file, do proc and this should display you all cells in
designed ordered. Require multiple different parameters to cover all.
4.http://scratch.clifford.at/coverage_html/passes/cmds/trace.cc.gcov.html
loading verilog file and doing  "trace proc" will create output with
additional logs, not much to check from output to be honest
5.
http://scratch.clifford.at/coverage_html/passes/cmds/write_file.cc.gcov.html
just write to file and check if written output is fine
6.
http://scratch.clifford.at/coverage_html/passes/cmds/stat.cc.gcov.html
if you have liberty cell library files, try it with those specified.
7.
http://scratch.clifford.at/coverage_html/passes/cmds/show.cc.gcov.html
note that you would always need to set -viewer since you do not wish to
call graphwiz.
Need covering of various parameters on a reasonable complicated design
to cover.
8. http://scratch.clifford.at/coverage_html/passes/cmds/scc.cc.gcov.html
detection of logic loops, output needs to be tested in order to check if
loop was detected on not.
9.
http://scratch.clifford.at/coverage_html/passes/cmds/scatter.cc.gcov.html
After doing synth on existing design, just run this step, can do
opt_clean after and there should be lot of temporary and unused wires
removed.
10.
http://scratch.clifford.at/coverage_html/passes/cmds/rename.cc.gcov.html
can load design and rename top modue, output should contain module with
new name
11.
http://scratch.clifford.at/coverage_html/passes/cmds/qwp.cc.gcov.html
Use it on simple design since it takes a while on big ones.
12.
http://scratch.clifford.at/coverage_html/passes/cmds/ltp.cc.gcov.html
Check if returns expected value for your design
13.
http://scratch.clifford.at/coverage_html/passes/cmds/edgetypes.cc.gcov.html
it just outputs report, so not sure what would be valid to check, just
execute for now.
14.
http://scratch.clifford.at/coverage_html/passes/cmds/delete.cc.gcov.html
load existing design and try removing inputs, outputs,... complete
design
15.
http://scratch.clifford.at/coverage_html/passes/cmds/cover.cc.gcov.html
it just prints report, so nothing to check
parent 25ef4356
*/work_*/
/.stamp
all: work
touch .stamp
clean::
rm -f .stamp
define template
$(foreach design,$(1),
$(foreach script,$(2),
work:: $(design)/work_$(script)/.stamp
$(design)/work_$(script)/.stamp:
bash run.sh $(design) $(script)
clean::
rm -rf $(design)/work_$(script)
))
endef
#test_abcloop
$(eval $(call template,test_abcloop,test_abcloop test_abcloop_n test_abcloop_s ))
#test_cell
#test_cell_map - takes a lot of time
# test_cell_mux, test_cell_pmux - is not supported
$(eval $(call template,test_cell,test_cell test_cell_aigmap test_cell_const test_cell_edges test_cell_f test_cell_div test_cell_muxdiv test_cell_n test_cell_noeval test_cell_nosat test_cell_s test_cell_script test_cell_simlib test_cell_v test_cell_vlog test_cell_w test_cell_alu test_cell_sop test_cell_lut test_cell_macc test_cell_lcu test_cell_fa))
#torder
$(eval $(call template,torder,torder torder_stop torder_noautostop ))
#trace
$(eval $(call template,trace,trace ))
#write_file
$(eval $(call template,write_file,write_file write_file_a ))
#stat
$(eval $(call template,stat, stat stat_top stat_width stat_liberty ))
#show
# show_pause - skipped
$(eval $(call template,show, show show_colorattr show_colors show_color show_enum show_format show_label show_lib show_long show_notitle show_prefix show_signed show_stretch show_viewer show_width))
#scc
$(eval $(call template,scc, scc scc_all_cell_types scc_expect scc_max_depth scc_nofeedback scc_select scc_set_attr ))
#scatter
$(eval $(call template,scatter, scatter ))
#rename
$(eval $(call template,rename, rename rename_top rename_src rename_hide rename_enumerate rename_enumerate_pat))
#qwp
#qwp_v - exception
#+ yosys -ql yosys.log ../../scripts/qwp_v.ys
#run.sh: line 11: 28262 Floating point exception(core dumped) yosys -ql yosys.log ../../scripts/$2.ys
$(eval $(call template,qwp, qwp qwp_ltr qwp_grid qwp_dump qwp_alpha))
#ltp
$(eval $(call template,ltp, ltp ltp_noff ))
#edgetypes
$(eval $(call template,edgetypes, edgetypes ))
#delete
$(eval $(call template,delete, delete delete_input delete_output delete_port delete_cell delete_wire delete_proc ))
$(eval $(call template,delete_mem, delete_mem ))
#cover
$(eval $(call template,cover, cover cover_q cover_o cover_dir cover_a ))
.PHONY: all clean
module top
(
input x,
input y,
input cin,
output A,
output cout
);
`ifndef BUG
assign {cout,A} = cin + y + x;
`else
assign {cout,A} = cin - y * x;
`endif
endmodule
module top
(
input x,
input y,
input cin,
output reg A,
output cout
);
wire o;
`ifndef BUG
always @(posedge cin)
A <= o;
assign cout = cin? y : x;
middle u_mid (x,y,o);
`else
assign {cout,A} = cin - y * x;
`endif
endmodule
module middle
(
input x,
input y,
output o
);
assign o = x + y;
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
`ifndef BUG
if (we_a)
`else
if (we_b)
`endif
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
`ifndef BUG
if (we_b)
`else
if (we_a)
`endif
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 x,
input y,
input cin,
output A,
output cout
);
`ifndef BUG
assign {cout,A} = cin + y + x;
`else
assign {cout,A} = cin - y * x;
`endif
endmodule
module top
(
input x,
input y,
input cin,
output reg A,
output cout
);
wire o;
`ifndef BUG
always @(posedge cin)
A <= o;
assign cout = cin? y : x;
middle u_mid (x,y,o);
`else
assign {cout,A} = cin - y * x;
`endif
endmodule
module middle
(
input x,
input y,
output o
);
assign o = x + y;
endmodule
module top
(
input x,
input y,
input cin,
output reg A,
output cout
);
wire o;
`ifndef BUG
//always @(posedge cin)
// A <= o;
assign cout = cin? y : x;
//middle u_mid (x,y,o);
`else
assign {cout,A} = cin - y * x;
`endif
endmodule
module middle
(
input x,
input y,
output o
);
assign o = x + y;
endmodule
module top
(
input x,
input y,
input cin,
output reg A,
output cout
);
wire o;
`ifndef BUG
always @(posedge cin)
A <= o;
assign cout = cin? y : x;
middle u_mid (x,y,o);
`else
assign {cout,A} = cin - y * x;
`endif
endmodule
module middle
(
input x,
input y,
output o
);
assign o = x + y;
endmodule
#!/bin/bash
set -ex
test -d $1
test -f scripts/$2.ys
rm -rf $1/work_$2
mkdir $1/work_$2
cd $1/work_$2
yosys -ql yosys.log ../../scripts/$2.ys
if grep 'Assert' result.log || grep 'failed in' result.log || grep 'fail' result.log || grep 'ERROR' result.log; then
echo fail > ${1}_${2}.status
else
echo pass > ${1}_${2}.status
fi
touch .stamp
module top
(
input x,
input y,
input cin,
output reg A,
output cout
);
wire o;
`ifndef BUG
always @(posedge cin)
A <= o;
assign cout = cin? y : x;
middle u_mid (x,y,o);
`else
assign {cout,A} = cin - y * x;
`endif
endmodule
module middle
(
input x,
input y,
output o
);
assign o = x + y;
endmodule
module top
(
input x,
input y,
input cin,
output reg A,
output cout
);
wire o;
`ifndef BUG
always @(posedge cin)
A <= o;
assign cout = cin? y : x;
middle u_mid (x,y,o);
`else
assign {cout,A} = cin - y * x;
`endif
endmodule
module middle
(
input x,
input y,
output o
);
assign o = x + y;
endmodule
read_verilog ../top.v
tee -o result.log cover
read_verilog ../top.v
tee -o result.log cover -a out.txt
read_verilog ../top.v
tee -o result.log cover -d out_dir
read_verilog ../top.v
tee -o result.log cover -o out.txt
read_verilog ../top.v
tee -o result.log cover -q
read_verilog ../top.v
tee -o result.log delete middle
read_verilog ../top.v
tee -o result.log delete top/$1
read_verilog ../top.v
tee -o result.log delete -input middle/x
read_verilog ../top.v
tee -o result.log delete top/$7
read_verilog ../top.v
tee -o result.log delete -output middle/o
read_verilog ../top.v
tee -o result.log delete -port top/A
read_verilog ../top.v
tee -o result.log delete top/$3
read_verilog ../top.v
tee -o result.log delete top/o
read_verilog ../top.v
tee -o result.log edgetypes
read_verilog ../top.v
proc
tee -o result.log ltp
read_verilog ../top.v
proc
tee -o result.log ltp -noff
read_verilog ../top.v
proc
tee -o result.log qwp
read_verilog ../top.v
proc
tee -o result.log qwp -alpha
read_verilog ../top.v
proc
tee -o result.log qwp -dump out.html
read_verilog ../top.v
proc
tee -o result.log qwp -grid 4
read_verilog ../top.v
proc
tee -o result.log qwp -ltr
read_verilog ../top.v
proc
tee -o result.log qwp -v
read_verilog ../top.v
proc
tee -o result.log rename middle mid_module
read_verilog ../top.v
proc
tee -o result.log rename -enumerate
read_verilog ../top.v
proc
tee -o result.log rename -enumerate -pattern '_%_' top
read_verilog ../top.v
proc
tee -o result.log rename -hide middle mid
read_verilog ../top.v
proc
tee -o result.log rename -src
read_verilog ../top.v
synth -top top
tee -o result.log rename -top new_top
read_verilog ../top.v
proc
tee -o result.log scatter
read_verilog ../top.v
proc
tee -o result.log scc top
read_verilog ../top.v
tee -o result.log scc -all_cell_types top
read_verilog ../top.v
tee -o result.log scc -expect 0 top
read_verilog ../top.v
tee -o result.log scc -max_depth 2 top
read_verilog ../top.v
tee -o result.log scc -nofeedback top
read_verilog ../top.v
synth -top top
tee -o result.log scc -select top
read_verilog ../top.v
tee -o result.log scc -set_attr attr true top
read_verilog ../top.v
proc
tee -o result.log show -viewer dummy.sh top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -color red $add top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -colorattr attr top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -colors red green blue top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -enum top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -format dot top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -label adder $add top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -lib ../top.v top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -long top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -notitle top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -pause top
read_verilog ../top.v
synth -top top
tee -o result.log show -viewer dummy.sh -prefix pr top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -signed top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -stretch top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh top
read_verilog ../top.v
tee -o result.log show -viewer dummy.sh -width top
read_verilog ../top.v
proc
tee -o result.log stat
read_verilog ../top.v
tee -o result.log stat -liberty ../lib.lib
read_verilog ../top.v
synth -top top
tee -o result.log stat -top top
read_verilog ../top.v
tee -o result.log stat -width
read_verilog ../top.v
synth -top top
tee -o result.log test_abcloop
read_verilog ../top.v
synth -top top
tee -o result.log test_abcloop -n 50
read_verilog ../top.v
synth -top top
tee -o result.log test_abcloop -s 50
read_verilog ../top.v
synth -top top
tee -o result.log test_cell $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -aigmap $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell $alu
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -const $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -n 2 $div $mod
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -edges $add
read_verilog ../gold.v
synth -top gold
write_ilang ilang.ilang
design -reset
tee -o result.log test_cell -f ilang.ilang
read_verilog ../top.v
synth -top top
tee -o result.log test_cell $fa
read_verilog ../top.v
synth -top top
tee -o result.log test_cell $lcu
read_verilog ../top.v
synth -top top
tee -o result.log test_cell $lut
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -n 2 $macc
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -n 2 -map ../simlib.v $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell $mux
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -muxdiv $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -n 50 $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -noeval $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -nosat $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell $pmux
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -s 50 $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -script ../test_cell_scr.ys $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -simlib $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell $sop
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -v $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -vlog vlog.v $add
read_verilog ../top.v
synth -top top
tee -o result.log test_cell -w pref $add
read_verilog ../top.v
tee -o result.log torder
read_verilog ../top.v
tee -o result.log torder -noautostop
read_verilog ../top.v
tee -o result.log torder -stop $add A
read_verilog ../top.v
tee -o result.log trace synth -top top
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
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