Unverified Commit d2e90b45 by Miodrag Milanović Committed by GitHub

Merge pull request #85 from SergeyDegtyar/review_yosys_group

Review yosys group
parents 3685d10d de9dc8ec
...@@ -16,7 +16,16 @@ if [ -f ../run-test.sh ]; then ...@@ -16,7 +16,16 @@ if [ -f ../run-test.sh ]; then
if [ $? != 0 ] ; then if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status echo FAIL > ${1}_${2}.status
else else
if [ -f "../$2.pat" ]; then
expectation=$(<../$2.pat)
if grep "$expectation" yosys.log; then
echo PASS > ${1}_${2}.status echo PASS > ${1}_${2}.status
else
echo FAIL > ${1}_${2}.status
fi
else
echo PASS > ${1}_${2}.status
fi
fi fi
touch .stamp touch .stamp
exit exit
......
*/work_*/ */work_*/
/.stamp /.stamp
/run-test.mk
all: work PYTHON_EXECUTABLE := $(shell if python3 -c ""; then echo "python3"; else echo "python"; fi)
touch .stamp
clean:: all::
rm -f .stamp
define template run-test.mk: ./generate.py
$(foreach design,$(1), @$(PYTHON_EXECUTABLE) ./generate.py > run-test.mk
$(foreach script,$(2),
work:: $(design)/work_$(script)/.stamp
$(design)/work_$(script)/.stamp:
./run.sh $(design) $(script)
clean::
rm -rf $(design)/work_$(script)
))
endef
#yosys
$(eval $(call template,yosys,yosys))
#yosys_help
$(eval $(call template,yosys_help,yosys))
#yosys_no_banner
$(eval $(call template,yosys_no_banner,yosys))
#yosys_no_footer
$(eval $(call template,yosys_no_footer,yosys))
#yosys_quiet
$(eval $(call template,yosys_quiet,yosys))
#yosys_headers
$(eval $(call template,yosys_headers,yosys))
#yosys_time
$(eval $(call template,yosys_time,yosys))
#yosys_detailed_timing
$(eval $(call template,yosys_detailed_timing,yosys))
#yosys_log_file
$(eval $(call template,yosys_log_file,yosys))
#yosys_log_file_lb_mode
$(eval $(call template,yosys_log_file_lb_mode,yosys))
#yosys_write_des_to_file
$(eval $(call template,yosys_write_des_to_file,yosys))
#yosys_backends
$(eval $(call template,yosys_backends,yosys))
#yosys_frontends
$(eval $(call template,yosys_frontends,yosys))
#yosys_command_list
$(eval $(call template,yosys_command_list,yosys))
#yosys_help_for_command
$(eval $(call template,yosys_help_for_command,yosys))
#yosys_script
$(eval $(call template,yosys_script,yosys))
#yosys_tcl_script
$(eval $(call template,yosys_tcl_script,yosys))
#yosys_exec_command
$(eval $(call template,yosys_exec_command,yosys))
#yosys_enable_tracing
$(eval $(call template,yosys_enable_tracing,yosys))
#yosys_randomize_alloc_point_addr
$(eval $(call template,yosys_randomize_alloc_point_addr,yosys))
#yosys_abort
$(eval $(call template,yosys_abort,yosys))
#yosys_macro
$(eval $(call template,yosys_macro,yosys))
#yosys_header
$(eval $(call template,yosys_header,yosys))
#yosys_regexp
$(eval $(call template,yosys_regexp,yosys))
#yosys_regexp_w
$(eval $(call template,yosys_regexp_w,yosys))
#yosys_regexp_e
$(eval $(call template,yosys_regexp_e,yosys))
#yosys_dependencies
$(eval $(call template,yosys_dependencies,yosys))
#yosys_globally_en_log_mes
$(eval $(call template,yosys_globally_en_log_mes,yosys))
#yosys_version
$(eval $(call template,yosys_version,yosys))
#yosys_synth
$(eval $(call template,yosys_synth,yosys))
include run-test.mk
.PHONY: all clean .PHONY: all clean
import os
is_heavy_enabled = int(os.getenv('ENABLE_HEAVY_TESTS', '0')) == 1
for root, dirs, files in sorted(os.walk(".")):
for file in files:
if file.endswith('run-test.sh'):
dir = os.path.basename(root)
work = os.path.splitext(file)[0]
heavy = os.path.exists(os.path.join(dir, "heavy_test"))
is_disabled = os.path.exists(os.path.join(dir, work + ".disable"))
print("all:: {0}/work_{1}/.stamp\n"
"{0}/work_{1}/.stamp:".format(dir, work))
if (is_disabled):
print("\t@echo 'Skipping disabled test {0}..'".format(dir, work))
continue
if (heavy and not is_heavy_enabled):
print("\t@echo 'Skipping heavy test {0}..'".format(dir, work))
continue
print("\t@echo 'Running {2}{1}..'\n"
"\t@../run.sh {0} {1}\n"
"clean::\n"
"\t@echo 'Cleaning {1}..'\n"
"\t@rm -rf {0}/work_{1}".format(dir, work, "heavy " if heavy else ""))
print(".PHONY: all clean")
#!/bin/bash
set -x
test -d $1
test -f scripts/$2.ys
rm -rf $1/work_$2
mkdir $1/work_$2
cd $1/work_$2
touch .start
expected_string=""
expected="1"
if [ "$1" = "yosys" ]; then
expected_string="yosys -- Yosys Open SYnthesis Suite"
elif [ "$1" = "yosys_help" ]; then
expected_string="print the help message for the specified command"
elif [ "$1" = "yosys_no_banner" ]; then
expected_string="yosys -- Yosys Open SYnthesis Suite"
expected="0"
elif [ "$1" = "yosys_no_footer" ]; then
expected_string="End of script. Logfile hash:"
expected="0"
elif [ "$1" = "yosys_quiet" ]; then
expected_string="yosys"
expected="0"
elif [ "$1" = "yosys_headers" ]; then
expected_string="yosys"
expected="0"
elif [ "$1" = "yosys_time" ]; then
expected_string="\[00000.000000\]"
elif [ "$1" = "yosys_detailed_timing" ]; then
expected_string=" calls"
elif [ "$1" = "yosys_log_file" ]; then
expected_string="yosys -- Yosys Open SYnthesis Suite"
elif [ "$1" = "yosys_log_file_lb_mode" ]; then
expected_string="yosys -- Yosys Open SYnthesis Suite"
elif [ "$1" = "yosys_write_des_to_file" ]; then
expected_string="Generated by Yosys"
elif [ "$1" = "yosys_backends" ]; then
expected_string="Generated by Yosys"
elif [ "$1" = "yosys_frontends" ]; then
expected_string="Parsing \`../top.v' using frontend \`verilog'"
elif [ "$1" = "yosys_command_list" ]; then
expected_string="abc"
elif [ "$1" = "yosys_help_for_command" ]; then
expected_string="abc \[options\] \[selection\]"
elif [ "$1" = "yosys_script" ]; then
expected_string="Executing script file \`../run_script.ys'"
elif [ "$1" = "yosys_tcl_script" ]; then
expected_string="Run tcl script!"
elif [ "$1" = "yosys_exec_command" ]; then
expected_string="abc"
elif [ "$1" = "yosys_enable_tracing" ]; then
expected_string="abc"
elif [ "$1" = "yosys_randomize_alloc_point_addr" ]; then
expected_string="abc"
elif [ "$1" = "yosys_abort" ]; then
expected_string="abc"
elif [ "$1" = "yosys_macro" ]; then
expected_string="abc"
elif [ "$1" = "yosys_header" ]; then
expected_string=" Parsing \`../top.v' using frontend \`verilog'"
elif [ "$1" = "yosys_regexp" ]; then
expected_string="abc"
elif [ "$1" = "yosys_regexp_w" ]; then
expected_string="abc"
elif [ "$1" = "yosys_regexp_e" ]; then
expected_string="abc"
elif [ "$1" = "yosys_dependencies" ]; then
expected_string="abc"
elif [ "$1" = "yosys_globally_en_log_mes" ]; then
expected_string="abc"
elif [ "$1" = "yosys_version" ]; then
expected_string="Yosys "
elif [ "$1" = "yosys_synth" ]; then
expected_string="Running command \`synth'"
fi
../run_yosys.sh
if [ "$1"! = "yosys_abort" ]; then
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
fi
if grep "$expected_string" yosys.log; then
if [ $expected = "1" ]; then
echo PASS > ${1}_${2}.status
else
echo FAIL > ${1}_${2}.status
fi
else
if [ $expected = "1" ]; then
echo FAIL > ${1}_${2}.status
else
echo PASS > ${1}_${2}.status
fi
fi
touch .stamp
yosys -- Yosys Open SYnthesis Suite
#!/bin/bash
yosys -A ../run_script.ys >> yosys.log
// File: design.v
// Generated by MyHDL 0.8
// Date: Tue Dec 3 04:33:14 2013
`timescale 1ns/10ps
module top (
x,clk,rst,a
);
output x;
reg x;
input clk;
input rst;
input [1:0] a;
always @(posedge clk, negedge rst) begin: DESIGN_PROCESSOR
reg i;
if (!rst) begin
i = 0;
x = 0;
end
else begin
case (a)
2'b00: begin
x = 0;
i = 0;
end
2'b01: begin
x = i;
end
2'b10: begin
i = 1;
end
2'b11: begin
i = 0;
end
default: begin
x = 0;
i = 0;
end
endcase
end
end
endmodule
yosys -- Yosys Open SYnthesis Suite
Parsing `../top.v' using frontend `verilog'
yosys -- Yosys Open SYnthesis Suite
Parsing `../top.v' using frontend `verilog'
print the help message for the specified command
abc \[options\] \[selection\]
yosys -- Yosys Open SYnthesis Suite
yosys -- Yosys Open SYnthesis Suite
Executing script file `../run_script.ys'
yosys -- Yosys Open SYnthesis Suite
yosys -- Yosys Open SYnthesis Suite
yosys -- Yosys Open SYnthesis Suite
Executing script file `../run_script.ys'
Running command `synth'
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