XDC: Add test for proper 'unknown' proc behavior Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
diff --git a/xdc-plugin/tests/Makefile b/xdc-plugin/tests/Makefile index e8f8d1b..080f134 100644 --- a/xdc-plugin/tests/Makefile +++ b/xdc-plugin/tests/Makefile
@@ -19,7 +19,7 @@ PART_JSON=xc7a35tcsg324-1.json \ OUT_JSON=$(1).json \ INPUT_XDC_FILE=$(1).xdc \ - yosys -p "tcl synth.tcl" $$< -l yosys.log + yosys -p "tcl $(1).tcl" $$< -l yosys.log update_$(1): $(1).json @python compare_output_json.py --json $$< --golden $(1)_golden.json --update
diff --git a/xdc-plugin/tests/synth.tcl b/xdc-plugin/tests/counter.tcl similarity index 100% rename from xdc-plugin/tests/synth.tcl rename to xdc-plugin/tests/counter.tcl
diff --git a/xdc-plugin/tests/port_indexes.tcl b/xdc-plugin/tests/port_indexes.tcl new file mode 100644 index 0000000..17d3b9e --- /dev/null +++ b/xdc-plugin/tests/port_indexes.tcl
@@ -0,0 +1,25 @@ +yosys -import +plugin -i xdc +#Import the commands from the plugins to the tcl interpreter +yosys -import + +# -flatten is used to ensure that the output eblif has only one module. +# Some of symbiflow expects eblifs with only one module. +synth_xilinx -vpr -flatten -abc9 -nosrl -noclkbuf -nodsp + +if {[info procs unknown] != ""} { + rename unknown "" +} +proc unknown args {puts "'unknown' proc command handler"} +if {[catch {invalid command}]} { + error "Command should be handled by the 'unknown' proc" +} +#Read the design constraints +read_xdc -part_json $::env(PART_JSON) $::env(INPUT_XDC_FILE) + +if {[catch {invalid command}]} { + error "Command should be handled by the 'unknown' proc" +} + +# Write the design in JSON format. +write_json $::env(OUT_JSON)