Presented by Brian Griffin
On behalf of
Manu Goel
Mohit Goel
Nov 12th, 2014
Building a dynamic GUI, configurable at runtime by backend tool
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Mentor
Graphics Company Confidential
2
Agenda
Introduction Advantages Case Study Conclusion
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Mentor
Graphics Company Confidential
3
Agenda
Introduction Advantages Case Study Conclusion
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Mentor
Graphics Company Confidential
4
Introduction
What is a dynamic GUIDynamic GUI is a GUI which can change during the course of execution
What is a dynamic GUI configurable by backendIn this case, there is a backend process, which is controlling and configuring the GUI at the run time based on user’s input
A Dynamic GUI can help in cases where— A Lot of information is to be displayed— Only a small set of information is of use to user
at any point of time— Selecting some option can impact subsequent
options — New information can be added frequently
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Introduction
How can we build such a GUI?— Divide the GUI in two parts, frontend and backend— Frontend is the place
– Which will just display the information to user as passed by the backend
– Relies solely on the information supplied by the backend dynamically
– Does not store any information statically– Pass on the user inputs to backend to update the next set of
information to be displayed to user
— Backend is the place which –– Controls the information to be displayed to user– Understands the user selected options– Where new functionality is added
5
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
How does it work
6
Start
Fetch Relevant Info from backend
User Selection
Impacts subsequent option
More inputs
needed
Process Data
No
No
Yes
Yes
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Mentor
Graphics Company Confidential
7
Agenda
Introduction Advantages Case Study Conclusion
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Advantages
Flexible – Backend can change the data if needed Scalable – New functionality supported by backend
will be supported seamlessly on GUI side No or very minimal supported needed on
GUI(frontend) side. Only relevant information is available to user at all
the time GUI and backend can never be out of sync
8
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Mentor
Graphics Company Confidential
9
Agenda
Introduction Advantages Case Study Conclusion
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Case study
A GUI developed to configure and connect VIPs to enable them to be used with the DUT
Large number of VIPs are available to user
New VIPs are added frequently
To use these VIPs user needs to — Configure the VIP of interest based on the DUT— Connect the VIP with the DUT through the available pins
10
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Configuring the VIP
VIPs are standard protocol to test certain aspect of the DUT
These are generic in nature and can be used with any DUT
User need to set a large number of options(can be in 100s) to use them
Without a GUI user need to know the options names and their possible values
User also need to know the functionality of each such option
11
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Connecting the VIP and DUT
VIPs provides a set of pins through which user needs to connect the DUT
Large number of pins(mostly more than 50)
To connect the VIP and DUT, user need to know the names of these pins, direction, and size
12
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Complexity
Large number of VIPs
The option set is completely different for different VIPs
Selecting certain options can impact subsequent options
New VIPs are added frequently, so the solution should be scalable
Without a GUI, the task is tedious and error prone
13
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
User Expectations from GUI
Provide the list of all supported VIPs Assist in configuring the VIP Show all configuration options in a user
understandable format Provide the functionality of each option Provide the possible values any option can take Show the available pins in the VIP Assist in connecting the VIP with the DUT Perform error checking on the data provided by
user
14
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
User expectations(contd…)
Generate the configuration and connection file, which can be directly used.
GUI should support the newly developed VIPs Support multiple VIPs with a single DUT
15
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
POSSIBLE SOLUTIONS
16
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Possible solutions
Create a separate GUI for each VIP— Advantages
– User sees only the relevant set of information at all the times
– Easy to build— Disadvantages
– So many GUIs to be developed and maintained– Not scalable– Any change on any existing VIP by triggers the need for
change in the GUI as well– Error checking of user input is difficult
— Not the right solution because of development and maintenance effort
17
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Possible solutions
Create a single static GUI with all information for all VIPs— Advantage
– Single GUI to develop and maintain— Disadvantages
– User sees a lot of options which are of no interest to him– Any change on any existing VIP by triggers the need for
change in the GUI as well– Not scalable– Error checking of user input is difficult
— Undesirable solution because the GUI is not user friendly and displays a lot of irrelevant information
18
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Possible solutions
Build a dynamic GUI where GUI side does not store any information statically, and there is a backend which controls the GUI at runtime
— Advantages– GUI is not storing any information statically so is very thin– User sees only the relevant set of information at all the
times– Backend is free to change any of the information for any VIP– Scalable. New VIPs can be supported seamlessly– Very low or no maintenance effort– Error checking of user data is very easy
19
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Possible solutions(dynamic GUI…)
— Disadvantages– Backend needs to manage the data for each VIP(one time
effort)– Interfaces needs to be defined for communication between
frontend and backend(again one time effort)
The choice is simple between all above cases. Build a dynamic GUI, which can be controlled by backend at runtime
20
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
IMPLEMENTATION
21
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Implementation
Define a set of interfaces, through which frontend will communicate with backend
Define a syntax in which the data will be passed between backend and frontend
Backend has all the knowledge of -— All supported VIPs— Options required to be set for any VIP along with their
possible values— The functionality of each option— Pin connection details
GUI starts with no statically stored information GUI fetches every information dynamically as and
when needed
22
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Implementation
First step is to fetch the list of supported VIPs
23
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Implementation
The initial view will just have the list of VIPs, from where user can make a selection
24
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Implementation
Once user has selected the VIP, Configuration pane is available to user
Backend can divide the options in different categories, and GUI will show them in different tabs accordingly
25
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Implementation
This is the core of this algorithm The options tabs is a list of list, through which
frontend will know the different tabs to be created. To fetch the options details for each tab, a syntax
was defined using associative arrays and lists. Backend will provide information about— Option name in user understandable form— Type of option, i.e. is it a combo box, entry box etc— What possible values any option can take— Tooltip, to assist in understanding the functionality— Suffix details(if any)
GUI stores this information in an associative array in the same format as received by the backend for each tab
26
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Implementation
Once user fills up all the values or asks GUI to validate the information for correctness, the information is supplied exactly in the same format to backend making it easier to process the information
Once user asks to generate verilog files, the information for each tab will be passed to backend through a call for each tab
Backend would maintain the information for all the VIPs statically in associative array, where name of VIP will be the key.
27
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Implementation
Tooltip will assist user in understanding the functionality and possible values of any options
User can perform validation on the values specified
28
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Implementation
Once the options are set, user is ready to connect the VIP with his DUT
Default connections between DUT and VIP will be done
Direction and bus size is also available to user
29
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Implementation
User can edit the pin connections on the DUT side based on his design
30
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Implementation
Once user confirms the connection, verilog files can be generated through GUI
These verilog files can directly be used with the next set of tools to compile VIP and DUT together
If user wants to connect multiple VIPs to the single DUT, then can add following the same steps. Connection needs to be done in the end only
A syntax was defined using which the information will be exchanged between backend and frontend
In this case, the backend was also using Tcl, though backend can also be done in C if needed
31
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Mentor
Graphics Company Confidential
32
Agenda
Introduction Advantages Case Study Conclusion
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Conclusion
Dynamic GUIs controllable by backend can be handy in cases where –— We have a lot of information to be displayed, which can
be divided in different groups and each group is unrelated to the other
— User is interested in only one such group at a time— New information can be added frequently— We do not want to have a dedicated GUI team — GUI does not need to store/understand the information
statically
With the GUI we discussed, the task which would have taken a couple of days to perform can be done in less than 30 minutes
Makes user aware of all the VIPs supported by the tool
33
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.com
Conclusion
Provides with all the options needed to be set for using any VIP. It also helps in— Understanding the functionality of any option, otherwise
user may have to refer user manual again and again— Knowing possible set of values any option can take— Performing error checking which would have been very
difficult otherwise— Logically categorizing the options making it easier for
user to set them
Helps user in connecting the VIP with DUT by providing the default connection as expected by the VIP
Helps in connecting multiple VIPs to the same DUT Ensures that the generated files have all the valid
data saving a lot of time in debugging the issues otherwise.
34
© 2010 Mentor Graphics Corp. Company Confidentialwww.mentor.comYour Initials, Presentation Title, Month Year35