how to create a Tcl file in Vitis - tcl

I am trying to learn how to create the TCL file from Vitis so I can use it to re-create the same project later.
I have done the same in Vivado, but Vitis seems different.
how can I re-create a project by using TCL or any other file in Vitis?
platform create -name {signal_fpga_06_09}\
-hw {/home/tahaalar/Downloads/Project/***_fpga-master#691d2d3b3bd/design_sources/firmware/processor_file/signal_fpga_06_09.xsa}\
-out {/home/tahaalar/workspace/re_gen_yeb}
platform write
domain create -name {standalone_microblaze_0} -display-name {standalone_microblaze_0} -os {standalone} -proc {microblaze_0} -runtime {cpp} -arch {32-bit} -support-app {empty_application}
platform generate -domains
platform active {signal_fpga_06_09}
platform generate -quick
I have some start lines to create the the project but where can I find the other commands for adding the sources and build the project and so on?.
Am I on the write path or Do I have to do something else to generate the TCL file?

Related

how to implement a exec command in tcl?

It is possible to call other programs from Tcl using the Tcl exec function. Let’s use this
command to create a Tcl script that will take all of the Tcl code you have written so far and
create a single PDF from it. The filename of the single PDF file should be TCL CODE.pdf.
Recall that the Tcl foreach command makes it very easy to go through a list of items.
You should use the exec command to call the Linux program called enscript to produce
a postscript file for each of the Tcl files. You should then use the Linux program called
ps2pdf to turn each of the postscript files into a PDF. Finally, merge all of the PDFs using
the Linux program called gs (short for ghostscript). Invoke ghostscript using the following
command
Some documentation
Tcl documentation
the exec man page
Tcl tutorial
the wiki entry for exec

How to open a window in Vivado using Tcl script?

I'd like to open a .vhd and .vhi file in window for editing in Vivado from Tcl Console, but I can't find any command for that.
As of at least Vivado 2014.2 any unrecognized Tcl command will be sent to the OS shell for execution, so you can simply open whatever editor you like as if you were not in the Tcl shell. It basically automatically runs exec for you. Older versions you may have to run exec yourself.
eg
nedit file.vhd
Vivado being a design tool works on projects instead of individual files. So to edit a file, say xyz.vhd, the file needs to be part of a project. This can be done through Tcl console by creating a new project, adding xyz.vhd file to it and then loading the project.
Create a new project using the following command:
project -new
Add files:
add_file -vhd "xyz.vhd"
Save the project and run.
project -save
project -run
You can find further resources at this link.

Installing JSON.pm on a web host without shell access

My host (iPage) does not have JSON.pm installed. I don't want to use the modules they have installed (XML) in order to transfer data from a CGI script back to a web page. Is there anyway that I can use JSON without them installing it on Perl?
The reason I ask is because I noticed when I downloaded the JSON zip that I had to run a makefile json.pm command but I don't have access to a Unix shell or a SSH terminal.
If your Perl is new enough, 5.14 and up, it will come with JSON::PP, a pure Perl implementation of the JSON parser. Confusingly it does not come with JSON.pm. So try use JSON::PP and see if it works.
Otherwise, follow Ilmari's instructions. If you switch to a host with shell access, you can use local::lib to manage CPAN modules.
You should be able to install a local copy of the pure Perl version of the JSON module without shell access. Just download the .tar.gz archive to your own computer, unpack it and copy everything under the lib subdirectory to a suitable location on your webhost.
You'll also need to tell Perl where to find the module, for which you need to know the filesystem path to which you copied the module. For example, if you copied the contents of the lib directory to /home/username/perl-lib on your webhost, then you would include in your code the lines:
use lib '/home/username/perl-lib';
use JSON;
Depending on how your webhost is configured, you might also be able to use $ENV{HOME} to obtain the path to your home directory, so that you can write:
use lib "$ENV{HOME}/perl-lib";
use JSON;
or you could try using the FindBin module to find the path to the directory containing your script, and locate the lib directory from there (see the example in the FindBin documentation).

Browser-based app framework for Ruby

I've a ruby script running out of the command line. I want to provide a local GUI for it (for my use). As I have some exposure to Sinatra and other web frameworks, I want to use HTML pages as my front-end. But I don't want to start a server and type in a URL every time I want to launch my app.
My solution would be to write a shell script which will start a Sinatra based server and then launch Chromium(Browser) in app mode to that url.
Is there some framework which can do it better/cleaner?
I'm not interested in learning a non-HTML framework like Shoes or Ruby-Gnome2.
#!/bin/sh
ruby $1 &
chromium localhost:4567
Put that somewhere in your $PATH (or change it to contain $HOME/bin with export PATH=$HOME/bin:$PATH and put it there), make it executable with chmod +x <file> and have fun by calling <file> <sinatra startup file>
You could extend this to read the port from Sinatra, but that would require a ruby startup, and this should do in most of the cases (the 80%, as people call it).

The Simplest Steps to Converting TCL TK to a Stand Alone Application

After running into major compatitiblity problems with C#, ASP.NET, MS Access, Linux, and Mono, I've decided to program in a language that is cross-platform, open source, and compatible with embedded databases that are also compatible with many platforms. I narrowed my choice down to TCL.
Before I began a sample application with TCL, I wanted to see how easy it was to create a stand alone application. I purchased a book entitled "Practical Programming in TCL and TK", downloaded TCLkit, and FreeWrap, yet I am having troubles finding a methodological way to convert TCL in TK (Wish) into a standalone application.
Would anyone be able to provide simple steps towards converting a TCL TK script, such as a label with text on it, into an application, or a web resource that has a pretty straight forward explanation?
To build a starpack you need a) a tclkit runtime, b) sdx.kit. You also need a "basekit", the executable that will be wrapped with your tcl code. For this example I'll assume you're creating an application for the same platform you are running on. You can create a basekit by simply copying tclkit (or tclkit.exe on windows) to another name, such as "basekit"
% ls
sdx.kit tclkit
% cp tclkit basekit
% ls
basekit sdx.kit tclkit
Now, create the code that you want to have wrapped into an executable. The convention is to create a directory with the name of your app and the suffix ".vfs" (for 'virtual file system'), then create a file named 'main.tcl' in that directory:
% mkdir myapp.vfs
% cat > myapp.vfs/main.tcl
package require Tk
label .l -text "Hello, world"
pack .l
^D
% ls myapp.vfs
main.tcl
Now to do the wrapping: for this you'll need the sdx.kit file. Assuming it and tclkit (or tclkit.exe) are in your current working directory, you wrap your app like this:
% ./tclkit sdx.kit wrap myapp -runtime basekit
1 updates applied
% ls
basekit myapp myapp.vfs sdx.kit tclkit
The wrap command knows when you give it the argument "myapp" that it should wrap the contents of myapp.vfs, and that it should look for a file named "main.tcl" in that directory to be the program entry point. You can put whatever other files you want in that directory and they will all be wrapped, including platform-specific binary files, image files and anything else you want bundled up.
You now have an executable file, 'myapp', that is the wrapped application.
If you have the tclkits for different architectures you can use them (replacing 'basekit' on the command line with the kit for the target architecture) to cross-compile for other platforms.
For more information see How to create my first Starpack on the Tcl'ers Wiki
kitgen build system may also help you at the beginning.