how to detect inout contention

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
 
"black" <mini_monkey@163.net> wrote in message news:<bm5vui$irc19$1@ID-199450.news.uni-berlin.de>...
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.
have you tried $countdrivers task? its an easy way of detecting contentions.
 
sam22277@yahoo.com (Akshaye) wrote in message news:<913cdaa6.0310271140.316509b8@posting.google.com>...
"black" <mini_monkey@163.net> wrote in message news:<bm5vui$irc19$1@ID-199450.news.uni-berlin.de>...
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.

have you tried $countdrivers task? its an easy way of detecting contentions.
How do you use $countdrivers? The VCS manual doesn't give much info on this task?

- Hung
 

Welcome to EDABoard.com

Sponsor

Back
Top