Sunday, March 30, 2014
OOP method to access variables of the derived class !!!
Sunday, March 10, 2013
Base class library specific to product on top of RVM/VMM/OVM/UVM !!!
Tuesday, January 1, 2013
System verilog 2012 features !!!
Tuesday, April 24, 2012
do_copy() , do_compare(), do_byte_pack() , do_is_vaild() , do_allocate() & do_byte_unpack() !!!
Wednesday, March 7, 2012
Factory services in VMM !!!
Factory in VMM was implemented by assigning different blueprints to factory place holders like randomize_obj and scenario_set[] for atomic generator and scenario generator respectively. With the introduction of factory services from VMM1.1 replacing any type of object say a transaction or transactor can be done easily using methods like override_with_new() or override_with_copy(). We can replace one particular instance of an object with the derived object or we can replace all the instances of the object with the derived object.
Following are the steps one has to follow to use VMM factory services.
- Use the macro `vmm_class_factory(class_name) to register the class to factory services
- Use create_instance() to create an object instead of using new()
- Use override_with_new() or override_with_copy() to replace and existing object with a derived object.
- Use pattern matching to replace all the instance of the class or a particular instance of the class.
Saturday, February 18, 2012
Accessing class attributes bottom up !!!
Accessing a property of a class top down is done through hierarchical access through dot operator which is very common in the HVL world. Accessing class properties bottom up through multiple levels is also a requirement we come across in verification which is little bit tricky to implement.
Following is an example on how we could do a bottom up access of a class property.
class top;
int flag;
level_1 obj;
function new();
obj=new(this);
endfunction
endclass
class level_1;
top parent_of_the_class;
function new ( top parent_of_the_class);
this.parent_of_the_class=parent_of_the_class;
endfunction
task run();
if(parent_of_the_class.flag==1)
begin
$display(" Flag set \n");
end
else
begin
$display(" Flag not set \n");
end
endtask
endclass
Saturday, January 28, 2012
Constraint solver performance !!!
Debugging constraint solver performance issues is a real challenge; even a small mistake in a constraint can impact constraint solver performance . Common mistake people do which results in constrain solver performance degradation is to constraint the data payload to a predictable pattern to enable designers to debug RTL faster. When predictable data pattern is constrained for every transaction the number of bidirectional constraints solved increases exponentially resulting in constraint solver performance degradation. The problem would be magnified further when a scenario generator is used to randomize sequence of transactions.
The solution to this is if you would require a predictable data pattern to be used in the data payload override the random value with predictable pattern in post_randomize() method instead of going for a constraint, this would improve the runtime performance of your simulation.
Saturday, December 3, 2011
Using vmm_opts to configure the test bench !!!
Traditionally plusargs switch is used in verification environments to configure attributes of the verification environment from the command line, like configuring timeout value of the test environment, configuring no of packets to be generated by the generator and setting error limits for the test to exit simulation. More compact and robust implementation of configuration mechanism in VMM is through vmm_opts. vmm_opts class has methods like get_object_bit(), get_object_int() to receive the runtime values in the environment. We can set different values to different instances from the command line. Example you can use the same configuration attribute for configuring no of packets for both TX as well as RX transactions and hierarchically set different values for TX and RX from the command line. Configuring global values like the test bench timeout does not require hierarchical access. The values can also be overridden from the test case using set_int () and set_bit() methods in place of a command line override.
Configurability of test bench from command line is a must have feature especially to abstract your test bench complexity from the consumers in this case a RTL designer , test case development team or release management team.
Saturday, November 12, 2011
Register Automation using VMM/UVM RAL
VMM RAL had been around for a long time is a very powerful feature to verify your hardware registers it provides the user with features like name based register access, mirroring registers, back door access, functional coverage and the predefined tests .The same set of VMM RAL features are available in UVM as well. One of the features which i was impressed with was auto mirror update feature which updates the RAL mirror on register changes through backdoor, this feature is handy when you do your register read/write through an embedded processor instead of regular front door access and you want to synchronize your test bench based on the value of register mirrors.
Accellera has come up with standards like IPXACT and system RDL to define your registers, this enables vendor independence to the users and most of generator tools are converging on these standards. The ideal way of automating your register is to define the registers using the standards and use generators from vendors to auto generate the RTL, firmware code, documentation and system Verilog RAL classes.
Quick survey on the tools supporting the standards indicated that there are many players in this space. One aspect which did not sink into my head was why the entire register solution can’t be packaged with the simulator itself, so that the user does not have to make additional investment on another tool. May be it might be on the product road map for the simulators.
With VMM RAL being adopted in UVM, definitely the user base for RAL is going to increase.
Saturday, August 20, 2011
VMM Channel methods grab, ungrab, lock, unlock !!!
Assume two different threads feeding a single channel with a sequence of transactions. If the transactions are just put in to the channel without using channel grab() the result would be that the sequence between two threads will be mixed producing unexpected results. Grab() method is used to request for exclusive access to the channel once the grab is activated no other thread can put an object in to the channel. Once the channel is loaded with the sequence of transaction object ungrab() should be used to release the channel for other threads. Is_grabbed () function can be used to know if the channel is grabbed.
Saturday, June 18, 2011
vmm_broadcast and vmm_scheduler !!!
Channels are point-to-point data transfer mechanisms. If multiple consumers had to extract same transaction descriptors from a channel then vmm_broadcast should be used. vmm_broadcast broadcasts transaction from one source channel to multiple output channels. Copy of the transaction from the source channel is forwarded to the output channels. Assume if you have multiple interfaces having different signal level protocol transmitting the same transaction at the same time a VMM broadcast can be used in this scenario. Unified generator is connected to the source channel of the vmm_broadcast and output channels of the broadcast are connected to the drivers of the interfaces.
Vmm_scheduler directs the transaction from different input channels to single output channel based on a scheduling algorithm. The default scheduling algorithm is round robin mode, by adjusting the constraint you can also have a random scheduling implemented. If you need custom scheduling you can implement the same in the vmm_scheduler_election class. Scheduler can be used if you need to schedule transactions based on some timing information.
Saturday, April 2, 2011
Channel record & playback in VMM !!!
Channel record and playback is useful feature which can be used to reproduce an issue hit at top level environment in a different block level environment. As you know the randomization changes with the change in system Verilog files for the same seed, the same scenario cannot be reproduced with the same seed in a different environment due to the change in the system Verilog files. We need to spend time running random regression with different seeds at block level to reproduce the issue that happened in the top level with a particular sequence. The alternative way to reproduce the issue at block level is to record the transaction at top level which is done using channel record. Then playback the transaction through channel playback from the block level to reproduce the issue.
// Record transaction in top level
gen.out_chan.record("Record_transaction");
// Play back at Block level
gen.out_chan.playback(status,"Record_transaction",tr);
If (!status)
`vmm_error(log,”play back failed \n”);
Sunday, February 20, 2011
Error injection in VMM environments !!!
There are different approaches in VMM to inject error , each one selects a way which is comfortable for them. But when finalizing on an approach it is good to know the advantages and disadvantages in terms of test bench reuse and code organization.
Error injection in transaction class attributes
Design a transaction class with virtual fields specifying the error types and control the physical fields based on the virtual error types.
This error injection code can be placed with basic transaction class or the error injection code can be a separate class extending the basic transaction class. I would prefer the error injection class to be a separate class extending the basic transaction class as the code become better organized and you don’t end up having one big monolithic transaction class.
Most of the transaction based error injection should be done using this approach. Sequence involving error injection can be easily generated using this approach.
Error injection through call back registered through driver.
Error injection on the signal level protocol controlling the driver attributes should be done through call back registers to the driver. Transaction class error injection should not be handled through driver call backs.
Sunday, November 7, 2010
Test end condition using vmm_consensus !!!
With the introduction of vmm_consensus class various elements such as channels, notification, and transactors play the role of voter and all voters have to agree for a consensus. Even if one voter opposes there will be no consensus. The vmm_consensus has a wait_for_consensus ( ) method which will be called in vmm_env’s wait_for_end ( ) method. The wait_for_consensus ( ) method will block till all voters consent.
How to use vmm_consensus to determine when the test should end ?
1) Add vmm_consensus::wait_for_consensus ( ) method to vmm_env::wait_for_end () method
2) Register voters in the vmm_env::build ( ) using end_vote.register_* () method, where end_vote is the instance of vmm_consensus defined in vmm.sv
3) Each of the sub environment instance has a single vote, it can consent or oppose.
4) We have options such as consensus_force_thru() which can be used by a particular subenv or a VMM components to force consensus through even though other components oppose the decision.
5) As usual we have methods that can be used to monitor the status of consensus, which components oppose and which components consent.
Saturday, October 9, 2010
Scoreboard for checking interrupts !!!
Saturday, September 11, 2010
Interfacing CRV environment with procedural environments !!!
Thursday, May 20, 2010
Factory replacement in the scenario generator scenario using ‘.using’ gotcha !!!
Scenario.using=transaction_factory;
The gotcha in this factory replacement is we need to implement the allocate() and copy() methods in the extended class for the factory replacement to work.
Many times i have seen people including myself spending time debugging their code when using “.using” for factory replacement as they are not aware of the gotcha.Maybe the RVM/VMM documentation should have this requirement highlighted so that the user can easily understand this requirement.
Saturday, May 8, 2010
Atomic generator using allocate() !!!

For the above code to work you need to implement the allocate method in your extended class. The extended class is assigned to the factory before the start_xactor() method is called.
