A practical approach to design reuse
EE Times: A practical approach to design reuse | |
Tom Dewey (04/11/2005 9:00 AM EDT) URL: http://www.eetimes.com/showArticle.jhtml?articleID=160503544 | |
There has been much discussion and a great deal of ink devoted to the topic of reuse. This topic is usually covered from the perspective of designing new code for reuse in future designs. Most pundits agree that this is a good idea and vital to fulfilling the systems-on-chip promise. However, how many engineers, teams, or corporations actually design for reuse? Not too many. The common alibi is that schedule pressures do not allow for the extra time and effort it takes to create HDL code that can be truly reusable with no alterations. In addition, a level of corporate infrastructure needs to be built so that everyone can access these designs. So what actually happens? If asked, most will say that new designs use existing blocks of HDL that are altered. Is this true reuse? Purists would say "no" that this is mere recycling. Yet, since designers are not starting from scratch, this "recycling" undoubtedly must offer some value. Enter practical reuse In the Portland, Oregon metro area, close to 70% of the population now recycles their waste, implying that about 60% of material collected by garbage companies does not go into the landfill. Similar relatively high numbers are reflected in Silicon Valley and other parts of California too. This was not always the case. In the recent past, there were so many rules about separating, bundling, and sorting that people did not want to spend the time participating. Worse, if these rules were violated, the garbage truck left your recyclables at the curb. If that happened, people gave up and just threw it all away. Then, a great thing happened. Recycling became practical as the concept of co-mingling was instituted. A single receptacle was provided for every possible type of recyclable material, and the garbage company handled the sorting. Since then, the recycling percentage has consistently risen year after year. With due apologies to those designers who may have taken offense, this example is not intended to insinuate that any of the designs out there are junk! Instead, the intention is to drive home a serious fact. It is time to look at reuse from a completely different perspective. Is there a methodology to help you reuse existing HDL code that was not initially designed for reuse? This is practical reuse a working methodology for getting your next design quickly completed, by reusing code that already exists at your corporation. And, you will likely find that looking at the problem from a completely different angle will actually lead to more and more reuse in your next projects. Practical reuse is a discovery process performed with or without tools. As shown in figure 1, this process includes:
Figure 1 We need a methodology to help us reuse existing HDL code that was not initially designed for reuse.
Determining design integrity Design integrity fundamentally means that all the code is complete and ready for simulation. Typically, the first step is to find the top level of the design in order to ascertain which files comprise the RTL description from the root of the design on down. Additionally, you can eliminate any extraneous HDL files from the project. If the design is under version control, you will need to check out the latest version of the RTL and review history notes before starting the discovery process. You can start with a manual technique, looking for a top-level "readme" or document file that might describe the design file hierarchy. Or, look for a compilation script for clues to design content. Finally, look for a file with an obvious name like "top" or a file that contains many component instances and no logic. As you work with the files, take note of modules containing structure but no logic, as you will have to find or create this logic yourself. Taking the analysis up a level, if you possess a tool that parses and determines hierarchy as part of the process of specifying code or performing an analysis, that tool can typically figure out the topography of the design and whether anything is missing. Also, parsers provide you with syntax and semantic checks that could reveal problems with the code. Examples of these types of tools are code visualizers, synthesizers, or simulators. Visualization tools also help you understand the design composition and what the design does. At this point, you are ready to consider the "Practical Factor" for the first time in the process. You can incrementally refine and use this value (equation 1) as an initial checkpoint during the reuse process:
The ultimate goal of course is to reduce the denominator to zero, even though that can never actually happen. As you will see later, it is best to measure time in minutes or to convert hours to minutes. Days, weeks, or months can be interpreted differently between people (for example, does a day have eight hours or 24?). The TimeScratch variable is the hardest to estimate. You can employ various techniques to make a best guess: 1. Get the total line count and apply a time factor in minutes for each comment (typically a low number) and for each non-commented line of code (typically a higher number).
At this point, the TimeReuse variable represents TimeIntegrity, which comprises the following:
If the Practical Factor approaches 1, you would obviously stop now, as reusing this design would take as much time as it would take to create it from scratch. Determining code quality Assuming that the code passed these checkpoints, quality is the next consideration. A good place to start is with the Quality IP (QIP) matrix and user guide provided by the folks at the Virtual Socket Interface Alliance (VSIA). The QIP is a spreadsheet that lets you leverage collective knowledge about how reusable your code is. You manually enter answers to questions and a weighted score is produced. If the score is low, it could take a lot of work to reuse this code. At the time of this writing, you had to be a member of VSIA to access the QIP. To automate code quality assessment, you can use a code checker (sometimes called a linter). Often, a company has a set of reuse rules commonly based on the Reuse Methodology Manual. Separately, companies capture rules that represent collective knowledge about code that can cause design errors. Activate these rules separately and run the tool to assess reuse and quality. Some checkers also support the RTL QIP checks or allow you to weight and score your own rules. These checkers can also detect empty blocks for you. At this point, TimeReuse represents TimeIntegrity (from our previous checkpoint) plus TimeQuality:
Is the number getting closer to 1? If not, proceed to the next step. Establishing design validity After you determine the code integrity and quality, it is time to decide if the design works as expected. Design verification can be a complex process that uses several techniques and tools. First, account for validation time in the denominator of the Practical Reuse factor. This value should be significantly less than creating a test environment and running validations from scratch. Taking a simplistic approach, estimate a time value for each of the following:
Next, don't forget to account for the time it would take you to create tests and run the validation from scratch. For a rough estimate, you can use the "70% of the design cycle is spent in verification" claim of lore. Assume that this 70% means creating and running tests as well as correcting problems. That means 30% of your time is spent doing something else. If you assume that 20% of that "something else" is design creation, then multiply your value for TimeScratch by 3.5 to get a value for TimeScratch Validate. Add this number to your original TimeScratch value to get the "final" TimeScratch estimate (used in equation 4).
Does the Practical Factor indicate that the code is still viable for reuse? Sharing your knowledge Even if the design failed to pass the checkpoints, the upside is that it is still good knowledge to share within a team or corporation. Otherwise, someone else might discover the code and spend time trying to reuse it. Also, there could be blocks of code or data that could help a colleague. A good approach to sharing is to create a high-level website that contains a list of designs available for reuse. At the top level, enter a brief design description and add your comments on the Practical Factor checkpoints so that everyone knows its status. Then create (or use a tool to generate) a web page for each design and collate the following information from your discovery process:
Conclusion Until everyone designs for pure reuse, the need for practical reuse will exist. Establishing your own practical reuse methodology now will encourage a new method for thinking about the problem and will allow you to identify tools you need to automate the process. As you work with automation techniques and tools, you will gravitate towards a design flow that naturally enables developing code for reuse. Eventually, you will realize that you are actually designing new code for reuse as an effect of employing practical reuse techniques. Tom Dewey is a technical marketing engineer in the Design Creation and Synthesis Division of Mentor Graphics Corp.
| |
All material on this site Copyright © 2005 CMP Media LLC. All rights reserved. - - | |
Related Articles
- A practical approach to IP quality inspection
- A practical approach to reusing HDL code in FPGA designs
- Infrastructure reveals a novel approach to re-use
- BCD Technology: A Unified Approach to Analog, Digital, and Power Design
- Enhancing VLSI Design Efficiency: Tackling Congestion and Shorts with Practical Approaches and PnR Tool (ICC2)
New Articles
Most Popular
- Streamlining SoC Design with IDS-Integrate™
- System Verilog Assertions Simplified
- System Verilog Macro: A Powerful Feature for Design Verification Projects
- Enhancing VLSI Design Efficiency: Tackling Congestion and Shorts with Practical Approaches and PnR Tool (ICC2)
- PCIe error logging and handling on a typical SoC
E-mail This Article | Printer-Friendly Page |