aboutsummaryrefslogtreecommitdiff
path: root/platform_impl.ml
diff options
context:
space:
mode:
authorPrashanth Mundkur <prashanth.mundkur@gmail.com>2018-06-22 15:16:33 -0700
committerPrashanth Mundkur <prashanth.mundkur@gmail.com>2018-06-22 17:46:59 -0700
commit3175ee126d529aa9d94fa2289f80850f40a993cf (patch)
treeffdf643b9e543a8e8da1d80a5a042963543e30e2 /platform_impl.ml
parent453b8aa899ffa12f32e23fce60c5ba9843ba755d (diff)
downloadsail-riscv-3175ee126d529aa9d94fa2289f80850f40a993cf.zip
sail-riscv-3175ee126d529aa9d94fa2289f80850f40a993cf.tar.gz
sail-riscv-3175ee126d529aa9d94fa2289f80850f40a993cf.tar.bz2
Add cli options to riscv simulator to dump platform device-tree info.
Diffstat (limited to 'platform_impl.ml')
-rw-r--r--platform_impl.ml11
1 files changed, 8 insertions, 3 deletions
diff --git a/platform_impl.ml b/platform_impl.ml
index 0902877..aab272f 100644
--- a/platform_impl.ml
+++ b/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";
*)