Summary of VDEES

 
Embedded products are becoming more feature rich. Embedded system developers use design and testing tools to make their products faster. However, tool improvements have not kept pace with the rapid development of customized hardware parts. The simulation of target system or virtual platform helps developers of embedded software for consumer electronics work without having to wait for the physical hardware to be available. In this work, we designed and implemented a Virtual Development Environment for Embedded Software (VDEES). This environment provides the tools to build a virtual platform according to a given target hardware specification and to develop software to run on the target hardware with the virtual platform. VPDE is implemented at low cost by exploiting open source software packages and extended or customized them to meet our requirements. VDEES provides a configuration tool for composing a virtual target, a code editor for writing simulated components, software to be run on the target, building tools for binary images, a debugger for investigation of the software running on the virtual target, and a system monitor for the investigation of the virtual target.

A Deployment of VDEES on Ubuntu 10.04

Dear Readers,

We just had some deployment on Ubuntu 10.04 (Lucid Lynx), and the process didn't come up smoothly. Some additional configuration should be made. Furthermore, library support for the newer tool was like incompatible with the auto generated script we have made with the VDEES IDE. Here are some notes we need to inform in order to get VDEES work as it should.

 

Install CDT Plugin

We used two the official packages of Eclipse, the most recent ones, with code name Helios and Galileo. At the very beginning, during installation we found out that package "org.eclipse.cdt.core" was not available. We can then add new site to the Software Update section as:

http://download.eclipse.org/tools/cdt/releases/<code name>

For example : "http://download.eclipse.org/tools/cdt/releases/galileo" .

Put a check mark on the "Eclipse C/C++ Development Tools" package, and then install it. CDT plugin will be added, and then you can install the VDEES plugin afterwards.

 

Install aclocal

You can do it through Synaptic Package Manager in Ubuntu, or using YasT for example in another platform. Search for "automake" package, and it will install the aclocal, automake, and autoconfig library.

 

Install libtool 1.5.22

We found out that the most recent one of libtool is version 2.2.6b. However, the compilation for custom component didn't work well. It was related with the compatibility of libtool macro used. The simplest solution we did was downgrading the version to 1.5.22. We uninstalled the recommended version, and replaced it with the older one, downloaded from http://packages.ubuntu.com/dapper/i386/libtool/download .

Those are our recent attempt on VDEES, hope it helps.

Regards,

VDEES Packages Local Install

Dear Reader,

VDEES Package for 4 Plugins of VDEES are now available for download in Download page:

VDEES Binary Image Builder Package (VDEES_Binary_Builder.zip) 264.17 KB
VDEES Component Builder (VDEES_Component_Builder.zip) 282.82 KB
VDEES Configuration Builder (VDEES_Configuration_Builder.zip) 275.88 KB
VDEES Monitor (VDEES_Monitor.zip) 254.33 KB

 

You also have to download Ronetix arm-tools to get all the functionality works. here.
We hope you can try and give some input to us.

Regards,
Admin

 

 

 

 

 

 

 

 

 

 

 

Download Page Updated

Dear Readers,

 

The Download page is updated, containing documents of VDEES and installation package download. You can click here .

 

Regards,

Administrator

VDEES : Component Relation example

When we got confused how to affect other components directly in runtime or you want to make one component accessing a private attribute in other component, then "relate" is a good option to do it. It is actually not recommended because accessing directly the other component can make it highly coupled among them. As it will be harder to be reused in the future. However, it is sometimes is a must when we face a feature to update others component attributes and other low level function of SID in runtime.

The author met a problem that require a "relate". The problem is when there are two windows, the lcd display window and touch screen window. These windows should be integrated, so user wil be able to click a precise location on the lcd window. The problem is, how to integrate the functionality of "mouse-click" event to the lcd window. The problem is solved by passing a string that will be evaluated as tcl-script in the lcd component on runtime. The string it self contains events and attribute modification to the originating component (in this case the touch screen component).

Here is the example of the code for relate, in this case is placed on the lcd component:

#relating
proc relate {relation component} {

global comp


if { $relation == "comp" } then {
catch {unset comp}

set comp $component

return "ok"

}

return "not_found"
}

roc unrelate {relation component} {
global comp


if { $relation  == "comp" } then {
unset comp
return "ok"
}
return "not_found"
}
#relate

There you can see there is already variable "comp" prepared as global variable to store the component reference. In the configuration file of SID, the function is simply called by the "relate" keyword. Here is the line of relating component:

#relation between display and touch screen component
relate display comp touchS

In the above example, the display component (lcd display) is given a relation or reference to the touchS component (touch screen). The relation name is called "comp". That is why in the previous relate and unrelate function there is a checking for relation name .. if { $relation  == "comp" } ... .

