From c2c827ee107bc18f2c0b07579f61f6b5e7d30c58 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Tue, 25 Jan 2022 20:27:41 -0800 Subject: [PATCH 1/4] [Script] Fix a bug in git-diff for regression tests --- openfpga_flow/regression_test_scripts/basic_reg_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfpga_flow/regression_test_scripts/basic_reg_test.sh b/openfpga_flow/regression_test_scripts/basic_reg_test.sh index 16bc4cda1..a062c3b76 100755 --- a/openfpga_flow/regression_test_scripts/basic_reg_test.sh +++ b/openfpga_flow/regression_test_scripts/basic_reg_test.sh @@ -148,7 +148,7 @@ run-task basic_tests/explicit_multi_verilog_files --debug --show_thread_logs echo -e "Testing output files without time stamp"; run-task basic_tests/no_time_stamp --debug --show_thread_logs # Run git-diff to ensure no changes on the golden netlists -if git diff origin/main HEAD --name-status -- ':openfpga_flow/tasks/basic_tests/no_time_stamp/golden_output_no_time_stamp/**'; then +if git diff origin/master HEAD --name-status -- ':openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/**'; then echo -e "Golden netlist remain unchanged" else echo -e "Detect changes in golden scripts"; exit 1; From a9e6b7c12e9e1312f46f9a0e04fa28736a6824b9 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Tue, 25 Jan 2022 20:33:49 -0800 Subject: [PATCH 2/4] [FPGA-Bitstream] Remove version numbers when ``--no_time_stamp`` is enabled --- .../src/report_arch_bitstream_distribution.cpp | 3 ++- openfpga/src/fpga_bitstream/write_text_fabric_bitstream.cpp | 3 ++- openfpga/src/fpga_bitstream/write_xml_io_mapping.cpp | 3 ++- .../golden_outputs_no_time_stamp/bitstream_distribution.xml | 2 +- .../golden_outputs_no_time_stamp/fabric_bitstream.bit | 2 +- .../no_time_stamp/golden_outputs_no_time_stamp/pin_mapping.xml | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libopenfpga/libfpgabitstream/src/report_arch_bitstream_distribution.cpp b/libopenfpga/libfpgabitstream/src/report_arch_bitstream_distribution.cpp index 4446d1aac..b6bf66d96 100644 --- a/libopenfpga/libfpgabitstream/src/report_arch_bitstream_distribution.cpp +++ b/libopenfpga/libfpgabitstream/src/report_arch_bitstream_distribution.cpp @@ -33,11 +33,12 @@ void report_architecture_bitstream_distribution_xml_file_head(std::fstream& fp, fp << " diff --git a/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/fabric_bitstream.bit b/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/fabric_bitstream.bit index f7279bb7a..27263dd13 100644 --- a/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/fabric_bitstream.bit +++ b/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/fabric_bitstream.bit @@ -1,5 +1,5 @@ // Fabric bitstream -// Version: 1.0.3764-dev+dd400579-dirty +// Version: 1.0.3764-dev+4a89d175 // Bitstream length: 527 // Bitstream width (LSB -> MSB): 1 1 diff --git a/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/pin_mapping.xml b/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/pin_mapping.xml index 191a22ef8..6420c410d 100644 --- a/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/pin_mapping.xml +++ b/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/pin_mapping.xml @@ -1,6 +1,6 @@ From 23795d6474a30e63f58a9137c9383f8e18db37cd Mon Sep 17 00:00:00 2001 From: tangxifan Date: Tue, 25 Jan 2022 20:37:08 -0800 Subject: [PATCH 3/4] [Test] Update golden netlists --- .../golden_outputs_no_time_stamp/bitstream_distribution.xml | 1 - .../golden_outputs_no_time_stamp/fabric_bitstream.bit | 1 - .../no_time_stamp/golden_outputs_no_time_stamp/pin_mapping.xml | 1 - 3 files changed, 3 deletions(-) diff --git a/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/bitstream_distribution.xml b/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/bitstream_distribution.xml index 6197435bd..b734007e7 100644 --- a/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/bitstream_distribution.xml +++ b/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/bitstream_distribution.xml @@ -1,6 +1,5 @@ diff --git a/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/fabric_bitstream.bit b/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/fabric_bitstream.bit index 27263dd13..6bdd75fcb 100644 --- a/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/fabric_bitstream.bit +++ b/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/fabric_bitstream.bit @@ -1,5 +1,4 @@ // Fabric bitstream -// Version: 1.0.3764-dev+4a89d175 // Bitstream length: 527 // Bitstream width (LSB -> MSB): 1 1 diff --git a/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/pin_mapping.xml b/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/pin_mapping.xml index 6420c410d..934c68508 100644 --- a/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/pin_mapping.xml +++ b/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/pin_mapping.xml @@ -1,6 +1,5 @@ From 11e045992d765fb957fcad9c8b1e6f1aafd046f2 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Tue, 25 Jan 2022 21:24:10 -0800 Subject: [PATCH 4/4] [Test] Now only compare on the golden netlist changes to branch --- openfpga_flow/regression_test_scripts/basic_reg_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfpga_flow/regression_test_scripts/basic_reg_test.sh b/openfpga_flow/regression_test_scripts/basic_reg_test.sh index a062c3b76..9708fdaba 100755 --- a/openfpga_flow/regression_test_scripts/basic_reg_test.sh +++ b/openfpga_flow/regression_test_scripts/basic_reg_test.sh @@ -148,7 +148,7 @@ run-task basic_tests/explicit_multi_verilog_files --debug --show_thread_logs echo -e "Testing output files without time stamp"; run-task basic_tests/no_time_stamp --debug --show_thread_logs # Run git-diff to ensure no changes on the golden netlists -if git diff origin/master HEAD --name-status -- ':openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/**'; then +if git diff --name-status -- ':openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/**'; then echo -e "Golden netlist remain unchanged" else echo -e "Detect changes in golden scripts"; exit 1;