B
black
Guest
below is the code:
module detect_inout_contention(
ad, ad_oe,ad_in,ad_out,clk
);
inout ad;
input ad_oe,ad_in;
output ad_out;
input clk;
assign ad = ad_oe?ad_in :1'z;
assign ad_out = ~ad;
reg ad_oe_hold,ad_in_hold,ad_out_hold;
always@(posedge clk)
begin
ad_oe_hold<=ad_oe;
ad_out_hold<=ad_in;
ad_in_hold<= ad;
if (ad_oe_hold & (ad_out_hold != =ad_in_hold))
begin
$display(" ad inout contention detected at %t",$time);
end
'No_else
end
endmodule
i am not sure whether this way can detect the inout contention,any comments
will be appreciated.
--
BestRegards
BlackSin
module detect_inout_contention(
ad, ad_oe,ad_in,ad_out,clk
);
inout ad;
input ad_oe,ad_in;
output ad_out;
input clk;
assign ad = ad_oe?ad_in :1'z;
assign ad_out = ~ad;
reg ad_oe_hold,ad_in_hold,ad_out_hold;
always@(posedge clk)
begin
ad_oe_hold<=ad_oe;
ad_out_hold<=ad_in;
ad_in_hold<= ad;
if (ad_oe_hold & (ad_out_hold != =ad_in_hold))
begin
$display(" ad inout contention detected at %t",$time);
end
'No_else
end
endmodule
i am not sure whether this way can detect the inout contention,any comments
will be appreciated.
--
BestRegards
BlackSin