Line 41... |
Line 41... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.3 2003/08/03 18:04:44 mihad
|
|
// Added limited WISHBONE B3 support for WISHBONE Slave Unit.
|
|
// Doesn't support full speed bursts yet.
|
|
//
|
// Revision 1.2 2002/08/13 11:03:51 mihad
|
// Revision 1.2 2002/08/13 11:03:51 mihad
|
// Added a few testcases. Repaired wrong reset value for PCI_AM5 register. Repaired Parity Error Detected bit setting. Changed PCI_AM0 to always enabled(regardles of PCI_AM0 define), if image 0 is used as configuration image
|
// Added a few testcases. Repaired wrong reset value for PCI_AM5 register. Repaired Parity Error Detected bit setting. Changed PCI_AM0 to always enabled(regardles of PCI_AM0 define), if image 0 is used as configuration image
|
//
|
//
|
// Revision 1.1 2002/02/01 13:39:43 mihad
|
// Revision 1.1 2002/02/01 13:39:43 mihad
|
// Initial testbench import. Still under development
|
// Initial testbench import. Still under development
|
Line 71... |
Line 75... |
STB_O,
|
STB_O,
|
WE_O,
|
WE_O,
|
TAG_I,
|
TAG_I,
|
TAG_O,
|
TAG_O,
|
CAB_O,
|
CAB_O,
|
|
check_CTI,
|
log_file_desc
|
log_file_desc
|
) ;
|
) ;
|
|
|
input CLK_I ;
|
input CLK_I ;
|
input RST_I ;
|
input RST_I ;
|
Line 89... |
Line 94... |
input STB_O ;
|
input STB_O ;
|
input WE_O ;
|
input WE_O ;
|
input [(`WB_TAG_WIDTH-1):0] TAG_I ;
|
input [(`WB_TAG_WIDTH-1):0] TAG_I ;
|
input [(`WB_TAG_WIDTH-1):0] TAG_O ;
|
input [(`WB_TAG_WIDTH-1):0] TAG_O ;
|
input CAB_O ;
|
input CAB_O ;
|
|
input check_CTI ;
|
input [31:0] log_file_desc ;
|
input [31:0] log_file_desc ;
|
|
|
always@(posedge CLK_I)
|
always@(posedge CLK_I)
|
begin
|
begin
|
if (RST_I !== 1'b0)
|
if (RST_I !== 1'b0)
|
Line 337... |
Line 343... |
$fdisplay(log_file_desc, "CAB_O value changed during cycle") ;
|
$fdisplay(log_file_desc, "CAB_O value changed during cycle") ;
|
end
|
end
|
end
|
end
|
end // CAB_O monitor
|
end // CAB_O monitor
|
|
|
|
// CTI_O[2:0] (TAG_O[4:2]) monitor for bursts
|
|
reg [2:0] first_cti_val ;
|
|
always@(posedge CLK_I or posedge RST_I)
|
|
begin
|
|
if (RST_I)
|
|
first_cti_val <= 3'b000 ;
|
|
// logging for burst cycle
|
|
else if ( check_CTI && ((CYC_O === 0) && (first_cti_val == 3'b011) && ~(previous_rty || previous_err)))
|
|
begin
|
|
message_out("Master violated WISHBONE protocol by NOT changing the CTI_O signals to '111' when end of burst!") ;
|
|
$display("CTI_O didn't change to '111' when end of burst") ;
|
|
$fdisplay(log_file_desc, "CTI_O didn't change to '111' when end of burst") ;
|
|
first_cti_val <= 3'b000 ;
|
|
end
|
|
else if (CYC_O === 0)
|
|
first_cti_val <= 3'b000 ;
|
|
else
|
|
begin
|
|
if ((first_cti_val == 3'b000) && (TAG_O[4:2] === 3'b000) && (ACK_I || ERR_I || RTY_I))
|
|
first_cti_val <= 3'b001 ;
|
|
else if ((first_cti_val == 3'b000) && (TAG_O[4:2] === 3'b111) && (ACK_I || ERR_I || RTY_I))
|
|
first_cti_val <= 3'b010 ;
|
|
else if ((first_cti_val == 3'b000) && (TAG_O[4:2] === 3'b010) && (ACK_I || ERR_I || RTY_I))
|
|
first_cti_val <= 3'b011 ;
|
|
else if ((first_cti_val == 3'b011) && (TAG_O[4:2] === 3'b111) && (ACK_I || ERR_I || RTY_I))
|
|
first_cti_val <= 3'b010 ;
|
|
// logging for clasic cycles
|
|
else if (check_CTI && ((first_cti_val == 3'b001) && (TAG_O[4:2] !== 3'b000)))
|
|
begin
|
|
message_out("Master violated WISHBONE protocol by changing the CTI_O signals during CYC_O when clasic cycle!") ;
|
|
$display("CTI_O change during CYC_O when clasic cycle") ;
|
|
$fdisplay(log_file_desc, "CTI_O change during CYC_O when clasic cycle") ;
|
|
end
|
|
// logging for end of burs cycle
|
|
else if (check_CTI && (first_cti_val == 3'b010))
|
|
begin
|
|
message_out("Master violated WISHBONE protocol by changing the CTI_O signals to '111' before end of burst!") ;
|
|
$display("CTI_O change to '111' before end of burst") ;
|
|
$fdisplay(log_file_desc, "CTI_O change to '111' before end of burst") ;
|
|
end
|
|
end
|
|
end
|
|
|
// WE_O monitor for consecutive address bursts
|
// WE_O monitor for consecutive address bursts
|
reg [1:0] first_we_val ;
|
reg [1:0] first_we_val ;
|
always@(posedge CLK_I or posedge RST_I)
|
always@(posedge CLK_I or posedge RST_I)
|
begin
|
begin
|
if (~CYC_O || ~CAB_O || RST_I)
|
if (~CYC_O || ~CAB_O || RST_I)
|