Q1.Aclocking Resources
Q1.Aclocking Resources
AClocking Resources
Fpga 7 series has 4 clock capable inputs in each bank-These are regular I/O pins with dedicated
connections to the internal clock sources
Therefore Resources per clock region:
Random Variables:
• The class variables which get random values on randomization are called random variables
• There are two types of random variables; rand and randc. rand is the random variable
which gets any random value wheras randc is the cyclic random variable which gets
random values which are not repeated.
Example:
class packet;
rand bit [2:0] addr1;
randc bit [2:0] addr2;
endclass
module rand_methods;
initial begin
packet pkt;
pkt = new();
repeat(10) begin
pkt.randomize();//start randomization
$display("\taddr1 = %0d \t addr2 = %0d",pkt.addr1,pkt.addr2);
end
end
endmodule
Constrained randomization
Simply running ramdomized tests do not make sense because there will be many invalid cases and
in some situations it is required to control the values getting assigned on randomization, this can be
achieved by writing constraints. By writing constraints to a random variable, the user can get
specific value on randomization. constraints to a random variable shall be written in constraint
blocks.
Eg: rand bit [1:0] mode;
constraint c_mode1 { mode < 3; }