Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to make a complete plan to verify a mcu?

Status
Not open for further replies.

xworld2008

Full Member level 4
Joined
Dec 13, 2002
Messages
230
Helped
18
Reputation
36
Reaction score
14
Trophy points
1,298
Activity points
1,801
how to verify a mcu

Verification is very hard, and mcu verify is very very hard,i just know write some assemble code to verify it, but how to make a complete plan to verify a mcu ,such as 8051,Can you help ,Thanks!
 

Re: how to verify a mcu

the one of our way is to write a C model, compare result cycle by cyle.
 

Re: how to verify a mcu

if you work with 8051, you have to check Clock, Reset, and Ale pin
 

how to verify a mcu

Hi,
even i have doubts on this. How do we verify fully wether an MCU like 8051 is working correctly for each and every instruction? And do we say that the verification is correct and complete?

Best Regards,
 

how to verify a mcu

hello hyena_dale, your method have another question, we must provide the c model to be Golden, and the c model need verify too.
 

Re: how to verify a mcu

We use C model to verify core except peripherals.

For golden C model, design a golden C model is more easy than design a golden RTL. For C model verification. First, you can compare C code with spec, check software is easy than check RTL. Second, U can verify your C model when verifying your RTL.
 

Re: how to verify a mcu

hyena_dale said:
We use C model to verify core except peripherals.

For golden C model, design a golden C model is more easy than design a golden RTL. For C model verification. First, you can compare C code with spec, check software is easy than check RTL. Second, U can verify your C model when verifying your RTL.

then, how can you verify the peripherals ? write assemble and watch the waveform cycle by cycle ? anyway , slow and low efficient !

it is so troublesome !!
 

Re: how to verify a mcu

C model, fo course.
After all, it depends on your application.
 

Re: how to verify a mcu

Usually for a CPU verification, there are acculated testcases. If your designed passed all the acculated testcases. It is said to be OK.

For 8051, first you could check the basic functions, every instruction, the interrupt, and the GPIO ect. Then complex case, you could download some routines for all kinds of purposes, of course the interrupt routines is very important. When you database is large enough your 8051 is considered to be ...

Then you get it taped out. After you get the chip, you could run as many as testcases one the test board. Then you send it to you costomer. ......


For a complex CPU, debug maybe found years later... But don't worry about it. As long as it is not cretical defect, you could find many way to work around...:)
 

Re: how to verify a mcu

If we take 8051 as an example and we want to verify it, we professionally can do the following :

1- Prepare a large amount of C/Assembly programs ( no matter C or assembly ). The programs has to cover all the Instruction of the 8051. Moreover, each instruction has to be tested with corner cases, like testing the ADD instruction once with 2 positive numbers, then 2 negative numbers, and then for one negative and one positive.

2- Making sure that the testing programs do cover everything must be done thru profiling tools. These profiling (or reporting) tools should give you a complete automatic picture on the used programs without a need to go manually inside them.

3- After preparing the required programs, you should run them on 8051 compiler/emulator like Keil. The result of running can be obtained by printing the contents of the RAM into a file.

4- The same programs can be compiled to be in binary format ( DUA or 0's and 1's), then to be loaded into the VHDL code memory model to be simulated with the 8051 Design. Then, using a testbench you can read all the code memory and run the instructions on your VHDL simulator. The results of running the programs on the VHDL code can be obtained by dumping the RAM contents into a file. ModelSim can do that for you easily.

5- Now you have 2 results. The first one is due to running a cetrain program on the 8051 emulator (ideal results that should exactly happen if you have the real 8051 platform). And the second is due to running the same program on your own VHDL design. Compare both using (Diff) and report the percentage coverage of your design.

6- Repeat the process till you reach 100% coverage of your microcontroller ISA.

7- The whole mentioned verification process can be completely automated using scripts. Paying some time at the begining will save you alot at the end. You better spend sometime planning for how many programs and preparing the required tools, then go for the scripts that will take all the programs and do everything on both Keil and ModelSim. Then collect the results in a report file.
It may take you from couple of hours to some days to do all these simulations of a fast PC. But it still can be completely automated.

8- Remember, once u did that once and u prepared all your scirpts, you will be able to do again and again on any processor. This can be a very valuable experience.
 

Re: how to verify a mcu

omara007 said:
1- Prepare a large amount of C/Assembly programs ( no matter C or assembly ). The programs has to cover all the Instruction of the 8051. Moreover, each instruction has to be tested with corner cases, like testing the ADD instruction once with 2 positive numbers, then 2 negative numbers, and then for one negative and one positive.

Although it's possbile to test all the supported instructions by this MCU, it can not help us to ensure that the combination of the instructions can still function well, which is quite enormouse and hardly to verified completely!

And I'd like to know how to trade off the verification accuracy and the time?
 

Re: how to verify a mcu

Thomson said:
Although it's possbile to test all the supported instructions by this MCU, it can not help us to ensure that the combination of the instructions can still function well, which is quite enormouse and hardly to verified completely!

And I'd like to know how to trade off the verification accuracy and the time?

First of all, you need to test all lower-level component individually, like testing the sequencer, decoder, etc.
Second, running relatively large amount of programs to cover the ISA may help testing the combination of these instructions for proper functionality .. this is acheived simply by printing the RAM contents after running each program, or if you want, you can collect the RAM contents after each execution cycle.

By the way, there is nothing like a 100% test .. there always be a room for bugs that can't be discovered except by the consumer ..

the proposed methodology for testing is quite good .. but it may not be exclusive ..
 

how to verify a mcu

very easy, just write a c module and check the result
 

Re: how to verify a mcu

Hi,omara007,
first Q:
2- Making sure that the testing programs do cover everything must be done thru profiling tools. These profiling (or reporting) tools should give you a complete automatic picture on the used programs without a need to go manually inside them.

What is profiling tools? coverage tools like covermeter, or embedded in Keil tools?

second Q:
You dump RAM contents to files and compare them. But it only works when you read write RAM. If you read write through interface, how can you verify the interface?
dump external RAM also? and other interface logic?

Third Q:
You only achieve ISA coverage 100%, but how about code coverage ? functional coverage ?

Claint
 

how to verify a mcu

hi, omara007. some questions for you. What you said is maily to deal with those micro controllers with definitely well defined instruction set. but if self-defined instruction set CPU is designed, surely has no classical tools like Keil, what do you do about it? I mean any efficient way of doing the verification, checking the result. Then what is the golden model?
That means depending on what can i gurrentee it is true. How can i make it easier? Thansks
 

Re: how to verify a mcu

omara007 said:
First of all, you need to test all lower-level component individually, like testing the sequencer, decoder, etc.
..

Yes! At this level, the 100% code coverage(e.g., statement coverage) and 100% functional coverage can be reached.

omara007 said:
Second, running relatively large amount of programs to cover the ISA may help testing the combination of these instructions for proper functionality .. this is acheived simply by printing the RAM contents after running each program, or if you want, you can collect the RAM contents after each execution cycle.
..
Do you mean that for the MCU system-level verification, the individual ISA shall be verified individually first; then the real programs (better applied programs) shall be employed to verify the MCU.

omara007 said:
By the way, there is nothing like a 100% test .. there always be a room for bugs that can't be discovered except by the consumer ..

the proposed methodology for testing is quite good .. but it may not be exclusive ..

Yes! 100% is really a nut, but still the nearer is the better!
Except the listed verfification features by the verification engineer, do you have some additional techniques to ensure that the MCU is error-free, at least for most times. Currently the state-of-the-art verification methodlogy such as coverage-driven and constraint-random methods can leverage the progress with the traditional ones? Have you tried them?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top