CODE
https://drive.google.com/drive/folders/1rHtTGMBZwmpckFHQrTmcwqDBDiIR-pzu?usp=sharing
################################################################
NOTES
MAY_08_2019
questions from interviews:
- Ethernet switch : verification environemtn for the same
- how does switch architecture looks like?
o group of ingress and egress ports - L2/L3/L4 layer
o L2 : Preamble SOF DA SA Len Payload CRC
- TB architercture
- Features
o mostly will be taken from specification - Scenarios
o generate packets from all the ports
o generate packets to different ports - testplan
- TB components
- TB Coding
top down approach
Top most module
Notes:
- physical interface is the actual memory allocation for itnerface signals.
Virtual interface is the pointer to above allocated memory. Physical interface is instantiated in top most module, virtual interface is used everywhere else(BFM, monitor, etc) - mbox.get(pkt);
before this line, we should have done pkt = new(); - explain what is input skew and output skew in clocking block?
Input skew is the -delay used for sampling the clocking block inputs w.r.t active edge of clock. This is the time before which inputs are sampled
Output skew is the delay applied for driving the clocking block output w.r.t active edge of clock. This is the time after which outputs are driven - for any interface how many types of modports are required?
3
one for Master behavior
one for Slave behavior
one for monitor behavior - WHy data signals are not declared as input in inteface definition, whereas clk, rst are declared as inputs?
- clk, rst are inputs to all the blocks connected to itnerface(master, slave, monitor)
- data can be input to bfm, then it will be output of DUT, it is input to monitor
- why signals in interface are declared as logic?
- logic ensures that we can driven an unkonwn value(x) on the interface port
bit a;
logic b;
b = 1’bx;
a = b;
a ? 0
- what is difference between int and integer?
int is 2 state variable
integre is a 4 state varibale - what is difference between mailbox and sempahore?
mailbox and sempahore are used for inter process synchronization.
milabox is specifically used for connecting a producer component to consumer component
– it helps synchronize the data flow from producer to consumer
– ex: mailbox is used to connect gen to bfm.
sempahore is used for synchronizing various processes(components) that are trying to access a common resource
– ex: sempahore is used when multiple bfm are writing to write
in to a memory. Semaphore ensures that only one BFM will access memory at any time
sempahore smp = new(1);
smp.get(1);
write_mem();
smp.put(1); - what is scheduling scemantics in SV? what are different scheduling regions?
- guidelines used by the tools to schedule various simulation events in different regions of timestep
- 12 regions
- what is parameterization? how parameterization differs between Verilog and SV?
- parameterization is a concept which allows for same code be used for different requirements by changing the parameter values
- Verilog supports only value parameterization, where a variable is declared
as a parameter, that variable value can only be changed. - SV supports both value and type parameterization, where a variable type and a variable value can also be changed
- what is the difference between functional coveage and code coverage?
functional coveage gives the measure how much %age of design functionality has been covered by various testcases. It is defined by functional verification engineer.
code coverage gives the measure how much %age of design code has been exercised by various testcases. It is not used defined, tools generates the report based on various tests run. - write assertion for req to ack(max delay: 3 clocks), followed by data delay of exact 5 clock after ack
property req_ack_data_prop;
@(posedge clk) req |-> ##[0:3] $rose(ack) ##5 not($isunknown(data));
endproperty
REQ_ACK_PROP : assert property(req_ack_data_prop); - difference between concurrent and immeditate assertiotns?
immeditate assertiotn checks happens at same time, it does not involve any delay
concurrent assertiotn checks happens over multiple clock cycles. It involves a antecedeant and consequent.
antecedeant : reason which triggers the check
consequent : check that happens for assertion pass/fail - what is difference between #, ##?
: number of time steps
: number of clock cycles
- what is the difference between parameterzied mailbox and non-parameterzied mailbox?
- what is callbacks in verification enviornemnt?
- it is verification enviornemnt concept, where a method is associated with
some otehr methods(which are called as callback methods). When the actual
method is called, these callback methdos gets called automatically(by
default).
randomize, pre_randomize, psot_randomize are the examples
- what is interative constraint?
- type of constraints used when we need to implement constraints for whole array elemnts
write an ex:
- what is distribution constraint? explain with an example?
type of constraints used when a value needs to be assigned in range of values with some weigfhtage
constraint {
len dist {[100:200]:\5, [1000:1500]:\1};
} - what is soft constraint and hard constraint? explain with an example?
soft constraint are type of constraints, which can be overriden. If there is constraint which conflicts with soft constraint, then overriden value will eb taken.
hard constraint are type of constraints, which can’t be overriden. If we try to override, it will result in constraints solving error. Hence randomization will fail.
how to declare these constraints?
- wirte a simple way to sum all the array elements?
sum = array_name.sum(); - difference between delay, latency, throughput?
throughput : essential BW we are getting from the system. for ex: for every clock cycle, some specific amount of data is driven.
delay :
latency: refers to wait cycles introduced between request and response
################################################################