
Saturday, January 16, 2010
SOC Boot Concept

Tuesday, January 5, 2010
"C" constructs for verification

This module details the usage of writing verification test software in C
1. Representation of hardware registers in C
2. Symbol file providing module base address
3. Accessing the module register in a test-case
Question 1 : How do you represent hardware registers in "C"?
In C modules are represented using structures, since it is simply an amalgamation of logically unified registers. The registers themselves are of either byte, word or double word, or double double word.
The representation is as follows :
unsigned char byte : BYTE : 8 bit
unsigned short int : WORD : 16 bit
unsigned long int : DOUBLE_WORD : 32 bit
unsigned long long : DOUBLE_DOUBLE_WORD : 64 bit
It all depends on the size of the register you are accessing. I haven’t seen any granularity other than this, that’s how processors work; they work on bytes or multiples thereof.
Now typically during your verification you would come across data which are represented as uint16 or uint32, they are no different from their definitions above:
typedef unsigned char uint8
typedef unsigned short int uint16
typedef unsigned long int uint32
typedef unsigned long long uint64
If you want them signed simply substitude unsigned with signed above,
typedef signed char int8
….
As an example lets say you have a module called GPD [General purpose device] and it has a SW register map as follows

You could create a structure as follows:
typedef struct{
volatile uint32 REV_NO; /*REV NO*/
volatile uint32 CLOCK_CONTROL; /*Clock control */
volatile uint16 INT_STATUS; /* Interrupt Status */
volatile uint16 INT_MASK; /* Interrupt Mask */
volatile uint32 CONFIG_SETTING; /* Configuration Setting */
} ASIC_GPD_STR
What does the volatile data type do for you ?
Simply put volatile tells the compiler to not make any assumptions about the value of the variable defined. It can change anytime, and it probably will, because not all registers are in total control of the processor, and especially HW status registers. This tells the compiler to go load the value from the register directly each and every time it needs it instead of treating it like a value in the processor register. Also it might require the MPU settings of your processor to make sure that such registers are not cached for any reason, and they will not be pushed on to stack like other variables.
You can put this structure into the sw_module_name/module_name_hardware.h header file
We are only done with defining our module. We need to breathe some life in to it, in order to allow for the processor to access it.
For this we need to do two things:
1. Tell the processor what the actual structure maps to
2. Make an allocation of memory of this structure
Question 2 : How do you map the base address of a module to the pointer to the structure just defined?
The actual structure’s base address is what you need to indicate to the compiler. This is usually done in a symbol file : The actually base address of all modules is defined out here, for both design and test-bench data structures:
0xA000_0000 asicGPD // This tells the compiler, and the processor where to access the module in the test-case
0xB000_0000 asicInterrupt_Controller
0xC000_0000 asicTB_Slave_1
Question 3 : And finally, how does the processor actually access the hardware register?
In actual Verification Test Software you can access the registers as follows:
#include "asicGPD_hardware_structure.h"
.....
integer module_access_test()
{
volatile ASIC_GPD_STR *asicGPD; /* This creates a pointer to the structure*/
uint16 mask_value;
uint32 config_setting;
integer errors = 0;
config_setting = 0x11112222;
mask_value = busread_register(asicGPD->Interrupt_Mask);
if(mask_value != interrupt_mask_register_default) {errors = errors++;}
buswrite_register(asicGPD->Config_Setting, config_setting);
return errors;
}
Friday, January 1, 2010
The ASIC design flow

We detail here the typical ASIC flow for first timers and folks new to the industry as to what it takes to get and ASIC back in silicon.
1. The Architecture team specifies the workability of design - how many MIPS would your processor require, what is the throughput of your interconnect, what is the peak data rate processing capability of your HW/SW combine, what is the SDRAM controller bottleneck - it quantifies roughly how well your design ought to work.2. RTL coding in HDL - American companies usually prefer Verilog, while their cross-Atlantic counterparts prefer VHDL. VHDL is the more strongly typed, better suited language for synthesis, whereas Verilog is the more easier to understand, C kind of HDL.
3. If your design contains memories : RAMs TCMs specifically on chip on design memories - you would need to do DFT memory BIST insertion to be able to check the memories after production. If your RTL design is dependant on certain technology libraries, for example if you use the IBM/Artisan design flow, or a vendor specific technology, you would require the basic technology library cells to map on to your design.
4. The RTL design is meanwhile subjected to strenuous verification from the verification team to check design intent versus design content. This means using multiple approaches
a. Creation of TB using HDL
b. If your design contains one or multiple processors : Hardware Software Cosimulation based environment using C to write your tests, and having a compiler convert them in to Assembly [x86, ARM]
c. Usage of HVL such a Specman e, Vera or System Verilog [OVM, or VMM methodologies] for doing exhaustive contrained & random verification, collecting code coverage metrics etc.
d. Usage of static formal techniques such as Cadence IFV
e. Creation of dynamic assertions in PSL or SVA
f. Emulation using prelimary version of software - this involves mapping of RTL into FPGA's and having SW test the HW that it will eventually target when the ASIC is made. This helps speed up simulations by factors of over 100x, and it helps SW teams to ramp up and get ready, even before the final ASIC is available on PCB.
5. In Synopsys DC or Magma, you would write constraints for clock, area, power, etc. Once you have the constraints you'd synthesize your design and add scan insertion (JTAG for processor -- SW tracing) .
6. Formal verification - that is comparison of RTL against the synthesized netlist, using Cadence LEC, Synopsys Formality etc.
7. Pre-layout STA on the design using Synopsys PT engine.
8. Initial floorplanning with timing driven placement of cells, clock tree insertion and global routing, hard macros, clock tree synthesis
9. Transfer of synthesized clock tree to the netlist [made from synthesizing RTL] back into Design Compiler.
10. Formal verification between the synthesized netlist and clock tree inserted netlist.
11. Extraction of timing delays from the layout after the global routing step - sdf.
12. Back annotation of estimated timing data from the global routed design, in to PrimeTime.
13. Extraction of real timing delays and back annotation of the real extracted timing data to PrimeTime.
14. Post-layout static timing analysis using PrimeTime.
15. PV : Physical Verification : Tape out after LVS and DRC verification using IC Compiler