mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
fix timing of delayed interrupt
This commit is contained in:
parent
e90d0eee72
commit
99a15e7897
@ -470,8 +470,12 @@ module testbench();
|
|||||||
if(CheckMIPFutureE) CheckMIPFutureE <= 0;
|
if(CheckMIPFutureE) CheckMIPFutureE <= 0;
|
||||||
CheckMIPFutureM <= CheckMIPFutureE;
|
CheckMIPFutureM <= CheckMIPFutureE;
|
||||||
if(CheckMIPFutureM) begin
|
if(CheckMIPFutureM) begin
|
||||||
if((ExpectedPCM != MepcExpected) & ((MepcExpected - ExpectedPCM) * (MepcExpected - ExpectedPCM) <= 16)) begin
|
$display("%tns: ExpectedPCM %x",$time,ExpectedPCM);
|
||||||
RequestDelayedMIP = 1;
|
$display("%tns: ExpectedPCE %x",$time,ExpectedPCE);
|
||||||
|
$display("%tns: ExpectedPCW %x",$time,ExpectedPCW);
|
||||||
|
if((ExpectedPCE != MepcExpected) & ((MepcExpected - ExpectedPCE) * (MepcExpected - ExpectedPCE) <= 16)) begin
|
||||||
|
// if((ExpectedPCM != MepcExpected) & ((MepcExpected - ExpectedPCM) * (MepcExpected - ExpectedPCM) <= 16)) begin
|
||||||
|
RequestDelayedMIP <= 1;
|
||||||
$display("%tns: Requesting Delayed MIP. Current MEPC value is %x",$time,MepcExpected);
|
$display("%tns: Requesting Delayed MIP. Current MEPC value is %x",$time,MepcExpected);
|
||||||
end else begin // update MIP immediately
|
end else begin // update MIP immediately
|
||||||
$display("%tns: Updating MIP to %x",$time,NextMIPexpected);
|
$display("%tns: Updating MIP to %x",$time,NextMIPexpected);
|
||||||
@ -488,14 +492,14 @@ module testbench();
|
|||||||
$display("%tn: ExpectedCSRArrayM[NumCSRM] %x",$time,ExpectedCSRArrayM[NumCSRM]);
|
$display("%tn: ExpectedCSRArrayM[NumCSRM] %x",$time,ExpectedCSRArrayM[NumCSRM]);
|
||||||
$display("%tn: ExpectedCSRArrayValueM[NumCSRM] %x",$time,ExpectedCSRArrayValueM[NumCSRM]);
|
$display("%tn: ExpectedCSRArrayValueM[NumCSRM] %x",$time,ExpectedCSRArrayValueM[NumCSRM]);
|
||||||
|
|
||||||
if((ExpectedPCM != MepcExpected) & ((MepcExpected - ExpectedPCM) * (MepcExpected - ExpectedPCM) <= 16)) begin
|
// if((ExpectedPCM != MepcExpected) & ((MepcExpected - ExpectedPCM) * (MepcExpected - ExpectedPCM) <= 16)) begin
|
||||||
RequestDelayedMIP = 1;
|
// RequestDelayedMIP = 1;
|
||||||
$display("%tns: Requesting Delayed MIP. Current MEPC value is %x",$time,MepcExpected);
|
// $display("%tns: Requesting Delayed MIP. Current MEPC value is %x",$time,MepcExpected);
|
||||||
end else begin
|
// end else begin
|
||||||
$display("%tns: Updating MIP to %x",$time,NextMIPexpected);
|
// $display("%tns: Updating MIP to %x",$time,NextMIPexpected);
|
||||||
MIPexpected = NextMIPexpected;
|
// MIPexpected = NextMIPexpected;
|
||||||
force dut.hart.priv.csr.genblk1.csri.MIP_REGW = MIPexpected;
|
// force dut.hart.priv.csr.genblk1.csri.MIP_REGW = MIPexpected;
|
||||||
end
|
// end
|
||||||
end
|
end
|
||||||
if(RequestDelayedMIP) begin
|
if(RequestDelayedMIP) begin
|
||||||
$display("%tns: Executing Delayed MIP. Current MEPC value is %x",$time,dut.hart.priv.csr.genblk1.csrm.MEPC_REGW);
|
$display("%tns: Executing Delayed MIP. Current MEPC value is %x",$time,dut.hart.priv.csr.genblk1.csrm.MEPC_REGW);
|
||||||
|
Loading…
Reference in New Issue
Block a user