SlideShare a Scribd company logo
∗
               Notes on GHDL and Simulation
                                Dilawar Singh
                        Email : dilawars@iitb.ac.in
                                 Version 1.0
                                  January 18, 2011


      “To leave error unrefuted is to encourage intellectual immorality.“
      Karl Marx.

                          quoted in ’The Poverty Of Theory’ by E. P. Thompson.
                                          The only Western Historian who could
                                            think beyond the nation of Atlantis.


Simulation
An engineer should be able to not only correct an error but also locate them.
Simulation is mostly used for these two puposes. Failure in detecting errors
could be very costly. Later you detect it, costlier it gets. Intel has witnessed it
once. It may be not a matter of life an death but surely it can throw a mid-size
design house out of business. Big corporations can survive but it costs a lot. A
minor FDIV bug in Intel Pentium processor cost $500 million.
    After you have implemented your design as per given ’specifications’, first
task is to test whether it is giving what was expected (verification). While
designing, one might have taken clues from on one’s common sense in addition
to what one knows for sure. Simulation protect you from this common sense
(or intuitions), same way mathematics protect natural sciences from common
senses of humans which by the way hardly have anything in common 1 . Studying
social sciences is beset with ills. There is no protection from ’common sense’.
No wonder, two economists seldom agree on anything.
    Verification of design (mostly done using Simulation) is a big fraction of
today’s total design activities and consumes about 60-80% time. In VHDL, you
will create ’test benches’2 to test your design against certain set of test inputs.
For all these possible inputs, if output satisfies given ’truth table’ (or behavioral
description) then the design is said to be correct. One should test his/design
for all possible input combinations which is not possible for large enough input
   ∗ These notes have nothing to do with your course content. Usual disclaimer of ’I am not

responsible for any damages caused etc. etc’ applies.
   1 As far as common sense is concerned, it make sense asking whether an electron is a wave

or a particle. For mathematics, this question in itself is absurd. An electron is what its
equation implies, nothing less, yet could be more than that.
   2 While using ghdl you have to write test-bench in VHDL only, in Modelsim you have

another option called do files



                                             1
ports. On top of it, one should be able to catch error as early as possible for
cost grows exponentially with design stages. If design is found faulty at later
stages, you might loose your job (or get transfered if in government job). In any
case, it will be a blot on your claim to be an engineer.
    Simulation’s present is bright, future is surely bleak 3 . VLSI has grown up
in size tremendously. A modern chip has many input combinations that one
can possibly be tested in reasonable amount of time even though computer run
faster than Chacha Cahudhary’s brain. To overcome this, what one generally
does is to break a large design into smaller one (decomposition) and simulate
smaller parts. Most of simulation is done for moderate size components like
adder, multiplexer etc.
    There have been tremendous growth in the area of formal verification (you
can google it if you like) but you can not do away with simulation, at least
for next 6-7 decades. Reduced Binary decision diagrams (RBDD) and Kripke
Structures are very prominent tools these days. In the past, using formal meth-
ods in practice seemed hopeless, only few crazy people stuck to them. Recently,
industries are trying out formal verification like Z notation to document system
properties more rigorously. Model checking and theorem proving (on certain
structures) are being plugged in to complement more traditional one of simula-
tion.


Making a case for GHDL
Since I am ’lobbying’ for ghdl, it is clear that I am heavily biased and like
electrons under bias my ideas will move in a certain direction i.e. towards
supporting ghdl.
    Why ghdl? I can give two arguments, one is solely driven by my love for free
