Monday, April 4, 2016

GeoTime: Android App showing Actual Time Difference Between Two Cities [Sunrise Time Difference]

Features of GeoTimeApp:

  • Shows Actual Time Difference and Time Zone difference between two Cities  
  • Having Inbuilt Offline Database of more than 20,000 Cities of the World  
  • Shows other information about Cities like Location Co-Ordinates [Longitude and Lattitude], Time Zone Name, Time Zone Value, Country Code, ISD Code  
  • User can select any City available in the database"

What is Actual Time Difference:

  • Lets take example of two Indian Cities. Ahmedabad and Kolkata.
  • Both belong to same Time Zone which is 'Asia/Kolkata [5:30]'. So, as per Time Zone, there is no difference in time between these two cities.
  • But, if you go to Kolkata, you will notice that there Sun rises approx. 1 Hour earlier than Ahmedabad.
  • So, if Sun rises at 6:30 AM in Ahmedabad, it will rise at 5:30 AM in Kolkata. This is Actual Time Difference.
  • Most people, experience this but they don't have information about this Actual Time difference. Mostly, time difference data between two Cities is available as per Time Zone.
  • This App show this Actual Time Difference between Two Cities !!!"

GeoTime App Snapshots






































Download GeoTime App

  • This App will work fine with Android Version 4.0.3 [IceCreamSandwich] or Higher 

Monday, April 21, 2014

Published Articles


CPAN.org: Perl GUI Builder


Simplifying SoC Verification by communicating between HVL Env and processor

 

Before I describe a way to simplify SoC verification, let me clarify what do I mean by SoC. SoC, System on Chip, means a chip which is having different design blocks integrated together, in which the main controlling block is the Processor (Proc). The Proc in SoC will have access to most or all blocks in the chip to control them.

 

Now, if we need to verify SoC, we have to deal mostly with Proc because most of the things will be controlled by it. We need to initialize/configure registers of different blocks, configure DMA channels for data transfer, handle interrupts and other kinds of exceptions, etc. using Proc only. When we say, we have to do all these things using Proc that means, we need to write C or Assembly Language code which will be converted to hex code (machine code), which Proc can execute.

 

Since we have to do most of the things in C or Assembly Language, strength of verification will become very limited because we can’t use powerful features of HVL like SystemVerilog (SV), Vera, etc.

 

Someone might argue that we can use PLI or DPI (of SV) for directly calling C from SV and vice versa. But, you might already know that PLI or DPI is going to make simulation very slow which can’t be afforded if you are verifying a very big chip. Also, Proc might not support syntaxes which are required to use DPI. In case of ARM Proc (which supports very limited set of instructions), it doesn’t even support all syntaxes of C language.

 

As an alternate way, we can implement our own communication mechanism between Proc and HVL env which is faster than PLI/DPI and flexible also. Since we are developing it on our own, we can customize it as per our requirement.

 

Using this new mechanism,

  1. We can read/write any register or memory location which can be accessible by Proc (C code), using SV.
  2. We can pass valuable information back and forth from Proc to HVL Env and vice versa, to achieve synchronization between the two. This will be very useful in generating complex SoC scenarios.

 

From now onwards, we will term this mechanism as SV-C (SystemVerilog-C) mechanism.

 

Following shows the block diagram for SV-C mechanism.

Figure 1.   SV-C Architecture Diagram

 

In this mechanism, we will have set of memory locations, which will act as communication medium between C code (Proc) and SV code. These memory locations should be very near to Proc so that it can access them with minimum amount of latency. Time that Proc takes to access these locations determines the speed of this mechanism. For faster access, we can map these locations in DTCM (Data side Tightly Coupled Memory) of Proc or nearest cache memory available to Proc. One more thing, this memory should also be accessible to SV using backdoor.

 

