![]() |
![]() |
![]() |
E.7 pLUGINS+ Scripts
There are two types of plugins scripts: scripts which are used for creating SNiFF+ projects for pSOSystem+ and scripts which integrate pmanager with SNiFF+/pSOSystem+.
E.7.1 Scripts to Create SNiFF+ Projects for pSOSystem
These scripts exist in the
$PSS_ROOT/bin/source/plugins/scripts
directory. They run on Unix in the Bourne Shell and on Windows in the mks shell. These scripts are shipped with pSOSystem+ and can be used to facilitate the creation of SNiFF+ projects that have a complex code directory structure. These scripts (with some changes, if needed) automate the creation of a SNiFF+ project for the inclusion of the project's code. A project created using these scripts works on Unix as well as Windows platforms.plugins_create_proj
Given a file list, relative to
PSS_ROOT
, this script creates a SNiFF+ project. It creates the main SNiFF+ project in the directory where the first file of the list exists. Since SNiFF+ does not support files from different directories in a single project, this script creates projects for every directory in the list. These projects are added to the main project as subproject.By default, the PDF (Project Description File) file of the main project has the name
'basename MAIN_PROJ_DIR'.shared
. The remainder of the PDF files have the name'basename project_dir'_
<TAG>
.shared
, whereTAG
is the basename of the main project directory. An alternative name for the main project can be specified using-n <main_proj_name>
option, wheremain_proj_name
is the name of the main project without the extension. An alternativeTAG
name can also be specified using-t
<TAG>
option.By default, the lists of files are read from the
.snifffl.lst
file from the current directory. Alternatively,-f
<filename>
option can be used to specify a filename.Option
-p <ProjectTemplateName>
specifies the project template to be used in the Project Template Directory of SNiFF+ (default:$SNIFF_DIR/config/project
).Usage:
plugin_create_proj [-f <filename> ] [-n <main_proj_name>] [-t <TAG>] -p <ProjectTemplateName>
The script assumes that SNiFF+ is running (session0).
When creating SNiFF+ projects for the pSOSystem, the directory attribute of the
'Project Description'
FileType
in the preferences file is set tosniffprj
. As a result, project PDFS files are created under thesniffprj
subdirectory of the main project directory.plugins_create_app
This script uses the
plugins_create_proj
andplugins_add_target
scripts and creates a SNiFF+ project for a pSOSystem+ application. It first creates the main project using theplugins_create_prj
script. It then adds generic pSOSystem+ projects and bsp projects to the main project and if referred to by the application, it also adds drivers projects.This script modifies the application project to use the
PSS_BSP
environment variable to refer to bsp projectsbsp.shared
andbsp_src.shared
. The application project is also modified to add the build targets (ram.elf, ram.axf, ram.BD, etc.
, for example).This script modifies the application makefile by adding a make target for the BSP library
These templates are to be found in
$(PSS_BSP)/bsp.lib
for CAD-UL Compiler$(PSS_BSP)/libbsp.$(BSP_TYPE)
for ARM Compiler$(PSS_BSP)/libbsp.a
for DIAB Compiler and all other Compilers$PSS_ROOT/bin/source/plugins/scripts/apps_makefile*.add
.The
plugins_create_all
script is used to create pSOSystem application projects. To use plugins_create_app in stand-alone mode to create an application project the following must apply:
- SNiFF+ should already be running (session0)
- The script should be invoked from the application dir
- The application directory should contain the
.snifffl.lst
file.plugins_create_all
This is the master script which creates SNiFF+ projects for the entire pSOSystem+. The following must be setup before you start this script:
- The environment variables
PSS_ROOT
,PSS_BSP
andSNIFF_DIR
are set.PSS_BSP
can be set to any valid bsp. This is used when creating application projects. The references to the BSP is changed to use$PSS_BSP
.- The
$SNIFF_DIR/bin
directory is in the path.PSS_ROOT
contains.snifffl.lst
files.This script creates the following SNiFF+ projects:
When a project contains files only from a single directory and all the files from that directory go into the project, no file list is needed to create the project. In this case a SNiFF+ project created by default, will be accurate.
The
include.shared
andsys_os.shared
files need to have the automatic add and remove property for files because files under these directories depend upon what components of pSOSystem are installed.The pSOSystem projects are generated using project templates. These templates are located in
$SNIFF_DIR/config/project
and have the namepRISM-<ProjectType>-Project.ptmpl
,
where <ProjectType> is one of:
- Bsp
- Bsp-Src
- Config-Std
- Drivers
- Include
- PSS_Main-Appl
- Standard-Apps
- Sys-LibC
- Sys-OS
- User-Apps
The following scripts are used by
plugins_create_all
:
plugins_add_target
plugins_create_proj
plugins_create_app
plugins_clean_all
plugins_clean_all
This script deletes all the SNiFF+ projects and
.sniffdir
from$PSS_ROOT
. It can be used to restore the pSOSystem to its previous state in the event thatplugins_create_all
script fails to complete properly.plugins_switch_CMVC_tool
This script selects the CMVC (Configuration Management/Version Control tool) for all projects used under SNiFF+ in pRISM+. These projects use the project templates stored in
$SNIFF_DIR/config/project
. The script replaces the CMVC tool setting against one of the installed ones. The first parameter is the name of the new CMVC tool.
After the use of this script, you must call the scriptsniffproj_rebuild.ksh
to regenerate all the pSOSystem/pRISM+ projects.Usage:
plugins_switch_CMVC_tool <CMVC tool name>
E.7.2 Integration scripts
These scripts integrate pRISM+ Manager with SNiFF+/pSOSystem.
plugins_open_proj
This script is invoked by the pmanager when user selects File>New>SNiFF+>`Start from the pSOSystem sample application'. This script is also invoked when the SNiFF+ button is pressed for an existing pRISMSpace. It opens an existing SNiFF+ project in the user's PWE. It takes the project directory name as the input parameter and looks for the SNiFF+ project file under this directory using the following order:
This script maps the pSOSystem variable
$PSS_BSP
from being absolute to being relative to the Working Environment. This is needed for file sharing and file overriding in SNiFF+.Usage:
plugins_open_proj
<dir_name>
plugins_create_uproj
This script is invoked by the pmanager when user selects File>New>SNiFF+>`Start from an existing code base'. It creates a SNiFF+ project (recursively) for the given directory. The directory should be a subdirectory of
$PSS_USER_SSWE
. This script then opens the project in user's PWE. This script also addsrelinkable_obj_name
as a relinkable target for the SNiFF+ project.This script maps the pSOSystem variable
$PSS_BSP
from being absolute to being relative to the Working Environment. This is needed for file sharing and file overriding in SNiFF+.The following scripts are used by
plugins_create_uproj
:
plugins_convert_proj
plugins_add_target
For further details on
plugins_convert_proj
refer to the next section.Usage:
plugins_create_uproj
<prj_dir> [<relinkable_obj_name>]
plugins_convert_proj
This script is invoked from the script
plugins_create_uproj
. It converts a SNiFF+ project to the pSOSystem application projectpss_main.shared
.
It performs the following:
- Creates the
pss_main
directory under the project directory and copies the templatesys_conf.h
,drv_conf.c
and makefile underpss_main
from the$PSS_ROOT/apps/snf_tmpl_$CPU_FAMILY
directory.- Extracts the relinkable object name from the project description file.
- Modifies the
pss_main
makefile to definePSS_APPOBJS
to a relinkable object and adds a rule for it.- Sets all files in the project
pss_main
and the user's subprojects to read-only.- Creates a SNiFF+ project for
pss_main
and adds pSOSystem generic projects to it as subprojects. It also adds the project being converted as the subproject of this project.The following script is used by
plugins_convert_proj
:
plugins_add_target
Usage:
plugins_convert_proj
<proj_name>
plugins_add_target
This script modifies a SNiFF+ project to add pSOSystem target names. These targets are then displayed by SNiFF+ under PE>Target>Make menu. The list of targets are hard coded in this script and should be changed whenever there is a change in targets defined in
config.mk
.Usage:
plugins_add_target
<project_name>
plugins_create_bsp
This script creates SNiFF+ projects for a custom BSP. These projects are required to integrate custom BSPs into pRISM+. The BSP should be located under
$PSS_ROOT/bsps
and should follow the standard pSOSystem BSP format, (<custom_bsp>
/src
source format). Before you invoke this command you would need to create a file containing a list of files which make this BSP. The default name of this file is.snifffl.lst
and should exist under<custom_bsp>
/src
.First file name in this file should be from
<custom_bsp>/src
. An example can be found in one of the standard BSPs. This script createsbsp_src.shared
under$PSS_ROOT/bsps/<custom_bsp>/src/sniffprj
andbsp.shared
under$PSS_ROOT/bsps/<custom_bsp>/sniffprj
and assumes that the pRISM+ environment setup the makefile derived from pSOSystem BSP makefile.The following scripts are used by
plugins_create_bsp
:
plugins_create_proj
plugins_add_target
Usage:
plugins_create_bsp
<bsp_dir>
[
-f
<file_list_file>
]
Where
bsp_dir
is$PSS_ROOT/bsps/
<custom_bsp>
plugins_edit_file
This script opens a file in the SNiFF+ source editor. It assumes that SNiFF+ is running with
session0
and one of the open projects contains this file. This script is typically used with SDS to replace its editor with SNiFF+ SE. User should alias _edit toOn Unix:
alias
_edit
'plugins_edit_file
\!:2
\!:1'
On PC:
alias
_edit
'sh
-f
plugins_edit_file
\!:2
\!:1'
This can be done in SDS command window or in the
sstep.ini
file. Output of this script (such as errors) is displayed in the SDScmd
window.Usage:
plugins_edit_file
<filename> [<linenumber>]
plugins_pwizard
solaris/plugins_pwizard
,hpux/plugins_pwizard
, orwin32/plugins_pwizard.bat
are invoked by SNiFF+ as a result of a double click on thesys_conf.h
file. This script invokes pRISM+ wizard on thesys_conf.h
file.Usage:
plugins_pwizard
<full path to sys_conf.h>
psosmake
This is a wrapper to the actual make command and is host specific. There are three different scenarios in which make is called:
- make using pSOSystem makefile in a Non-SNiFF+ environment
- make using pSOSystem makefile in a SNiFF+ environment
- make using SNiFF+ generated makefile.
This wrapper, depending upon the make situation, calls the appropriate make commands.
The environment detection checks for the existence of the environment variablePSS_ABS_PWE_BSP
. If yes, the variablePSS_BSP
gets the absolute path copied from$PSS_ABS_PWE_BSP
.
The SNiFF+ makefile detection checks for the existence of the string "_XX_SNIFF_GEN_MAKEFILE_SIGN_XX_" in the makefile. If detected, the SNiFF+gmake
command is called. If not, the pSOSystemmake
command is called to create the Compiler and Linker options and then called again for the desired target.Usage:
psosmake
[<target_name>]
E.7.3 Startup scripts
plugins_remove_duplicates
This script removes the entries in the file to be modified (usually the file
.snifffl.lst
). These entries are found twice in a pSOSystem project, which has to prevented.
A BSP comes with two projects:There is a reference file, containing the entries to be removed fron the file to be modified. This reference file is
- bsp.shared and
- bsp_src.shared
$SNIFF_DIR/integrations/pRISM2.0/pRISM2.0/remove_from_snifffl.lst
and contains:where "XbspnameX" is replaced by the real BSP name found in the first entry of the file to be modified.
- bsps/XbspnameX/README
- bsps/XbspnameX/readme.txt
- bsps/XbspnameX/bsp.mk
- bsps/XbspnameX/bsp.h
- configs/std/snf_gnu.mk
Usage:
plugins_remove_duplicates <file to be modified> <file containing entries to be removed>
plugins_patch_makefiles
This script patches the makefiles in the directories:
$PSS_ROOT/drivers
$PSS_ROOT/bsps
$PSS_ROOT/devices
The references to the variablesare replaced by references to the variables
$(PSS_ROOT)/include
$(PSS_ROOT)/bsps
$(PSS_ROOT)/drivers
$(PSS_ROOT_FOR_SNIFF_PWE)/include
$(PSS_ROOT_FOR_SNIFF_PWE)/bsps
$(PSS_ROOT_FOR_SNIFF_PWE)/drivers
Usage:
plugins_patch_makefiles
plugins_upgrade_siteprefs
This script updates the preferences definitions file
SitePrefs.sniff
in the directory$SNIFF_DIR
. It is called at installation time only.The following script is used by
plugins_upgrade_siteprefs
:
plugins_change_prefs
Usage:
plugins_upgrade_siteprefs <full path to sys_conf.h>
plugins_upgrade_userprefs
This script updates the preferences definitions file
UserPrefs.sniff
. It is called from the startup script (On Windowsenv$CPU_FAMILY.ksh
, on UNIXenvv$CPU_FAMILY.csh
orenvv$CPU_FAMILY.sh
- On Windows, the preferences for all users are stored in
$SNIFF_DIR/Profiles/<username>/UserPrefs.sniff
or individually for each user in$SNIFF_RESOURCE_DIR/UserPrefs.sniff
.- On UNIX, the preferences are stored individually for each user in
$SNIFF_RESOURCE_DIR/UserPrefs.sniff
.The following script is used by
plugins_upgrade_userprefs
:
plugins_change_prefs
Usage:
plugins_upgrade_userprefs
plugins_change_prefs
This script changes a preference file and prints the result to standard out. To prevent this file from subsequent changes, a signature is appended to the file: "SNiFF32_pRISM20_Integration". When this signature is found, no changes take place!
The following keywords are touched:
- LocalExecutable set to "
$SHELL
"- DefaultWorkingEnv set to "
adm PWE:$CPU_FAMILY-Private
"- WorkingEnvDir set to "
$PSS_ROOT/workingenvs/SNiFF3.2_pRISM2.0/$CPU_FAMILY"
- SHELLOPT set to "
-i
"- PlatformDefault set to "
${COMP_TOOL}${CPU_FAMILY}_${HOST}
"Usage:
plugins_change_prefs
<full path to the preference file>
![]() |
![]() |
![]() |