By having this relationship, the display component can make a low level command of SID. For example, accesing attributes, drive pins, write and read buses. The calling of the function of other component can be done in runtime, as when something trigger the lcd window by the a click, then it can forward the event to the touch screen component through attribute setting of clicked point of its. Here are the code on the set attribute in the touch screen component.

...

#list of available attributes names
set attributes_names [list "width" "height" ]

...

proc set_attribute_value {attr value} {
global attributes attributes_names
#special relation
global xp_pin yp_pin down_pin


#for private attributes, just in relation with other component
if { $attr == "xp_pin" } then {
sid::pin::driven_h4 $xp_pin $value
}
if { $attr == "yp_pin" } then {
sid::pin::driven_h4 $yp_pin $value
}

if { $attr == "down_pin" } then {
sid::pin::driven_h4 $down_pin $value
}

#regular attributes
if { [lsearch -exact $attributes_names $attr] >= 0} {
set attributes($attr) $value

#refresh updated configuration
refreshState

return "ok"

}

return "not_found"

}

...

In the above code, the xp_pin, yp_pin, and down_pin is not listed in the attribute list. At the setting of those attributes, instead of saving the value, it driven the value to the suitable pins. And by not showing it in the attribute list, the variables are kept to be private, and can only be accessed by related components.

And there is one more code that makes the lcd component is "touchable" and able to deliver it's clicked point to the touch screen component. It is done by passing a code through attribute setting when the relate keyword is executed on the configuration file.

...

proc relate {relation component} {
global scr

if { $relation == "scr" } then {
catch {unset scr}
set scr $component
#wm title . $relation
puts "set scr $component"

#hide the window
wm withdraw .

#set the display by calling the get attribute value
puts "settting variable"
set c [sid::component::attribute_value $scr canvas]

#################start embed event on canvas###########################
set a "
bind $c <ButtonPress-1> {
global comp

sid::component::set_attribute_value \$comp \"xp_pin\" %x
sid::component::set_attribute_value \$comp \"yp_pin\" %y

#0 is down
sid::component::set_attribute_value \$comp \"down_pin\" 0

#updateRegister
}

bind $c <B1-Motion> {
global comp

sid::component::set_attribute_value \$comp \"xp_pin\" %x
sid::component::set_attribute_value \$comp \"yp_pin\" %y

}

bind $c <ButtonRelease-1> {
global comp
#1 is up
sid::component::set_attribute_value \$comp \"down_pin\" 1

}"

sid::component::set_attribute_value $scr "eval" $a

###################end embed event on canvas###########################

return "ok"
}

return "not_found"

}

proc unrelate {relation component} {
global scr

if { $relation  == "scr" } then {
unset scr
#wm title . "unassociated"
return "ok"
}

return "not_found"

}

...

 

The binding event is attached to the display window by the relate function. And here is the code in the display component side:

proc set_attribute_value {attr value} {
variable attributes
...

if {$attr == "eval"} then {

eval $value
return "ok"
}
...
}

And don't forget to relate it in the configuration file :

relate touchS scr display

So, there it is the example of "relate" in SID. Hope it will be useful.

Tips On Creating Tcl/Tk-based Component

We usually need to make new GUI components using Tcl/Tk. It is because Tcl/Tk provides an easy GUI scripting compared to C++ . We can make user friendly interface easily complete with the mouse and keyboard event handling.

There are functions should be implemented on Tcl/Tk-based Components. The list can be seen in the source code of the bridge-tcl.tcl and bridge-tk.tk :

proc attribute_names_in_category {cat} { return [list] }
proc attribute_names {} { return [list] }
proc pin_names {} { return [list] }
proc relationship_names {} { return [list] }
proc bus_names {} { return [list] }
proc accessor_names {} { return [list] }
proc attribute_value {name} { return "" }

However, implementing each of them could took plenty of resource to write the same thing over and over. There are some point that can be optimized on each function. We can store attributes in an array that has word as the key. For example :

#declare variable
variable attributes
#set variable initial values
set attributes(height) 320
set attributes(width) 240

And then when we are going to used it, instead of using if else control like this :

proc set_attribute_value {attr value} {
global attributes

if {$attr == "width" } {
set attributes["width"] $value
return "ok"
}
if {$attr == "height" } {
set attributes["height"] $value
return "ok"
}
return "not_found"
}

we can use the search command to find the right index :

#contains list of attributes names
set attributes_names [list "width" "height" ]

proc set_attribute_value {attr value} {

global attributes attributes_names

if { [lsearch -exact $attributes_names $attr] >= 0} {
set attributes($attr) $value
return "ok"
}
return "not_found"
}

By that, the code will be shorter and more efficient. We can change the code easily when the new attributes is added, just need to add in the attributes_names list the name of the new attribute.

