Line 108... |
Line 108... |
wire lineStatusChange;
|
wire lineStatusChange;
|
reg rxToutIe; // receiver timeout interrupt enable
|
reg rxToutIe; // receiver timeout interrupt enable
|
reg [3:0] rxThres; // receiver threshold for interrupt
|
reg [3:0] rxThres; // receiver threshold for interrupt
|
reg [3:0] txThres; // transmitter threshold for interrupt
|
reg [3:0] txThres; // transmitter threshold for interrupt
|
reg rxTout; // receiver timeout
|
reg rxTout; // receiver timeout
|
wire [11:0] rxCnt; // reciever counter value
|
wire [9:0] rxCnt; // reciever counter value
|
reg [7:0] rxToutMax;
|
reg [7:0] rxToutMax;
|
reg [2:0] irqenc; // encoded irq cause
|
reg [2:0] irqenc; // encoded irq cause
|
wire rxITrig; // receiver interrupt trigger level
|
wire rxITrig; // receiver interrupt trigger level
|
wire txITrig; // transmitter interrupt trigger level
|
wire txITrig; // transmitter interrupt trigger level
|
// reciever errors
|
// reciever errors
|
Line 145... |
Line 145... |
|
|
assign rxITrig = rxQued >= rxThres;
|
assign rxITrig = rxQued >= rxThres;
|
assign txITrig = txQued <= txThres;
|
assign txITrig = txQued <= txThres;
|
wire rxDRQ1 = (fifoEnable ? rxITrig : ~rxEmpty);
|
wire rxDRQ1 = (fifoEnable ? rxITrig : ~rxEmpty);
|
wire txDRQ1 = (fifoEnable ? txITrig : txEmpty);
|
wire txDRQ1 = (fifoEnable ? txITrig : txEmpty);
|
assign rxDRQ = dmaEnable & rxDRQ1;
|
assign rxDRQ_o = dmaEnable & rxDRQ1;
|
assign txDRQ = dmaEnable & txDRQ1;
|
assign txDRQ_o = dmaEnable & txDRQ1;
|
wire rxIRQ = rxIe & rxDRQ1;
|
wire rxIRQ = rxIe & rxDRQ1;
|
wire txIRQ = txIe & txDRQ1;
|
wire txIRQ = txIe & txDRQ1;
|
|
|
reg [7:0] cmd0, cmd1, cmd2, cmd3;
|
reg [7:0] cmd0, cmd1, cmd2, cmd3;
|
reg [7:0] ctrl0, ctrl1, ctrl2, ctrl3;
|
reg [7:0] ctrl0, ctrl1, ctrl2, ctrl3;
|
Line 581... |
Line 581... |
// frame size is one less
|
// frame size is one less
|
assign frameSize = {wordLength + 4'd1 + stopBits[2:1] + parityCtrl[0], stopBits[0],3'b0} - 1;
|
assign frameSize = {wordLength + 4'd1 + stopBits[2:1] + parityCtrl[0], stopBits[0],3'b0} - 1;
|
|
|
//-----------------------------------------------------
|
//-----------------------------------------------------
|
// encode IRQ mailbox
|
// encode IRQ mailbox
|
always @(rxDRQ or rxTout or txDRQ or lineStatusChange or modemStatusChange)
|
always @(rxDRQ_o or rxTout or txDRQ_o or lineStatusChange or modemStatusChange)
|
irqenc <=
|
irqenc <=
|
lineStatusChange ? 3'd0 :
|
lineStatusChange ? 3'd0 :
|
~rxDRQ ? 3'd1 :
|
~rxDRQ_o ? 3'd1 :
|
rxTout ? 3'd2 :
|
rxTout ? 3'd2 :
|
~txDRQ ? 3'd3 :
|
~txDRQ_o ? 3'd3 :
|
modemStatusChange ? 3'd4 :
|
modemStatusChange ? 3'd4 :
|
3'd0;
|
3'd0;
|
|
|
endmodule
|
endmodule
|