Params plugin: Improve getparam test Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
diff --git a/params-plugin/tests/Makefile b/params-plugin/tests/Makefile index 2ab247e..a3f2ff3 100644 --- a/params-plugin/tests/Makefile +++ b/params-plugin/tests/Makefile
@@ -1,6 +1,6 @@ TESTS = pll -pll_verify = $(call compare_json,pll) +pll_verify = $(call compare_json,pll) && test $$(grep "PASS" pll/params.txt | wc -l) -eq 2 all: $(TESTS)
diff --git a/params-plugin/tests/pll/pll.tcl b/params-plugin/tests/pll/pll.tcl index 3072cde..f06bc3d 100644 --- a/params-plugin/tests/pll/pll.tcl +++ b/params-plugin/tests/pll/pll.tcl
@@ -8,9 +8,25 @@ read_verilog -lib +/xilinx/cells_xtra.v hierarchy -check -auto-top set phase [getparam CLKOUT2_PHASE top/PLLE2_ADV_0 top/PLLE2_ADV] -puts "Phase before: $phase" +if {[llength $phase] != 2} { + error "Getparam should return a list with 2 elements" +} +set fp [open "params.txt" "w"] +puts -nonewline $fp "Phase before: " +if {$phase == [list 90 70]} { + puts $fp "PASS" +} else { + puts $fp "FAIL" +} setparam -set CLKOUT2_PHASE [expr [lindex $phase 0] * 1000] top/PLLE2_ADV -puts "Phase after: [getparam CLKOUT2_PHASE top/PLLE2_ADV_0 top/PLLE2_ADV]" +set phase [getparam CLKOUT2_PHASE top/PLLE2_ADV_0 top/PLLE2_ADV] +puts -nonewline $fp "Phase after: " +if {$phase == [list 90000 70]} { + puts $fp "PASS" +} else { + puts $fp "FAIL" +} +close $fp # Start flow after library reading synth_xilinx -vpr -flatten -abc9 -nosrl -noclkbuf -nodsp -iopad -run prepare:check