-
Notifications
You must be signed in to change notification settings - Fork 19
Examples
[TOC]
This section is provided to help user become more familiar with Tincr and its capabilities by presenting common tasks and showing to how accomplish them using the Tincr API.
All of the examples listed in this section assume that you have a device loaded in Vivado. Before beginning any of these examples, first open Vivado. You can either start the GUI or run Vivado from a command prompt (make sure Vivado's bin directory is on your path):
vivado -mode tcl
If you are using the GUI, place your cursor in the Tcl Console window at the bottom of the application (where it says "Type a Tcl command here"). Now that Vivado's Tcl console is open, the Tincr packages need to be imported (Tincr must be installed first):
package require tincr
The Tcl interpreter will return the version of Tincr that is installed. Next, we will create an empty design. Enter the following:
::tincr::designs new demo xc7k70tfbg484-3
The xc7k70tfbg484-3 part will be used in all examples in this section. If you do not have this device install, feel free to try another part. If you are running any of the included scripts, you will need to update the part in each script.
The Tincr distribution includes a folder of demo scripts. Each of these demos can be run by entering the following in a Windows command prompt:
vivado -mode tcl -source %TINCR_PATH%\demos\<demo>.tcl
If you are on another OS, adjust the backslashes and dereferencing characters accordingly.
In Vivado, a node is a section of wire that originates and terminates in any of the following:
- Another node
- A programmable interconnect point (PIP)
- A site pin
For example, you can have a node that starts from a PIP and ends at a site pin.
Being able to traverse nodes quickly and easily is crucial to the implementation of any FPGA routing tool. This example shows you how you can use Tincr to find the set of nodes that are reachable from a given node in X number of "hops". A "hop" refers to the traversal of a PIP between two nodes, in the direction of the flow of data across that PIP. In other words, the set of nodes that are 1 hop away from a given node are all nodes that are sourced by a PIP that is sourced by the given node.
If you don't already have a device loaded in Vivado, please follow the instructions at the beginning of this page.
First, we need to select a starting node. In the Tcl command prompt, type the following:
set node [get_nodes INT_L_X14Y66/EE4BEG3]
This command gets a handle to the node named INT_L_X14Y66/EE4BEG3 and assigns it to the node variable.
Alternatively, if you are working from the GUI, you can select a node from the Device window. First, click on a node to highlight it, and then enter the following:
set node [get_selected_objects]
If you cannot see any nodes in the Device view, ensure the "Routing Resources" toggle button is selected (on the left side of the window).
Getting a set nodes N hops away from the node chosen earlier can be done using the command
::tincr::nodes hops $node N
where N
should be replaced with any number. This will return a list of nodes that can be reached from $node
in N hops. To select all these nodes in the GUI Device view, you can wrap the above command with the select_objects
command like so:
select_objects [::tincr::nodes hops $node 3]
If the GUI isn't already open, you will need to call the start_gui
command first.
Tincr includes a script demonstrating the nodes hop capability: hop_nodes.tcl