diff options
| author | Prashanth Mundkur | 2018-06-22 15:16:33 -0700 |
|---|---|---|
| committer | Prashanth Mundkur | 2018-06-22 17:46:59 -0700 |
| commit | c3b10065d3918be2d63cf12612ac00b59b02640b (patch) | |
| tree | fe4064375189fcc05cc6daef7de5a6f8f8f02c8a /riscv/platform_impl.ml | |
| parent | d50d0283aa85abf3911fc57fc9b3f2f1900e067a (diff) | |
Add cli options to riscv simulator to dump platform device-tree info.
Diffstat (limited to 'riscv/platform_impl.ml')
| -rw-r--r-- | riscv/platform_impl.ml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/riscv/platform_impl.ml b/riscv/platform_impl.ml index 0902877a..aab272f8 100644 --- a/riscv/platform_impl.ml +++ b/riscv/platform_impl.ml @@ -154,13 +154,18 @@ let rec term_read () = (* todo: handle nbytes == 0 *) Bytes.get buf 0 +(* Platform diagnostics *) + +let show_bytes s = + output_string stdout s + +let dump_dts () = show_bytes dts +let dump_dtb () = show_bytes (bytes_to_string (make_dtb dts)) + (* let save_string_to_file s fname = let out = open_out fname in output_string out s; close_out out;; -let _ = - save_string_to_file dts "/tmp/platform.dts"; - save_string_to_file (bytes_to_string (get_dtb dts)) "/tmp/platform.dtb"; *) |
