?? isa_lpt.v
字號:
module isa_lpt (ISA_RESET,
ISA_D,ISA_A,
ISA_IOR,ISA_READY,ISA_IOW,ISA_AEN,
LPT_RESET,LPT_BUSY,LPT_ACK,LPT_STOB,
LPT_D,DIR0,DIR8,DIR16,
a0,a1,a2,a3,a4,a5
);
/********ISA PIN ***********/
inout [7:0] ISA_D;
input [19:0] ISA_A;
input ISA_IOR;
input ISA_IOW;
input ISA_RESET;
input ISA_AEN;
inout ISA_READY;
/********LPT PIN ***********/
output LPT_RESET;
input LPT_BUSY;
input LPT_ACK;
output LPT_STOB;
output [7:0] LPT_D;
output DIR0;
output DIR8;
output DIR16;
output a0;
output a1;
output a2;
output a3;
output a4;
output a5;
/******************************/
wire ISA_IOCS16;
wire LPT_DATA_CS;
wire LPT_STOB_CS;
wire LPT_BUSY_CS;
wire LPT_ACK_CS;
reg [7:0] DATA_reg;
/* ISA Bus Logic*/
assign ISA_IOCS16 = 1'h0;
assign LPT_DATA_CS = ((ISA_A==20'h0378) && !ISA_AEN && !ISA_IOW) ? 0 : 1;
assign LPT_STOB_CS = ((ISA_A==20'h0379) && !ISA_AEN && !ISA_IOW);
assign LPT_BUSY_CS = ((ISA_A==20'h037A) && !ISA_AEN && !ISA_IOR);
assign LPT_ACK_CS = ((ISA_A==20'h037B) && !ISA_AEN && !ISA_IOR);
assign ISA_IOCS16 = ((ISA_A>=20'h0378) && (ISA_A<=20'h037B) && !ISA_AEN ) ? 1 : 1'bZ;
assign ISA_READY = 1'bZ;
/******* Host read BUSY and ACK of printer*************/
assign ISA_D[0] = LPT_BUSY_CS ? LPT_BUSY : 1'bZ;
assign ISA_D[1] = LPT_ACK_CS ? LPT_ACK : 1'bZ;
/*************Output data to printer***************/
always @ (posedge LPT_DATA_CS)
begin
DATA_reg[7:0] <= #1 ISA_D[7:0];
end
/****數據送出后,要產生 STOB脈沖,才能打入打印機******/
assign LPT_D = DATA_reg;
assign LPT_STOB = !LPT_STOB_CS;
/**************************/
assign DIR0=1'h0;
assign DIR8=1'h1;
assign DIR16=1'h0;
assign a0=1'h0;
assign a1=1'h0;
assign a2=1'h0;
assign a3=1'h0;
assign a4=1'h0;
assign a5=1'h0;
endmodule //of glue
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -