VisionSDK_UsecaseGen_UserGuide Vision SDK User Guide Usecase Gen

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 9

DownloadVisionSDK_UsecaseGen_UserGuide Vision SDK User Guide Usecase Gen
Open PDF In BrowserView PDF
VISION SDK
Use-Case Auto-Generation Tool
User Guide

Page 1 of 9

IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements,
improvements, and other changes to its products and services at any time and to discontinue any product or service without notice.
Customers should obtain the latest relevant information before placing orders and should verify that such information is current and
complete. All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard
warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except
where mandated by government requirements, testing of all parameters of each product is not necessarily performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and
applications using TI components. To minimize the risks associated with customer products and applications, customers should
provide adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask
work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are
used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such
products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under
the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is
accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an
unfair and deceptive business practice. TI is not responsible or liable for such altered documentation. Information of third parties
may be subject to additional restrictions.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service
voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business
practice. TI is not responsible or liable for any such statements.
TI products are not authorized for use in safety-critical applications (such as life support) where a failure of the TI product would
reasonably be expected to cause severe personal injury or death, unless officers of the parties have executed an agreement
specifically governing such use. Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of
their applications, and acknowledge and agree that they are solely responsible for all legal, regulatory and safety-related
requirements concerning their products and any use of TI products in such safety-critical applications, notwithstanding any
applications-related information or support that may be provided by TI. Further, Buyers must fully indemnify TI and its
representatives against any damages arising out of the use of TI products in such safety-critical applications.
TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are
specifically designated by TI as military-grade or "enhanced plastic." Only products designated by TI as military-grade meet military
specifications. Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is
solely at the Buyer's risk, and that they are solely responsible for compliance with all legal and regulatory requirements in connection
with such use.
TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI
products are designated by TI as compliant with ISO/TS 16949 requirements. Buyers acknowledge and agree that, if they use
any non-designated products in automotive applications, TI will not be responsible for any failure to meet such requirements.
Following are URLs where you can obtain information on other Texas Instruments products and application solutions:
Products
Amplifiers
Data Converters
DLP® Products
DSP
Clocks and Timers
Interface
Logic
Power Mgmt
Microcontrollers
RFID
RF/IF and ZigBee® Solutions

amplifier.ti.com
dataconverter.ti.com
www.dlp.com
dsp.ti.com
www.ti.com/clocks
interface.ti.com
logic.ti.com
power.ti.com
microcontroller.ti.com
www.ti-rfid.com
www.ti.com/lprf

Applications
Audio
Automotive
Broadband
Digital Control
Medical
Military
Optical Networking
Security
Telephony
Video & Imaging
Wireless

www.ti.com/audio
www.ti.com/automotive
www.ti.com/broadband
www.ti.com/digitalcontrol
www.ti.com/medical
www.ti.com/military
www.ti.com/opticalnetwork
www.ti.com/security
www.ti.com/telephony
www.ti.com/video
www.ti.com/wireless

Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2014, Texas Instruments Incorporated

Page 2 of 9

Table of Contents
1

Introduction ................................................................................................. 4

2

Requirements ............................................................................................... 4

3
3.1
3.1.1
3.1.2
3.1.3
3.2
3.3

Generating Use-Case files ............................................................................ 5
Configuration files ............................................................................................ 5
Usecase Name ................................................................................................. 5
Naming Of Link ................................................................................................ 5
Connections..................................................................................................... 5
Generating Files ............................................................................................... 6
Error Handling ................................................................................................. 6

4
4.1
4.2

Tool Development ........................................................................................ 7
Adding support for new link in the tool ................................................................ 7
Adding support for new Algorithm Plugin in the tool .............................................. 9

5

Revision History ........................................................................................... 9

Page 3 of 9

1

Introduction
Vision SDK Use-Case Auto Generation tool allows users to generate C code for Vision SDK usecases from configuration file.
This document explains procedure for writing configuration files and generating usecase files
This document assumes that the reader is familiar with basics of links and chains
architecture used in Vision SDK.

2

Requirements
Install the following to use Auto Generation tool:


