File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ These are optional paths that can be enabled at commandline. They allow for a mo
24
24
| ` --debug dot-latency-problem ` | Dot debug the problem graph for latency counting in ` solve_latencies_problem.dot ` |
25
25
| ` --debug dot-latency-solution ` | Dot debug the solution graph for latency counting in ` solve_latencies_solution.dot ` |
26
26
| ` --debug dot-latency-infer ` | Dot debug the problem graph for latency inference in ` latency_inference_problem.dot ` |
27
+ | ` --debug dot-png ` | Use ` dot -Tpng ` to create a png file from generated dot files (Can be surprisingly slow, prefer svg) |
28
+ | ` --debug dot-svg ` | Use ` dot -Tsvg ` to create a svg file from generated dot files |
27
29
| ` --debug lsp-debug ` | Instead of regular LSP hover info, provide raw debug info |
28
30
| ` --debug TEST ` | Temporary marker for debugging |
29
31
Original file line number Diff line number Diff line change @@ -35,10 +35,10 @@ fn unique_file_name(
35
35
Ok ( ( file, path) )
36
36
}
37
37
38
- fn try_convert_dot_to_image ( dot_path : & std:: path:: Path ) {
39
- let output_path = dot_path. with_extension ( "svg" ) ;
38
+ fn dot_command ( dot_path : & std:: path:: Path , file_name : & str ) {
39
+ let output_path = dot_path. with_extension ( file_name ) ;
40
40
match std:: process:: Command :: new ( "dot" )
41
- . arg ( "-Tsvg" )
41
+ . arg ( format ! ( "-T{file_name}" ) )
42
42
. arg ( dot_path)
43
43
. arg ( "-o" )
44
44
. arg ( & output_path)
@@ -62,6 +62,15 @@ fn try_convert_dot_to_image(dot_path: &std::path::Path) {
62
62
}
63
63
}
64
64
65
+ fn try_convert_dot_to_image ( dot_path : & std:: path:: Path ) {
66
+ if crate :: debug:: is_enabled ( "dot-svg" ) {
67
+ dot_command ( dot_path, "svg" ) ;
68
+ }
69
+ if crate :: debug:: is_enabled ( "dot-png" ) {
70
+ dot_command ( dot_path, "png" ) ;
71
+ }
72
+ }
73
+
65
74
pub fn display_generated_hardware_structure ( md_instance : & ModuleTypingContext < ' _ > ) {
66
75
let ( mut file, path) = unique_file_name ( & md_instance. name , "hw_structure" ) . unwrap ( ) ;
67
76
write ! ( file, "{}" , custom_render_hardware_structure( md_instance) ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments