Hog v10.58.0
vivado.tcl
Go to the documentation of this file.
1 namespace eval Tools::Vivado {
2 
3  variable Manifest {
4  name "Vivado"
5  vendor "AMD/Xilinx"
6  Flows {
7  @CREATE {CreateProject}
8  @SYNTH {@CREATE Synthesize}
9  @IMPL {@SYNTH Implement}
10  @WORKFLOW {@IMPL GenerateBitstream}
11  @SIMULATE {@CREATE Simulate}
12  @CHECKSYNTAX {@CREATE CheckSyntax}
13  @RTL {@CREATE RtlAnalysis}
14  }
15 
16  Supports {
17  Synthesis 1
18  Implementation 1
19  Bitstream 1
20  Simulation 1
21  CheckSyntax 1
22  }
23  }
24 
25  proc IsActive {} {
26  if {[info commands version] eq ""} { return 0 }
27  set v [version]
28  return [expr {
29  [string first "Vivado" $v] == 0 ||
30  [string first "PlanAhead" $v] == 0
31  }]
32  }
33 
34 
35  proc Launch {} {
36  # Each tool should define how it passes context from tclsh to itself
37  # I think most can just pass the entire context dict as a tclarg, but
38  # something like vitis_unified will probably need to manpulate it to
39  # pass to python env.
40 
41  set script [Context::Get launch_script]
42  set before_tcl_script " -nojournal -nolog -mode batch -notrace -source "
43  exec -ignorestderr vivado -nojournal -nolog -mode batch -notrace -source $script -tclargs "-context" "[Context::GetFullContext]" >@ stdout
44  }
45 
46  proc Initialize {args} {
47  # Again, each tool will need to define how it processes the context passed from tclsh.
48  if {[llength $args] < 1} {
49  puts "Vivado::InitializeTool requires at least 1 argument (the context dict)"
50  return
51  } else {
52  if {[lindex $args 0] eq "-context"} {
53  set context_dict [lindex $args 1]
54  puts "Context: $context_dict"
55  Context::Load $context_dict
56  } else {
57  puts "Vivado::InitializeTool requires -context argument"
58  return
59  }
60  }
61  }
62 
63  proc CreateProject {} {
64  set project_name [Context::Get LaunchSettings project_name]
65  set top_path [Context::Get LaunchSettings top_path]
66  Msg Info "Creating Vivado project \"$project_name\" from $top_path"
67  }
68 
69  proc Synthesize {} {
70  Msg Info "Running synthesis..."
71  return "Done"
72  }
73 
74  proc Implement {} {
75  Msg Info "Running implementation..."
76  }
77 
78  proc GenerateBitstream {} {
79  Msg Info "Generating bitstream..."
80  }
81 
82  proc Simulate {} {
83  Msg Info "Running simulation..."
84  }
85 
86  proc CheckSyntax {} {
87  Msg Info "Checking syntax..."
88  }
89 
90  proc RtlAnalysis {} {
91  Msg Info "Running RTL analysis..."
92  }
93 
94 }