Graphviz : Graphviz version 2.38.0 or higher
o

http://www.graphviz.org/Download.php

Install the below tools to compile and build the Auto Generation tool:
For windows,


Install
GCC
compiler
(v4.8.1
http://www.codeblocks.org/)



Install GNU Make (v3.81 or higher) for Windows (ex, “gmake” is available as
part
XDC
install
at
$(xdc_PATH)/gmake)
or
http://gnuwin32.sourceforge.net/packages/make.htm



Install bash shell in Windows via tool like https://msysgit.github.io/ or Cygwin



Flex : flex version 2.5.* or higher
o



or

higher)

for

Windows

(ex,

http://gnuwin32.sourceforge.net/packages/flex.htm

Bison : bison version 2.4.* or higher
o

http://gnuwin32.sourceforge.net/packages/bison.htm

Page 4 of 9

3

Generating Use-Case files
Generating Use-Case files involves:
1. Writing Configuration file
2. Generating files

3.1

Configuration files

3.1.1

Usecase Name
 Use-case name can be mentioned in configuration file. It is used as prefix in files generated
and struct and function names.
Example:
UseCase: chains_vipSingleCam_Display

3.1.2

Naming Of Link







3.1.3

Every link has a particular basename, i.e. all instances of a particular type of link starts with
basename. E.g.: All links of Capture type should start with basename Capture
Basename information is available in help option (./vsdk.exe -help)
A Link is named as Basename or Basename_suffix. For e.g Capture, Capture_1
Different instances of a particular link have same basename but different suffix, i.e.
Display_Video, Display_Grpx
If it is algorithm link it has to be named Alg__suffix. For e.g:
Alg_FrameCopy_xyz
In case link does not match any of the supported links an error will be shown.

Connections
 Grammar of Connections:
Connection : ID | ID -> Connection | ID ( [CPU] ) | ID ( [CPU] ) -> Connection


Example: Single camera display



Intermediate IPC are autogenerated. So, no need to mention in config file.
Example:

Above Configuration file generates IPC links, which makes overall connections:

Page 5 of 9

Capture -> IPCOut_IPU1_0_EVE1_0 -> IPCIn_EVE1_IPU_0_0 (EVE1) ->
Alg_EdgeDetect(EVE1) -> IPCOut_ EVE1_IPU1_0 _0 (EVE1)->
IPCIn _IPU_0_ EVE1_0 -> Display

3.2

Generating Files






3.3

To generate usecase files, type:
 ./vsdk.exe –file configFile
 This generates file in the folder where command is executed
To generate usecase files in an “output” folder, type:
 ./vsdk –file configFile –path ./output
To generate image along with file, type:
 ./vsdk –file –img configFile
Other options supported are:
 -help Shows help regarding supported cmd line options, links and CPU
 -v
Verbose

Error Handling
Error is handled in following cases:


Input file is not present



Wrong number of input or output is provided to a link



Link is assigned Invalid CPU or two different CPU



Naming of Link does not follow the rules, i.e. Basename, Basename_suffix

Page 6 of 9

4

Tool Development
This section describes how to extend the tool by modifying its source code.
If you are a user of the tool, then you can skip this section

4.1

Adding support for new link in the tool
To create a new Link class:
1. In link.h create new class in following format:
class LinkName: public Link {
~LinkName ();
public:
LinkName(string nm);
void genIncludes(ostream &fp);
void genLinkID(ostream &fp);
void genCreatePrms(ostream &fp);
void genResetLinkPrms(ostream &fp, string obj);
void genSetLinkPrms(ostream &fp, string obj);
int setInLink(Link* obj);
int setOutLink(Link* obj);
};
2. In processor.h, introduce extra enum in ClassType, cLinkName
3. Implement the functions in link.cpp file:
a. Constructor:
LinkName(string nm){
cType = cLinkName; //cType is classType which is set in Processor.h
name = nm;
linkIDName = name + string("LinkID");
prmName = name + string("Prm");
execPos = -1;
procID = -1;
pType = IPU1_0; //default processor type
mulInQue = false; //set to true if the link can have multiple input
mulOutQue = false; //set to true if the link can have multiple output
}
b. genIncludes: Include the header file where the link is implemented
void LinkName::genIncludes(ostream &fp) {
fp << "headerName.h"<< endl;
}
c.

genLinkID : Not required to change
void LinkName::genLinkID(ostream &fp) {
fp << BLOCK_SPACE << setw(10) << left << "UInt32" << linkIDName << ";"
<< endl;
}

Page 7 of 9

d. genCreatePrms : Modify LinkName _CreateParams with actual CreateParams struct
name
void LinkName::genCreatePrms(ostream &fp) {
fp << BLOCK_SPACE << setw(40) << left << " LinkName _CreateParams " <<
prmName<< ";" << endl;
}
e. genResetLinkPrms : Modify LinkName _CreateParams_Init function name
void LinkName::genResetLinkPrms(ostream &fp, string obj) {
fp << BLOCK_SPACE << " LinkName _CreateParams_Init(&" << obj << "->"
<< prmName << ");" << endl;
}
f.

setInLink : Leave the function as it is. Uncomment in case you want to introduce error if
number of incoming links exceeds maxIncoming. Also, replace maxIncoming with actual
number
int LinkName::setInLink(Link* obj) {
//CHECK_ERROR_ABORT(inLink.size() >= maxIncoming, "Error: "+name+" Link
//should not have more than “+maxIncoming+” ingoing links");
inLink.push_back(make_pair(obj, -1));
if(inLink.size() > 1)
mulInQue = true;
return (inLink.size() - 1);
}

g. setOutLink: Same rules as setInLink
int LinkName::setOutLink(Link* obj) {
//CHECK_ERROR_ABORT(outLink.size()
>=
maxOutGoing,
"Error:
//"+name+" Link should not have more than “+maxOutGoing +” outgoing links");
outLink.push_back(make_pair(obj, -1));
return (outLink.size() - 1);
}
h. genSetLinkPrms: Can set any parameters for the link
void LinkName::genSetLinkPrms(ostream &fp, string obj)
{
}
4. In processor.cpp getLinkID function, introduce an extra case in switch. Replace ID with LinkID
which needs to be assigned. Other switch cases serve as an example.
case cDecode:
linkIDName = ID;
linkIDAsgn[cType]++;
break;
5. In usecase.cpp in createNewObj function, include a new condition. Where “NewLinkBase” is the
base name and NewLink is the class created.
else if (root == "NewLinkBase")

Page 8 of 9

obj = new NewLink(name);
6.

4.2

In options.cpp in process_Options function, add a new text string for the newly added link. Where
“NewLinkBase” is the new link that is added
string usage =
…
" Supported Links: \n"
…
“ NewLinkBase\n”

Adding support for new Algorithm Plugin in the tool
To develop a new Algorithm:
th

1. Follow all the steps in developing new link above except 5 . Preferably name class as
Alg_LinkName
2. In processor.cpp getProcID introduce a new case to validate the CPU.
3. In usecase.cpp, in createNewObj function, include a new condition inside Alg condition.
e.g:
else if (root == "Alg") { //insert condition inside Alg Condition
string sec = getSecRoot(name);
if (sec == "NewLinkBase") //NewLinkBase is the base name of Alg link
obj = new Alg_NewLink(name); // Alg_NewLink is class of new Alg
}

5

Revision History
Version

Date

Revision History
rd

0.1

03 March 2016

0.2

29 June 2017

th

Draft
Updated for Vision SDK
rel 3.0

Page 9 of 9



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : No
Page Count                      : 9
Language                        : en-US
Tagged PDF                      : Yes
Title                           : VisionSDK_UsecaseGen_UserGuide
Author                          : TI
Creator                         : Microsoft® Word 2010
Create Date                     : 2017:07:05 14:58:07+05:30
Modify Date                     : 2017:07:05 14:58:07+05:30
Producer                        : Microsoft® Word 2010
EXIF Metadata provided by EXIF.tools

Navigation menu