We will use three words (32-bit) of this memory for CMD_LOC, ADDR_LOC and DATA_LOC. These locations are used to pass register/memory read/write request/data to/from Proc/SV.

  1. CMD_LOC will be used to pass Read, Write and Done command from SV to Proc and Sync command from Proc to SV.
  2. ADDR_LOC will be updated by SV to pass address value of register to be read/written using Proc. Any address value can be provided which Proc can access.
  3. DATA_LOC will be updated by SV to pass ‘Data to be written’ in case of Write Command. And it will be updated by Proc to pass ‘Read Data’ in case of Read Command.

We will have SV-C Interrupt Service routine written in Proc to understand and execute the requests made by SV. SV will also have set of tasks/functions to request read/write access to registers using Proc.

 

Now, let’s look at how the flow works.

  1. SV code will update CMD_LOC, ADDR_LOC and DATA_LOC locations as per the requirement using backdoor and generates Interrupt to Proc.
  2. Once Interrupted, Proc executes SV-C Interrupt Service routine and executes the things requested from SV.
  3. Once done with execution, Proc updates CMD_LOC with Sync Command, which indicates completion of request to SV code.
  4. By this time, SV code was waiting for CMD_LOC to be updated by Proc with Sync command.
  5. Once SV receives Sync Command in CMD_LOC, it ensures that Write/Read request, it made earlier, is executed by Proc. After this, it can take read data from DATA_LOC in case of Read request.
  6. Proc continues to execute SV-C Interrupt Service Routine until it gets Done Command in CMD_LOC.
  7. When SV no longer need to access any register, it will update CMD_LOC with Done Command and de-asserts the interrupt.
  8. Once interrupt is de-asserted, Proc comes out of SV-C Interrupt service routine and executes its main code.

 

Following state machine depicts details for Read Command execution.

 

 

Figure 2.   SV-C Read State Machine

 

This explains how we can access any address (register or memory) which is accessible to Proc, using SV.

 

Now, while generating different SoC test scenarios, you might need to pass information from Proc (C code) to SV and vice versa. You can achieve this by using SV-C Stat Locations as depicted in Block Diagram.

 

  1. SV will write these locations using backdoor to pass information to Proc. Proc will read them and get the information from SV.
  2. Proc will write these locations and SV will read them using backdoor to get information from Proc.

One can reserve one of the Stat Location for Synchronization between SV and Proc to know when to get the information. So when this Stat Location is updated with specific pattern, which is agreed upon by Proc and SV code, Proc/SV can read Other Stat Locations to get the information.

 

For example, consider one of test scenario requires SV code to determine how much cycle spent in DMA transfer, so it can calculate the throughput of the transfer. In this case, when Proc gets transfer completion interrupt from DMA, we can read cycle counter register and updates one of Stat Location with particular pattern and other Stat Location with cycle counter value. Once SV will detect that pattern on particular Stat Location updated by Proc, it will come to know that DMA transfer is completed and then it can read cycle counter value from other Stat Location updated by Proc. This way SV code will come to know about how much time taken to do the given amount of data transfer. This is very simple example. Based on complex SoC scenarios, these Stat Locations can be used accordingly.

 

At last, we have implemented and used above mentioned SV-C mechanism in couple of our SoC verification projects and it proved very useful, flexible and efficient. We were able to access register/memory from SV as fast as if they were accessed directly using Proc. We were able to generate very complex scenario easily which is very difficult to generate in absence of this mechanism. We have mapped memory space used between SV and Proc into L2 (Level 2) cache outside the Proc.

 

In case of any query/question, you can reach me on my email ID: sandeep.vaniya@gmail.com.

 

 

Acronyms used in this article:

 

Acronym

Description

SoC

System on Chip

SV

SystemVerilog

Proc

Processor

PLI

Programming Language Interface

DPI

Direct Programming Interface

TCM

Tightly Coupled Memory

DTCM

Tightly Coupled Memory for Data

HVL

Hardware Verification Language

Link to Published Article


Design-reuse.com: An Effective way to drastically reduce bug fixing time in SoC Verification