For retrieving the list of attributes name is easier too. Instead of writing :

proc attribute_names_in_category {cat} {
if { $cat == "setting" } then  {
return [ list "width" "height" ]
}
return [list]
}

We just need to write :

proc attribute_names_in_category {cat} {
global attributes_names
if { $cat == "setting" } then  {
return $attributes_names
}
return [list]
}

So when the new attributes added, no change has to be made on this part. Providing a better consistent code. The search is also implemented on retrieving the value of desired attribute.

This optimization using list of available names of attributes can be implemented too on the list of available pins and buses. Using list of names that can be searched through. I hope it will be useful.

Just reminder for myself and you, the keyword "global" should be written on the beginning of the procedure, because instead of creating a new local variable, it will try to find the global variable outside the procedure. The "global" keyword is needed to share the same variable reference across the code.

VDEES Custom Component Tutorial

Here is a brief tutorial to make new component for in the VDEES.

First we create a new Project from the menu. Select in the VDEES group, the SID Custom Component Wizard, then click next.

 

Select Project Type

 

Give name to the new Project, for this example we use "TouchScreen". Then click Finish.

Create Project Name

 

A new Folder will be created in the left sid of the window "TouchScreen". Inside the folder there is "src" folder containing source files and configuration. There are three main file that need to be modified to create a new component:

1. Makefile.am

It contains configuration on compilation using "make" command in linux. This files will create output file "Makefile.in" . Here is the content of the Makefile.am. For further info you could open here explains about Makefile.am .

note : "#" mark is the escape character for commenting.

 

## Process this with automake to create Makefile.in

#####update#########
by: author
date: 2008-01-08
####################

AUTOMAKE_OPTIONS = foreign

#The name of the component file that will be created
pkglib_LTLIBRARIES = ADC_TS_Contoller.la

#path to the files needed to be includid for compilation
INCLUDES = -I. -I/home/febi/lat_comp/sid/build/include -I/home/febi/lat_comp/sid/src/include -I

#Information about the source filenames and configuration, change the filename based on you preference
#For meanwhile just use the default values for LDFLAGS

ADC_TS_Contoller_la_SOURCES = ADC_TS_Controller.cxx
ADC_TS_Contoller_la_LDFLAGS = -module -no-undefined

 

##end of file##

 

2. configure.in

The file contains commands and conditions to predict the invironment of the host system. The configure.in file will create "configure" file that is a portable shell script that is required to do compilation, deciding what environment exists and what resources and commands are available. For further information about the configure.in you can go here . Here is the part of the file that you should modify.

note: "dnl" word is for commenting in the code

 

dnl start of file dnl

dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.in)

dnl AC_CONFIG_AUX_DIR(../../sid/src/sid/config)
dnl This part need to be configured based on the real path existed in the system
AC_CONFIG_AUX_DIR(../../../../../../home/bowo/sid/src/sid/config)
AM_INIT_AUTOMAKE(sidcomp,0.1)
AM_CONFIG_HEADER(config.h:config.in)

dnl Default prefix, it is volatile depends on the project setting
dnl Modify as a place you will place the binary file from compilation
AC_PREFIX_DEFAULT(/home/febi/lat_comp)

...

...

dnl end of file dnl

 

3. C++ source file in this image named "ADC_TS_Controller.cxx"

 

There will be an empty file created, but you can copy paste the content of other available components. Or you can read the comprehensive tutorial here to write the code for the new component. As mention there, you should know first what buses, pins, and registers needed by the component, don't have to be the same as the real component, you just need to make required and simpler ones.

 

Custom Component Code

 

 

At the very first time you created the project, a building project process will occur. It will create binary files and place it in the destination default folder. If the folder doesn't exist or can not be created, then error will occur, but you just need to update the path to the right folder. The destination folder for binary is configured in "configure.in" file.

 

Compiler Output Information

 

The output file will occur in the desired folder. In this example the folder is "/home/febi/lat_comp/lib/sidcomp/" .

 

File output

We hope you can have some information here. If there is any question please contact us at havban at gmail dot com .

Source Code Download Link and Repository Link added -- source code update

The source code access for VDEES can be downloaded in the download page. There are some adjustment shoulds be made after importing the code into eclipse SDK, about the plugin needed and pre-installed SID.

 

There are updates on the VDEES source code:

1. The Make install command is configured to install on user predefined folder, not the default folder of SID plugin

2. The interface for configuration file wizards transformed into Tree view

Component Select Configuration editor

Component Select Configuration editor

Feature

  • Configuration Virtual Platform
  • Develop new Component
  • Extends CDT : Virtual Component Builder
  • Develop software with a real target platform
  • Debug Software
  • Build Image , extends CDT : Image Builder
  • Monitor the virtual platform
  • Syndicate content