Skip to content

Commit

Permalink
getting closer...
Browse files Browse the repository at this point in the history
  • Loading branch information
billmcspadden-riscv committed Aug 5, 2022
1 parent b50c4ae commit b77c1b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions c_emulator/riscv_sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,13 @@ char *process_args(int argc, char **argv)
fprintf(stderr, "unable to build fast-yaml document from %s\n", optarg);
exit(1);
}
rv_cfg_dump_yaml_c(optarg);
break;

case 'u':
if ( rv_cfg_build_from_file(RV_CFG_ISA, optarg) == 0 ) {
fprintf(stderr, "unable to build fast-yaml document from %s\n", optarg);
exit(1);
}
rv_cfg_dump_yaml_c(optarg);
break;
case 'a':
report_arch();
Expand Down
8 changes: 4 additions & 4 deletions c_emulator/rv_cfg_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ rv_cfg_string_c(char * key_str)
continue;
}

printf("%s, %d: checking yaml file, %s\n", __FILE__, __LINE__, rv_cfg_enum2doc_a[i].filename);
//printf("%s, %d: checking yaml file, %s\n", __FILE__, __LINE__, rv_cfg_enum2doc_a[i].filename);
conversion_str = " %1023s";
tmp_str = malloc(strlen(key_str) + strlen(conversion_str) + 1);
strcpy(tmp_str, key_str);
strcat(tmp_str, conversion_str);
printf("%s, %d: scanf string: '%s'\n", __FILE__, __LINE__, tmp_str);
//printf("%s, %d: scanf string: '%s'\n", __FILE__, __LINE__, tmp_str);

count = fy_document_scanf(fyd, tmp_str, yaml_val_string);
if (count == 1)
Expand All @@ -195,7 +195,7 @@ rv_cfg_string_c(char * key_str)
ret_str_ptr = malloc(strlen(yaml_val_string)); // TODO: where should this be freed?
strcpy(ret_str_ptr, yaml_val_string);
//fy_emit_document_to_fp(fyd, FYECF_DEFAULT | FYECF_SORT_KEYS, stdout);
return(yaml_val_string);
return(ret_str_ptr);
}
free(tmp_str);
}
Expand Down Expand Up @@ -235,7 +235,7 @@ int
rv_cfg_string(sail_string **s, char * yaml_key_str)
{
printf("%s, %d: entering rv_cfg_string()\n", __FILE__, __LINE__);
*s = rv_cfg_string_c(yaml_key_str);
s = rv_cfg_string_c(yaml_key_str);
return(1);
}

Expand Down

0 comments on commit b77c1b2

Please sign in to comment.