Introduction
Many times we are not aware of very useful EDA tool options which are already available. Even if such options are very well documented, we don't look at them and try them [I partly agree that tool supports MANY options and trying/understanding them is time consuming and boring]. But some options are very useful and if you know them, it makes job of design engineer and/or verification engineer very easy.
Here, I am going to talk about one very powerful and useful VSIM option of QuestaSim. It is VCDSTIM option of VSIM. As per Mentor Graphics Corporation, people didn’t understand the value of this powerful option in bug hunting though it is already in the tool for so long.
[Note: VSIM is last step of 3 step (vlog => vopt => vsim) simulation flow of QuestaSim].
Details of VCDSTIM option
VCDSTIM is one of the options of VSIM of QuestaSim. Here are the details of this option as described in QuestaSim User Manual.

Read Complete Article 

Design-reuse.com: Basics of Assertion IP

The purpose of this article is to provide some basic information about Assertion IP to people who don’t have much information about it.
As per the name, AIP is having assertions written at interface level.
Mostly, AIP is written following strict design coding guidelines so that it can be synthesizable.
AIP can be used in Functional simulation environment as an interface monitor similar to transaction level monitor which is used to check interface behavior as per interface protocol. But, mainly it is targeted for Formal environment with Formal tool.
In Formal environment with Formal tool, it is used to generate stimulus to design, perform interface level checks and provide coverage in the Formal environment to verify the design with very less efforts.
Inside AIP
One will found following details in most of the AIP
  • Top level module having Inputs and Outputs which is used to connect [or bind] AIP with DUT
  • Parameters to customize AIP to work with customized DUT
  • Having interface checkerswritten in the form of properties
  • Assert / Assume / Cover declarations of the properties
  • Glue logic to help writing complex protocol check conditions in the properties
Bind
Bind will be used to connect AIP with DUT without creating separate test bench module or without editing design code.
One can create separate bind file and using bind keyword, AIP can be connected to DUT.
One can use internal signals and parameters of top level DUT module during binding. Binding AIP with DUT using bind keyword is something like one is creating instance of AIP module inside top level DUT module.
Glue logic
Main purpose of the AIP is to run it with Formal tool in Formal environment. So, AIP should be written in such a way that it will be Formal tool friendly and fully synthesizable. There are various coding guidelines to code AIP to make it formal tool friendly. Those details are out of scope for this article.
Glue logic is required in AIP to avoid writing very complex conditions in the properties. Formal tool will find it very hard to converge on properties if they involve very complex conditions. So, one need to write separate glue logic which can take care of complex condition of the property and code in the property will get simplified.
Assert, Assume and Cover
People familiar with SystemVerilog assertions will be mostly aware of assert, assume and cover declarations of the properties.
AIP will be having various properties to perform protocol checks on given interface.
Then, those properties will be declared as “assert” so that it can indicate adherence or violation of the protocol condition in either formal or simulation environment. In Formal environment, one can look at property falsification and in simulation environment, one can look at failing message in the log.

Saturday, August 22, 2009

Ganeshay Dheemahi By Shankar Mahadevan

Following are parts taken from Shankar Mahadevan's Beautiful Song about Bhagavan Ganesha in Bollywood movie Virudh.
Ganeshay Dheemahi Part 1
Ganeshay Dheemahi Part 2
Ganeshay Dheemahi Part 3
Ganeshay Dheemahi Part 1-2-3

Wednesday, October 15, 2008

Installing Windows XP on HP Pavilion DV6707 Laptop

As you know, HP Pavilion dv6707 laptop comes with Windows Vista Pre-Installed. If you want to replace Windows Vista by Windows XP, you need new drivers for WinXP. Recovery DVD or 'SWSETUP' created using Window Vista will not help to install drivers for WinXP. All drivers come with Windows Vista are not compatible with Windows XP.
Refer to any of the following link to get WinXP compatible drivers. These drivers can also work on dv6000, dv9000 and dvxx7x series as per Link1.