softwares, second is put forward my Prof M. P. Desai in his lecture. Free soft-
wares (as defined by http://www.gnu.org/philosophy/free-sw.html) allow one
to understand how a particular software works by providing you with its source
code. That makes improvement as well as enhancement faster. This is the right
way of making this planet ’smarter’. Another more effective way is by dumbing
down the users by taking away their rights to know that they are using. Adding
a fancy Graphical User Interface (GUI) may not necessarily translates into a
better software. We all have experiences with Microsoft Word!
    Second, according to Prof Desai (quoting in spirit, not the exact words),

      I’ll prefer giving 5 lacs more to someone who is an expert in free
      software rather than spending 10 lacs buying a license of a propriety
      softwares given that my job is done. Its like preferring a musi-
      cian who is better trained with his instruments over someone who is
      backed by costly electronic gadgets.

    First argument is a truism given that one is suffering from the mental neces-
sity ’to know’ like Donald E. Knuth; second is also a truism if one works with
(for) people who have the same vision. But most of the time, this is not the
case. Only first rate mind appreciate first rate minds. N’th level mediocrity
   3 I’m Done Simulating; Now What? Verification Coverage Analysis and Correctness

Checking of the DECchip 21164 Alpha microprocessor; Michael Kantrowitz, Lisa M. Noack;
See


                                          2
always support N+1’th level mediocrity. So it should not be surprising to note
that most of the people prefer Madona over Pt. Ravishankar, Daniel Steele over
R. K. Narayanan, T-Shirt over Kurta - I plead guilty (Albert Einstein would
have looked more graceful in Kurta!) and ’some Indian Idol’ over Indian Ocean.
On same lines, Modelsim over ghdl (offense indented!). Bottom line is Your
real skills (with free-softwares) may be grossly undervalued (in pro-
priety softwares driven world). To survive in Industries, it is useful to have
familiarity with ’standard’ tools. Internet is flooded with articles about them.


Installing GHDL
Linux Users
Before using package managers such as synaptic, yast etc make sure proxy vari-
ables are set. On Ubuntu, synaptic is installed by default. Go to (System− >
Administration− > SynapticP ackageM anager), go to the settings− > P ref erances− >
N etwork and set the proxy. Search ghdl and mark for installation. If you prefer
using apt − get utility from command line then make sure to put proxy informa-
tion in /etc/apt/apt.conf file. For example, if my user-name is profc haos and
password is khoonid arinda then my file will look like this.
Acquire::http::proxy "http://prof_chaos:khooni_darinda@netmon.iitb.ac.in:80/";
Acquire::ftp::proxy "http://prof_chaos:khooni_darinda@netmon.iitb.ac.in:80/";
Acquire::https::proxy "http://prof_chaos:khooni_darinda@netmon.iitb.ac.in:80/";
For other linux distribution, please google about it. If you are new to linux, you
may not be able to get things right for first few hours. That suppose to happen,
but don’t let it put you off.

Windows user
Guys! Learn linux if you have not started learning it. As someone has said, “We
learn to live in the world of linux where there is no Gates or Windows”. . For
Modelsim student edition, you have to use windows as expected. In VLSI lab,
it is installed on linux and can be invoked by vsim command from terminal.
Modelsim tutorial is given on its website.


Text Editor
ghdl now have an inbuilt text editor but it may not be available on vlsi lab.
You have to use vim or gedit. vim is the most advanced and simple (as a rule
of thumb, takes quite a lot of practice to learn) text editor. gedit is also a
good editor. Spend some time with vim every week. You can curse me while
learning but you will surely thank me after a year. vim is like a light saber, it
is only effective in the hand of a ’Jedi Knight’. First timer can not do anything
significant with it. vim has a lot of tutorial and free books available on its
website.




                                        3
Coding
Get into habit of commenting your code properly. Not only because it will be
readable by others but also you can remember what you have done a week ago.
Literate Programming is a school of thought which deals with readability of
codes. Writing readable codes not only recommended but also mandatory these
days. When a team of many people works on a single project, non-readability
consume much more time then it saves.
   You make also like to read about subversion (or git). Its a ’version control
system’ which keeps track of what you have done in the past. You can easily
recover any past version of your file. You can use google-code to make your svn
repository or can set up your own local repository on your personal machine.
There are many blogs written about how to do it.


Few words of wisdom




                                      4

More Related Content

What's hot

Lkce12.emergent patternsit ops
Lkce12.emergent patternsit opsLkce12.emergent patternsit ops
Lkce12.emergent patternsit ops
Dominica DeGrandis
 
How to get what you really want from Testing' with Michael Bolton
How to get what you really want from Testing' with Michael BoltonHow to get what you really want from Testing' with Michael Bolton
How to get what you really want from Testing' with Michael Bolton
TEST Huddle
 
How Four Statistical Rules Forecast Who Wins a Competitive Bid
How Four Statistical Rules Forecast Who Wins a Competitive BidHow Four Statistical Rules Forecast Who Wins a Competitive Bid
How Four Statistical Rules Forecast Who Wins a Competitive Bid
IntelCollab.com
 
Velocity 2010: Scalable Internet Architectures
Velocity 2010: Scalable Internet ArchitecturesVelocity 2010: Scalable Internet Architectures
Velocity 2010: Scalable Internet Architectures
Theo Schlossnagle
 
SCAM 2012 Keynote Slides on Cooperative Testing and Analysis by Tao Xie
SCAM 2012 Keynote Slides on Cooperative Testing and Analysis by Tao XieSCAM 2012 Keynote Slides on Cooperative Testing and Analysis by Tao Xie
SCAM 2012 Keynote Slides on Cooperative Testing and Analysis by Tao Xie
Tao Xie
 
Hpai class 15 - genes, mini-modules, and learning
Hpai   class 15 - genes, mini-modules, and learningHpai   class 15 - genes, mini-modules, and learning
Hpai class 15 - genes, mini-modules, and learning
melendez321
 
SBQS 2013 Keynote: Cooperative Testing and Analysis
SBQS 2013 Keynote: Cooperative Testing and AnalysisSBQS 2013 Keynote: Cooperative Testing and Analysis
SBQS 2013 Keynote: Cooperative Testing and Analysis
Tao Xie
 

What's hot (7)

Lkce12.emergent patternsit ops
Lkce12.emergent patternsit opsLkce12.emergent patternsit ops
Lkce12.emergent patternsit ops
 
How to get what you really want from Testing' with Michael Bolton
How to get what you really want from Testing' with Michael BoltonHow to get what you really want from Testing' with Michael Bolton
How to get what you really want from Testing' with Michael Bolton
 
How Four Statistical Rules Forecast Who Wins a Competitive Bid
How Four Statistical Rules Forecast Who Wins a Competitive BidHow Four Statistical Rules Forecast Who Wins a Competitive Bid
How Four Statistical Rules Forecast Who Wins a Competitive Bid
 
Velocity 2010: Scalable Internet Architectures
Velocity 2010: Scalable Internet ArchitecturesVelocity 2010: Scalable Internet Architectures
Velocity 2010: Scalable Internet Architectures
 
SCAM 2012 Keynote Slides on Cooperative Testing and Analysis by Tao Xie
SCAM 2012 Keynote Slides on Cooperative Testing and Analysis by Tao XieSCAM 2012 Keynote Slides on Cooperative Testing and Analysis by Tao Xie
SCAM 2012 Keynote Slides on Cooperative Testing and Analysis by Tao Xie
 
Hpai class 15 - genes, mini-modules, and learning
Hpai   class 15 - genes, mini-modules, and learningHpai   class 15 - genes, mini-modules, and learning
Hpai class 15 - genes, mini-modules, and learning
 
SBQS 2013 Keynote: Cooperative Testing and Analysis
SBQS 2013 Keynote: Cooperative Testing and AnalysisSBQS 2013 Keynote: Cooperative Testing and Analysis
SBQS 2013 Keynote: Cooperative Testing and Analysis
 

Viewers also liked

gLite Administration Workshop, Slides
gLite Administration Workshop, SlidesgLite Administration Workshop, Slides
gLite Administration Workshop, Slides
Stefan Freitag
 
Turmeric SOA - EclipseCon 2011 BOF
Turmeric SOA - EclipseCon 2011 BOFTurmeric SOA - EclipseCon 2011 BOF
Turmeric SOA - EclipseCon 2011 BOFkingargyle
 
CRL STATEWIDE WORKSHOP SERIES
CRL STATEWIDE WORKSHOP SERIESCRL STATEWIDE WORKSHOP SERIES
CRL STATEWIDE WORKSHOP SERIES
Healthy City
 
Turmeric soa google
Turmeric soa googleTurmeric soa google
Turmeric soa google
kingargyle
 
Final exam English III
Final exam English IIIFinal exam English III
Final exam English III
Mónica Gómez
 
Youth Voices on a Map
Youth Voices on a MapYouth Voices on a Map
Youth Voices on a Map
Healthy City
 
How to Use HealthyCity.org for Grant Writing & Reporting
How to Use HealthyCity.org for Grant Writing & ReportingHow to Use HealthyCity.org for Grant Writing & Reporting
How to Use HealthyCity.org for Grant Writing & Reporting
Healthy City
 
100624.2 stephan van den berg
100624.2 stephan van den berg100624.2 stephan van den berg
100624.2 stephan van den bergKennisLAB
 
Healthy city hands-on_training_f5_final
Healthy city hands-on_training_f5_finalHealthy city hands-on_training_f5_final
Healthy city hands-on_training_f5_finalHealthy City
 
Aca healthy citywebinar_final
Aca healthy citywebinar_finalAca healthy citywebinar_final
Aca healthy citywebinar_finalHealthy City
 
Career Development Team September 26
Career Development Team September 26Career Development Team September 26
Career Development Team September 26
V
 
Rancangan pengajaran harian bahasa melayu
Rancangan pengajaran harian bahasa melayuRancangan pengajaran harian bahasa melayu
Rancangan pengajaran harian bahasa melayuAinku Nurul Ain
 
F pialang indonesia13_september_2013
F pialang indonesia13_september_2013F pialang indonesia13_september_2013
F pialang indonesia13_september_2013Muhammad Ma'ruf
 
Liqvid aduro.pdf
Liqvid aduro.pdfLiqvid aduro.pdf
Liqvid aduro.pdf
Ashutosh Singh
 

Viewers also liked (20)

gLite Administration Workshop, Slides
gLite Administration Workshop, SlidesgLite Administration Workshop, Slides
gLite Administration Workshop, Slides
 
Turmeric SOA - EclipseCon 2011 BOF
Turmeric SOA - EclipseCon 2011 BOFTurmeric SOA - EclipseCon 2011 BOF
Turmeric SOA - EclipseCon 2011 BOF
 
060814 ss
060814 ss060814 ss
060814 ss
 
CRL STATEWIDE WORKSHOP SERIES
CRL STATEWIDE WORKSHOP SERIESCRL STATEWIDE WORKSHOP SERIES
CRL STATEWIDE WORKSHOP SERIES
 
Turmeric soa google
Turmeric soa googleTurmeric soa google
Turmeric soa google
 
3.3.2011
3.3.20113.3.2011
3.3.2011
 
Final exam English III
Final exam English IIIFinal exam English III
Final exam English III
 
060814 mw
060814 mw060814 mw
060814 mw
 
Youth Voices on a Map
Youth Voices on a MapYouth Voices on a Map
Youth Voices on a Map
 
FAREEDA moodboard
FAREEDA moodboardFAREEDA moodboard
FAREEDA moodboard
 
How to Use HealthyCity.org for Grant Writing & Reporting
How to Use HealthyCity.org for Grant Writing & ReportingHow to Use HealthyCity.org for Grant Writing & Reporting
How to Use HealthyCity.org for Grant Writing & Reporting
 
100624.2 stephan van den berg
100624.2 stephan van den berg100624.2 stephan van den berg
100624.2 stephan van den berg
 
Zulay bertel 2
Zulay bertel  2Zulay bertel  2
Zulay bertel 2
 
Email marketing2.0
Email marketing2.0Email marketing2.0
Email marketing2.0
 
Healthy city hands-on_training_f5_final
Healthy city hands-on_training_f5_finalHealthy city hands-on_training_f5_final
Healthy city hands-on_training_f5_final
 
Aca healthy citywebinar_final
Aca healthy citywebinar_finalAca healthy citywebinar_final
Aca healthy citywebinar_final
 
Career Development Team September 26
Career Development Team September 26Career Development Team September 26
Career Development Team September 26
 
Rancangan pengajaran harian bahasa melayu
Rancangan pengajaran harian bahasa melayuRancangan pengajaran harian bahasa melayu
Rancangan pengajaran harian bahasa melayu
 
F pialang indonesia13_september_2013
F pialang indonesia13_september_2013F pialang indonesia13_september_2013
F pialang indonesia13_september_2013
 
Liqvid aduro.pdf
Liqvid aduro.pdfLiqvid aduro.pdf
Liqvid aduro.pdf
 

Similar to Notes on Simulation and GHDL

From 🤦 to 🐿️
From 🤦 to 🐿️From 🤦 to 🐿️
From 🤦 to 🐿️
Ori Pekelman
 
Testing for the deeplearning folks
Testing for the deeplearning folksTesting for the deeplearning folks
Testing for the deeplearning folks
Vishwas N
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patterns
Steven Smith
 
(In)convenient truths about applied machine learning
(In)convenient truths about applied machine learning(In)convenient truths about applied machine learning
(In)convenient truths about applied machine learning
Max Pagels
 
Another Day In Paradise
Another Day In ParadiseAnother Day In Paradise
Another Day In Paradise
kum72
 
Patterns of fail
Patterns of failPatterns of fail
Patterns of fail
Gleicon Moraes
 
Software Carpentry and the Hydrological Sciences @ AGU 2013
Software Carpentry and the Hydrological Sciences @ AGU 2013Software Carpentry and the Hydrological Sciences @ AGU 2013
Software Carpentry and the Hydrological Sciences @ AGU 2013Aron Ahmadia
 
Chaos Engineering Without Observability ... Is Just Chaos
Chaos Engineering Without Observability ... Is Just ChaosChaos Engineering Without Observability ... Is Just Chaos
Chaos Engineering Without Observability ... Is Just Chaos
Charity Majors
 
10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programming10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programming
Hugo Shi
 
From DevOps to NoOps how not to get Equifaxed Apidays
From DevOps to NoOps how not to get Equifaxed ApidaysFrom DevOps to NoOps how not to get Equifaxed Apidays
From DevOps to NoOps how not to get Equifaxed Apidays
Ori Pekelman
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
Jennifer Lim
 
Worse Is Better, for Better or for Worse
Worse Is Better, for Better or for WorseWorse Is Better, for Better or for Worse
Worse Is Better, for Better or for Worse
Kevlin Henney
 
Artificial Intelligence is back, Deep Learning Networks and Quantum possibili...
Artificial Intelligence is back, Deep Learning Networks and Quantum possibili...Artificial Intelligence is back, Deep Learning Networks and Quantum possibili...
Artificial Intelligence is back, Deep Learning Networks and Quantum possibili...
John Mathon
 
CT Brown - Doing next-gen sequencing analysis in the cloud
CT Brown - Doing next-gen sequencing analysis in the cloudCT Brown - Doing next-gen sequencing analysis in the cloud
CT Brown - Doing next-gen sequencing analysis in the cloud
Jan Aerts
 
Talk at Bioinformatics Open Source Conference, 2012
Talk at Bioinformatics Open Source Conference, 2012Talk at Bioinformatics Open Source Conference, 2012
Talk at Bioinformatics Open Source Conference, 2012
c.titus.brown
 
"Startups, comment gérer une équipe de développeurs" par Laurent Cerveau
"Startups, comment gérer une équipe de développeurs" par Laurent Cerveau"Startups, comment gérer une équipe de développeurs" par Laurent Cerveau
"Startups, comment gérer une équipe de développeurs" par Laurent Cerveau
TheFamily
 
Ai lecture1 final
Ai lecture1 finalAi lecture1 final
Ai lecture1 final
Shivam Agrawal
 
Daniel Lance - What "You've Got Mail" Taught Me About Cyber Security
Daniel Lance - What "You've Got Mail" Taught Me About Cyber SecurityDaniel Lance - What "You've Got Mail" Taught Me About Cyber Security
Daniel Lance - What "You've Got Mail" Taught Me About Cyber Security
EnergySec
 
Designing nlp-js-extension
Designing nlp-js-extensionDesigning nlp-js-extension
Designing nlp-js-extension
Alain Lompo
 
If the coding bug is banal, it doesn't meant it's not crucial
If the coding bug is banal, it doesn't meant it's not crucialIf the coding bug is banal, it doesn't meant it's not crucial
If the coding bug is banal, it doesn't meant it's not crucial
PVS-Studio
 

Similar to Notes on Simulation and GHDL (20)

From 🤦 to 🐿️
From 🤦 to 🐿️From 🤦 to 🐿️
From 🤦 to 🐿️
 
Testing for the deeplearning folks
Testing for the deeplearning folksTesting for the deeplearning folks
Testing for the deeplearning folks
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patterns
 
(In)convenient truths about applied machine learning
(In)convenient truths about applied machine learning(In)convenient truths about applied machine learning
(In)convenient truths about applied machine learning
 
Another Day In Paradise
Another Day In ParadiseAnother Day In Paradise
Another Day In Paradise
 
Patterns of fail
Patterns of failPatterns of fail
Patterns of fail
 
Software Carpentry and the Hydrological Sciences @ AGU 2013
Software Carpentry and the Hydrological Sciences @ AGU 2013Software Carpentry and the Hydrological Sciences @ AGU 2013
Software Carpentry and the Hydrological Sciences @ AGU 2013
 
Chaos Engineering Without Observability ... Is Just Chaos
Chaos Engineering Without Observability ... Is Just ChaosChaos Engineering Without Observability ... Is Just Chaos
Chaos Engineering Without Observability ... Is Just Chaos
 
10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programming10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programming
 
From DevOps to NoOps how not to get Equifaxed Apidays
From DevOps to NoOps how not to get Equifaxed ApidaysFrom DevOps to NoOps how not to get Equifaxed Apidays
From DevOps to NoOps how not to get Equifaxed Apidays
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Worse Is Better, for Better or for Worse
Worse Is Better, for Better or for WorseWorse Is Better, for Better or for Worse
Worse Is Better, for Better or for Worse
 
Artificial Intelligence is back, Deep Learning Networks and Quantum possibili...
Artificial Intelligence is back, Deep Learning Networks and Quantum possibili...Artificial Intelligence is back, Deep Learning Networks and Quantum possibili...
Artificial Intelligence is back, Deep Learning Networks and Quantum possibili...
 
CT Brown - Doing next-gen sequencing analysis in the cloud
CT Brown - Doing next-gen sequencing analysis in the cloudCT Brown - Doing next-gen sequencing analysis in the cloud
CT Brown - Doing next-gen sequencing analysis in the cloud
 
Talk at Bioinformatics Open Source Conference, 2012
Talk at Bioinformatics Open Source Conference, 2012Talk at Bioinformatics Open Source Conference, 2012
Talk at Bioinformatics Open Source Conference, 2012
 
"Startups, comment gérer une équipe de développeurs" par Laurent Cerveau
"Startups, comment gérer une équipe de développeurs" par Laurent Cerveau"Startups, comment gérer une équipe de développeurs" par Laurent Cerveau
"Startups, comment gérer une équipe de développeurs" par Laurent Cerveau
 
Ai lecture1 final
Ai lecture1 finalAi lecture1 final
Ai lecture1 final
 
Daniel Lance - What "You've Got Mail" Taught Me About Cyber Security
Daniel Lance - What "You've Got Mail" Taught Me About Cyber SecurityDaniel Lance - What "You've Got Mail" Taught Me About Cyber Security
Daniel Lance - What "You've Got Mail" Taught Me About Cyber Security
 
Designing nlp-js-extension
Designing nlp-js-extensionDesigning nlp-js-extension
Designing nlp-js-extension
 
If the coding bug is banal, it doesn't meant it's not crucial
If the coding bug is banal, it doesn't meant it's not crucialIf the coding bug is banal, it doesn't meant it's not crucial
If the coding bug is banal, it doesn't meant it's not crucial
 

More from DIlawar Singh

Sexual love
Sexual loveSexual love
Sexual love
DIlawar Singh
 
Indian Middle Class : A bird-view
Indian Middle Class : A bird-viewIndian Middle Class : A bird-view
Indian Middle Class : A bird-viewDIlawar Singh
 
Towards Microelectrode Arrays for Retinal Prosthesis
Towards Microelectrode Arrays for Retinal ProsthesisTowards Microelectrode Arrays for Retinal Prosthesis
Towards Microelectrode Arrays for Retinal Prosthesis
DIlawar Singh
 
On Coding Guidelines
On Coding GuidelinesOn Coding Guidelines
On Coding Guidelines
DIlawar Singh
 

More from DIlawar Singh (6)

Sexual love
Sexual loveSexual love
Sexual love
 
Formal verification
Formal verificationFormal verification
Formal verification
 
Indian Middle Class : A bird-view
Indian Middle Class : A bird-viewIndian Middle Class : A bird-view
Indian Middle Class : A bird-view
 
Towards Microelectrode Arrays for Retinal Prosthesis
Towards Microelectrode Arrays for Retinal ProsthesisTowards Microelectrode Arrays for Retinal Prosthesis
Towards Microelectrode Arrays for Retinal Prosthesis
 
On cmos fabrication
On cmos fabricationOn cmos fabrication
On cmos fabrication
 
On Coding Guidelines
On Coding GuidelinesOn Coding Guidelines
On Coding Guidelines
 

Recently uploaded

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 

Recently uploaded (20)

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 

Notes on Simulation and GHDL

  • 1. Notes on GHDL and Simulation Dilawar Singh Email : dilawars@iitb.ac.in Version 1.0 January 18, 2011 “To leave error unrefuted is to encourage intellectual immorality.“ Karl Marx. quoted in ’The Poverty Of Theory’ by E. P. Thompson. The only Western Historian who could think beyond the nation of Atlantis. Simulation An engineer should be able to not only correct an error but also locate them. Simulation is mostly used for these two puposes. Failure in detecting errors could be very costly. Later you detect it, costlier it gets. Intel has witnessed it once. It may be not a matter of life an death but surely it can throw a mid-size design house out of business. Big corporations can survive but it costs a lot. A minor FDIV bug in Intel Pentium processor cost $500 million. After you have implemented your design as per given ’specifications’, first task is to test whether it is giving what was expected (verification). While designing, one might have taken clues from on one’s common sense in addition to what one knows for sure. Simulation protect you from this common sense (or intuitions), same way mathematics protect natural sciences from common senses of humans which by the way hardly have anything in common 1 . Studying social sciences is beset with ills. There is no protection from ’common sense’. No wonder, two economists seldom agree on anything. Verification of design (mostly done using Simulation) is a big fraction of today’s total design activities and consumes about 60-80% time. In VHDL, you will create ’test benches’2 to test your design against certain set of test inputs. For all these possible inputs, if output satisfies given ’truth table’ (or behavioral description) then the design is said to be correct. One should test his/design for all possible input combinations which is not possible for large enough input ∗ These notes have nothing to do with your course content. Usual disclaimer of ’I am not responsible for any damages caused etc. etc’ applies. 1 As far as common sense is concerned, it make sense asking whether an electron is a wave or a particle. For mathematics, this question in itself is absurd. An electron is what its equation implies, nothing less, yet could be more than that. 2 While using ghdl you have to write test-bench in VHDL only, in Modelsim you have another option called do files 1
  • 2. ports. On top of it, one should be able to catch error as early as possible for cost grows exponentially with design stages. If design is found faulty at later stages, you might loose your job (or get transfered if in government job). In any case, it will be a blot on your claim to be an engineer. Simulation’s present is bright, future is surely bleak 3 . VLSI has grown up in size tremendously. A modern chip has many input combinations that one can possibly be tested in reasonable amount of time even though computer run faster than Chacha Cahudhary’s brain. To overcome this, what one generally does is to break a large design into smaller one (decomposition) and simulate smaller parts. Most of simulation is done for moderate size components like adder, multiplexer etc. There have been tremendous growth in the area of formal verification (you can google it if you like) but you can not do away with simulation, at least for next 6-7 decades. Reduced Binary decision diagrams (RBDD) and Kripke Structures are very prominent tools these days. In the past, using formal meth- ods in practice seemed hopeless, only few crazy people stuck to them. Recently, industries are trying out formal verification like Z notation to document system properties more rigorously. Model checking and theorem proving (on certain structures) are being plugged in to complement more traditional one of simula- tion. Making a case for GHDL Since I am ’lobbying’ for ghdl, it is clear that I am heavily biased and like electrons under bias my ideas will move in a certain direction i.e. towards supporting ghdl. Why ghdl? I can give two arguments, one is solely driven by my love for free softwares, second is put forward my Prof M. P. Desai in his lecture. Free soft- wares (as defined by http://www.gnu.org/philosophy/free-sw.html) allow one to understand how a particular software works by providing you with its source code. That makes improvement as well as enhancement faster. This is the right way of making this planet ’smarter’. Another more effective way is by dumbing down the users by taking away their rights to know that they are using. Adding a fancy Graphical User Interface (GUI) may not necessarily translates into a better software. We all have experiences with Microsoft Word! Second, according to Prof Desai (quoting in spirit, not the exact words), I’ll prefer giving 5 lacs more to someone who is an expert in free software rather than spending 10 lacs buying a license of a propriety softwares given that my job is done. Its like preferring a musi- cian who is better trained with his instruments over someone who is backed by costly electronic gadgets. First argument is a truism given that one is suffering from the mental neces- sity ’to know’ like Donald E. Knuth; second is also a truism if one works with (for) people who have the same vision. But most of the time, this is not the case. Only first rate mind appreciate first rate minds. N’th level mediocrity 3 I’m Done Simulating; Now What? Verification Coverage Analysis and Correctness Checking of the DECchip 21164 Alpha microprocessor; Michael Kantrowitz, Lisa M. Noack; See 2
  • 3. always support N+1’th level mediocrity. So it should not be surprising to note that most of the people prefer Madona over Pt. Ravishankar, Daniel Steele over R. K. Narayanan, T-Shirt over Kurta - I plead guilty (Albert Einstein would have looked more graceful in Kurta!) and ’some Indian Idol’ over Indian Ocean. On same lines, Modelsim over ghdl (offense indented!). Bottom line is Your real skills (with free-softwares) may be grossly undervalued (in pro- priety softwares driven world). To survive in Industries, it is useful to have familiarity with ’standard’ tools. Internet is flooded with articles about them. Installing GHDL Linux Users Before using package managers such as synaptic, yast etc make sure proxy vari- ables are set. On Ubuntu, synaptic is installed by default. Go to (System− > Administration− > SynapticP ackageM anager), go to the settings− > P ref erances− > N etwork and set the proxy. Search ghdl and mark for installation. If you prefer using apt − get utility from command line then make sure to put proxy informa- tion in /etc/apt/apt.conf file. For example, if my user-name is profc haos and password is khoonid arinda then my file will look like this. Acquire::http::proxy "http://prof_chaos:khooni_darinda@netmon.iitb.ac.in:80/"; Acquire::ftp::proxy "http://prof_chaos:khooni_darinda@netmon.iitb.ac.in:80/"; Acquire::https::proxy "http://prof_chaos:khooni_darinda@netmon.iitb.ac.in:80/"; For other linux distribution, please google about it. If you are new to linux, you may not be able to get things right for first few hours. That suppose to happen, but don’t let it put you off. Windows user Guys! Learn linux if you have not started learning it. As someone has said, “We learn to live in the world of linux where there is no Gates or Windows”. . For Modelsim student edition, you have to use windows as expected. In VLSI lab, it is installed on linux and can be invoked by vsim command from terminal. Modelsim tutorial is given on its website. Text Editor ghdl now have an inbuilt text editor but it may not be available on vlsi lab. You have to use vim or gedit. vim is the most advanced and simple (as a rule of thumb, takes quite a lot of practice to learn) text editor. gedit is also a good editor. Spend some time with vim every week. You can curse me while learning but you will surely thank me after a year. vim is like a light saber, it is only effective in the hand of a ’Jedi Knight’. First timer can not do anything significant with it. vim has a lot of tutorial and free books available on its website. 3
  • 4. Coding Get into habit of commenting your code properly. Not only because it will be readable by others but also you can remember what you have done a week ago. Literate Programming is a school of thought which deals with readability of codes. Writing readable codes not only recommended but also mandatory these days. When a team of many people works on a single project, non-readability consume much more time then it saves. You make also like to read about subversion (or git). Its a ’version control system’ which keeps track of what you have done in the past. You can easily recover any past version of your file. You can use google-code to make your svn repository or can set up your own local repository on your personal machine. There are many blogs written about how to do it. Few words of wisdom 4