| Login | | Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name. | |
| Who's Online | There are currently, 70 guest(s) and 1 member(s) that are online.
You are Anonymous user. You can register for free by clicking here | |
 | |
|
Verification Guild: Forums |
|
| View previous topic :: View next topic |
| Author |
Message |
semi Newbie


Joined: Nov 13, 2004 Posts: 3
|
Posted: Sat Nov 13, 2004 2:18 am Post subject: how to catch glitch in the testbench |
|
|
Our chip has a glitch that is caught by another clock domain. But it's impossible to find our simulation enviroment. What's the way to catch this kind of problems? Any tools can help?
thanks, |
|
| Back to top |
|
 |
vhdlcohen Industry Expert


Joined: Jan 05, 2004 Posts: 1237 Location: Los Angeles, CA
|
Posted: Sat Nov 13, 2004 7:08 pm Post subject: |
|
|
| Quote: | | Our chip has a glitch that is caught by another clock domain. But it's impossible to find our simulation enviroment. What's the way to catch this kind of problems? Any tools can help? |
I am not sure if this really answers your question, but event-driven simulators don't exhibit the behavior of metastability, which is an analog behavior when a signal is at a threshold level and it is clocked.
Metastability problems are resolved (or mathematically minimized) thru good design style. There are static analysis tools that provide Multiple Clock Domain Verification and Analysis. See:
http://www.athdl.com/pdf/datasheets/@Verifier_MCDVA.pdf
Ben Cohen _________________ Ben Cohen http://www.systemverilog.us/
* SystemVerilog Assertions Handbook, 3rd Edition, 2013
* A Pragmatic Approach to VMM Adoption
* Using PSL/SUGAR ... 2nd Edition
* Real Chip Design and Verification
* Cmpt Design by Example
* VHDL books |
|
| Back to top |
|
 |
srini Senior


Joined: Jan 23, 2004 Posts: 430 Location: Bengaluru, India
|
Posted: Sun Nov 14, 2004 11:49 am Post subject: Re: how to catch glitch in the testbench |
|
|
| semi wrote: | Our chip has a glitch that is caught by another clock domain. But it's impossible to find our simulation enviroment. What's the way to catch this kind of problems? Any tools can help?
thanks, |
Hi,
Such problems are often referred to as CDC - Clock Domain Crossing problems, and they require a slightly different methodology than the regular simulation. I look at it from 2 angels:
1. Structural view - well known design styles such as 2-FF, FIFO based synchronization techniques etc.
2. Dynamic nature - i.e. consider a fast-2-slow clock data transfer, data_in_fast_domain must be held for atleast 1 slow_clk period - just one of the requirements that can be tested during every simulation via assertions.
Thanks,
Srinivasan _________________ Srinivasan Venkataramanan
Chief Technology Officer, CVC www.cvcblr.com
A Pragmatic Approach to VMM Adoption
SystemVerilog Assertions Handbook
Using PSL/SUGAR 2nd Edition.
Contributor: The functional verification of electronic systems |
|
| Back to top |
|
 |
semi Newbie


Joined: Nov 13, 2004 Posts: 3
|
Posted: Mon Nov 15, 2004 4:48 pm Post subject: |
|
|
Are there anything you can do in testbench to find out this? One case is like this, one flop(that is running in B clock domain) is being async reset by A clock domain, and the flop output is used in B clock domain.
thanks, |
|
| Back to top |
|
 |
vhdlcohen Industry Expert


Joined: Jan 05, 2004 Posts: 1237 Location: Los Angeles, CA
|
Posted: Mon Nov 15, 2004 7:40 pm Post subject: |
|
|
| Quote: | Are there anything you can do in testbench to find out this? One case is like this, one flop(that is running in B clock domain) is being async reset by A clock domain, and the flop output is used in B clock domain.
|
Srini addressed the solution to minimize metastability problems thru structural design styles such as 2-FF or even 3 FFs, or FIFO based synchronization techniques etc.
In you case, the Aside_reset should be reclocked through at least 2 FF with B clock, and THAT recloked output should be used as the async reset by the A clock domain. Skipping those 2 (or 3 FFs) is an invitation to problems.
Your question "Are there anything you can do in testbench to find out this?" is intriguing because you're asking the simulation to detect poor design styles that are related to an analog domain. Again, if you want tools to address those CDC (Clock Domain Crossing problems) you need static analysis tools, and if that is not available, a good design review with people knowledgeable with good design practices.
Ben Cohen _________________ Ben Cohen http://www.systemverilog.us/
* SystemVerilog Assertions Handbook, 3rd Edition, 2013
* A Pragmatic Approach to VMM Adoption
* Using PSL/SUGAR ... 2nd Edition
* Real Chip Design and Verification
* Cmpt Design by Example
* VHDL books |
|
| Back to top |
|
 |