Link1: Downgrading Hewlett Packard dv6000 series Notebook from Vista to XP
Link2:
The Official DV6704nr "Vista to XP" Guide
Download and Install the drivers as mentioned in any of the above link.
Issue with 'Audio Device On HD Bus'
Even after following step 5 as described in above Link1, if 'Audio Device On HD Bus' doesn't show up in device manager, you need to follow step 3 of Link2.
But neither step 5 of Link1 nor step 3 of Link2, helps in resolving 'Audio Driver' issue in Window XP with Service Pack 3. To resolve it, follow the steps as mentioned below.

1. Open 'Start' -> 'Run'
2. Give 'regedit' command to open registry editor
3. Modify Value of 'CSDVersion' key in 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows' from 300 to 200
4. Restart machine
5. Install KB888111xpsp2.exe
6. Modify Value of 'CSDVersion' key in 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows' from 200 to 300
7. Restart machine

These steps are also found here
Now, you will have 'Audio Device On HD Bus' in device manager. Now, you can install 'audio driver' on this device.
Steps mentioned above are tested on HP Pavilion dv6707 with WinXP SP3. They are working perfectly fine.

Sunday, June 1, 2008

VMM Source Code Released Under Apache License

After source code of OVM (Open Verification Methodology) which is based on AVM (Advanced Verification Methodology) by Mentor Graphics, now source code of VMM (Verification Methodology Manual) for SystemVerilog by Synopsys , can also be freely downloaded. Synopsys has released its entire VMM library source code under Apache Open Source License. It can be freely downloaded from http://vmmcentral.org/
Not only you can download VMM source code, you can modify it also as per your needs. And if you think, your modifications should become part of VMM library, it is also possible. If VMM designer get convinced about your modification, your modification might become part of VMM source code. Read this Verification Martial Arts: Verification Methodology initiated by author of VMM, for more details about how to convey your modification to VMM designer.

Friday, May 16, 2008

Implementing Linked Methods of rvm_env/vmm_env/avm_env/ovm_env

If you have used RVM (Reference Verification Methodology) in Vera or VMM (Verification Methodology Manual), AVM (Advanced Verification Methodology) or OVM (Open Verification Methodology) in SystemVerilog, then you will be familiar with rvm_env, vmm_env, avm_env, etc. base classes. These classes has set of methods build, cfg_dut, run, etc. which are getting called in predefined order. When you call any single method, it will make sure that previous methods in given order set has already called, and if not, it will be called first to ensure ordering. Do you know how this order can be maintained in *_env (rvm_env, vmm_env, avm_env or ovm_env) classes? In this article, I will try to explain one way of implementing this chain of method calls. I don't know how exactly, it is implemented in *_env but they can be implemented as follows also. Who knows they might be implemented as described below in *_env?.

I will try to explain this flow using vmm_env class. vmm_env class has following methods which are executed in the order metioned as below.



    1.  gen_cfg()
    2.  build()
    3.  reset_dut()
    4.  cfg_dut()
    5.  start()
    6.  wait_for_end()
    7.  stop()
    8.  clean()
    9.  report()
    10. run()

When you call build() and if gen_cfg() is not called before that, gen_cfg() will be called first then build will execute.

Same way, if you call gen_cfg() followed by cfg_dut() followed by report(), then cfg_dut() will make sure to call reset_dut() first "before executing itself", report will make sure to call start(), wait_for_end(), stop(), clean(), in the order given, "before executing itself".

There is one more top level method, called run(). If you don't call any of the previous method and just call run(), it will make sure all the previous methods called in the given order "before executing itself". I am giving emphasis on "before executing itself" because it is key of this chain flow of method calling.

This is just an overview of method chaining. Now, let see how it can be implemented. If you look at the implementation, logic is very easy...


Look at the following code.


