Deb
New Member
Offline
Posts: 5
|
Dear All,
Please help me in the following issue.
I am giving here a code snippet. Please look into this.
///////////////////////////////////////////////////////////////////////////////
fork : globalOperator
real timeOfStart; integer setMatchHigh; real timeOfMatch; timeOfStart = $abstime; $display("Fork Entered for %d time and timeOfStart for this fork is %f: \n", countStart, timeOfStart); /* forever begin while (($abstime - timeOfStart) < delay) begin if(!setExpr) begin $display("Expr became low before delay time exceeded and hence Thread disabled. \n"); disable globalOperator; end else begin match = 1'b0; end end end forever begin @(cross(($abstime - (timeOfStart + delay)), +1, TimeTolerance)) begin setMatchHigh = 1; $display("setMatchHigh is made high. \n"); timeOfMatch = $abstime; end end
if(setExpr && setMatchHigh) begin match = 1'b1; countMatch = countMatch + 1; end @(cross(($abstime - (timeOfMatch + KeepMatchHighTime)), +1, TimeTolerance)) begin if(match) begin match = 1'b0; $display("%d Match was detected and match signal is made low: \n", countMatch); disable globalOperator; end end join
end
//////////////////////////////////////////////////////////////////////////
Within the fork block, after each thread is created, I want to check setExpr for delay value after timeOfStart. For that I have used the while loop but its basically stalling the simulation. How can I do that within the fork block? Please suggest. Also please suggest how can I use a cross statement within the fork block.
Thanks in advance for your kind support.
------------------------------ Thanking you,
Yours sincerely, Debjit ====================== Debjit Pal
|