@@ -76,21 +76,43 @@ void compare_files(const std::string& output_fname, const std::string& golden_fn
76
76
REQUIRE (output_data == golden_data);
77
77
}
78
78
79
+ void copy_file (const std::string& src_fname, const std::string& dst_fname) {
80
+ std::ifstream src_file (src_fname, std::ios::binary);
81
+ std::ofstream dst_file (dst_fname, std::ios::binary);
82
+
83
+ REQUIRE (src_file.good ());
84
+ REQUIRE (dst_file.good ());
85
+
86
+ src_file.seekg (0 , std::ios_base::end);
87
+ size_t size = src_file.tellg ();
88
+ src_file.seekg (0 , std::ios_base::beg);
89
+
90
+ auto buf = std::unique_ptr<uint8_t >(new uint8_t [size]);
91
+ src_file.read ((char *)buf.get (), size);
92
+ dst_file.write ((char *)buf.get (), size);
93
+ }
94
+
79
95
TEST_CASE (" post_verilog" , " [vpr]" ) {
80
96
do_vpr_flow (" unconnected" , " unconnected" );
81
- compare_files (" unconnected_post_synthesis.v" , " test_post_verilog_i_unconnected_o_unconnected.golden .v" );
97
+ copy_file (" unconnected_post_synthesis.v" , " test_post_verilog_i_unconnected_o_unconnected.out .v" );
82
98
83
99
do_vpr_flow (" unconnected" , " nets" );
84
- compare_files (" unconnected_post_synthesis.v" , " test_post_verilog_i_unconnected_o_nets.golden .v" );
100
+ copy_file (" unconnected_post_synthesis.v" , " test_post_verilog_i_unconnected_o_nets.out .v" );
85
101
86
102
do_vpr_flow (" vcc" , " unconnected" );
87
- compare_files (" unconnected_post_synthesis.v" , " test_post_verilog_i_vcc_o_unconnected.golden .v" );
103
+ copy_file (" unconnected_post_synthesis.v" , " test_post_verilog_i_vcc_o_unconnected.out .v" );
88
104
89
105
do_vpr_flow (" gnd" , " unconnected" );
90
- compare_files (" unconnected_post_synthesis.v" , " test_post_verilog_i_gnd_o_unconnected.golden .v" );
106
+ copy_file (" unconnected_post_synthesis.v" , " test_post_verilog_i_gnd_o_unconnected.out .v" );
91
107
92
108
do_vpr_flow (" nets" , " unconnected" );
93
- compare_files (" unconnected_post_synthesis.v" , " test_post_verilog_i_nets_o_unconnected.golden.v" );
109
+ copy_file (" unconnected_post_synthesis.v" , " test_post_verilog_i_nets_o_unconnected.out.v" );
110
+
111
+ compare_files (" test_post_verilog_i_unconnected_o_unconnected.out.v" , " test_post_verilog_i_unconnected_o_unconnected.golden.v" );
112
+ compare_files (" test_post_verilog_i_unconnected_o_nets.out.v" , " test_post_verilog_i_unconnected_o_nets.golden.v" );
113
+ compare_files (" test_post_verilog_i_vcc_o_unconnected.out.v" , " test_post_verilog_i_vcc_o_unconnected.golden.v" );
114
+ compare_files (" test_post_verilog_i_gnd_o_unconnected.out.v" , " test_post_verilog_i_gnd_o_unconnected.golden.v" );
115
+ compare_files (" test_post_verilog_i_nets_o_unconnected.out.v" , " test_post_verilog_i_nets_o_unconnected.golden.v" );
94
116
}
95
117
96
118
} // namespace
0 commit comments