SlideShare, the PowerPoint hosting company, has announced the results of the "World’s Best Presentation Contest" on their blog.
Of the few that have won the prize, the above presentation is the one I liked the most.
Link via: Digital Inspiration
SlideShare, the PowerPoint hosting company, has announced the results of the "World’s Best Presentation Contest" on their blog.
Of the few that have won the prize, the above presentation is the one I liked the most.
Link via: Digital Inspiration
I came across a query on the possibility of passing info to modelsim's do file.
The first thing that I thought was it is possible by using command line arguments. Since do file is nothing but a Tcl file (ModelSim uses Tcl as its command language), info as arguments can be passed from the command line.
ex: # tcl <filename.tcl> arg1 arg2 ... argn
Then we can use Tcl's global variables argc and argv to access these arguments inside the tcl file.
So by passing the info as arguments to the do file while invoking vsim command, info can be passed on to the do file.
That is: vsim ... -do "<filename.do> arg1 arg2 ... argn"
But when tried with this logic, the arguments passed were not passed on to the file. But instead I saw the vsim arguments echoed on the screen.
echo "No of command line arguments passed are: $argc"
set i 0
foreach index $argv {
echo "argument #$i: $index"
incr i
}
Adding the above lines of code in the do file (run_def.do) and then passing this file as a -do switch option to vsim command as,
vsim {other switch options} -do "run_def.do test1 test2" &
where test1 and test2 are arguments passed on to the do file. Instead of displaying argc as 3 and test1 and test2 as the arguments, it showed 21 as the argc and echoed the arguments of entire vsim command!
Since ModelSim uses Tcl as its command language, vsim invocation too is like running a tcl script with its switch options as command line arguments. The do file passed as -do switch option is taken to be as an argument passed. The script vsim doesn't consider the do file as a separate script file but as a part of vsim script itself. (It can be assumed that the contents of do file gets appended to vsim script at the end). So it is vsim script that reads the do file and executes the commands within it.
This is why argc and argv displayed the results as detailed above. Now it became simple to pass the info to do file. The info can be passed as a generic option of vsim command (-G switch option), which can then be searched for in the do file if the info is known in prior.
For my requirement, the do file had to execute different set of commands according to the category of testcase to be executed. So the do file needed to know the category of the testcase and based on this info selects the branch (if-else) for execution. Also if no category is passed then no branch is to be selected but run as normal.
If a testcase was part of a category then this info was passed as a generic parameter (with -G switch option) of vsim command. The do file searched for this prior defined generic parameter (in top level TB) within the argument list (argv) and then select the branch for execution.
TX_CATEGORY and RX_CATEGORY were defined as generics of boolean type in the top level TB file and the do file searched for either of these strings for the branch selection.
vsim -GTX_CATEGORY=TRUE {....} -do "<run_def.do>"
In the run_def.do file:
set x [lsearch $argv -GTX_CATEGORY=TRUE ]
set y [lsearch $argv -GRX_CATEGORY=TRUE ]
if "$x != -1" { #TX_Category...
}
if "$y != -1" { #RX_CATEGORY
...
}
run -all
quit -f
The result of lsearch if successful in finding the string is the index of the argument list, argv, and -1 if it fails in finding the string. Each branch contains different set of commands to be run in prior to run -all command. If neither of the the generics are passed, then no branch gets selected, which is the required case.
Reference : Tcl tutorial
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Basic Idea on the use of do file:
Do file is basically a script file for modelsim to automate tasks like repetitive simulations for debugging purposes. All the commands that can be run on a ModelSim command prompt can be saved in a macro file (usually named with .do extension), and this file can be passed as an argument to vsim command with -do switch option. Once the ModelSim launches and loads the design, this file will be executed as "do <file.do>" automatically.
Since ModelSim uses Tcl for its command language, the do file can have simulation-specific commands as well as Tcl commands which can include graphic interface features, and a general programming interface for building up complex command procedures.
Idea2:
Use vsim command's generic argument switch (-G) to pass a generic to the design (The design is in VHDL.) This generic value can be used in the top level test-bench to create an event by turning high one of the signal meant only for this purpose. Based on the signal event going high, a particular branch should get selected in the do file.
Using 'when' command of Tcl to wait on an event and executing the branch statement is not possible because of Tcl's sequential execution. If the first when statement doesn't trigger then the execution doesn't proceed further. The execution of the further statements/commands never happens.
______________________________________________________
This video has had an astounding over 52,000,000 views and has a 5-star rating from over 200,000 reviewers.
via - Atanu Dey
Firefox 3 is planned to be launched worldwide on June 17. Mozilla Corp. calls this a Download Day and wants to set a Guinness World Record for the most downloaded software in 24 hours. Why? I am not so sure, but if the software comes with a tag as the most downloaded, or from another point of view, the most commonly used browser in the world, what's the loss?! This software deserves it.
For this, they also want us to pledge to make 17th the record day. Again why? Crazy!
What is the type or object type of "sys" in specman?
Specman language (or also called 'e' language, are often used interchangeably) has two main building blocks - "struct" and "unit" (both here are keywords.) While struct is similar to structure in C, unit is specific to Specman.
What necessitated the creation of unit as another building block for specman? This is another way of asking the advantages and disadvantages of struct and unit. The features of struct is more flexible and efficient than the unit, it so appears that unit is not necessary. How?
"Sys" is something similar to main() function in C. So this is the very first pre-defined object that is generated and executed as the simulation starts.
"Sys" is a pre-defined unit and cannot be a struct because it cannot be used as a dynamic object, that is, it cannot be created or generated on the fly. This is automatically called by the specman at the very beginning of simulation. If it is a struct, then "sys" can also be generated on the fly from within the middle of the code, which, theoretically, should re-start the simulation. This is an impossible situation in hardware verification. Also, this defeats the very purpose of using unit as static objects.
What are static and Dynamic objects?
Dynamic objects can have lifetime shorter than the whole simulation period, while static objects have a lifetime equal to the simulation time. According to this, structs are dynamic objects and units are static objects. So "sys" is a static object which is generated when the simulation starts and killed only when the simulation ends.
So, a static object like 'unit' was required in Specman because of a need to be constantly in connect with the DUT interface (and also with scoreboard.) So, unit can be accessed as a repository of data by other entities inside the program (for eg., thru get_enclosing_unit().) This necessitates the need for unit as a static object inside Specman.
Together with dynamic object such as struct, memory can be efficiently used in random verification with Specman.
I found more such questions and answers on Specman here.
-*-*-*-*-*-*-*-*-*-*-*-*
I am trying to find the means to satisfy my fondness for writing. In here, I'd like to write all about the random things and random thoughts that I come upon in life.
There is no particular agenda or something that I want to maintain on this blog. Whenever I hit upon an idea, be it in technical subjects, relationships, politics, economics or anything, all that will find a place of digital permanence here in my words.
This place is just to satisfy my urge for writing.