diff options
author | Prashanth Mundkur <prashanth.mundkur@gmail.com> | 2018-06-22 15:16:33 -0700 |
---|---|---|
committer | Prashanth Mundkur <prashanth.mundkur@gmail.com> | 2018-06-22 17:46:59 -0700 |
commit | 3175ee126d529aa9d94fa2289f80850f40a993cf (patch) | |
tree | ffdf643b9e543a8e8da1d80a5a042963543e30e2 /platform_impl.ml | |
parent | 453b8aa899ffa12f32e23fce60c5ba9843ba755d (diff) | |
download | sail-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.ml | 11 |
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"; *) |