class vmm_env();


    local bit gen_cfg_done;
    local bit build_done;
    local bit reset_dut_done;
    local bit cfg_dut_done;
    local bit start_done;
    local bit wait_for_end_done;
    local bit stop_done;
    local bit clean_done;
    local bit report_done;

    function new();
        gen_cfg_done      = 0;
        build_done        = 0;
        reset_dut_done    = 0;
        cfg_dut_done      = 0;
        start_done        = 0;
        wait_for_end_done = 0;
        stop_done         = 0;
        clean_done        = 0;
        report_done       = 0;
    endfunction

    function void gen_cfg();
        gen_cfg_done = 1;
    endfunction

    function void build();
        if(gen_cfg_done == 0)
            gen_cfg();
        build_done = 1;
    endfunction

    task reset_dut();
        if(build_done == 0)
            build();
        reset_dut_done = 1;
    endtask

    task cfg_dut();
        if(reset_dut_done == 0)
            reset_dut();
        cfg_dut_done = 1;
    endtask

    task start();
        if(cfg_dut_done == 0)
            cfg_dut();
        start_done = 1;
    endtask

    task wait_for_end();
        if(start_done == 0)
            start();
        wait_for_end_done = 1;
    endtask

    task stop();
        if(wait_for_end_done == 0)
            wait_for_end();
        stop_done = 1;
    endtask

    task clean();
        if(stop_done == 0)
            stop();
        clean_done = 1;
    endtask

    task report();
        if(clean_done == 0)
            clean();
        clean_done = 1;
    endtask

    task run();
        if(report_done == 0)
            report();
    endtask

endclass

Very easy... Isn't it?
Now see, when you call only run() without calling any other method, following will happen.