srini Senior


Joined: Jan 23, 2004 Posts: 430 Location: Bengaluru, India
|
Posted: Mon Nov 15, 2004 11:19 pm Post subject: |
|
|
| semi wrote: | Are there anything you can do in testbench to find out this? One case is like this, one flop(that is running in B clock domain) is being async reset by A clock domain, and the flop output is used in B clock domain.
thanks, |
I am not sure if I understand you correctly, are you asking for some sort of a "monitor/checker" that would watch these signals and flag an error the moment these signals behave incorrectly (as in they were not stable for required number of A_clk or B_clk)? If so - that's exactly what assertions tend to do - NOTE: it is not necessary to use PSL/SVA for assertions - just that they make life easier for this class of checks. One is free to use his/her favourite HDL/HVL/C for coding such a checker. One of the problems with a high level testbench is that the observability is often limited (by the testbench creator, not really by the language/tool) to external pins/signals. What ABV brings in is observability at lower levels and that fits very well with traditional high level testbench.
HTH,
Srinivasan _________________ Srinivasan Venkataramanan
Chief Technology Officer, CVC www.cvcblr.com
A Pragmatic Approach to VMM Adoption
SystemVerilog Assertions Handbook
Using PSL/SUGAR 2nd Edition.
Contributor: The functional verification of electronic systems |
|
| Back to top |
|
 |
vhdlcohen Industry Expert


Joined: Jan 05, 2004 Posts: 1237 Location: Los Angeles, CA
|
Posted: Tue Nov 16, 2004 12:22 am Post subject: |
|
|
Srini wrote:
| Quote: | | "monitor/checker" that would watch these signals and flag an error the moment these signals behave incorrectly (as in they were not stable for required number of A_clk or B_clk)? If so - that's exactly what assertions tend to do |
Ben Wrote:
| Quote: | In you case, the Aside_reset should be reclocked through at least 2 FF with B clock, and THAT recloked output should be used as the async reset by the A clock domain. Skipping those 2 (or 3 FFs) is an invitation to problems.
|
Question: does the verification that the Aside_reset signal is stable for 2 clocks of B clock sufficient to guarantee no metastability issues?
The answer is NO because I can have on the B side an Aside_reset signal pulse that is synchronous to the A clock (and asynchronous to the B clock), yet it lasts for a duration longer than 2 B clock cycles.
Again, since simulators are not analog, and do not reflect the metastability effects, that assertion will not do a good job.
Srini, I'll go along with your original answer " 1. Structural view - well known design styles such as 2-FF". Verification can be done thru static analysis, done by either human or by static analysis tools, such as those provided by @HDL.
Ben Cohen _________________ Ben Cohen http://www.systemverilog.us/
* SystemVerilog Assertions Handbook, 3rd Edition, 2013
* A Pragmatic Approach to VMM Adoption
* Using PSL/SUGAR ... 2nd Edition
* Real Chip Design and Verification
* Cmpt Design by Example
* VHDL books |
|
| Back to top |
|
 |
alexg Senior

