Skip to content

Commit 1d39cdb

Browse files
author
Arthur Brown
committed
Write README; Add Initial XSCT Scripts
1 parent d8e5ba3 commit 1d39cdb

File tree

3 files changed

+112
-0
lines changed

3 files changed

+112
-0
lines changed

README.md

+62
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,64 @@
11
# digilent-vitis-scripts
22
Set of scripts for managing Vitis workspaces with git.
3+
4+
## Glossary
5+
* XSCT = Xilinx Software Command-Line Tool
6+
* XSA = Xilinx Shell Architecture, handoff file including all relevent data from a Vivado design, including address maps, instantiated IP, etc.
7+
* TODO
8+
9+
10+
----
11+
## Quick Guide
12+
13+
TODO: Simple instructions for cloning and checking out a repository using this as a submodule
14+
15+
Repositories using this submodule should be cloned recursively (`git clone --recursive <URL>`), or recursively initialized and updated, if already cloned non-recursively (`git submodule update --init --recursive`).
16+
17+
When launching Vitis, whether through Vivado's Tools menu, or on its own, the workspace should be specified as the parent repository's sw/workspace folder.
18+
19+
Individual scripts present in this repository can be run through the use of XSCT, which is built into Vitis. This tool can be opened from the Vitis GUI through the *Xilinx > XSCT Console* option in the menu bar at the top of the window. Upon launch, XSCT's current working directory is set to the Vitis install directory. To recreate the workspace, the following sequence of commands is recommended:
20+
21+
`cd [getws]; source ../scripts/create_workspace.xsct.tcl`
22+
23+
**Note:** *The current working directory is irrelevant to the functionality of the scripts in this submodule. The cd command is used only to simplify the path used in the source command.*
24+
25+
----
26+
## File Structure
27+
28+
The parent repository must contain all Vitis-related information in one directory, which will be referred to as `sw`. This folder must contain the following:
29+
30+
* `workspace` - Working directory for the local repository.
31+
* `scripts` - digilent-vitis-scripts, this submodule.
32+
* `workspace_info.xsct.tcl` - Script for the Xilinx Software Command-Line Tool that contains information about the workspace not handled by source files.
33+
* `handoff/*.xsa` - Single handoff file, as exported from Vivado. Used to recreate the platform project.
34+
* `app/<app name>/<sources>` - Application project sources for each application project present in the workspace.
35+
* `bsp/<domain name>/*.mss` - MSS files for each domain present in the (single) platform project.
36+
* `lib` - *Placeholder* directory intended for submodule libraries depended upon by applications in the workspace.
37+
38+
Several notes must be made about this model and its current implementation:
39+
- Multiple application projects are not currently handled. This is a high priority issue.
40+
- It does not currently handle modified FSBL sources or BIF files.
41+
- Several settings are not able to be automatically resolved, requiring that the workspace_info script be manually edited - particularly the application project's language and template .
42+
43+
----
44+
## Scripts
45+
### create_workspace.xsct.tcl
46+
47+
Populates the parent repository's sw/workspace folder with a Vitis Workspace using sources and information pulled from the parent repository.
48+
49+
----
50+
### config_workspace.xsct.tcl
51+
#### Intent
52+
53+
Pulls changes to sources without symlinks from version control into the workspace.
54+
55+
#### Current Implementation
56+
57+
Updates the platform based on the XSA file and each domain based on the corresponding MSS files.
58+
59+
----
60+
### checkin_workspace.xsct.tcl
61+
62+
Not yet implemented.
63+
64+
Writes a mostly-complete workspace_info.tcl script into the parent repository, collects and copies workspace sources and configuration files into the parent repo's sw directory. Writes a template gitignore into the parent repo's sw directory.

config_workspace.xsct.tcl

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This script reconfigures each workspace component represented in the repo source files
2+
# If it is desired to only reconfigure specific components, then it is recommended to
3+
# use associated GUI flows.
4+
5+
# set variables specific to the repo
6+
set script_dir [file normalize [file dirname [info script]]]
7+
set sw_dir [file dirname $script_dir]
8+
source [file join $sw_dir "workspace_info.vitis.tcl"]
9+
10+
platform active $platform_name
11+
platform config -updatehw $xsa_file
12+
puts "updated platform $platform_name from XSA $xsa_file"
13+
14+
set orig_domain [domain active]
15+
16+
foreach mss_file $mss_files {
17+
set domain_name [file tail [file dirname $mss_file]]
18+
domain active $domain_name
19+
domain config -mss $mss_file
20+
puts "configured domain $domain_name from $mss_file"
21+
}
22+
23+
domain active $orig_domain

create_workspace.xsct.tcl

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# set variables specific to the repo
2+
set script_dir [file normalize [file dirname [info script]]]
3+
set sw_dir [file dirname $script_dir]
4+
source [file join $sw_dir "workspace_info.vitis.tcl"]
5+
6+
# create a single hardware platform
7+
platform create -name $platform_name -hw $xsa_file -proc ps7_cortexa9_0 -os standalone
8+
platform generate $platform_name
9+
puts "platform $platform_name created"
10+
app create -name $app_name -template $app_template -proc $app_proc -platform $platform_name -domain $app_domain -lang $app_lang
11+
puts "application project $app_name created"
12+
puts "system project ${app_name}_system created"
13+
# note: addsources may have an additional flag that allows it to use a link.
14+
# this is currently unimplemented in this script
15+
importsources -name $app_name -path $app_sources -linker-script
16+
17+
# save current active domain
18+
set orig_domain [domain active]
19+
20+
foreach mss_file $mss_files {
21+
set domain_name [file tail [file dirname $mss_file]]
22+
domain active $domain_name
23+
domain config -mss $mss_file
24+
puts "configured domain $domain_name from $mss_file"
25+
}
26+
# restore original active domain
27+
domain active $orig_domain

0 commit comments

Comments
 (0)