V
Viji
Guest
I have a Flip-Flop RTL code
always @ (posedge QCK or posedge QR or posedge QS)
if (QR)
QZ = 1'b0;
else if (QS)
QZ = 1'b1;
else if(QEN)
QZ = QZI;
when simulated has the following issue:
QRT=1 and QST =1 the output QZ->0, the transition of QZ->0 takes place
immediately.
But when QRT changes from 1 ->0 and QST is till '1' the transition from
QZ-> is not immediate it takes place in the next rising edge of the
CLK.
To overcome these I have seperate simulation model for flip-flop
always @(posedge QCK)
if(~QR && ~QS)
if(QEN)
QZ = QZI;
always @(QRor QS)
if(QR)
QZ = 1'b0;
else if (QS)
QZ = 1'b1;
1) Is there anyway to have single RTL code and Simulation Code?
2) How is these issue take care by FPGA vendors like Xilinx ,Altera n
other FPGA vendors?
always @ (posedge QCK or posedge QR or posedge QS)
if (QR)
QZ = 1'b0;
else if (QS)
QZ = 1'b1;
else if(QEN)
QZ = QZI;
when simulated has the following issue:
QRT=1 and QST =1 the output QZ->0, the transition of QZ->0 takes place
immediately.
But when QRT changes from 1 ->0 and QST is till '1' the transition from
QZ-> is not immediate it takes place in the next rising edge of the
CLK.
To overcome these I have seperate simulation model for flip-flop
always @(posedge QCK)
if(~QR && ~QS)
if(QEN)
QZ = QZI;
always @(QRor QS)
if(QR)
QZ = 1'b0;
else if (QS)
QZ = 1'b1;
1) Is there anyway to have single RTL code and Simulation Code?
2) How is these issue take care by FPGA vendors like Xilinx ,Altera n
other FPGA vendors?