![]()
Joined: Jan 07, 2004 Posts: 586 Location: Ottawa
|
Posted: Tue Nov 16, 2004 10:05 am Post subject: |
|
|
This is a good example, where the problem resides on the boundary between what we used to call "design" and what we used to call "verification".
As Srini wrote, there are 2 steps to solve CDC issues.
1. Topological checks.
The goals of these checks are:
- Extract all clock domain boundaries in multi-clock design and then audit these reports to make sure all clock domain crossings are implemented correctly
- Set/Rest checks: check that sets/resets feeding all registers originate from correct clock domains.
- Glitches elimination: glitch before sync. flops can create the level after transition. The best way to eliminate glitches is to check that only one flop is feeding signal to the sync. flops.
All these checks can be run on the post-synthesis netlist using dc-tcl with Synopsys Design Compiler or similar. However, post-synthesis database is heavy, and there is a need to wait for the synthesis stage completion to get the reports.
Fortunately, there is another way to generate such reports without the need of synthesis tools. Many existing LINT tools can generate these reports immediately after RTL code is written. Some LINT tools such as Synopsys LEDA have their own tcl shell, and is is very easy to write custom scripts to extract all needed topological information from design.
2. Dynamic Effects & Checks
Usage of two flops on the clock domain boundary practically eliminates metastability effect, where the signal is stuck between high and low voltage value. However, the races between clock and data still have an influence on digital simulation and have to be modeled / checked properly.
One of the good solutions is to create syncronization cell containing different "views" for design and for simulation. From design (synthesis) prospective, it contains only two sequentially connected flops. From verification prospective, it is more complex.
First, we have to model the outcome of clock/data conflicts. It may take either one or two clock cycles for data to propagate to the second sync flop, depending on who wins in the race: clock or data. Since it is absolutely unpredictable in RTL simulation, we have to model these races using randomization.
Second, there is a need to perform some checks, such as:
- Minimum pulse width check. Valid pulse can be ignored during clock domain crossing, if the pulse width is smaller that the period of capturing clock.
- Multi-bit signals crossing clock domain are coded properly. There is a need to check that only one bit of the multi-bit signal changes during every clock cycle.
Regards,
Alexander Gnusin |
|
| Back to top |
|
 |
Ajeetha Senior


Joined: Mar 29, 2004 Posts: 424 Location: Bengaluru, India
|
Posted: Tue Nov 16, 2004 11:49 am Post subject: |
|
|
| vhdlcohen wrote: | Ben Wrote:
Question: does the verification that the Aside_reset signal is stable for 2 clocks of B clock sufficient to guarantee no metastability issues?
|
Ben,
Sure, it is not "sufficient" but rather "necessary" to have that check. The original poster was asking for what he could do in a testbench based simulation - I look at the whole digital simulation as an "abstraction" of analog behaviour (in a rather theoretical sense). So, a necessary check would to make sure that the "width" of the signal is long enough. Of-course there are more to it - one can also do SDF + timing checks, that would catch things like setup, recovery etc. But it all depends on how good the stimulus is.
So one of the "better" (if not best) approach would be to add those assertions and have them checked during simulations.
There is an interesting whitepaper on this issue @ http://www.cadence.com/whitepapers/cdc_wp.pdf
| Quote: |
Srini, I'll go along with your original answer " 1. Structural view - well known design styles such as 2-FF".
|
Again that's one part of the puzzle not the whole.
| Quote: |
Verification can be done thru static analysis, done by either human or by static analysis tools, such as those provided by @HDL.
Ben Cohen |
Well, I think @Verifier is more than "structural analysis" tool, it has good formal engines too. One of the benefits of the above mentioned assertions would be to have them formally verified (i.e. with regards to signal stability in source/destination domains) with such formal tools. And a little "semi-marketing" plug-in:
| Quote: |
Using a standard assertion language for such purposes would ensure inter-operability among such various tools/methodologies (than having them coded in say C or HVL etc.).
|
My 2 cents worth.
Regards,
Aji _________________ Ajeetha Kumari,
CVC Pvt Ltd. http://www.cvcblr.com
* A Pragmatic Approach to VMM Adoption http://www.systemverilog.us/
* SystemVerilog Assertions Handbook
* Using PSL/Sugar |
|
| Back to top |
|
 |
semi Newbie


Joined: Nov 13, 2004 Posts: 3
|
Posted: Fri Nov 19, 2004 5:13 pm Post subject: |
|
|
yes, I know this is a bad design practice. But I take the design from other people. It's hard for me to review line by line and make sure they don't have bad design practice.
So I wonder if anything I can do to find out if this problem exists. So CDC should find out this problem?
thanks, |
|
| Back to top |
|
 |
alexg Senior

![]()
Joined: Jan 07, 2004 Posts: 586 Location: Ottawa
|
Posted: Fri Nov 19, 2004 11:20 pm Post subject: |
|
|
| semi wrote: | I wonder if anything I can do to find out if this problem exists. So CDC should find out this problem?
thanks, |
@HDL claims that it has complete flow to debug synchronization issues. This flow is implemented in their @Verifier tool. Though I am not completely convinced that this flow is really complete, I still think that this tool may be useful in your case.
Regards,
Alexander Gnusin |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|