run()
{
    if(!report_done)
    {
        report()
        {
            if(!clean_done)
            {
                clean()
                {
                    if(!stop_done)
                    {
                        stop()
                        {
                            if(!wait_for_end_done)
                            {
                                wait_for_end()
                                {
                                    if(!start_done)
                                    {
                                        start()
                                        {
                                            if(!cfg_dut_done)
                                            {
                                                cfg_dut()
                                                {
                                                    if(!reset_dut_done)
                                                    {
                                                        reset_dut()
                                                        {
                                                            if(!build_done)
                                                            {
                                                                if(!gen_cfg_done)
                                                                {
                                                                    gen_cfg();
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

I guess do_test() of avm_env/ovm_env might have the same logic.

Now you might also came to know that why super.<method>() (super.build(), super.reset_dut(), super.cfg_dut(), etc.) is compulsory at the start of these methods in class extended from *_env. If you don't call super.<method>(), above mentioned internal functionality of base class required for chaining will not execute properly.

I hope this information will be useful to you.

Leave comment if you have any suggestion/question/doubt about his article.

$finish;


Sunday, May 11, 2008

Print Screen in Windows Vista

If you are running Windows Vista, you might have faced issues in 'Print Screen' or 'Screen Capture' functionality.
In other version of Windows by pressing key 'print screen' or 'Alt + print screen', you can take snapshot of your entire screen or active window, respectively. Then you can paste it into 'Paint' and save it. But in Windows Vista, pressing key 'print screen' or 'Alt + print screen' does not capture the screen. I think they have modified key combination for screen capture.
In Windows Vista you need to press 'Fn + print screen' or 'Fn + Alt + print screen' to capture the entire screen or active window.
In most cases, 'Fn' key is located at bottom left part of keyboard, between 'Ctrl' and 'Window' key.

Wednesday, April 23, 2008

Advanced use of define macro in RVM and VMM of Synopsys

If you have used RVM (Reference Verification Methodology) library for Vera or VMM (Verification Methodology Manual) library for SystemVerilog, implemented by Synopsys, you can recall channel, atomic generator, scenario genertor, rvm_OO_callbacks, vmm_callbacks macros. These macros are generic/reusable macro written using above mentioned two powerful features of define macro.

In VMM for SystemVerilog,
`channel(data_class) // data_class_channel
This macro call creates customized channel class declaration handling object of type data_class.

`atomic_gen(data_class) // data_class_atomic_gen
This macro call creates customized atomic generator class declaration handling object of type data_class.

`scenario_gen(data_class) // data_class_scenario_gen
This macro call creates customized scenario generator class declaration handling object of type data_class.
This macro call all creates classes like 'data_class_scenario', 'data_class_scenario_election', etc.

If you have noticed, implementation of `vmm_callbacks is given in the vmm document.

I hope this information improves your knowledge about using define macro.

$finish;


Reusable Channel using Define Macro

Now, same code can be implemented using define macro as follows.

`define channel(A) class A``_channel ; // Class of type 'A_channel' \
    A queue[$]; \
    semaphore sem; \
    task put_data(A t); \
        sem.get(1); \
        queue.push_back(t); \
        sem.put(1); \
    endtask \
    task get_data(ref A t); \
        sem.get(1); \
        t = queue.pop_back(t); \
        sem.put(1); \
    endtask \
endclass

Using above mentioned code, you can create any type of customized channel between two components.
Like,
Channel passing integer data between two components using,
`channel(integer)
integer_channel int_channel = new();
Channel passing class object of type 'data_class' between two component using,
`channel(data_class)
data_class_channel data_class_channel = new();
As you noted here, `channel(integer) or `channel(data_class) macro calls, creates customized channel class declarations for you and then you can instantiate those class objects.

Another thing to be noticed is the use of `` to create customized data type. In the example above, I have used 'A_``channel'. This expands to 'A_channel'.

Next: Advanced use of define macro in RVM and VMM of Synopsys


Reusable Channel using Parameterized class

Let's consider the example of generic channel using paramerized class,


class channel #(type T = integer);

    T          queue[$];
    semaphore  sem;
    
    task put_data(T t);
        sem.get(1);
        queue.push_back(t);
        sem.put(1);
    endtask
    
    task get_data(ref T t);
        sem.get(1);
        t = queue.pop_back(t);
        sem.put(1);
    endtask

endclass

Using above mentioned code, you can create any type of customized channel between two components.
Like,
Channel passing integer data between two components using,
channel #(integer) int_channel = new();
Channel passing class object of type 'data_class' between two component using,
channel #(data_class) data_class_channel = new();

Next: Reusable Channel using Define Macro




Features of Define Macro in SystemVerilog

Following is the excerpt from SystemVerilog LRM about important features of define macro.

1. In Verilog, the ‘define macro text can include a backslash ( \ ) at the end of a line to show continuation on the next line.

2. In SystemVerilog, the macro text can also include `", `\`" and ``.
An `" overrides the usual lexical meaning of ", and indicates that the expansion should include an actual quotation mark. This allows string literals to be constructed from macro arguments.
A `\`" indicates that the expansion should include the escape sequence \", e.g.
`define msg(x,y) `"x: `\`"y`\`"`"
This expands:
$display(`msg(left side,right side));
to:
$display("left side: \"right side\"");

3. A `` delimits lexical tokens without introducing white space, allowing identifiers to be constructed from arguments,

`define foo(f) f``_suffix
This expands:
`foo(bar)
to:
bar_suffix

These three are most important features because using them we can create customizable data_type and generic or reusable SystemVerilog Components.

For example consider following macro,
`define MY_DATA_TYPE(A) A
Using this macro, I can do following.

Instead of writing,
integer a;
I can write,
`MY_DATA_TYPE(integer) a;

You might think that is it advanced use of Macro? But when you read Reusable Channel using Define Macro of this article, you will realize that how this simple feature of define macro can help in creating generic/reusable components. Here, only intention is to convey that "Using define macro you can 'pass' data_type as argument".
define macro consider its argument as 'text only', it doesn't impose rule of 'keyword' or 'data type' on that. So passing data type as argument to define macro doesn't result into any compilation error.
These features can be used as an alternate option to 'Parameterization feature of SystemVerilog' (Parameterized Classes). If you are using EDA tool or SystemVerilog Compiler that doesn't support 'Parameterized class', you can use define macro as supplement for that, to make generic or reusable components.

Let's go through how to create generic/reusable SystemVerilog components using 'Parameterized Class' and Using 'Define Macro'.

Next: Reusable Channel using Parameterized class