Skip to content

Commit da54968

Browse files
committed
fix simulation directory missing trailing slash
1 parent cc84bb4 commit da54968

File tree

4 files changed

+39
-11
lines changed

4 files changed

+39
-11
lines changed

ODIN_II/SRC/odin_ii.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ OTHER DEALINGS IN THE SOFTWARE.
6969
#include "vtr_path.h"
7070
#include "vtr_memory.h"
7171

72-
#define DEFAULT_OUTPUT "temp/"
72+
#define DEFAULT_OUTPUT "temp"
7373

7474
size_t current_parse_file;
7575
t_arch Arch;

ODIN_II/SRC/simulate_blif.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,28 +344,28 @@ sim_data_t *init_simulation(netlist_t *netlist)
344344

345345
// Open the output vector file.
346346
char out_vec_file[128] = { 0 };
347-
odin_sprintf(out_vec_file,"%s%s",((char *)global_args.sim_directory),OUTPUT_VECTOR_FILE_NAME);
347+
odin_sprintf(out_vec_file,"%s/%s",((char *)global_args.sim_directory),OUTPUT_VECTOR_FILE_NAME);
348348
sim_data->out = fopen(out_vec_file, "w");
349349
if (!sim_data->out)
350350
error_message(SIMULATION_ERROR, 0, -1, "Could not create output vector file.");
351351

352352
// Open the input vector file.
353353
char in_vec_file[128] = { 0 };
354-
odin_sprintf(in_vec_file,"%s%s",((char *)global_args.sim_directory),INPUT_VECTOR_FILE_NAME);
354+
odin_sprintf(in_vec_file,"%s/%s",((char *)global_args.sim_directory),INPUT_VECTOR_FILE_NAME);
355355
sim_data->in_out = fopen(in_vec_file, "w+");
356356
if (!sim_data->in_out)
357357
error_message(SIMULATION_ERROR, 0, -1, "Could not create input vector file.");
358358

359359
// Open the activity output file.
360360
char act_file[128] = { 0 };
361-
odin_sprintf(act_file,"%s%s",((char *)global_args.sim_directory),OUTPUT_ACTIVITY_FILE_NAME);
361+
odin_sprintf(act_file,"%s/%s",((char *)global_args.sim_directory),OUTPUT_ACTIVITY_FILE_NAME);
362362
sim_data->act_out = fopen(act_file, "w");
363363
if (!sim_data->act_out)
364364
error_message(SIMULATION_ERROR, 0, -1, "Could not create activity output file.");
365365

366366
// Open the modelsim vector file.
367367
char test_file[128] = { 0 };
368-
odin_sprintf(test_file,"%s%s",((char *)global_args.sim_directory),MODEL_SIM_FILE_NAME);
368+
odin_sprintf(test_file,"%s/%s",((char *)global_args.sim_directory),MODEL_SIM_FILE_NAME);
369369
sim_data->modelsim_out = fopen(test_file, "w");
370370
if (!sim_data->modelsim_out)
371371
error_message(SIMULATION_ERROR, 0, -1, "Could not create modelsim output file.");
@@ -3115,7 +3115,7 @@ static int verify_output_vectors(char* output_vector_file, int num_vectors)
31153115

31163116
// Our current output vectors. (Just produced.)
31173117
char out_vec_file[128] = { 0 };
3118-
odin_sprintf(out_vec_file,"%s%s",((char *)global_args.sim_directory),OUTPUT_VECTOR_FILE_NAME);
3118+
odin_sprintf(out_vec_file,"%s/%s",((char *)global_args.sim_directory),OUTPUT_VECTOR_FILE_NAME);
31193119
FILE *current_out = fopen(out_vec_file, "r");
31203120
if (!current_out)
31213121
error_message(SIMULATION_ERROR, 0, -1, "Could not open output vector file.");

ODIN_II/verify_odin.sh

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,39 @@ function sim() {
248248
#build commands
249249
mkdir -p $DIR
250250

251-
verilog_command="./wrapper_odin.sh --log_file ${DIR}/synthesis.log --test_name ${TEST_FULL_REF} --failure_log ${global_synthesis_failure}.log --time_limit ${TIME_LIMIT} ${USING_LOW_RESSOURCE}"
252-
verilog_command="${verilog_command} ${DEFAULT_CMD_PARAM} ${arch_cmd} -V ${verilog_file} -o ${blif_file} -sim_dir ${DIR}/"
251+
verilog_command="\./wrapper_odin.sh \
252+
--log_file ${DIR}/synthesis.log \
253+
--test_name ${TEST_FULL_REF} \
254+
--failure_log ${global_synthesis_failure}.log \
255+
--time_limit ${TIME_LIMIT} \
256+
${USING_LOW_RESSOURCE} \
257+
${RUN_WITH_VALGRIND}"
258+
259+
verilog_command="${verilog_command} \
260+
${DEFAULT_CMD_PARAM} \
261+
${arch_cmd} \
262+
-V ${verilog_file} \
263+
-o ${blif_file} \
264+
-sim_dir ${DIR}"
265+
253266
echo "${verilog_command}" > ${DIR}/cmd_param
254267

255268
if [ "_$use_sim" == "_1" ]
256269
then
257-
simulation_command="./wrapper_odin.sh --log_file ${DIR}/simulation.log --test_name ${TEST_FULL_REF} --failure_log ${global_simulation_failure}.log --time_limit ${TIME_LIMIT} ${USING_LOW_RESSOURCE}"
258-
simulation_command="${simulation_command} ${DEFAULT_CMD_PARAM} ${arch_cmd} -b ${blif_file} -sim_dir ${DIR}/"
270+
271+
simulation_command="./wrapper_odin.sh \
272+
--log_file ${DIR}/simulation.log \
273+
--test_name ${TEST_FULL_REF} \
274+
--failure_log ${global_simulation_failure}.log \
275+
--time_limit ${TIME_LIMIT} \
276+
${USING_LOW_RESSOURCE} \
277+
${RUN_WITH_VALGRIND}"
278+
279+
simulation_command="${simulation_command} \
280+
${DEFAULT_CMD_PARAM} \
281+
${arch_cmd} \
282+
-b ${blif_file} \
283+
-sim_dir ${DIR}"
259284

260285
if [ "_$with_input_vector" == "_1" ] && [ "_$REGENERATE_BENCH" != "_1" ]; then
261286
simulation_command="${simulation_command} -t ${benchmark_dir}/${test_name}_input"
@@ -429,6 +454,9 @@ function parse_args() {
429454
fi
430455
shift
431456
;;
457+
--valgrind)
458+
RUN_WITH_VALGRIND="--valgrind"
459+
;;
432460

433461
--test)
434462
if [ "_$TEST_TYPE" != "_" ]

ODIN_II/wrapper_odin.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ do
156156
;;
157157

158158
--valgrind)
159-
VALGRIND_EXEC="valgrind"
159+
VALGRIND_EXEC="valgrind --leak-check=full"
160160
;;
161161

162162
*)

0 commit comments

Comments
 (0)