Skip to content

Interface Interview Questions

merlinjohnsonmirafra edited this page Sep 28, 2022 · 20 revisions

1.How does the clocking block handles synchronous reset?

Synchronous reset

Synchronous reset is sampled only with respect to clock event. When reset is enabled, it will be effective only after next active clock edge.

 module synchronous_reset (input logic clk, rst, in1, output logic out1)  
 always @(posedge clk)  
 if(rst) out1 <= 1'b0;  
 else out1 <= in1;  
 endmodule     

Here , we can see that out1 will be changed only with the posedge of clk. So the reset will be wide enough to be captured for next posedge clk.

Note: The clocking block is only designed to handle synchronous reset - it should happen only be based on clock event. Reset in clocking block should be handled elsewhere. If the clocking block outputs are variables, you can procedurally assign them outside of a clocking block on a reset.

how does the modport handle asynchronous reset?

Asynchronous Reset

In asynchronous reset sampling is done by independent of clk. When reset is enabled ,it will be effective immediately within the same the clock edges.

 module asynchronous_reset (input logic clk, rst, in1, output logic out1);  
 always @(posedge clk or posedge rst)  
 if(rst) out1 <= 1'b0;  
 else out1 <= in1;
 endmodule    

In asynchronous whenever there is a posedge of clock or posedge of reset happens, then out1 will be changed.

image

                                         Fig 1: Design example   

Here, in this example there are three examples a,b,c. 'a' is continuous signal and it is asynchronous signal. 'b' and 'c' signals are synchronous signals. Using modport we can change the asynchronous signal 'a' to synchronous signal.
modport TB_MP(TB_CB , output a);

In asynchronous whenever there is a posedge of clock or posedge of reset happens, then out1 will be changed.

Note: In Modport, the design can handled with asynchronous reset. The asynchronous reset will be happen at any time.

Clone this wiki locally